forked from scratchfoundation/scratch-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
SPIKE: Use custom events to trigger Scratch behaviour from the outside #6
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
Closed
Conversation
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
* Scope the package name by organisation. This ties the package to the RPF organisation rather than just to my user and means that, for example, any member of the organisation can publish the package. * Only publish package on successful builds of the experience-cs branch. * Use organisation-specific release version to avoid confusion with versions in the canonical package and use "experience-cs" string instead of "raspberrypifoundation" to distinguish it from the package version(s) used by the Code Club World project. * Always publish using "latest" npm tag; not "hotfix" or "stable". * Add `--access public` option to `npm publish` command, because scoped packages only allow "restricted" access by default. * We can use the GITHUB_TOKEN that is made available by default in a GitHub Action as the NODE_AUTH_TOKEN, although we need to add the `packages: write` permission to the Action. Co-authored-by: Chris Roos <[email protected]> Co-authored-by: Chris Lowis <[email protected]>
The MenuBar is quite specific to the canonical version of the online Scratch editor [1]. We want to make use of the scratch-gui package without displaying the MenuBar. Since the height of the menu bar is hard-coded as a CSS variable, I've had to override the height calculation for the body wrapper when the menu bar is not visible. Ideally the height of the menu bar wouldn't be hard-coded and this wouldn't be necessary. [1]: https://scratch.mit.edu/projects/editor
By listening for the custom `scratch-gui-save` event. Try this by: - Running `npm start` - Visiting http://localhost:8601 to view the Scratch editor - Execute `window.dispatchEvent(new Event('scratch-gui-save'));` in the web developer tools - Observe the `received scratch-gui-save` and `START_MANUAL_UPDATING` log messages in the web developer console
86a57ff
to
addcb07
Compare
@chrisroos have these changes all been merged into the |
Good spot, @sebjacobs! We merged the equivalent functionality into experience-cs in https://github.com/RaspberryPiFoundation/experience-cs/commit/d9546a4e98782de9ea2aca02478b72711b680a80. Closing. |
sebjacobs
pushed a commit
that referenced
this pull request
Apr 24, 2025
* fix: add support for Scratch-style procedures * refactor: remove underscore procedure creation callback
sebjacobs
pushed a commit
that referenced
this pull request
Apr 30, 2025
* fix: add support for Scratch-style procedures * refactor: remove underscore procedure creation callback
sebjacobs
pushed a commit
that referenced
this pull request
Apr 30, 2025
* fix: add support for Scratch-style procedures * refactor: remove underscore procedure creation callback
sebjacobs
pushed a commit
that referenced
this pull request
Apr 30, 2025
* fix: add support for Scratch-style procedures * refactor: remove underscore procedure creation callback
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.
We're exploring whether this is a good mechanism to trigger Scratch behaviour (e.g. load/save/remix) from outside of the Scratch UI.