8000 UI creation API by fpliger · Pull Request #1960 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

UI creation API #1960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 154 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
bdce197
add JSProperty to pydom so it can be used to create descriptors mappi…
fpliger Jan 30, 2024
25e1b06
add pyweb.ui
fpliger Jan 30, 2024
e4d5b66
fix pyweb imports
fpliger Jan 31, 2024
5c5c6e3
fix link and a elements and add a script element
fpliger Jan 31, 2024
73745a0
fix imports and add initialization to load resources to shoelace module
fpliger Jan 31, 2024
5f748c9
new pyweb.ui test folder
fpliger Jan 31, 2024
ff19d63
remove comments
fpliger Jan 31, 2024
a9057e4
add Icon to shoelace components
fpliger Jan 31, 2024
6c50522
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 31, 2024
e3e669c
use html property rather than accessing _js directly
fpliger Jan 31, 2024
a5c3fc6
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Jan 31, 2024
8ade988
add markdown suppport
fpliger Jan 31, 2024
f5857ba
move examples section out of stdlib pyweb to examples.py in the demo …
fpliger Jan 31, 2024
a702518
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 31, 2024
37ef462
simplify demo code
fpliger Jan 31, 2024
275c3dc
improve docstrings
fpliger Jan 31, 2024
ac1cf5f
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Jan 31, 2024
cffee1d
precommit fixes
fpliger Jan 31, 2024
dbc4db4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 31, 2024
7a41a60
simplify code for main page
fpliger Jan 31, 2024
be65cf3
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Jan 31, 2024
c76ce20
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 31, 2024
f37048f
add load_resources to markdown
fpliger Jan 31, 2024
e716049
add showlace extra style dynamically
fpliger Feb 1, 2024
f69338c
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 1, 2024
1cca5f0
precommit
fpliger Feb 1, 2024
c559d8b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 1, 2024
a9637bb
add gallery files
fpliger Feb 1, 2024
5c6de9b
add global attributes and dynamic property assignment
fpliger Feb 1, 2024
3b8745e
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 1, 2024
d370450
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 1, 2024
9edb318
Add shoelace radio component (#1961)
aaskat Feb 1, 2024
3f19695
fix type that lead using the the JSDescriptor directly instead of the…
fpliger Feb 1, 2024
6fd8c6a
add missing marked dependency
fpliger Feb 1, 2024
316652a
refactor gallary to simplify codebase
fpliger Feb 1, 2024
f6b7660
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 1, 2024
495fbc3
precommig lint
fpliger Feb 1, 2024
77c8b5d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 1, 2024
fb584c3
add text attribute to pydom Elements
fpliger Feb 2, 2024
05a5fb7
add global JS attributes to elements and improve demos
fpliger Feb 2, 2024
7036008
lint
fpliger Feb 2, 2024
fe420be
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 2, 2024
bbe9c23
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 2, 2024
6436df2
fix image instantiation on card since the API has changed
fpliger Feb 2, 2024
e75625f
add attributes to all classes in elements
fpliger Feb 2, 2024
e0ee871
lint
fpliger Feb 2, 2024
11a4ada
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 2, 2024
6f3f289
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 2, 2024
779b367
change example creation functions to take the label and the object di…
fpliger Feb 2, 2024
c52caef
fix input name clashing with input keyword
fpliger Feb 2, 2024
410c444
refactor examples to better simplify and automate
fpliger Feb 2, 2024
c387695
fix div clashing names
fpliger Feb 2, 2024
6c838ae
fix demo left menu width
fpliger Feb 2, 2024
cf987b1
simplify base elements demo by moving all the examples to the example…
fpliger Feb 2, 2024
3bf4a85
rename Grid to grid to align to other elements
fpliger Feb 2, 2024
70b97d8
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 2, 2024
21c206a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 2, 2024
0a655f6
reorg classes order in elements.py and add missing elements to examples
fpliger Feb 2, 2024
844e376
fix issue related to now importing div from pyweb.ui
fpliger Feb 2, 2024
3de622f
improve demo
fpliger Feb 2, 2024
fd9ebc9
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 2, 2024
7178616
link and fix spelling typo
fpliger Feb 2, 2024
aac21e4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 2, 2024
d101d7d
Add a bunch more elements (#1966)
FabioRosado Feb 2, 2024
0791890
Add radio group (#1963)
aaskat Feb 2, 2024
9033a09
Small tweaks to main demo page (#1962)
FabioRosado Feb 2, 2024
4ee0540
fix post merge issues
fpliger Feb 2, 2024
1db1e43
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 2, 2024
2c59717
fixed issues with renaming Grid to grid, after we merged
fpliger Feb 2, 2024
39647d7
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 2, 2024
635ede9
lint
fpliger Feb 2, 2024
d5d37fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 2, 2024
bdb84eb
add multple HTML elements in alphabetical order from abbr to em
fpliger Feb 5, 2024
34628f6
fix attributes of some of the elements added in the previous commit a…
fpliger Feb 5, 2024
8a28934
fix embed attributes and add fieldset
fpliger Feb 5, 2024
c0bc27b
add figcation, figure and form. Also fix ordering of definitoin of im…
fpliger Feb 5, 2024
ff7aba3
add style and lint
fpliger Feb 9, 2024
4b89ac1
wrap up adding all major html elements
fpliger Feb 10, 2024
1db8163
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 10, 2024
0f3444e
fix test failing due to different error message from fake server comp…
fpliger Feb 12, 2024
ae3c36b
change default docstring associated with all classes dynamically patched
fpliger Feb 12, 2024
b467bfe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2024
83d17a7
lint
fpliger Feb 12, 2024
bd68966
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 12, 2024
e0cf825
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2024
6121d32
Merge branch 'main' into poc_ui_blocks
WebReflection Feb 14, 2024
3654160
add pyweb tests
fpliger Feb 27, 2024
850f8c6
lint
fpliger Feb 27, 2024
98413cf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 27, 2024
c518e79
add global attributes and change abbr test
fpliger Feb 27, 2024
6dccf08
fix abbr to inherit from TextElementBase
fpliger Feb 27, 2024
51dc090
add address test and improve error messaging when ElementBase gets a …
fpliger Feb 27, 2024
97fdfae
change test helper function to be more flexible on attributes and ma…
fpliger Feb 27, 2024
d1038cb
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Feb 27, 2024
f5f01f6
add test for more elements up to caption
fpliger Feb 27, 2024
7e06894
fix canvas and caption as elements that have content and fix name typ…
fpliger Feb 27, 2024
a4272c7
fix another typo on figcaption
fpliger Feb 27, 2024
34552ae
minor fixes and complete tests for 8000 all elements
fpliger Feb 28, 2024
43c085d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 28, 2024
b9cfe74
adapt shoelace to latest upates in ui.elements
fpliger Feb 29, 2024
15896cd
fix issue with example code not showing created button
fpliger Mar 4, 2024
ff7e2ef
Merge branch 'main' into poc_ui_blocks
fpliger Mar 26, 2024
7f26724
move global attributes to base class
fpliger Mar 26, 2024
012e659
replace all the calls to _add_js_properties with defining attributes …
fpliger Mar 26, 2024
2bb751a
finish moving all properties manually on each class
fpliger Mar 26, 2024
35e7273
remove _add_js_properties
fpliger Mar 26, 2024
ee94039
replace JSProperty with js_property
fpliger Mar 26, 2024
111616a
replace JSProperty with js_property
fpliger Mar 26, 2024
5d22ec1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2024
ef43e1f
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Mar 26, 2024
da3db51
fixed merge conflicts
fpliger Mar 26, 2024
1c315f8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2024
8d955ad
remove js_property and just use JSProperty with name and allow_nones …
fpliger Mar 26, 2024
4cc3092
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Mar 26, 2024
0eadcc1
fix bug around Element not being able to map global attributes in sub…
fpliger Mar 26, 2024
b73b30b
remove js_property and fix references
fpliger Mar 26, 2024
27363f4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2024
307eb73
precommit
fpliger Mar 26, 2024
152ad6c
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Mar 26, 2024
f6a634c
precommit again
fpliger Mar 26, 2024
abe706b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2024
106a78b
Merge branch 'main' into poc_ui_blocks
fpliger Apr 3, 2024
80529ca
lint
fpliger Apr 3, 2024
d7ac58d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2024
9b46e7c
Merge branch 'main' into poc_ui_blocks
WebReflection Apr 15, 2024
6dc75e5
Merge branch 'main' into poc_ui_blocks
WebReflection Apr 17, 2024
18ffdb9
Merge branch 'main' into poc_ui_blocks
fpliger May 7, 2024
12c9946
enable pyweb on micropython
fpliger May 7, 2024
313824d
switch examples to micropython
fpliger May 7, 2024
62d31d9
fix pydom issue with micropython, created by the monkeypatch around J…
fpliger May 7, 2024
b885f30
print micropython version on micropython pydom example
fpliger May 7, 2024
7c1a0d1
lint and remove of textwrap in stdlib for micropython compatibility
fpliger May 7, 2024
a6df2be
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 7, 2024
4c20406
added msising attributes on the option Element. Tests are all passing…
fpliger May 7, 2024
0c2dec3
fix tests
fpliger May 8, 2024
d348d9a
lint
fpliger May 8, 2024
69bb8ba
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger May 8, 2024
343f059
temp ugly fix for micropython, using the when decorator with a functi…
fpliger May 9, 2024
90d891e
small fixes and improvements to examples
fpliger May 9, 2024
4ca89cc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 9, 2024
c8db625
fix examples and broken link from the removal of markdown and shoelac…
fpliger May 14, 2024
106be4b
lint
fpliger May 14, 2024
1b27b86
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 14, 2024
767f2f9
dynamically change the server address in tests
fpliger Jun 3, 2024
2ea493d
use the right element in test_a
fpliger Jun 3, 2024
a7279de
lint
fpliger Jun 3, 2024
3c11d95
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 3, 2024
4503933
skipping test_audio in CI due to different behavior of fake_server vs…
fpliger Jun 3, 2024
e6f7040
Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc…
fpliger Jun 3, 2024
0524a18
add conditional expected_missing_file_errors property to manage diffe…
fpliger Jun 3, 2024
a3a3172
lint
fpliger Jun 3, 2024
6eb27df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 3, 2024
b7d17e4
Merge branch 'main' into poc_ui_blocks
fpliger Jun 3, 2024
01a1710
Merge branch 'main' into poc_ui_blocks
fpliger Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
fpliger committed Jun 3, 2024
commit a7279de12eadb8714729a23cb1a01b18f5f3a88f
1 change: 1 addition & 0 deletions pyscript.core/src/stdlib/pyscript/fetch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json

import js

from pyscript.util import as_bytearray


Expand Down
1 change: 1 addition & 0 deletions pyscript.core/src/stdlib/pyscript/magic_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import js as globalThis
from polyscript import config as _config
from polyscript import js_modules

from pyscript.util import NotSupported

RUNNING_IN_WORKER = not hasattr(globalThis, "document")
Expand Down
1 change: 1 addition & 0 deletions pyscript.core/src/stdlib/pyscript/websocket.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import js

from pyscript.util import as_bytearray

code = "code"
Expand Down
1 change: 1 addition & 0 deletions pyscript.core/src/stdlib/pyweb/media.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pyodide.ffi import to_js

from pyscript import window


Expand Down
3 changes: 2 additions & 1 deletion pyscript.core/src/stdlib/pyweb/ui/elements.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import inspect
import sys

from pyscript import document, when, window
from pyweb import JSProperty, pydom

from pyscript import document, when, window

#: A flag to show if MicroPython is the current Python interpreter.
is_micropython = "MicroPython" in sys.version

Expand Down
3 changes: 2 additions & 1 deletion pyscript.core/test/camera.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from pyodide.ffi import create_proxy
from pyscript import display, document, when, window
from pyweb import media, pydom

from pyscript import display, document, when, window

devicesSelect = pydom["#devices"][0]
video = pydom["video"][0]
devices = {}
Expand Down
3 changes: 2 additions & 1 deletion pyscript.core/test/pydom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import time
from datetime import datetime as dt

from pyscript import display, when
from pyweb import pydom

from pyscript import display, when

display(sys.version, target="system-info")


Expand Down
1 change: 1 addition & 0 deletions pyscript.core/test/pyscript_dom/run_tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
print("tests starting")
import pytest

from pyscript import window

args = window.location.search.replace("?", "").split("&")
Expand Down
3 changes: 2 additions & 1 deletion pyscript.core/test/pyscript_dom/tests/test_dom.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from unittest import mock

import pytest
from pyscript import document, when
from pyweb import pydom

from pyscript import document, when


class TestDocument:
def test__element(self):
Expand Down
3 changes: 2 additions & 1 deletion pyscript.core/test/ui/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import shoelace
import styles
from markdown import markdown
from pyscript import when, window
from pyweb import pydom
from pyweb.ui import elements as el
from pyweb.ui.elements import a, button, div, grid, h1, h2, h3

from pyscript import when, window

MAIN_PAGE_MARKDOWN = dedent(
"""
## What is pyweb.ui?
Expand Down
3 changes: 2 additions & 1 deletion pyscript.core/test/ui/examples.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from markdown import markdown
from pyscript import when, window
from pyweb import pydom
from pyweb.ui.elements import (
a,
Expand Down Expand Up @@ -41,6 +40,8 @@
Textarea,
)

from pyscript import when, window

LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
details_code = """
LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
Expand Down
3 changes: 2 additions & 1 deletion pyscript.core/test/ui/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import styles
import tictactoe
from markdown import markdown
from pyscript import when, window
from pyweb import pydom
from pyweb.ui import elements as el

from pyscript import when, window

MAIN_PAGE_MARKDOWN = dedent(
"""
This gallery is a collection of demos using the PyWeb.UI library. There are meant
Expand Down
1 change: 1 addition & 0 deletions pyscript.core/test/worker.py
Original file line number Diff line number Diff line change
5DAB Expand Up @@ -3,6 +3,7 @@
js.document.body.append("document patch ")

import a

from pyscript import RUNNING_IN_WORKER, display, sync

display("Hello World", target="test", append=True)
Expand Down
Loading
0