$ show RaspberryPiFoundation/blockly-samples
This repository is a monorepo containing Blockly plugins and example applications that demonstrate how to extend and customize the Blockly visual programming library. It provides reusable UI components (custom fields, toolbox enhancements, workspace minimap), real-time collaboration features, and developer tools for creating custom blocks. The architecture follows a plugin pattern where each extension is self-contained with its own source, tests, and package.json. Examples showcase practical integrations like block factories, serialization, and multi-user editing. The codebase is actively maintained with regular updates to track Blockly releases and employs Lerna for workspace management.
The LLM identified 3 files worth highlighting for reuse:
Implements a custom Blockly colour field with HSV sliders and an eyedropper tool. Demonstrates how to create a complex custom field with a custom editor, state persistence, and multi-language code generation. Self-contained and reusable in any Blockly application.
Provides a minimap for the Blockly workspace that updates in real-time as the user builds programs. Shows how to listen to workspace events and render a scaled-down version of the workspace. Decoupled from specific block logic and easily integrable.
Adds a searchable filter to the Blockly toolbox, allowing users to quickly find blocks by name. Demonstrates extending the toolbox UI and handling user input to dynamically show/hide toolbox items. Self-contained and non-intrusive.