601 Commits

Author SHA1 Message Date
Nicholas Tollervey
ade0dca8f9 Update to latest Pyodide (#631) 2022-07-28 20:52:54 -04:00
Fabio Pliger
8e1cd0b268 minor changes to make linting happier (#598)
* minor changes to make linting happy

* remove cast since linter wasn't happy

* address PR comments
2022-07-28 15:30:03 -05:00
woxtu
9102768366 Improve with string interpolations (#604)
* Use string interpolations

* Fix the key in py-env
2022-07-28 11:07:10 -04:00
Mariana Meireles
c49fdfc56c Re-introduce xPyWidget update on CustomWidget's class (#576)
Co-authored-by: mariana <marianameireles@protonmail.com>
2022-07-21 15:13:11 -05:00
Mariana Meireles
afa216dc5e Mv build folder from examples/build to build/ (#571)
Co-authored-by: mariana <marianameireles@protonmail.com>
2022-07-07 11:29:09 -03:00
Fabio Pliger
91a09a09f7 Rename examples cmd and add checks (#563)
* add checks for node and npm versions

* rename example cmd to examples
2022-07-04 15:21:17 -03:00
Leonardo Pliger
ee9b0960f7 Add support to py- events that map all js events available (#561)
* added the  py- events throughout pyscript.ts

* Integrated the py- event throughout the examples

* Fixed spelling error
2022-06-29 19:49:21 -03:00
woxtu
506ac2574f Add type annotations (#562) 2022-06-28 14:17:23 -05:00
ic-768
dc84d7c1b5 Minor improvements (#556)
* checkpoint: added some text

* checkpoint: added setting up the environment, tips for writing good issues

* continuing to fill it out

* added more detailed description of the process of creating a change and some other cleanup.

* added a getting started section and cleaned up the grammar. This ready for the PR now

* forgot to add the new section to the TOC

* Minor fixes

Co-authored-by: Kevin Goldsmith <kgoldsmith@anaconda.com>
Co-authored-by: Matt Kramer <mkramer@anaconda.com>
2022-06-28 14:16:05 -05:00
Fabio Pliger
fcaa57307f See you later tailwind (#452)
* start removing tailwind and rebuilding some css

* add css to pybox and add class to repl

* set output component visibility

* replace tailwind class with single component class

* add styles to css

* replace classes on  button

* replace classes on input

* replace classes in title

* replace classes on list

* replace classes

* add new style file

* add list element style

* remove tailwind classes from todo example

* revert link on examples files

* remove tailwind config files

* remove commented old code

* add missing ;
2022-06-24 18:30:07 -05:00
woxtu
c7942d7d8f Use the type definition of pyodide (#535)
* Import the type definition

* Add type annotations
2022-06-24 14:25:14 -05:00
Philipp Rudiger
deb2eee3ad Revert output manager after REPR evaluation (#522)
* Revert output manager after repr evaluation

* Fix indentation
2022-06-21 16:42:53 -05:00
Philipp Rudiger
829cc9f6f9 Simplify tests with pytest-playwright (#523)
* Simplify tests with pytest-playwright

* Add pytest-playwright to pip

* Fix simple_clock example

* Attempt to make example tests more robust

* Make pre-commit happy

* Revert accidental change to simple_clock pyscript resources

* Another attempt at reducing flakeyness

* Do not wait until page load event is fired

* Remove pointless py-config

Co-authored-by: mariana <marianameireles@protonmail.com>
2022-06-21 14:28:05 -03:00
woxtu
6822105c70 Add type annotations (#488) 2022-06-20 13:22:03 -03:00
andre-dietrich
e1622a56fa fix: < & > are parsed with HTML escape symbols (#481)
Adds utils.htmlDecode arround innerHTML to read the code for <py-repl> and
<py-script>, which preserves all newlines, tabs, and < & > characters.

Fix bug #480
2022-06-09 16:01:31 -05:00
Fabio Pliger
f60dd6a788 Fix extensions regression bug (#489)
* add output div visibility rule and make sure CustomWidget is being registered

* add new runAfterRuntimeInitialized method that classes can use to run code only after runtime actually initialized

* replace setTimout with proper event to wait for runtime to be completed

* replace setTimout on pyinpytbox with proper event to wait for runtime to be completed
2022-06-01 15:39:05 -05:00
woxtu
4b4ff08131 Change the metadata format (#457)
* Chnage the metadata format

* Add syntax highlighting

* have simple_clock example run from local build to test change

Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
2022-06-01 15:49:41 -03:00
marianoweber
eaacd45672 [FIX] output management cleanups (#464)
* return on \n before empty div is appended

* use appendOutput with out.write

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Mariano Weber <info@uiremotely.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-27 00:21:47 -05:00
Peter W
1bf6cc0e72 Fix examples Ci, Makefile, some doc references (#469)
* fix examples ci, makefile, and update docs

* getting started reference
2022-05-26 16:56:54 -05:00
Mariana Meireles
a9470ed9c1 Move tests, create makefile action to run tests on examples (#433)
* Move tests, create makefile action to run tests on examples

* Correct import file for html files

* Build environment for tests

* Fix the CI

* rearrange CI

* fix find cmd and make sure we don't delete the folder implicitly

* more rearranging

* fix folder permissions and custom sed for subfolders

* add toga wheels files

* re-add missing file

* mirror latest changes in alpha ci

* fix find cmd

* try different fix for find

* remove redundant build

Co-authored-by: mariana <marianameireles@protonmail.com>
Co-authored-by: pww217 <pwilson@anaconda.com>
Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
2022-05-26 16:31:38 -05:00
Philipp Rudiger
2c5ef95027 Update panel examples to panel 0.13.1 (#458)
* Update panel examples to panel 0.13.1

* More indent
2022-05-24 18:01:45 -05:00
marianoweber
f712b1369a [PROPOSAL] REPL output replacement (#439)
* fix OutputManager _append setter

* fix OutputManager change parameters

* fix OutputCtxManager __init__ and change methods

* replacing OutputManager pyscript.write with write function

* add optional output-append attribute to py-repl

* add appendOutput(default: true) to base component

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pyscriptjs/src/components/pyrepl.ts

Co-authored-by: woxtu <woxtup@gmail.com>

* change from output-append flag to output-mode attribute

* removed type annotation

* repositioned setOutputMode call for auto-generated REPLs to work

* fixed indentation error for indented input

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added preEvaluate method

* moved output-mode logic to preEvaluate

* remove static write method from PyScript, add write method to Element

* removed err parameter from OutputCtxManager

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add PyScript.write back with a deprecation warning

* fix wrong input name

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: woxtu <woxtup@gmail.com>
Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
2022-05-24 17:58:48 -05:00
ic-768
8cd5ba6361 Minor refactoring (#437) 2022-05-23 18:15:37 -05:00
woxtu
3b68e1b27d Bundle the Python files into the output file (#441)
* Bundle the Python files into the output file

* Remove unused functions
2022-05-22 16:30:19 -05:00
Peter W
ee46b46234 Add testing to CI flow (#418)
* new testing ci flow

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* install conda

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test conda

* pre-commit fix

* remove if

* makefile fix

* fix pytest install

* argument for test

* restructure

* fix sync

* full path filter

* use setup-condav2

* syntax

* test path

* add binary argument

* remove which

* Update Makefile

* remove arguments

* trigger CI

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-20 13:45:49 -05:00
Furkan Doğan
db49fd498a fixed the logging of initializers (#431) 2022-05-19 19:44:55 -03:00
woxtu
e95b90363e Add event listeners properly (#424) 2022-05-19 17:56:53 -03:00
woxtu
82c0d741e4 Add type annotations (#396)
* Add type annotations

* Replace `StateCommand` with `Command`

* Revert "Replace `StateCommand` with `Command`"

This reverts commit 2dfc2d34e4.

* Fix the return value
2022-05-19 16:59:39 -03:00
ic-768
508a7d8605 Add labels for pyrepl component (#322)
* Add labels for pyrepl component

* Add id to editor box instead of main div

Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
2022-05-19 09:23:08 -05:00
cleonard
59fc667651 Basic tests (#355)
* Added microsoft channel and playwright as dependency

* Added test-setup to run

* Basic tests for each example in examples/index.html

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_webgl_raycaster_index.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_folium.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_folium.py

* Update test_folium.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_bokeh.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Whitelisting assertion statements in test files

* Updated bare execept statements with ImportError

* Flake8 compliance

* Updated  message

* Removed 'make test-setup'

* Removed @echo from make test

* Uncommented Toga test

* Removed __test_all__.py file

* Removing unnecessary files

* Removed individual test files

* conftest.py with all data for running tests

* Consolidated test file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed pre-commit flake8 issues

* flake8 issue

* add playwright installation to setup

* Testing parameterization and webserver to serve examples locally

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Flake8 compliance

* More flake8

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Michael Verhulst <michael@terminallabs.com>
Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
2022-05-18 13:08:15 -05:00
Jeff Glass
b767a78b05 Provide Visible Error if <py-env> paths is used in a local HTML file (#311)
* Add onscreen error when using py-env paths in local HTTP files without file server

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove redundant code, fix error handling, add 404 error

* Lint and Format

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* manage errors loading files

* use handleFetchError for handling fetch errors in env

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
2022-05-17 23:48:02 -05:00
woxtu
39774a83c5 Use a recommended method (#363) 2022-05-17 22:24:33 -05:00
marianoweber
c04015899b fixed REPL bugs (#372)
* fixed REPL play button alignment

* fixed REPL auto-generate

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* changed nextExecId selector

* added removeClasses to utils.ts

* fixed visual bug after error output

* changed play button alignment

Co-authored-by: Mariano Weber <info@uiremotely.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-17 16:20:00 -05:00
hoge1e3
eb3a31a698 fixed the bug std-err attribute cannot set stderr properly (#371) 2022-05-16 21:30:57 -05:00
Fabio Pliger
0476627f34 fix autogenerated element (#397)
* use static string in checkId to simplify behaviour and ensure ids always start with alpha char

* re-enable terser on minify

* fix example local path
2022-05-16 16:08:28 -05:00
Yannick Funk
eba42ad9b4 Add checkId() for PyButton and PyInputBox, add id check for tags with pys- Event handlers (#400)
* Add id generation to PyButton and PyInputBox components

* Refactor init handlers and add check for id
2022-05-16 16:05:11 -05:00
Javadz
ca909b4f6b Create readme.md (#374) 2022-05-16 11:13:39 -05:00
Fabio Pliger
8670f96d21 remove terser since it's breaking specific examples (#395) 2022-05-16 10:58:02 -05:00
Philipp Rudiger
1e8aa87b0a Ensure minified pyscript is captured by query selector (#393) 2022-05-16 09:40:23 -05:00
Fabio Pliger
8c65cad209 remove prod flag from build cmd and add alternative build-min cmd (#368) 2022-05-13 19:08:02 -05:00
Fabio Pliger
74d29bca8c fix paths to pyscript.net (#366) 2022-05-13 18:40:11 -05:00
Peter W
1fdec1ca21 redirect examples (#365) 2022-05-13 18:24:29 -05:00
woxtu
86eb771cdc Use substring() instead of substr() (#341) 2022-05-12 14:54:35 -05:00
NiJia Lin
a3e86f32b7 Update say_hello.html (#327)
- remove un-usage `setTimeout` package
2022-05-11 20:39:22 -05:00
woxtu
53a21b74eb Enable to generate the source map (#325) 2022-05-11 19:18:28 -05:00
Fabio Pliger
363f3751f9 support different pyodide versions (#328)
* add PyLoader class

* create global loader during app creation time and remove it when pyscript loading operations are done

* make the loader global and open/close when apps is starting. Also add concept of app config so users can set if they want to autoclose the loader of handle it themselves

* add pyconfig file

* auto add global config if there's no config set in the page

* export initializer type

* define type for config

* move initialization out of svelte file, into app config

* change runtimes from strings to objects

* fix typo
2022-05-11 16:59:13 -05:00
Julian
73a0d9b02e Fix <py-repl theme="dark"> (#320)
* fix: theme for <py-repl>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove comment

* fix: populate initial theme on auto generated repls.

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-11 14:57:01 -05:00
ic-768
2526d242bc Change let to const; Minor code improvement (#300)
* Change let to const; Minor code improvement

* Indentation fix
2022-05-10 16:15:32 -05:00
Fabio Pliger
71319d0969 add app loading splash screen and AppConfig (#279)
* add PyLoader class

* create global loader during app creation time and remove it when pyscript loading operations are done

* make the loader global and open/close when apps is starting. Also add concept of app config so users can set if they want to autoclose the loader of handle it themselves

* add pyconfig file

* auto add global config if there's no config set in the page

* remove changes to simple_clock example
2022-05-10 16:00:25 -05:00
Peter W
5f19756ff3 fix ci issues (#312)
* test ci

* sync fixes, ignore symlink

* remove symlink

* undo trigger tests

* only deploy latest on merge, not PR

* quotes to single
2022-05-10 12:27:06 -05:00