-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Extensions: implement drop-down menus #700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also, add `ANGLE` argument type (like `NUMBER` but adds an angle picker)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
The menu field's color looks like it needs adjusting, but we can fix that later.
src/engine/runtime.js
Outdated
const menuId = this._makeExtensionMenuId(menuName, categoryInfo.id); | ||
|
||
/** @TODO: support dynamic menus when 'menuItems' is a method name string (see extension spec) */ | ||
const options = menuItems.map(item => { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
colour: categoryInfo.color1, | ||
colourSecondary: categoryInfo.color2, | ||
colourTertiary: categoryInfo.color3, | ||
outputShape: ScratchBlocksConstants.OUTPUT_SHAPE_ROUND, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Dynamic menus are not yet supported for extension menus, though they are part of the extension spec. This change provides more thorough feedback if an extension tries to register an unsupported dynamic menu.
Changed existing string ids to use the convention `<repo>.<component>.<identifier>`
Resolves
Resolves #689
Proposed Changes
This change implements basic drop-down menu support for extension blocks. Dynamic menus -- ones which collect menu items fresh each time the menu opens -- are not yet supported.
Since I was in the area, I also fixed Boolean inputs and added angle picker support.
Reason for Changes
This is another step toward implementing the whole extension spec.