* Allow MicroPython Terminal on Main
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix#2056 - Provide a default empty config per editor env
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Even better PyEditor offline use case (#2050)
* Even better PyEditor offline use case
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* PyEditor - process(code) ability
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix#2031 - Add pyscript.WebSocket to the mix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Working on a test case anyone can run
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix#2040 - Polyscript update to provide config dictionary
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
## Changes
* fixed an issue with the **py-editor** related to the new `linebuffer` directive
* provide in worker hook scope a simple callback that pre-buffers unicode sequences [accordingly to the standard](https://encoding.spec.whatwg.org/#utf-8-bytes-needed) so that the buffer is sent to the terminal only once those sequences are fulfilled
* test with both `µ` and way more convoluted sequences such as 👩❤️👨 that the output, if either requested as input or already evaluated from the page works ... in latter case `test = "👩❤️👨"` completely messes up the program and the resulting string is empty
* Fix#1998 - Allow lazy PyTerminal bootstrap
* Fix#1998 - Allow lazy terminal bootstrap / runtime
* Implemented mpy terminal in both main and worker
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix#2000 - Allow advanced users to deal themselves with responses
* rolled back the direct utility idea
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated to latest MicroPython and latest way to have direct access with fetch
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* add missing test for html attribute
* add test for text attribute
* fix text attribute test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andrea Giammarchi <andrea.giammarchi@gmail.com>
* fix pydom example
* fix the pydom test example to use a python syntax that works with MicroPython by replacing datetime
* add note about capturing errors importing when
* patch event_handler to handle compat with micropython
* turn pyweb into a package and remove hack to make pydom a sort of module with an ugly hack
* add pydom example using micropython
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix select element test
* change pydom test page to let pytest tests load it properly
* add missing folders to test dev server so it can run examples in the manual tests folder
* add pydom tests to the test suite as integration tests
* lint
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* improve fixes in event_handling
* change when decorator to actually dynamically fail in micropython and support handlers with or without arguments
* simplify when decorator code
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add type declaration back for the MP use case
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* removed code to access pydom get index as I can't think of any proper use case
* remove old commented hack to replace pydom module with class
* fix examples title
* precommit checks
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* add media module
* add Device class to media
* add camera test example
* add snap, download and other convenience methods
* load devices automagically
* add draw method to canvas
* add docstring for download
* add docstrings to draw method
* add docstrings to snap
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* load devices as soon as the page loads
* solve conflict
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove display calls listing devices in camera example
* fix typos and other small errors
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix typo in docstring
* fix error message typo
* replace setAttribute on JS properties with accessors
* remove debug statement
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add docstrings
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add docstrings to camera example
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix#1899 - Expose pyscript.js_modules as module
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix#1899 - Make import as smooth as in polyscript
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* add tests for select options
* add classes to support select and options management
* fix add methond and implement clear on options
* fix optionsproxy.add
* fix select.add method
* add test adding a second option to select
* add tests around adding options in multiple flavors
* add test to add an option by passing the option it wants to be added before
* complete test around adding options
* add select to add test on remove
* add tests and support for selected item
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andrea Giammarchi <andrea.giammarchi@gmail.com>
This MR shows errors and exit in these conditions:
* multiple `<py-config>` or `<mpy-config>` found on the page
* both `<py-config>` and `<script type="py" config="file.toml">` found on main
* different `<script type="py" config="a.toml">` and `<script type="py" config="b.toml">` configs found on main
* added a *py-editor* plugin based on *codemirror*
* use a `<script type="py-editor">` wrapper to bootstrap code
* tested that all is good via smoke-test in test/py-editor.html
* Patch js.document out of the box
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* add base test for input value field
* add value property to Element
* add test for non supported element
* prevent users to set value attribute on elements that do not support it
* add test for setting value on collections
* add value property to collection and add more tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
pre-commit.ci has been disabled for a while.
This PR ensures that all the files has been validated/formatted by pre-commit, to avoid spurious diffs in subsequent PRs.
During the process, ruff broke the code because it removed an "unused" import which was actually used.
A linter which breaks my code is a linter which I cannot trust, so I just removed it. I re-enabled isort instead.