Repository navigation
v0.3.0
Morphic Blocks 0.3.0 shows one program in as many views as you like, keeps every request on your own site, and makes the toolbox work without a mouse. It has two breaking changes; see below.
Breaking changes
-
Blockly's media loads from your own site by default. Images and sounds now come from
blockly-media/next to your page. Copy them there with the new command beforedevandbuild:"dev": "morphic-blocks copy-media public/blockly-media && vite"
A console warning names the problem when the media is missing. To keep loading from Blockly's server, set
blockly: { media: "https://blockly-demo.appspot.com/static/media/" }. See Privacy & External Requests. -
Language settings of code elements moved into a
codesection.stringQuoteandempty(fromelementTypes) and the top levelhighlightingmap now live undercode.<element>, next to the newemptyStatementandvalues.mount()throws on the old places and names where each setting moved. See Definitions Format.
New
- More views:
engine.addView()adds more previews, codespaces (editable) and read only workspaces, each in its own mode. Presets set their modes withviews, and toolbars attach to any view by name. - Toolbox without a mouse: tiles drag with a finger or pen, and are reached with Tab and added with Enter or Space, with names for screen readers. Both are on by default (
toolbox.touch,toolbox.keyboard). - Toolbox:
mount()sets its label and block list, code shown as text on tiles is colored like the codespace, and the widest block's width is published as--morphic-toolbox-block-widthfor your layout. - Warnings for the app:
onWarninginmount()receives the framework's warnings instead of the console. - Runtime changes:
setModeElements()changes which elements a mode shows, andrefresh()measures blocks again after a font change. - Output:
runJavaScript()prints values the way the codespace's language writes them (True,None, …), set withcode.<element>.values. - Codespace and preview carry their mode's class, so mode CSS styles them too.
Fixes
- Codespace drops follow the workspace's connection checks, connect into top level chains and no longer cover other blocks.
- Toolbox tiles show slot defaults and field values, draw each code element from its own template, and render right to left correctly.
- Field values a mode's template leaves out are kept, and values typed into default slots survive a redraw.
- New blocks no longer push nearby blocks away.
- Highlighting matches keywords in any script and custom colors win over the defaults.
- The selection highlight is visible on light and dark backgrounds and follows theme changes.
- JavaScript language support loads only for the code editor.
Full changelog: v0.2.1...v0.3.0