Repository navigation
Conversation
- Add event handling infrastructure in the pyodide-code package. - Create EventSource and ExecutionEventSource interfaces for event management. - Implement ExtensionEventStore to manage event subscriptions and deliveries. - Develop WorkerEventSession to handle event sessions in web workers. - Introduce webio.py for Python event handling, allowing event registration and processing. - Create cookie-klicker extension with event handling for cookie clicks. - Add CookieComponent to the website for user interaction with cookies. - Update SiteStore to include CookieStore for managing cookie states. - Enhance tests for event handling and worker extensions to ensure reliability.
|
|
✅ Deploy Preview for teaching-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…nd setup instructions
…ie-klicker documentation
… cookie-klicker extensions - Implemented a new ClientExtensions class to manage extension instances and their stores. - Updated the extension message handling to utilize the new ClientExtensions class. - Enhanced the extension configuration to support both string and object descriptors. - Created a new hook `useExtensionStore` for easier access to extension stores. - Introduced a clock extension with a complete implementation including a Clock class, ClockStore, and UI components. - Added a cookie-klicker extension with a Cookie class, CookieStore, and interactive UI components. - Updated the SiteStore to remove direct references to ClockStore and CookieStore, simplifying the structure. - Added README files for both clock and cookie-klicker extensions to guide usage.
…ucture and functionality
…ker examples; remove outdated clock.mdx
- Implemented the snowfall game using a game loop to manage snowflake rendering and user interactions. - Added new components and styles for the snowfall game, including scene management and event handling. - Updated webio documentation to include details about the new game loop functionality. - Enhanced event handling in the WorkerEventSession to support frame-based updates. - Registered the snowfall game extension in the site configuration for easy integration.
…capabilities - Implemented a new grid extension for the Teaching Dev website, allowing users to create and manipulate grids using Python. - Added JavaScript and Python modules for grid rendering, including support for cell colors, text, and event handling. - Introduced a WorkerGrid class to manage grid state and rendering in a web worker context. - Created a Grid class in Python to interface with the JavaScript grid functionality, enabling seamless integration. - Developed a client extension to handle grid messages and updates from the worker. - Added tests for Python module registration and grid functionality to ensure reliability. - Updated site configuration to include the new grid extension.
- Added CookieStore to manage cookies in the Cookie Clicker game. - Introduced GridStore to handle grid-related data in the grid component. - Created Grid component with rendering logic and event handling. - Developed WorkerGrid for offloading grid operations to a web worker. - Added Scene and SceneStore for managing the Snowfall game state. - Implemented WorkerScene for handling scene operations in a web worker. - Updated README files to reflect new import paths for components. - Added styles for Grid and SnowfallGame components.
This branch has not been deployed
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.
Python scripts can now receive browser events from extension handles and update interactive components while the script remains active. The cookie clicker demonstrates the full flow: clicking either cookie updates its rotation, and the focused second cookie turns 5° left or right with the arrow keys.
Changes
webio.on_event,@on_click(target), and@on_key(target, key=None)APIs. Keyboard handlers can filter by a key such asArrowLeft;Noneand'*'receive all keys.await webio.run(). Async handlers can useawait asyncio.sleep(...);webio.stop()ends event processing.CookieStorewith multiple models keyed by ID, and an accessible cookie button with focus-scoped keyboard input. Keep cookie behavior outside the generic Python event module.docs/and gives the cookie example its own linked subpage, followingbrython-code.