Skip to content
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

Cleanup pyscript web elements #2094

Open
wants to merge 69 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
af7092b
change pydom example to use new pyscript.web namespace
fpliger Jun 4, 2024
12f1619
change tests to use new pyscript.web namespace
fpliger Jun 4, 2024
2351d45
create new pyscript.web package and move pydom to pyscript.web.dom
fpliger Jun 4, 2024
426da5a
add __init__ to pyscript.web and expose the dom instance instead of t…
fpliger Jun 4, 2024
74c8ede
move elements from pyweb.ui to pyscript.web and temp fix pydom import
fpliger Jun 4, 2024
a9254e6
moved of elements file completed
fpliger Jun 4, 2024
5cba331
moved media from pyweb to pyscript.web
fpliger Jun 4, 2024
02cc87b
RIP pyweb
fpliger Jun 4, 2024
0fb0985
move JSProperty from pyscript.web.dom to pyscript.web.elements
fpliger Jun 4, 2024
5fd5e9b
move element classes from pyscript.web.dom to pyscript.web.elements
fpliger Jun 4, 2024
903a63f
first round of fixes while running tests
fpliger Jun 4, 2024
009aeda
fix test typo
fpliger Jun 4, 2024
676a500
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 4, 2024
e4e2378
restore right type type returned for Element.parent. ALL TESTS PASS L…
fpliger Jun 5, 2024
dd44759
lint
fpliger Jun 5, 2024
56991d9
Merge branch 'pydom_pyweb_to_stdlib' of github.com:pyscript/pyscript …
fpliger Jun 5, 2024
e399663
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2024
a944199
clean up dom.py from dead commented code and osbolete comments
fpliger Jun 5, 2024
490d23b
bugfix: dom shouldn't return None when it can't find any element for …
fpliger Jun 5, 2024
27f107a
additional cleanup in tests
fpliger Jun 5, 2024
d2aa10b
lint
fpliger Jun 5, 2024
8804401
Merge branch 'pydom_pyweb_to_stdlib' of github.com:pyscript/pyscript …
fpliger Jun 5, 2024
e914b1b
initial cleaning up of unused modules
fpliger Jun 5, 2024
6824617
change element.append to not consider types anymore and add tests for…
fpliger Jun 5, 2024
11f624f
add Element.append tests for append JS elements directly and appendin…
fpliger Jun 5, 2024
edf4cdc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2024
4784405
Tag and create the correct subclass of Element.
mchilvers Jun 7, 2024
6b4ad33
Move: Element.snap -> video.snap
mchilvers Jun 7, 2024
a599e30
Move: Element.download and draw to canvas.download and draw.
mchilvers Jun 7, 2024
c6aa88e
Minor cleanups.
mchilvers Jun 7, 2024
965fe00
Commenting.
mchilvers Jun 7, 2024
c7d13b2
Allow css classes to be passed to Element constructor.
mchilvers Jun 7, 2024
12baf1e
Commenting.
mchilvers Jun 7, 2024
17e05e4
Typo fix.
mchilvers Jun 7, 2024
a7cbe52
Make html, id and text JSProperties.
mchilvers Jun 7, 2024
d72f20b
Commenting.
mchilvers Jun 7, 2024
9f4fd2e
Remove unnecessary selected attribute on BaseElement.
mchilvers Jun 7, 2024
ca66a1a
Extract: BaseElement.from_js -> element_from_js
mchilvers Jun 7, 2024
796b038
Pass *args and **kwargs to element_from_js and remove BaseElement.create
mchilvers Jun 7, 2024
458bea9
Move value attribute to specific Element subclasses.
mchilvers Jun 7, 2024
863f64b
fix: wrapping of existing js elements.
mchilvers Jun 7, 2024
568b306
Add body and head elements so parent and children work everywhere.
mchilvers Jun 7, 2024
bc3844b
Revert order of HasOptions mixin for the select element.
mchilvers Jun 7, 2024
49af9d5
Comment out tests that are no longer relevant (see comment).
mchilvers Jun 7, 2024
66b267e
Use correct super args in mixin.
mchilvers Jun 7, 2024
f12c051
Have to use element_from_js when returning options from OptionsProxy.
mchilvers Jun 7, 2024
899ccc2
rename: StyleProxy -> Style, OptionsProxy -> Options and added Classes.
mchilvers Jun 10, 2024
3ec40dc
Remove cached_property.
mchilvers Jun 10, 2024
5635922
Remove list-y methods from Classes collection.
mchilvers Jun 11, 2024
8096e72
Allow explicit children or *args for containers.
mchilvers Jun 25, 2024
73dc1fa
controversial: fix tests to use find rather than dom
mchilvers Jun 26, 2024
e6bd691
Add html element so (say) body.parent does what is expected.
mchilvers Jun 26, 2024
b28b98a
Collapse Element class hierarchy.
mchilvers Jun 27, 2024
7e218f7
rename: js_element -> dom_element
mchilvers Jun 27, 2024
ac17b48
rename: element_from_js -> element_from_dom
mchilvers Jun 27, 2024
fdb4ae1
replace: JS with DOM
mchilvers Jun 27, 2024
8483ca5
rename: _js -> _dom_element
mchilvers Jun 27, 2024
f7a67cf
fix dom tests.
mchilvers Jun 27, 2024
1e7f80d
Complete element list with void elements derived from Element.
mchilvers Jun 27, 2024
e2ea500
Added attributes to the newly added Element subclasses.
mchilvers Jun 27, 2024
5a0494d
remove dom module, replace with instance.
mchilvers Jun 27, 2024
df507e5
fix: typo in test for 'b' element.
mchilvers Jun 27, 2024
a86b07b
Merge branch 'main' into cleanup_pyscript_web_elements
mchilvers Jun 27, 2024
ed0a6de
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2024
bf7a74c
Remove dom and media modules.
mchilvers Jun 27, 2024
77b2e3a
Merge branch 'cleanup_pyscript_web_elements' of github.com:pyscript/p…
mchilvers Jun 27, 2024
2958ba5
fix up ts definitions.
mchilvers Jun 27, 2024
0776a16
Added missing import (used in content property).
mchilvers Jun 27, 2024
58d9a38
Added TODO :)
mchilvers Jun 27, 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
Minor cleanups.
  • Loading branch information
mchilvers committed Jun 7, 2024
commit c6aa88e05cdd58cf175dfec39dbe92c89bb3a853
4 changes: 1 addition & 3 deletions pyscript.core/src/stdlib/pyscript/web/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def add_class(self, classname):
if isinstance(classname, list):
classList.add(*classname)
else:
self._js.classList.add(classname)
classList.add(classname)
return self

@property
Expand All @@ -288,8 +288,6 @@ def show_me(self):
self._js.scrollIntoView()




class OptionsProxy:
"""This class represents the options of a select element. It
allows to access to add and remove options by using the `add` and `remove` methods.
Expand Down