diff --git a/.gitignore b/.gitignore index 544d926..a16da5f 100644 --- a/.gitignore +++ b/.gitignore @@ -166,4 +166,7 @@ src/**/*.js *.tsbuildinfo examples/**/static/*.js -tests/**/static/*.js \ No newline at end of file +tests/**/static/*.js + +# Stubs should be generated on build, matching the pydom version +seamless/stubs/ \ No newline at end of file diff --git a/README.md b/README.md index f950cb5..1298939 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ pip install python-seamless ## Usage ```python -from seamless import Div, H1, P, Component, StyleObject +from seamless import Div, H1, P, Component, StyleSheet class MyComponent(Component): def render(self): - root_style = StyleObject(color="#33343c") + root_style = StyleSheet(color="#33343c") return Div(style=div_style)( H1( "Hello, World!", diff --git a/_auto_html.py b/_auto_html.py index 53b5afb..e038761 100644 --- a/_auto_html.py +++ b/_auto_html.py @@ -1,259 +1,110 @@ +# %% +import inspect import pathlib +import typing -HERE = pathlib.Path(__file__).parent -HTML_FILES = HERE / "seamless/html" - -# with open(HERE / "__init__.py", "w") as f: -# items = [] -# for file in HERE.iterdir(): -# if file.name.startswith("_") or file.suffix != ".py": -# continue - -# capitalized = file.stem.capitalize() -# items.append(capitalized) -# print(f"from .{file.stem} import {capitalized}", file=f) - -# all = "\n".join(f'\t"{item}",' for item in items) -# print(f"\n__all__ = [\n{all}\n]", file=f) - +import pydom +import pydom.element +import pydom.types.html -html_map = { - "A": "HTMLAnchorElement", - "Area": "HTMLAreaElement", - "Audio": "HTMLAudioElement", - "Br": "HTMLBRElement", - "Base": "HTMLBaseElement", - "Body": "HTMLBodyElement", - "Button": "HTMLButtonElement", - "Canvas": "HTMLCanvasElement", - "Caption": "HTMLTableCaptionElement", - "Col": "HTMLTableColElement", - "ColGroup": "HTMLTableColElement", - "Data": "HTMLDataElement", - "DataList": "HTMLDataListElement", - "Del": "HTMLModElement", - "Details": "HTMLDetailsElement", - "Dialog": "HTMLDialogElement", - "Div": "HTMLDivElement", - "Embed": "HTMLEmbedElement", - "FieldSet": "HTMLFieldSetElement", - "Form": "HTMLFormElement", - "H1": "HTMLHeadingElement", - "H2": "HTMLHeadingElement", - "H3": "HTMLHeadingElement", - "H4": "HTMLHeadingElement", - "H5": "HTMLHeadingElement", - "H6": "HTMLHeadingElement", - "Hr": "HTMLHRElement", - "Head": "HTMLHeadElement", - "Heading": "HTMLHeadingElement", - "Html": "HTMLHtmlElement", - "IFrame": "HTMLIFrameElement", - "Img": "HTMLImageElement", - "Input": "HTMLInputElement", - "Ins": "HTMLModElement", - "Li": "HTMLListItemElement", - "Label": "HTMLLabelElement", - "Legend": "HTMLLegendElement", - "Link": "HTMLLinkElement", - "Map": "HTMLMapElement", - "Meter": "HTMLMeterElement", - "Object": "HTMLObjectElement", - "Ol": "HTMLOrderedListElement", - "OptGroup": "HTMLOptGroupElement", - "Option": "HTMLOptionElement", - "Output": "HTMLOutputElement", - "P": "HTMLParagraphElement", - "Param": "HTMLParamElement", - "Picture": "HTMLPictureElement", - "Pre": "HTMLPreElement", - "Progress": "HTMLProgressElement", - "Q": "HTMLQuoteElement", - "Script": "HTMLScriptElement", - "Select": "HTMLSelectElement", - "Slot": "HTMLSlotElement", - "Source": "HTMLSourceElement", - "Span": "HTMLSpanElement", - "Style": "HTMLStyleElement", - "Table": "HTMLTableElement", - "TBody": "HTMLTableSectionElement", - "Td": "HTMLTableDataCellElement", - "TFoot": "HTMLTableSectionElement", - "Th": "HTMLTableHeaderCellElement", - "THead": "HTMLTableSectionElement", - "Tr": "HTMLTableRowElement", - "Template": "HTMLTemplateElement", - "TextArea": "HTMLTextAreaElement", - "Time": "HTMLTimeElement", - "Title": "HTMLTitleElement", - "Track": "HTMLTrackElement", - "Ul": "HTMLUnorderedListElement", - "Video": "HTMLVideoElement", +HERE = pathlib.Path(__file__).parent +BASE_STUBS_DIR = HERE / "_auto_html" +PYDOM_ROOT = pathlib.Path(pydom.html.__file__) +SEAMLESS_ROOT = HERE / "seamless/stubs" + +pydom_types = { + x: getattr(pydom.types.html, x) + for x in dir(pydom.types.html) + if x.startswith("HTML") } -html_classes = [ - "A", - "Abbr", - "Address", - "Area", - "Article", - "Aside", - "Audio", - "B", - "Base", - "Bdi", - "Bdo", - "BlockQuote", - "Body", - "Br", - "Button", - "Canvas", - "Caption", - "Cite", - "Code", - "Col", - "ColGroup", - "Data", - "DataList", - "Dd", - "Del", - "Details", - "Dfn", - "Dialog", - "Div", - "Dl", - "Dt", - "Em", - "Embed", - "FieldSet", - "FigCaption", - "Figure", - "Footer", - "Form", - "H1", - "H2", - "H3", - "H4", - "H5", - "H6", - "Head", - "Header", - "HGroup", - "Hr", - "Html", - "I", - "IFrame", - "Img", - "Input", - "Ins", - "Kbd", - "Label", - "Legend", - "Li", - "Link", - "Main", - "Map", - "Mark", - "Menu", - "Meta", - "Meter", - "Nav", - "NoScript", - "Object", - "Ol", - "OptGroup", - "Option", - "Output", - "P", - "Param", - "Picture", - "Pre", - "Progress", - "Q", - "Rp", - "Rt", - "Ruby", - "S", - "Samp", - "Script", - "Search", - "Section", - "Select", - "Slot", - "Small", - "Source", - "Span", - "Strong", - "Style", - "Sub", - "Summary", - "Sup", - "Svg", - "Table", - "TBody", - "Td", - "Template", - "TextArea", - "TFoot", - "Th", - "THead", - "Time", - "Title", - "Tr", - "Track", - "U", - "Ul", - "Var", - "Video", - "Wbr", -] - -inline_html_classes = [ - "Area", - "Base", - "Br", - "Col", - "Embed", - "Hr", - "Img", - "Input", - "Link", - "Meta", - "Param", - "Source", - "Track", - "Wbr", -] - -html_map = {key: html_map.get(key, "HTMLElementProps") for key in html_classes} - -template = """from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import {props_class_name} -from ..types import ChildType - - -class {class_name}(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[{props_class_name}]): ... -""" - -inline_string = "\n inline = True" - -lower_keys = {key.lower(): key for key in html_map} - -for cls, props in html_map.items(): - class_name = cls - class_name_lower = class_name.lower() - props_class_name = props - filename = f"{class_name_lower}.pyi" - inline = inline_string if class_name in inline_html_classes else "" - - if class_name == "Meta": - continue - - if class_name == "Del": - filename = "del_.pyi" - with open(HTML_FILES / filename, "w") as f: - f.write(template.format(class_name=class_name, class_name_lower=class_name_lower, props_class_name=props_class_name, inline=inline)) +element_classes = filter( + lambda x: isinstance(x, type) and issubclass(x, pydom.element.Element), + [getattr(pydom.html, x) for x in dir(pydom.html)], +) + + +def copy_bases(root: pathlib.Path, to_root: pathlib.Path): + for file in root.rglob("*.pyi"): + new_file = to_root / file.relative_to(root) + new_file.parent.mkdir(parents=True, exist_ok=True) + new_file.write_text(file.read_text()) + + +def init_kwargs_type(cls): + annotations = inspect.signature(cls.__init__).parameters + kwargs_hint = annotations.get("kwargs").annotation + inner = typing.get_args(kwargs_hint) + if len(inner) != 1: + return + + inner = inner[0] + + if isinstance(inner, typing.ForwardRef): + inner = inner.__forward_arg__ + + type = pydom_types.get(inner) + return type + + +def append_to_init(import_text: str, init_file: pathlib.Path): + if not init_file.exists(): + init_file.touch() + lines = init_file.read_text().splitlines() + lines = [x for x in lines if x.strip()] + if import_text in lines: + return + lines.append(import_text) + init_file.write_text("\n".join(lines)) + + +copy_bases( + BASE_STUBS_DIR, + SEAMLESS_ROOT, +) + +for element_cls in element_classes: + try: + class_file = pathlib.Path(inspect.getfile(element_cls)) + + kwargs_annotations = init_kwargs_type(element_cls) + annotation_file = None + if kwargs_annotations: + annotation_file = pathlib.Path(inspect.getfile(kwargs_annotations)) + + element_out_file = SEAMLESS_ROOT / "html" / class_file.with_suffix(".pyi").name + text = class_file.read_text() + new_text = text.replace( + "from ..element import Element", + "from pydom.element import Element", + ) + if annotation_file: + new_text = new_text.replace( + f"from ..types.html import {kwargs_annotations.__name__}", + f"from ..types.html.{annotation_file.stem} import {kwargs_annotations.__name__}", + ) + new_text = new_text.replace( + "from ..types import ChildType", "from pydom.types import ChildType" + ) + + element_out_file.parent.mkdir(parents=True, exist_ok=True) + element_out_file.write_text(new_text) + + if annotation_file: + out_annotation_file = ( + SEAMLESS_ROOT / "types/html" / annotation_file.with_suffix(".pyi").name + ) + out_annotation_file.parent.mkdir(parents=True, exist_ok=True) + new_text = annotation_file.read_text().replace( + "from pydom.types.html.", "from ." + ) + out_annotation_file.write_text(new_text) + + append_to_init( + f"from .{element_out_file.stem} import {element_cls.__name__} as {element_cls.__name__}", + SEAMLESS_ROOT / "html" / "__init__.pyi", + ) + + except Exception as e: + raise ValueError(f"Error with {element_cls}") from e diff --git a/_auto_html/types/html/aria_props.pyi b/_auto_html/types/html/aria_props.pyi new file mode 100644 index 0000000..c3230d7 --- /dev/null +++ b/_auto_html/types/html/aria_props.pyi @@ -0,0 +1,53 @@ +from typing import Optional +from typing_extensions import TypedDict + + +class AriaProps(TypedDict, total=False): + aria_active_descendant: Optional[str] + aria_atomic: Optional[str] + aria_auto_complete: Optional[str] + aria_busy: Optional[str] + aria_checked: Optional[str] + aria_col_count: Optional[str] + aria_col_index: Optional[str] + aria_col_span: Optional[str] + aria_controls: Optional[str] + aria_current: Optional[str] + aria_described_by: Optional[str] + aria_details: Optional[str] + aria_disabled: Optional[str] + aria_drop_effect: Optional[str] + aria_error_message: Optional[str] + aria_expanded: Optional[str] + aria_flow_to: Optional[str] + aria_grabbed: Optional[str] + aria_has_popup: Optional[str] + aria_hidden: Optional[str] + aria_invalid: Optional[str] + aria_key_shortcuts: Optional[str] + aria_label: Optional[str] + aria_labelled_by: Optional[str] + aria_level: Optional[str] + aria_live: Optional[str] + aria_modal: Optional[str] + aria_multiline: Optional[str] + aria_multi_selectable: Optional[str] + aria_orientation: Optional[str] + aria_owns: Optional[str] + aria_placeholder: Optional[str] + aria_pos_inset: Optional[str] + aria_pressed: Optional[str] + aria_readonly: Optional[str] + aria_relevant: Optional[str] + aria_required: Optional[str] + aria_role_description: Optional[str] + aria_row_count: Optional[str] + aria_row_index: Optional[str] + aria_row_span: Optional[str] + aria_selected: Optional[str] + aria_set_size: Optional[str] + aria_sort: Optional[str] + aria_value_max: Optional[str] + aria_value_min: Optional[str] + aria_value_now: Optional[str] + aria_value_text: Optional[str] diff --git a/_auto_html/types/html/html_element.pyi b/_auto_html/types/html/html_element.pyi new file mode 100644 index 0000000..8d179d8 --- /dev/null +++ b/_auto_html/types/html/html_element.pyi @@ -0,0 +1,27 @@ +from typing import TYPE_CHECKING, Dict, Iterable, Union, Literal, Optional + +from typing_extensions import TypedDict + +if TYPE_CHECKING: + from pydom.styling import StyleSheet + + +class HTMLElement(TypedDict, total=False, closed=False): + access_key: Optional[str] + auto_capitalize: Optional[str] + classes: Optional[Union[str, Iterable[str]]] + content_editable: Optional[str] + dangerously_set_inner_html: Optional[Dict[Literal["__html"], str]] + # data: Dict[str, str] # add this if needed in the future + dir: Optional[Literal["ltr", "rtl", "auto"]] + draggable: Optional[str] + hidden: Optional[str] + id: Optional[str] + input_mode: Optional[str] + lang: Optional[str] + role: Optional[str] + spell_check: Optional[str] + style: Optional[Union[str, "StyleSheet"]] + tab_index: Optional[str] + title: Optional[str] + translate: Optional[str] diff --git a/_auto_html/types/html/html_element_props.pyi b/_auto_html/types/html/html_element_props.pyi new file mode 100644 index 0000000..549be93 --- /dev/null +++ b/_auto_html/types/html/html_element_props.pyi @@ -0,0 +1,7 @@ +from .aria_props import AriaProps +from .html_element import HTMLElement +from .html_event_props import HTMLEventProps + + +class HTMLElementProps(HTMLElement, AriaProps, HTMLEventProps): + pass diff --git a/_auto_html/types/html/html_event_props.pyi b/_auto_html/types/html/html_event_props.pyi new file mode 100644 index 0000000..da08c04 --- /dev/null +++ b/_auto_html/types/html/html_event_props.pyi @@ -0,0 +1,68 @@ +from typing import Callable, Optional +from typing_extensions import TypedDict + +EventHandler = Optional[str] | Callable + +class HTMLEventProps(TypedDict, total=False): + on_abort: EventHandler + on_auto_complete: EventHandler + on_auto_complete_error: EventHandler + on_blur: EventHandler + on_cancel: EventHandler + on_can_play: EventHandler + on_can_play_through: EventHandler + on_change: EventHandler + on_click: EventHandler + on_close: EventHandler + on_context_menu: EventHandler + on_cue_change: EventHandler + on_dbl_click: EventHandler + on_drag: EventHandler + on_drag_end: EventHandler + on_drag_enter: EventHandler + on_drag_leave: EventHandler + on_drag_over: EventHandler + on_drag_start: EventHandler + on_drop: EventHandler + on_duration_change: EventHandler + on_emptied: EventHandler + on_ended: EventHandler + on_error: EventHandler + on_focus: EventHandler + on_input: EventHandler + on_invalid: EventHandler + on_key_down: EventHandler + on_key_press: EventHandler + on_key_up: EventHandler + on_load: EventHandler + on_loaded_data: EventHandler + on_loaded_metadata: EventHandler + on_load_start: EventHandler + on_mouse_down: EventHandler + on_mouse_enter: EventHandler + on_mouse_leave: EventHandler + on_mouse_move: EventHandler + on_mouse_out: EventHandler + on_mouse_over: EventHandler + on_mouse_up: EventHandler + on_mouse_wheel: EventHandler + on_pause: EventHandler + on_play: EventHandler + on_playing: EventHandler + on_progress: EventHandler + on_rate_change: EventHandler + on_reset: EventHandler + on_resize: EventHandler + on_scroll: EventHandler + on_seeked: EventHandler + on_seeking: EventHandler + on_select: EventHandler + on_show: EventHandler + on_sort: EventHandler + on_stalled: EventHandler + on_submit: EventHandler + on_suspend: EventHandler + on_time_update: EventHandler + on_toggle: EventHandler + on_volume_change: EventHandler + on_waiting: EventHandler \ No newline at end of file diff --git a/docs/1-basics/1-syntax.rst b/docs/1-basics/1-syntax.rst index de7b8bf..4ae56fb 100644 --- a/docs/1-basics/1-syntax.rst +++ b/docs/1-basics/1-syntax.rst @@ -22,11 +22,11 @@ Using the card component as an example, we will show the different syntaxes. self.title = title def render(self): - return Div(class_name="card")( - self.title and Div(class_name="card-title")( + return Div(classes="card")( + self.title and Div(classes="card-title")( self.title ), - Div(class_name="card-content")( + Div(classes="card-content")( *self.children ) ) diff --git a/docs/1-basics/2-rendering-components.rst b/docs/1-basics/2-rendering-components.rst index 8717043..e91ec7d 100644 --- a/docs/1-basics/2-rendering-components.rst +++ b/docs/1-basics/2-rendering-components.rst @@ -114,11 +114,11 @@ Props Rendering ############### When rendering components, some props names are converted to another name in the HTML representation. -For example, the ``class_name`` prop is converted to the ``class`` attribute in the HTML representation. +For example, the ``classes`` prop is converted to the ``class`` attribute in the HTML representation. The full list of prop names and their corresponding HTML attributes is as follows: -- ``class_name`` -> ``class`` +- ``classes`` -> ``class`` - ``html_for`` -> ``for`` - ``accept_charset`` -> ``accept-charset`` - ``http_equiv`` -> ``http-equiv`` diff --git a/docs/2-components/1-base-component.rst b/docs/2-components/1-base-component.rst index f378d33..480abd9 100644 --- a/docs/2-components/1-base-component.rst +++ b/docs/2-components/1-base-component.rst @@ -25,11 +25,11 @@ It provides a ``children`` property that is a tuple of the components that are c self.title = title def render(self): - return Div(class_name="card")( - self.title and Div(class_name="card-title")( + return Div(classes="card")( + self.title and Div(classes="card-title")( self.title ), - Div(class_name="card-content")( + Div(classes="card-content")( *self.children ) ) @@ -137,11 +137,11 @@ component with the children as arguments. (See :ref:`syntax`) self.title = title def render(self): - return Div(class_name="card")( - Div(class_name="card-header")( + return Div(classes="card")( + Div(classes="card-header")( self.title ), - Div(class_name="card-body")( + Div(classes="card-body")( *self.children ) ) diff --git a/docs/2-components/2-page.rst b/docs/2-components/2-page.rst index f822f91..15a5253 100644 --- a/docs/2-components/2-page.rst +++ b/docs/2-components/2-page.rst @@ -44,12 +44,12 @@ The page component can be used to create a new page by passing the following pro def my_awesome_page(): return Page(title="My awesome page")( - Div(class_name="container mt-5")( - Div(class_name="text-center p-4 rounded")( - Div(class_name="h-1")( + Div(classes="container mt-5")( + Div(classes="text-center p-4 rounded")( + Div(classes="h-1")( "Awesome page" ), - P(class_name="lead")( + P(classes="lead")( "Welcome to seamless" ) ) @@ -87,12 +87,12 @@ You can create custom pages by extending the page component and overriding the d def my_awesome_page(): return MyPage(title="My awesome page")( - Div(class_name="container mt-5")( - Div(class_name="text-center p-4 rounded")( - Div(class_name="h-1")( + Div(classes="container mt-5")( + Div(classes="text-center p-4 rounded")( + Div(classes="h-1")( "Awesome page" ), - P(class_name="lead")( + P(classes="lead")( "Welcome to seamless" ) ) diff --git a/docs/2-components/4-router.rst b/docs/2-components/4-router.rst index 9d7aa59..ec4601a 100644 --- a/docs/2-components/4-router.rst +++ b/docs/2-components/4-router.rst @@ -54,7 +54,7 @@ To navigate between the pages, use the ``RouterLink`` component from ``seamless. class MyApp(Component): def render(self): - return Div(class_name="root")( + return Div(classes="root")( Nav( RouterLink(to="/")( "Home" @@ -66,7 +66,7 @@ To navigate between the pages, use the ``RouterLink`` component from ``seamless. "Contact" ) ), - Div(class_name="content")( + Div(classes="content")( Router( Route(path="/", component=Home), Route(path="/about", component=About), @@ -148,7 +148,7 @@ The parameter will be passed to the component as a prop with the same name. class MyApp(Component): def render(self): - return Div(class_name="root")( + return Div(classes="root")( Nav( RouterLink(to="/user/1")( "User 1" @@ -157,7 +157,7 @@ The parameter will be passed to the component as a prop with the same name. "User 2" ) ), - Div(class_name="content")( + Div(classes="content")( Router( Route(path="/user/{id:int}", component=User) ) diff --git a/docs/4-styling/1-style-object.rst b/docs/4-styling/1-style-object.rst index b139084..f880275 100644 --- a/docs/4-styling/1-style-object.rst +++ b/docs/4-styling/1-style-object.rst @@ -4,20 +4,20 @@ Style Object ############ -The ``StyleObject`` class is used to create reusable styles for components. +The ``StyleSheet`` class is used to create reusable styles for components. It is a dictionary-like object that can be used to store CSS properties and values. Usage ##### -To create a new style object, create a new instance of the ``StyleObject`` class from ``seamless.styling``. +To create a new style object, create a new instance of the ``StyleSheet`` class from ``seamless.styling``. .. code-block:: python :caption: Creating a style object - from seamless.styling import StyleObject + from seamless.styling import StyleSheet - style = StyleObject( + style = StyleSheet( background_color="red", color="white" ) diff --git a/docs/4-styling/2-css-modules.rst b/docs/4-styling/2-css-modules.rst index 25d5674..cd3d2d1 100644 --- a/docs/4-styling/2-css-modules.rst +++ b/docs/4-styling/2-css-modules.rst @@ -34,7 +34,7 @@ Then, use the ``CSS`` to import your css files. class MyComponent(Component): def render(self, css): - return Div(class_name=styles.card)( + return Div(classes=styles.card)( "Hello, world!" ) diff --git a/docs/4-styling/index.rst b/docs/4-styling/index.rst index f61a05b..2aa5e1c 100644 --- a/docs/4-styling/index.rst +++ b/docs/4-styling/index.rst @@ -12,7 +12,7 @@ Styling Styling in seamless can be done in multiple ways. -One way is to use the :ref:`StyleObject ` class. +One way is to use the :ref:`StyleSheet ` class. Another way is to use :ref:`CSS Modules `. More on CSS Modules can be found in the CSS Modules `GitHub `_ documentation. diff --git a/docs/5-advanced/3-context.rst b/docs/5-advanced/3-context.rst index 97f48ec..4da504a 100644 --- a/docs/5-advanced/3-context.rst +++ b/docs/5-advanced/3-context.rst @@ -41,7 +41,7 @@ The default context is created using the ``Context.standard`` method and has the The standard context also comes with the following :ref:`property transformers` in order: -- **Class Transformer**: Changes the ``class_name`` property key to ``class`` and converts +- **Class Transformer**: Changes the ``classes`` property key to ``class`` and converts the value to a string if it is a list. .. code-block:: python @@ -52,7 +52,7 @@ The standard context also comes with the following :ref:`property transformers

` except for ``class_name``. +- **Simple Transformer**: Converts the properties in :ref:`this list` except for ``classes``. .. code-block:: python @@ -106,7 +106,7 @@ The standard context also comes with the following :ref:`property transformers

= len(users): - return Div(class_name="container")( - Div(class_name="row")( - Div(class_name="display-1 text-center")("User not found"), + return Div(classes="container")( + Div(classes="row")( + Div(classes="display-1 text-center")("User not found"), ) ) @@ -25,16 +25,16 @@ def render(self): f"{user['name']['title']} {user['name']['first']} {user['name']['last']}" ) - return Div(class_name="container")( - Div(class_name="row")( - Div(class_name="text-center")( + return Div(classes="container")( + Div(classes="row")( + Div(classes="text-center")( Img( src=user["picture"]["large"], alt=user_name, - class_name="rounded-circle", + classes="rounded-circle", ), ), - Div(class_name="display-1 text-center")(user_name), - Div(class_name="display-6 text-center")(f"Email: {user['email']}"), + Div(classes="display-1 text-center")(user_name), + Div(classes="display-6 text-center")(f"Email: {user['email']}"), ), ) diff --git a/requirements.txt b/requirements.txt index 46ef01d..d6671d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ cssutils==2.9.0 -python-dom +pydom>=0.3.0 python-socketio==5.11.1 typing-extensions \ No newline at end of file diff --git a/seamless/__init__.py b/seamless/__init__.py index d8a6cba..56c2bbe 100644 --- a/seamless/__init__.py +++ b/seamless/__init__.py @@ -4,12 +4,11 @@ from .context import Context, set_global_context from .core import JS -from .internal.constants import DISABLE_GLOBAL_CONTEXT_ENV from .html import * +from .internal.constants import DISABLE_GLOBAL_CONTEXT_ENV from .rendering import render from .version import version as __version__ - if not os.getenv(DISABLE_GLOBAL_CONTEXT_ENV): set_global_context(Context.standard()) else: diff --git a/seamless/components/page.py b/seamless/components/page.py index c59c62b..01dc3f6 100644 --- a/seamless/components/page.py +++ b/seamless/components/page.py @@ -1,92 +1,5 @@ -from typing import overload, Iterable +from pydom.page import Page as _Page -from pydom import Component -from pydom.utils.functions import to_iter - -from ..html import ( - Fragment, - Html, - Head, - Title, - Body, - Meta, -) - -from ..types import ChildType, ChildrenType -from ..types.html import HTMLHtmlElement, HTMLBodyElement, HTMLHeadElement - - -class Page(Component): - @overload - def __init__( - self, - *children: ChildType, - title: str | None = None, - html_props: HTMLHtmlElement | None = None, - head_props: HTMLHeadElement | None = None, - body_props: HTMLBodyElement | None = None, - ): ... - @overload - def __init__( - self, - *, - children: ChildrenType, - title: str | None = None, - html_props: HTMLHtmlElement | None = None, - head_props: HTMLHeadElement | None = None, - body_props: HTMLBodyElement | None = None, - ): ... - - def __init__( # type: ignore - self, - *, - title: str | None = None, - html_props: HTMLHtmlElement | None = None, - head_props: HTMLHeadElement | None = None, - body_props: HTMLBodyElement | None = None, - ): - self.title = title - self._html_props = html_props or {"lang": "en"} - self._head_props = head_props or {} - self._body_props = body_props or {"dir": "ltr"} - - def head(self) -> Iterable["ChildType"]: - """ - The children that will be inside the `head` tag. - """ - return ( - Meta(charset="UTF-8"), - Meta(name="viewport", content="width=device-width, initial-scale=1.0"), - Title(self.title) if self.title else None, - ) - - def body(self) -> Iterable[ChildType]: - """ - The children that will be inside the `body` tag. - """ - return self.children - - def render(self): - return Fragment( - "", - Html(**self._html_props)( - Head(**self._head_props)(*to_iter(self.head())), - Body(**self._body_props)(*to_iter(self.body())), - ), - ) - - def __init_subclass__(cls, title: str | None = None, **kwargs) -> None: - super().__init_subclass__(**kwargs) - - if title is None: - return - - original_init = cls.__init__ - - def __init__(self, *args, **kwargs): - kwargs["title"] = kwargs.get("title", title) - original_init(self, *args, **kwargs) - - cls.__init__ = __init__ +class Page(_Page): __seamless_name__ = "SeamlessBasePage" diff --git a/seamless/html.py b/seamless/html.py new file mode 100644 index 0000000..ea7ffa7 --- /dev/null +++ b/seamless/html.py @@ -0,0 +1,123 @@ +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .stubs.html import * +else: + from pydom.html import * + +__all__ = [ + "A", + "Abbr", + "Address", + "Area", + "Article", + "Aside", + "Audio", + "B", + "Base", + "Bdi", + "Bdo", + "BlockQuote", + "Body", + "Br", + "Button", + "Canvas", + "Caption", + "Cite", + "Code", + "Col", + "ColGroup", + "Data", + "DataList", + "Dd", + "Del", + "Details", + "Dfn", + "Dialog", + "Div", + "Dl", + "Dt", + "Em", + "Embed", + "FieldSet", + "FigCaption", + "Figure", + "Footer", + "Form", + "Fragment", + "H1", + "H2", + "H3", + "H4", + "H5", + "H6", + "Head", + "Header", + "HGroup", + "Hr", + "Html", + "I", + "IFrame", + "Img", + "Input", + "Ins", + "Kbd", + "Label", + "Legend", + "Li", + "Link", + "Main", + "Map", + "Mark", + "Menu", + "Meta", + "Meter", + "Nav", + "NoScript", + "Object", + "Ol", + "OptGroup", + "Option", + "Output", + "P", + "Param", + "Picture", + "Pre", + "Progress", + "Q", + "Rp", + "Rt", + "Ruby", + "S", + "Samp", + "Script", + "Search", + "Section", + "Select", + "Slot", + "Small", + "Source", + "Span", + "Strong", + "Style", + "Sub", + "Summary", + "Sup", + "Table", + "TBody", + "Td", + "Template", + "TextArea", + "TFoot", + "Th", + "THead", + "Time", + "Title", + "Tr", + "Track", + "U", + "Ul", + "Var", + "Video", + "Wbr", +] diff --git a/seamless/html/__init__.py b/seamless/html/__init__.py deleted file mode 100644 index 99a419f..0000000 --- a/seamless/html/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from pydom.html import * - diff --git a/seamless/html/__init__.pyi b/seamless/html/__init__.pyi deleted file mode 100644 index f33e5ac..0000000 --- a/seamless/html/__init__.pyi +++ /dev/null @@ -1,233 +0,0 @@ -from .a import A -from .abbr import Abbr -from .address import Address -from .area import Area -from .article import Article -from .aside import Aside -from .audio import Audio -from .b import B -from .base import Base -from .bdi import Bdi -from .bdo import Bdo -from .blockquote import BlockQuote -from .body import Body -from .br import Br -from .button import Button -from .canvas import Canvas -from .caption import Caption -from .cite import Cite -from .code import Code -from .col import Col -from .colgroup import ColGroup -from .data import Data -from .datalist import DataList -from .dd import Dd -from .del_ import Del -from .details import Details -from .dfn import Dfn -from .dialog import Dialog -from .div import Div -from .dl import Dl -from .dt import Dt -from .em import Em -from .embed import Embed -from .fieldset import FieldSet -from .figcaption import FigCaption -from .figure import Figure -from .footer import Footer -from .form import Form -from .fragment import Fragment -from .h1 import H1 -from .h2 import H2 -from .h3 import H3 -from .h4 import H4 -from .h5 import H5 -from .h6 import H6 -from .head import Head -from .header import Header -from .hgroup import HGroup -from .hr import Hr -from .html import Html -from .i import I -from .iframe import IFrame -from .img import Img -from .input import Input -from .ins import Ins -from .kbd import Kbd -from .label import Label -from .legend import Legend -from .li import Li -from .link import Link -from .main import Main -from .map import Map -from .mark import Mark -from .menu import Menu -from .meta import Meta -from .meter import Meter -from .nav import Nav -from .noscript import NoScript -from .object import Object -from .ol import Ol -from .optgroup import OptGroup -from .option import Option -from .output import Output -from .p import P -from .param import Param -from .picture import Picture -from .pre import Pre -from .progress import Progress -from .q import Q -from .rp import Rp -from .rt import Rt -from .ruby import Ruby -from .s import S -from .samp import Samp -from .script import Script -from .search import Search -from .section import Section -from .select import Select -from .slot import Slot -from .small import Small -from .source import Source -from .span import Span -from .strong import Strong -from .style import Style -from .sub import Sub -from .summary import Summary -from .sup import Sup -from .svg import Svg -from .table import Table -from .tbody import TBody -from .td import Td -from .template import Template -from .textarea import TextArea -from .tfoot import TFoot -from .th import Th -from .thead import THead -from .time import Time -from .title import Title -from .tr import Tr -from .track import Track -from .u import U -from .ul import Ul -from .var import Var -from .video import Video -from .wbr import Wbr - -__all__ = [ - "A", - "Abbr", - "Address", - "Area", - "Article", - "Aside", - "Audio", - "B", - "Base", - "Bdi", - "Bdo", - "BlockQuote", - "Body", - "Br", - "Button", - "Canvas", - "Caption", - "Cite", - "Code", - "Col", - "ColGroup", - "Data", - "DataList", - "Dd", - "Del", - "Details", - "Dfn", - "Dialog", - "Div", - "Dl", - "Dt", - "Em", - "Embed", - "FieldSet", - "FigCaption", - "Figure", - "Footer", - "Form", - "Fragment", - "H1", - "H2", - "H3", - "H4", - "H5", - "H6", - "Head", - "Header", - "HGroup", - "Hr", - "Html", - "I", - "IFrame", - "Img", - "Input", - "Ins", - "Kbd", - "Label", - "Legend", - "Li", - "Link", - "Main", - "Map", - "Mark", - "Menu", - "Meta", - "Meter", - "Nav", - "NoScript", - "Object", - "Ol", - "OptGroup", - "Option", - "Output", - "P", - "Param", - "Picture", - "Pre", - "Progress", - "Q", - "Rp", - "Rt", - "Ruby", - "S", - "Samp", - "Script", - "Search", - "Section", - "Select", - "Slot", - "Small", - "Source", - "Span", - "Strong", - "Style", - "Sub", - "Summary", - "Sup", - "Svg", - "Table", - "TBody", - "Td", - "Template", - "TextArea", - "TFoot", - "Th", - "THead", - "Time", - "Title", - "Tr", - "Track", - "U", - "Ul", - "Var", - "Video", - "Wbr", -] diff --git a/seamless/html/a.pyi b/seamless/html/a.pyi deleted file mode 100644 index 4ff9624..0000000 --- a/seamless/html/a.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLAnchorElement -from ..types import ChildType - - -class A(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLAnchorElement]): ... diff --git a/seamless/html/abbr.pyi b/seamless/html/abbr.pyi deleted file mode 100644 index 3dfd9c9..0000000 --- a/seamless/html/abbr.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Abbr(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/address.pyi b/seamless/html/address.pyi deleted file mode 100644 index 1089cd2..0000000 --- a/seamless/html/address.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Address(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/area.pyi b/seamless/html/area.pyi deleted file mode 100644 index 829ba11..0000000 --- a/seamless/html/area.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLAreaElement -from ..types import ChildType - - -class Area(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLAreaElement]): ... diff --git a/seamless/html/article.pyi b/seamless/html/article.pyi deleted file mode 100644 index fe14b57..0000000 --- a/seamless/html/article.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Article(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/aside.pyi b/seamless/html/aside.pyi deleted file mode 100644 index 8d414db..0000000 --- a/seamless/html/aside.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Aside(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/audio.pyi b/seamless/html/audio.pyi deleted file mode 100644 index 1c4e2ce..0000000 --- a/seamless/html/audio.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLAudioElement -from ..types import ChildType - - -class Audio(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLAudioElement]): ... diff --git a/seamless/html/b.pyi b/seamless/html/b.pyi deleted file mode 100644 index 28a5db0..0000000 --- a/seamless/html/b.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class B(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/base.pyi b/seamless/html/base.pyi deleted file mode 100644 index 6e32322..0000000 --- a/seamless/html/base.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLBaseElement -from ..types import ChildType - - -class Base(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLBaseElement]): ... diff --git a/seamless/html/bdi.pyi b/seamless/html/bdi.pyi deleted file mode 100644 index e265ab6..0000000 --- a/seamless/html/bdi.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Bdi(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/bdo.pyi b/seamless/html/bdo.pyi deleted file mode 100644 index c015a34..0000000 --- a/seamless/html/bdo.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Bdo(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/blockquote.pyi b/seamless/html/blockquote.pyi deleted file mode 100644 index eb18f6d..0000000 --- a/seamless/html/blockquote.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class BlockQuote(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/body.pyi b/seamless/html/body.pyi deleted file mode 100644 index de357a5..0000000 --- a/seamless/html/body.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLBodyElement -from ..types import ChildType - - -class Body(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLBodyElement]): ... diff --git a/seamless/html/br.pyi b/seamless/html/br.pyi deleted file mode 100644 index 56aab7d..0000000 --- a/seamless/html/br.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLBRElement -from ..types import ChildType - - -class Br(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLBRElement]): ... diff --git a/seamless/html/button.pyi b/seamless/html/button.pyi deleted file mode 100644 index f05841b..0000000 --- a/seamless/html/button.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLButtonElement -from ..types import ChildType - - -class Button(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLButtonElement]): ... diff --git a/seamless/html/canvas.pyi b/seamless/html/canvas.pyi deleted file mode 100644 index 1404cd4..0000000 --- a/seamless/html/canvas.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLCanvasElement -from ..types import ChildType - - -class Canvas(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLCanvasElement]): ... diff --git a/seamless/html/caption.pyi b/seamless/html/caption.pyi deleted file mode 100644 index 8521418..0000000 --- a/seamless/html/caption.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableCaptionElement -from ..types import ChildType - - -class Caption(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableCaptionElement]): ... diff --git a/seamless/html/cite.pyi b/seamless/html/cite.pyi deleted file mode 100644 index 825382e..0000000 --- a/seamless/html/cite.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Cite(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/code.pyi b/seamless/html/code.pyi deleted file mode 100644 index 4e3f5d2..0000000 --- a/seamless/html/code.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Code(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/col.pyi b/seamless/html/col.pyi deleted file mode 100644 index 13acd36..0000000 --- a/seamless/html/col.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableColElement -from ..types import ChildType - - -class Col(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableColElement]): ... diff --git a/seamless/html/colgroup.pyi b/seamless/html/colgroup.pyi deleted file mode 100644 index 88e5755..0000000 --- a/seamless/html/colgroup.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableColElement -from ..types import ChildType - - -class ColGroup(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableColElement]): ... diff --git a/seamless/html/data.pyi b/seamless/html/data.pyi deleted file mode 100644 index c59a986..0000000 --- a/seamless/html/data.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLDataElement -from ..types import ChildType - - -class Data(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLDataElement]): ... diff --git a/seamless/html/datalist.pyi b/seamless/html/datalist.pyi deleted file mode 100644 index 414a0bd..0000000 --- a/seamless/html/datalist.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLDataListElement -from ..types import ChildType - - -class DataList(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLDataListElement]): ... diff --git a/seamless/html/dd.pyi b/seamless/html/dd.pyi deleted file mode 100644 index d76da11..0000000 --- a/seamless/html/dd.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Dd(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/del_.pyi b/seamless/html/del_.pyi deleted file mode 100644 index b0652eb..0000000 --- a/seamless/html/del_.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLModElement -from ..types import ChildType - - -class Del(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLModElement]): ... diff --git a/seamless/html/details.pyi b/seamless/html/details.pyi deleted file mode 100644 index 0851faa..0000000 --- a/seamless/html/details.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLDetailsElement -from ..types import ChildType - - -class Details(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLDetailsElement]): ... diff --git a/seamless/html/dfn.pyi b/seamless/html/dfn.pyi deleted file mode 100644 index a7301d4..0000000 --- a/seamless/html/dfn.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Dfn(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/dialog.pyi b/seamless/html/dialog.pyi deleted file mode 100644 index 2bd55b6..0000000 --- a/seamless/html/dialog.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLDialogElement -from ..types import ChildType - - -class Dialog(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLDialogElement]): ... diff --git a/seamless/html/div.pyi b/seamless/html/div.pyi deleted file mode 100644 index cdb7d77..0000000 --- a/seamless/html/div.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLDivElement -from ..types import ChildType - - -class Div(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLDivElement]): ... diff --git a/seamless/html/dl.pyi b/seamless/html/dl.pyi deleted file mode 100644 index e94c5e9..0000000 --- a/seamless/html/dl.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Dl(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/dt.pyi b/seamless/html/dt.pyi deleted file mode 100644 index 5468215..0000000 --- a/seamless/html/dt.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Dt(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/em.pyi b/seamless/html/em.pyi deleted file mode 100644 index dbd781d..0000000 --- a/seamless/html/em.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Em(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/embed.pyi b/seamless/html/embed.pyi deleted file mode 100644 index f0f8c8e..0000000 --- a/seamless/html/embed.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLEmbedElement -from ..types import ChildType - - -class Embed(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLEmbedElement]): ... diff --git a/seamless/html/fieldset.pyi b/seamless/html/fieldset.pyi deleted file mode 100644 index e1b5bb8..0000000 --- a/seamless/html/fieldset.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLFieldSetElement -from ..types import ChildType - - -class FieldSet(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLFieldSetElement]): ... diff --git a/seamless/html/figcaption.pyi b/seamless/html/figcaption.pyi deleted file mode 100644 index 5f9c886..0000000 --- a/seamless/html/figcaption.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class FigCaption(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/figure.pyi b/seamless/html/figure.pyi deleted file mode 100644 index 63395dd..0000000 --- a/seamless/html/figure.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Figure(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/footer.pyi b/seamless/html/footer.pyi deleted file mode 100644 index 2f1014c..0000000 --- a/seamless/html/footer.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Footer(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/form.pyi b/seamless/html/form.pyi deleted file mode 100644 index e7882e4..0000000 --- a/seamless/html/form.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLFormElement -from ..types import ChildType - - -class Form(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLFormElement]): ... diff --git a/seamless/html/fragment.pyi b/seamless/html/fragment.pyi deleted file mode 100644 index ac4fb11..0000000 --- a/seamless/html/fragment.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from pydom.element import Element - -class Fragment(Element): ... diff --git a/seamless/html/h1.pyi b/seamless/html/h1.pyi deleted file mode 100644 index a1771bc..0000000 --- a/seamless/html/h1.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHeadingElement -from ..types import ChildType - - -class H1(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHeadingElement]): ... diff --git a/seamless/html/h2.pyi b/seamless/html/h2.pyi deleted file mode 100644 index a2d7772..0000000 --- a/seamless/html/h2.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHeadingElement -from ..types import ChildType - - -class H2(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHeadingElement]): ... diff --git a/seamless/html/h3.pyi b/seamless/html/h3.pyi deleted file mode 100644 index 402bab5..0000000 --- a/seamless/html/h3.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHeadingElement -from ..types import ChildType - - -class H3(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHeadingElement]): ... diff --git a/seamless/html/h4.pyi b/seamless/html/h4.pyi deleted file mode 100644 index c09cb2f..0000000 --- a/seamless/html/h4.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHeadingElement -from ..types import ChildType - - -class H4(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHeadingElement]): ... diff --git a/seamless/html/h5.pyi b/seamless/html/h5.pyi deleted file mode 100644 index bcdc3ad..0000000 --- a/seamless/html/h5.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHeadingElement -from ..types import ChildType - - -class H5(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHeadingElement]): ... diff --git a/seamless/html/h6.pyi b/seamless/html/h6.pyi deleted file mode 100644 index 56ce191..0000000 --- a/seamless/html/h6.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHeadingElement -from ..types import ChildType - - -class H6(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHeadingElement]): ... diff --git a/seamless/html/head.pyi b/seamless/html/head.pyi deleted file mode 100644 index 2710933..0000000 --- a/seamless/html/head.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHeadElement -from ..types import ChildType - - -class Head(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHeadElement]): ... diff --git a/seamless/html/header.pyi b/seamless/html/header.pyi deleted file mode 100644 index 1f5f884..0000000 --- a/seamless/html/header.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Header(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/hgroup.pyi b/seamless/html/hgroup.pyi deleted file mode 100644 index 3ea7ea7..0000000 --- a/seamless/html/hgroup.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class HGroup(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/hr.pyi b/seamless/html/hr.pyi deleted file mode 100644 index 86b56bf..0000000 --- a/seamless/html/hr.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHRElement -from ..types import ChildType - - -class Hr(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHRElement]): ... diff --git a/seamless/html/html.pyi b/seamless/html/html.pyi deleted file mode 100644 index 3e4f163..0000000 --- a/seamless/html/html.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLHtmlElement -from ..types import ChildType - - -class Html(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLHtmlElement]): ... diff --git a/seamless/html/i.pyi b/seamless/html/i.pyi deleted file mode 100644 index 9418b89..0000000 --- a/seamless/html/i.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class I(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/iframe.pyi b/seamless/html/iframe.pyi deleted file mode 100644 index 3cdd5e3..0000000 --- a/seamless/html/iframe.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLIFrameElement -from ..types import ChildType - - -class IFrame(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLIFrameElement]): ... diff --git a/seamless/html/img.pyi b/seamless/html/img.pyi deleted file mode 100644 index f1bbb62..0000000 --- a/seamless/html/img.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLImageElement -from ..types import ChildType - - -class Img(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLImageElement]): ... diff --git a/seamless/html/input.pyi b/seamless/html/input.pyi deleted file mode 100644 index b73eec6..0000000 --- a/seamless/html/input.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLInputElement -from ..types import ChildType - - -class Input(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLInputElement]): ... diff --git a/seamless/html/ins.pyi b/seamless/html/ins.pyi deleted file mode 100644 index b186d8c..0000000 --- a/seamless/html/ins.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLModElement -from ..types import ChildType - - -class Ins(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLModElement]): ... diff --git a/seamless/html/kbd.pyi b/seamless/html/kbd.pyi deleted file mode 100644 index 4a64cc0..0000000 --- a/seamless/html/kbd.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Kbd(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/label.pyi b/seamless/html/label.pyi deleted file mode 100644 index c0dcfe6..0000000 --- a/seamless/html/label.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLLabelElement -from ..types import ChildType - - -class Label(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLLabelElement]): ... diff --git a/seamless/html/legend.pyi b/seamless/html/legend.pyi deleted file mode 100644 index 3c7f9e1..0000000 --- a/seamless/html/legend.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLLegendElement -from ..types import ChildType - - -class Legend(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLLegendElement]): ... diff --git a/seamless/html/li.pyi b/seamless/html/li.pyi deleted file mode 100644 index 1b6f85b..0000000 --- a/seamless/html/li.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLListItemElement -from ..types import ChildType - - -class Li(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLListItemElement]): ... diff --git a/seamless/html/link.pyi b/seamless/html/link.pyi deleted file mode 100644 index 2b4bafd..0000000 --- a/seamless/html/link.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLLinkElement -from ..types import ChildType - - -class Link(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLLinkElement]): ... diff --git a/seamless/html/main.pyi b/seamless/html/main.pyi deleted file mode 100644 index 57a2f4a..0000000 --- a/seamless/html/main.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Main(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/map.pyi b/seamless/html/map.pyi deleted file mode 100644 index 27fe304..0000000 --- a/seamless/html/map.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLMapElement -from ..types import ChildType - - -class Map(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLMapElement]): ... diff --git a/seamless/html/mark.pyi b/seamless/html/mark.pyi deleted file mode 100644 index 056867d..0000000 --- a/seamless/html/mark.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Mark(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/menu.pyi b/seamless/html/menu.pyi deleted file mode 100644 index bb399b3..0000000 --- a/seamless/html/menu.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Menu(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/meta.pyi b/seamless/html/meta.pyi deleted file mode 100644 index 246f21c..0000000 --- a/seamless/html/meta.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from typing import Literal, overload -from pydom.element import Element - -from ..types import ChildType - -HttpEquivOptions = Literal[ - "content-security-policy", - "content-type", - "default-style", - "x-ua-compatible", - "refresh", -] - - -class Meta(Element): - - @overload - def __init__( - self, *children: ChildType, http_equiv: HttpEquivOptions, content: str - ): ... - @overload - def __init__(self, *children: ChildType, name: str, content: str): ... - @overload - def __init__(self, *children: ChildType, charset: str): ... - @overload - def __init__(self, *children: ChildType, itemprop: str): ... - - def __init__(self, *children: ChildType, **kwargs): ... diff --git a/seamless/html/meter.pyi b/seamless/html/meter.pyi deleted file mode 100644 index 461c3a3..0000000 --- a/seamless/html/meter.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLMeterElement -from ..types import ChildType - - -class Meter(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLMeterElement]): ... diff --git a/seamless/html/nav.pyi b/seamless/html/nav.pyi deleted file mode 100644 index ac13956..0000000 --- a/seamless/html/nav.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Nav(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/noscript.pyi b/seamless/html/noscript.pyi deleted file mode 100644 index e7eb994..0000000 --- a/seamless/html/noscript.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class NoScript(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/object.pyi b/seamless/html/object.pyi deleted file mode 100644 index 14f0fa7..0000000 --- a/seamless/html/object.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLObjectElement -from ..types import ChildType - - -class Object(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLObjectElement]): ... diff --git a/seamless/html/ol.pyi b/seamless/html/ol.pyi deleted file mode 100644 index aedba81..0000000 --- a/seamless/html/ol.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLOrderedListElement -from ..types import ChildType - - -class Ol(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLOrderedListElement]): ... diff --git a/seamless/html/optgroup.pyi b/seamless/html/optgroup.pyi deleted file mode 100644 index 5c6c8ae..0000000 --- a/seamless/html/optgroup.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLOptGroupElement -from ..types import ChildType - - -class OptGroup(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLOptGroupElement]): ... diff --git a/seamless/html/option.pyi b/seamless/html/option.pyi deleted file mode 100644 index ebe4cfd..0000000 --- a/seamless/html/option.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLOptionElement -from ..types import ChildType - - -class Option(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLOptionElement]): ... diff --git a/seamless/html/output.pyi b/seamless/html/output.pyi deleted file mode 100644 index 23bb075..0000000 --- a/seamless/html/output.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLOutputElement -from ..types import ChildType - - -class Output(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLOutputElement]): ... diff --git a/seamless/html/p.pyi b/seamless/html/p.pyi deleted file mode 100644 index d31ba3d..0000000 --- a/seamless/html/p.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLParagraphElement -from ..types import ChildType - - -class P(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLParagraphElement]): ... diff --git a/seamless/html/param.pyi b/seamless/html/param.pyi deleted file mode 100644 index 2c4067f..0000000 --- a/seamless/html/param.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLParamElement -from ..types import ChildType - - -class Param(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLParamElement]): ... diff --git a/seamless/html/picture.pyi b/seamless/html/picture.pyi deleted file mode 100644 index 017dd08..0000000 --- a/seamless/html/picture.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLPictureElement -from ..types import ChildType - - -class Picture(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLPictureElement]): ... diff --git a/seamless/html/pre.pyi b/seamless/html/pre.pyi deleted file mode 100644 index 74c4882..0000000 --- a/seamless/html/pre.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLPreElement -from ..types import ChildType - - -class Pre(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLPreElement]): ... diff --git a/seamless/html/progress.pyi b/seamless/html/progress.pyi deleted file mode 100644 index a40007a..0000000 --- a/seamless/html/progress.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLProgressElement -from ..types import ChildType - - -class Progress(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLProgressElement]): ... diff --git a/seamless/html/q.pyi b/seamless/html/q.pyi deleted file mode 100644 index e8a2935..0000000 --- a/seamless/html/q.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLQuoteElement -from ..types import ChildType - - -class Q(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLQuoteElement]): ... diff --git a/seamless/html/rp.pyi b/seamless/html/rp.pyi deleted file mode 100644 index a272916..0000000 --- a/seamless/html/rp.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Rp(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/rt.pyi b/seamless/html/rt.pyi deleted file mode 100644 index 72693b0..0000000 --- a/seamless/html/rt.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Rt(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/ruby.pyi b/seamless/html/ruby.pyi deleted file mode 100644 index ff53752..0000000 --- a/seamless/html/ruby.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Ruby(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/s.pyi b/seamless/html/s.pyi deleted file mode 100644 index f5e7393..0000000 --- a/seamless/html/s.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class S(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/samp.pyi b/seamless/html/samp.pyi deleted file mode 100644 index d3214d2..0000000 --- a/seamless/html/samp.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Samp(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/script.pyi b/seamless/html/script.pyi deleted file mode 100644 index 019d5a0..0000000 --- a/seamless/html/script.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLScriptElement -from ..types import ChildType - - -class Script(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLScriptElement]): ... diff --git a/seamless/html/search.pyi b/seamless/html/search.pyi deleted file mode 100644 index dcc45f8..0000000 --- a/seamless/html/search.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Search(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/section.pyi b/seamless/html/section.pyi deleted file mode 100644 index 188559c..0000000 --- a/seamless/html/section.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Section(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/select.pyi b/seamless/html/select.pyi deleted file mode 100644 index 3710443..0000000 --- a/seamless/html/select.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLSelectElement -from ..types import ChildType - - -class Select(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLSelectElement]): ... diff --git a/seamless/html/slot.pyi b/seamless/html/slot.pyi deleted file mode 100644 index 0c2e55e..0000000 --- a/seamless/html/slot.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLSlotElement -from ..types import ChildType - - -class Slot(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLSlotElement]): ... diff --git a/seamless/html/small.pyi b/seamless/html/small.pyi deleted file mode 100644 index 5dd88ef..0000000 --- a/seamless/html/small.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Small(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/source.pyi b/seamless/html/source.pyi deleted file mode 100644 index 1293d0c..0000000 --- a/seamless/html/source.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLSourceElement -from ..types import ChildType - - -class Source(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLSourceElement]): ... diff --git a/seamless/html/span.pyi b/seamless/html/span.pyi deleted file mode 100644 index 188694b..0000000 --- a/seamless/html/span.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLSpanElement -from ..types import ChildType - - -class Span(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLSpanElement]): ... diff --git a/seamless/html/strong.pyi b/seamless/html/strong.pyi deleted file mode 100644 index 1a4239b..0000000 --- a/seamless/html/strong.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Strong(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/style.pyi b/seamless/html/style.pyi deleted file mode 100644 index 88ca5a6..0000000 --- a/seamless/html/style.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLStyleElement -from ..types import ChildType - - -class Style(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLStyleElement]): ... diff --git a/seamless/html/sub.pyi b/seamless/html/sub.pyi deleted file mode 100644 index d5ed8fd..0000000 --- a/seamless/html/sub.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Sub(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/summary.pyi b/seamless/html/summary.pyi deleted file mode 100644 index f1272f8..0000000 --- a/seamless/html/summary.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Summary(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/sup.pyi b/seamless/html/sup.pyi deleted file mode 100644 index fb82231..0000000 --- a/seamless/html/sup.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Sup(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/svg.pyi b/seamless/html/svg.pyi deleted file mode 100644 index 0b9c1bd..0000000 --- a/seamless/html/svg.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Svg(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/table.pyi b/seamless/html/table.pyi deleted file mode 100644 index ce8d857..0000000 --- a/seamless/html/table.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableElement -from ..types import ChildType - - -class Table(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableElement]): ... diff --git a/seamless/html/tbody.pyi b/seamless/html/tbody.pyi deleted file mode 100644 index 8b58ec2..0000000 --- a/seamless/html/tbody.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableSectionElement -from ..types import ChildType - - -class TBody(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableSectionElement]): ... diff --git a/seamless/html/td.pyi b/seamless/html/td.pyi deleted file mode 100644 index f431114..0000000 --- a/seamless/html/td.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableDataCellElement -from ..types import ChildType - - -class Td(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableDataCellElement]): ... diff --git a/seamless/html/template.pyi b/seamless/html/template.pyi deleted file mode 100644 index f94778e..0000000 --- a/seamless/html/template.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTemplateElement -from ..types import ChildType - - -class Template(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTemplateElement]): ... diff --git a/seamless/html/textarea.pyi b/seamless/html/textarea.pyi deleted file mode 100644 index 65f9e2c..0000000 --- a/seamless/html/textarea.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTextAreaElement -from ..types import ChildType - - -class TextArea(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTextAreaElement]): ... diff --git a/seamless/html/tfoot.pyi b/seamless/html/tfoot.pyi deleted file mode 100644 index 0165c1a..0000000 --- a/seamless/html/tfoot.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableSectionElement -from ..types import ChildType - - -class TFoot(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableSectionElement]): ... diff --git a/seamless/html/th.pyi b/seamless/html/th.pyi deleted file mode 100644 index b261bab..0000000 --- a/seamless/html/th.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableHeaderCellElement -from ..types import ChildType - - -class Th(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableHeaderCellElement]): ... diff --git a/seamless/html/thead.pyi b/seamless/html/thead.pyi deleted file mode 100644 index 2ecf6b3..0000000 --- a/seamless/html/thead.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableSectionElement -from ..types import ChildType - - -class THead(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableSectionElement]): ... diff --git a/seamless/html/time.pyi b/seamless/html/time.pyi deleted file mode 100644 index 8772c5d..0000000 --- a/seamless/html/time.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTimeElement -from ..types import ChildType - - -class Time(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTimeElement]): ... diff --git a/seamless/html/title.pyi b/seamless/html/title.pyi deleted file mode 100644 index ccc12ee..0000000 --- a/seamless/html/title.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTitleElement -from ..types import ChildType - - -class Title(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTitleElement]): ... diff --git a/seamless/html/tr.pyi b/seamless/html/tr.pyi deleted file mode 100644 index 7e01acd..0000000 --- a/seamless/html/tr.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTableRowElement -from ..types import ChildType - - -class Tr(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTableRowElement]): ... diff --git a/seamless/html/track.pyi b/seamless/html/track.pyi deleted file mode 100644 index c2fd36b..0000000 --- a/seamless/html/track.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLTrackElement -from ..types import ChildType - - -class Track(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLTrackElement]): ... diff --git a/seamless/html/u.pyi b/seamless/html/u.pyi deleted file mode 100644 index 906671c..0000000 --- a/seamless/html/u.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class U(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/ul.pyi b/seamless/html/ul.pyi deleted file mode 100644 index 5e55229..0000000 --- a/seamless/html/ul.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLUnorderedListElement -from ..types import ChildType - - -class Ul(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLUnorderedListElement]): ... diff --git a/seamless/html/var.pyi b/seamless/html/var.pyi deleted file mode 100644 index 6fb93d1..0000000 --- a/seamless/html/var.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Var(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/html/video.pyi b/seamless/html/video.pyi deleted file mode 100644 index ead65da..0000000 --- a/seamless/html/video.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLVideoElement -from ..types import ChildType - - -class Video(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLVideoElement]): ... diff --git a/seamless/html/wbr.pyi b/seamless/html/wbr.pyi deleted file mode 100644 index 8cf7de5..0000000 --- a/seamless/html/wbr.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing_extensions import Unpack -from pydom.element import Element - -from ..types.html import HTMLElementProps -from ..types import ChildType - - -class Wbr(Element): - def __init__(self, *children: ChildType, **kwargs: Unpack[HTMLElementProps]): ... diff --git a/seamless/styling/__init__.py b/seamless/styling/__init__.py index de7899e..2343a54 100644 --- a/seamless/styling/__init__.py +++ b/seamless/styling/__init__.py @@ -1 +1,7 @@ -from pydom.styling import * +from pydom.styling import StyleSheet, CSS, Color + +__all__ = [ + "StyleSheet", + "CSS", + "Color", +] diff --git a/seamless/styling/style.py b/seamless/styling/style.py deleted file mode 100644 index 0eb88e9..0000000 --- a/seamless/styling/style.py +++ /dev/null @@ -1,42 +0,0 @@ -from typing import Generic, TypeVar, Unpack, TYPE_CHECKING - -if TYPE_CHECKING: - from ..types.styling.css_properties import CSSProperties - -T = TypeVar("T") - - -class StyleObject: - class _StyleProperty(Generic[T]): - def __init__(self, instance: "StyleObject", name: str): - self.instance = instance - self.name = name.replace("_", "-") - - def __call__(self, value: T): - self.instance.style[self.name] = value - return self.instance - - def __init__( - self, *styles: "StyleObject | CSSProperties", **kwargs: Unpack["CSSProperties"] - ): - self.style: dict[str, object] = {} - for style in styles: - if isinstance(style, StyleObject): - style = style.style - self.style.update(style) - self.style.update(kwargs) - self.style = { - k.replace("_", "-"): v for k, v in self.style.items() if v is not None - } - - def copy(self): - return StyleObject(self) - - def to_css(self): - return "".join(map(lambda x: f"{x[0]}:{x[1]};", self.style.items())) - - def __str__(self): - return self.to_css() - - def __getattr__(self, name: str): - return StyleObject._StyleProperty(self, name) diff --git a/seamless/types/html/__init__.py b/seamless/types/html/__init__.py deleted file mode 100644 index f7c14b9..0000000 --- a/seamless/types/html/__init__.py +++ /dev/null @@ -1,145 +0,0 @@ -from seamless.types.html.aria_props import AriaProps -from seamless.types.html.html_anchor_element import HTMLAnchorElement -from seamless.types.html.html_area_element import HTMLAreaElement -from seamless.types.html.html_audio_element import HTMLAudioElement -from seamless.types.html.html_base_element import HTMLBaseElement -from seamless.types.html.html_body_element import HTMLBodyElement -from seamless.types.html.html_br_element import HTMLBRElement -from seamless.types.html.html_button_element import HTMLButtonElement -from seamless.types.html.html_canvas_element import HTMLCanvasElement -from seamless.types.html.html_charset_meta_element import HTMLCharsetMetaElement -from seamless.types.html.html_data_element import HTMLDataElement -from seamless.types.html.html_data_list_element import HTMLDataListElement -from seamless.types.html.html_details_element import HTMLDetailsElement -from seamless.types.html.html_dialog_element import HTMLDialogElement -from seamless.types.html.html_div_element import HTMLDivElement -from seamless.types.html.html_document_meta_element import HTMLDocumentMetaElement -from seamless.types.html.html_element import HTMLElement -from seamless.types.html.html_element_props import HTMLElementProps -from seamless.types.html.html_embed_element import HTMLEmbedElement -from seamless.types.html.html_event_props import HTMLEventProps -from seamless.types.html.html_field_set_element import HTMLFieldSetElement -from seamless.types.html.html_form_element import HTMLFormElement -from seamless.types.html.html_heading_element import HTMLHeadingElement -from seamless.types.html.html_head_element import HTMLHeadElement -from seamless.types.html.html_hr_element import HTMLHRElement -from seamless.types.html.html_html_element import HTMLHtmlElement -from seamless.types.html.html_iframe_element import HTMLIFrameElement -from seamless.types.html.html_image_element import HTMLImageElement -from seamless.types.html.html_input_element import HTMLInputElement -from seamless.types.html.html_label_element import HTMLLabelElement -from seamless.types.html.html_legend_element import HTMLLegendElement -from seamless.types.html.html_link_element import HTMLLinkElement -from seamless.types.html.html_list_item_element import HTMLListItemElement -from seamless.types.html.html_map_element import HTMLMapElement -from seamless.types.html.html_meter_element import HTMLMeterElement -from seamless.types.html.html_mod_element import HTMLModElement -from seamless.types.html.html_object_element import HTMLObjectElement -from seamless.types.html.html_option_element import HTMLOptionElement -from seamless.types.html.html_opt_group_element import HTMLOptGroupElement -from seamless.types.html.html_ordered_list_element import HTMLOrderedListElement -from seamless.types.html.html_output_element import HTMLOutputElement -from seamless.types.html.html_paragraph_element import HTMLParagraphElement -from seamless.types.html.html_param_element import HTMLParamElement -from seamless.types.html.html_picture_element import HTMLPictureElement -from seamless.types.html.html_pragma_meta_element import HTMLPragmaMetaElement -from seamless.types.html.html_pre_element import HTMLPreElement -from seamless.types.html.html_progress_element import HTMLProgressElement -from seamless.types.html.html_quote_element import HTMLQuoteElement -from seamless.types.html.html_script_element import HTMLScriptElement -from seamless.types.html.html_select_element import HTMLSelectElement -from seamless.types.html.html_slot_element import HTMLSlotElement -from seamless.types.html.html_source_element import HTMLSourceElement -from seamless.types.html.html_span_element import HTMLSpanElement -from seamless.types.html.html_style_element import HTMLStyleElement -from seamless.types.html.html_table_caption_element import HTMLTableCaptionElement -from seamless.types.html.html_table_cell_element import HTMLTableCellElement -from seamless.types.html.html_table_col_element import HTMLTableColElement -from seamless.types.html.html_table_data_cell_element import HTMLTableDataCellElement -from seamless.types.html.html_table_element import HTMLTableElement -from seamless.types.html.html_table_header_cell_element import ( - HTMLTableHeaderCellElement, -) -from seamless.types.html.html_table_row_element import HTMLTableRowElement -from seamless.types.html.html_table_section_element import HTMLTableSectionElement -from seamless.types.html.html_template_element import HTMLTemplateElement -from seamless.types.html.html_text_area_element import HTMLTextAreaElement -from seamless.types.html.html_time_element import HTMLTimeElement -from seamless.types.html.html_title_element import HTMLTitleElement -from seamless.types.html.html_track_element import HTMLTrackElement -from seamless.types.html.html_unordered_list_element import HTMLUnorderedListElement -from seamless.types.html.html_user_meta_element import HTMLUserMetaElement -from seamless.types.html.html_video_element import HTMLVideoElement - -__all__ = [ - "AriaProps", - "HTMLAnchorElement", - "HTMLAreaElement", - "HTMLAudioElement", - "HTMLBaseElement", - "HTMLBodyElement", - "HTMLBRElement", - "HTMLButtonElement", - "HTMLCanvasElement", - "HTMLCharsetMetaElement", - "HTMLDataElement", - "HTMLDataListElement", - "HTMLDetailsElement", - "HTMLDialogElement", - "HTMLDivElement", - "HTMLDocumentMetaElement", - "HTMLElement", - "HTMLElementProps", - "HTMLEmbedElement", - "HTMLEventProps", - "HTMLFieldSetElement", - "HTMLFormElement", - "HTMLHeadElement", - "HTMLHeadingElement", - "HTMLHRElement", - "HTMLHtmlElement", - "HTMLIFrameElement", - "HTMLImageElement", - "HTMLInputElement", - "HTMLLabelElement", - "HTMLLegendElement", - "HTMLLinkElement", - "HTMLListItemElement", - "HTMLMapElement", - "HTMLMeterElement", - "HTMLModElement", - "HTMLObjectElement", - "HTMLOptGroupElement", - "HTMLOptionElement", - "HTMLOrderedListElement", - "HTMLOutputElement", - "HTMLParagraphElement", - "HTMLParamElement", - "HTMLPictureElement", - "HTMLPragmaMetaElement", - "HTMLPreElement", - "HTMLProgressElement", - "HTMLQuoteElement", - "HTMLScriptElement", - "HTMLSelectElement", - "HTMLSlotElement", - "HTMLSourceElement", - "HTMLSpanElement", - "HTMLStyleElement", - "HTMLTableCaptionElement", - "HTMLTableCellElement", - "HTMLTableColElement", - "HTMLTableDataCellElement", - "HTMLTableElement", - "HTMLTableHeaderCellElement", - "HTMLTableRowElement", - "HTMLTableSectionElement", - "HTMLTemplateElement", - "HTMLTextAreaElement", - "HTMLTimeElement", - "HTMLTitleElement", - "HTMLTrackElement", - "HTMLUnorderedListElement", - "HTMLUserMetaElement", - "HTMLVideoElement", -] diff --git a/seamless/types/html/aria_props.py b/seamless/types/html/aria_props.py deleted file mode 100644 index 80e439f..0000000 --- a/seamless/types/html/aria_props.py +++ /dev/null @@ -1,52 +0,0 @@ -from typing_extensions import TypedDict - - -class AriaProps(TypedDict, total=False): - aria_active_descendant: str - aria_atomic: str - aria_auto_complete: str - aria_busy: str - aria_checked: str - aria_col_count: str - aria_col_index: str - aria_col_span: str - aria_controls: str - aria_current: str - aria_described_by: str - aria_details: str - aria_disabled: str - aria_drop_effect: str - aria_error_message: str - aria_expanded: str - aria_flow_to: str - aria_grabbed: str - aria_has_popup: str - aria_hidden: str - aria_invalid: str - aria_key_shortcuts: str - aria_label: str - aria_labelled_by: str - aria_level: str - aria_live: str - aria_modal: str - aria_multiline: str - aria_multi_selectable: str - aria_orientation: str - aria_owns: str - aria_placeholder: str - aria_pos_inset: str - aria_pressed: str - aria_readonly: str - aria_relevant: str - aria_required: str - aria_role_description: str - aria_row_count: str - aria_row_index: str - aria_row_span: str - aria_selected: str - aria_set_size: str - aria_sort: str - aria_value_max: str - aria_value_min: str - aria_value_now: str - aria_value_text: str diff --git a/seamless/types/html/html_anchor_element.py b/seamless/types/html/html_anchor_element.py deleted file mode 100644 index 9d51e99..0000000 --- a/seamless/types/html/html_anchor_element.py +++ /dev/null @@ -1,12 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLAnchorElement(HTMLElementProps, total=False): - download: str - href: str - href_lang: str - ping: str - referrer_policy: str - rel: str - target: str - type: str diff --git a/seamless/types/html/html_area_element.py b/seamless/types/html/html_area_element.py deleted file mode 100644 index 562b714..0000000 --- a/seamless/types/html/html_area_element.py +++ /dev/null @@ -1,14 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLAreaElement(HTMLElementProps, total=False): - alt: str - coords: str - download: str - href: str - href_lang: str - ping: str - referrer_policy: str - rel: str - shape: str - target: str diff --git a/seamless/types/html/html_audio_element.py b/seamless/types/html/html_audio_element.py deleted file mode 100644 index 8455853..0000000 --- a/seamless/types/html/html_audio_element.py +++ /dev/null @@ -1,10 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLAudioElement(HTMLElementProps, total=False): - auto_play: str - controls: str - loop: str - muted: str - preload: str - src: str diff --git a/seamless/types/html/html_base_element.py b/seamless/types/html/html_base_element.py deleted file mode 100644 index 8d141f6..0000000 --- a/seamless/types/html/html_base_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLBaseElement(HTMLElementProps, total=False): - href: str - target: str diff --git a/seamless/types/html/html_body_element.py b/seamless/types/html/html_body_element.py deleted file mode 100644 index cd85930..0000000 --- a/seamless/types/html/html_body_element.py +++ /dev/null @@ -1,117 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps -from seamless.types.html.html_event_props import Event, EventFunction -from seamless.types.events import ( - BeforeUnloadEvent, - HashChangeEvent, - MessageEvent, - PopStateEvent, - StorageEvent, -) - - -class HTMLBodyElement(HTMLElementProps, total=False, closed=False): - alink: str - """ - **@deprecated** Use the CSS color property in conjunction with the :active pseudo-class instead - - Specifies the color of text for hyperlinks when selected - """ - background: str - """ - **@deprecated** Use the CSS background property on the element instead - - Specifies the URI of an image to use as a background - """ - bgcolor: str - """ - **@deprecated** Use the CSS background-color property on the element instead - - Specifies the background color of the document - """ - bottom_margin: int - """ - **@deprecated** Use the CSS margin-bottom property on the element instead - - Specifies the bottom margin of the body - """ - left_margin: int - """ - **@deprecated** Use the CSS margin-left property on the element instead - - Specifies the left margin of the body - """ - link: str - """ - **@deprecated** Use the CSS color property in conjunction with the :link pseudo-class instead - - Specifies the color of text for unvisited hypertext links - """ - on_after_print: EventFunction[Event] - """ - Function to call after the user has printed the document - """ - on_before_print: EventFunction[Event] - """ - Function to call before the user prints the document - """ - on_before_unload: EventFunction[BeforeUnloadEvent] - """ - Function to call when the document is about to be unloaded - """ - on_hash_change: EventFunction[HashChangeEvent] - """ - Function to call when the fragment identifier part (starting with the hash (`#`) character) - of the document's current address has changed - """ - on_language_change: EventFunction[Event] - """ - Function to call when the preferred languages changed - """ - on_message: EventFunction[MessageEvent] - """ - Function to call when the document has received a message - """ - on_offline: EventFunction[Event] - """ - Function to call when network communication has failed - """ - on_online: EventFunction[Event] - """ - Function to call when network communication has been restored - """ - on_pop_state: EventFunction[PopStateEvent] - """ - Function to call when the user has navigated session history - """ - on_storage: EventFunction[StorageEvent] - """ - Function to call when the storage area has changed - """ - on_unload: EventFunction[Event] - """ - Function to call when the document is going away - """ - right_margin: int - """ - **@deprecated** Use the CSS margin-right property on the element instead - - Specifies the right margin of the body - """ - text: str - """ - **@deprecated** Use the CSS color property on the element instead - - Specifies the color of text - """ - top_margin: int - """ - **@deprecated** Use the CSS margin-top property on the element instead - - Specifies the top margin of the body - """ - vlink: str - """ - **@deprecated** Use the CSS color property in conjunction with the :visited pseudo-class instead - - Specifies the color of text for visited hypertext links - """ diff --git a/seamless/types/html/html_br_element.py b/seamless/types/html/html_br_element.py deleted file mode 100644 index 65c4f73..0000000 --- a/seamless/types/html/html_br_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLBRElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_button_element.py b/seamless/types/html/html_button_element.py deleted file mode 100644 index 6aa28c3..0000000 --- a/seamless/types/html/html_button_element.py +++ /dev/null @@ -1,15 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLButtonElement(HTMLElementProps, total=False): - auto_focus: str - disabled: str - form: str - form_action: str - form_enctype: str - form_method: str - form_no_validate: str - form_target: str - name: str - type: str - value: str diff --git a/seamless/types/html/html_canvas_element.py b/seamless/types/html/html_canvas_element.py deleted file mode 100644 index 49b5434..0000000 --- a/seamless/types/html/html_canvas_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLCanvasElement(HTMLElementProps, total=False): - height: str - width: str diff --git a/seamless/types/html/html_charset_meta_element.py b/seamless/types/html/html_charset_meta_element.py deleted file mode 100644 index 0449a21..0000000 --- a/seamless/types/html/html_charset_meta_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLCharsetMetaElement(HTMLElementProps, total=False): - charset: str diff --git a/seamless/types/html/html_data_element.py b/seamless/types/html/html_data_element.py deleted file mode 100644 index 30aab71..0000000 --- a/seamless/types/html/html_data_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLDataElement(HTMLElementProps, total=False): - value: str diff --git a/seamless/types/html/html_data_list_element.py b/seamless/types/html/html_data_list_element.py deleted file mode 100644 index 23547d6..0000000 --- a/seamless/types/html/html_data_list_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLDataListElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_details_element.py b/seamless/types/html/html_details_element.py deleted file mode 100644 index e5f827b..0000000 --- a/seamless/types/html/html_details_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLDetailsElement(HTMLElementProps, total=False): - open: str diff --git a/seamless/types/html/html_dialog_element.py b/seamless/types/html/html_dialog_element.py deleted file mode 100644 index 5e0c24a..0000000 --- a/seamless/types/html/html_dialog_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLDialogElement(HTMLElementProps, total=False): - open: str diff --git a/seamless/types/html/html_div_element.py b/seamless/types/html/html_div_element.py deleted file mode 100644 index 39e0b2a..0000000 --- a/seamless/types/html/html_div_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLDivElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_document_meta_element.py b/seamless/types/html/html_document_meta_element.py deleted file mode 100644 index 96ffb9a..0000000 --- a/seamless/types/html/html_document_meta_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLDocumentMetaElement(HTMLElementProps, total=False): - name: str - content: str diff --git a/seamless/types/html/html_element.py b/seamless/types/html/html_element.py deleted file mode 100644 index e76dc21..0000000 --- a/seamless/types/html/html_element.py +++ /dev/null @@ -1,29 +0,0 @@ -from typing import TYPE_CHECKING, Iterable, Union, Literal - -from typing_extensions import TypedDict - -if TYPE_CHECKING: - from seamless.core.javascript import JS - from seamless.styling import StyleObject - - -class HTMLElement(TypedDict, total=False, closed=False): - access_key: str - auto_capitalize: str - class_name: str | Iterable[str] - content_editable: str - # data: dict[str, str] # add this if needed in the future - dir: Literal["ltr", "rtl", "auto"] - draggable: str - hidden: str - id: str - input_mode: str - lang: str - role: str - spell_check: str - style: Union[str, "StyleObject"] - tab_index: str - title: str - translate: str - - init: "JS" diff --git a/seamless/types/html/html_element_props.py b/seamless/types/html/html_element_props.py deleted file mode 100644 index f5347c4..0000000 --- a/seamless/types/html/html_element_props.py +++ /dev/null @@ -1,7 +0,0 @@ -from seamless.types.html.aria_props import AriaProps -from seamless.types.html.html_element import HTMLElement -from seamless.types.html.html_event_props import HTMLEventProps - - -class HTMLElementProps(HTMLElement, AriaProps, HTMLEventProps): - pass diff --git a/seamless/types/html/html_embed_element.py b/seamless/types/html/html_embed_element.py deleted file mode 100644 index 8b8fd02..0000000 --- a/seamless/types/html/html_embed_element.py +++ /dev/null @@ -1,8 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLEmbedElement(HTMLElementProps, total=False): - height: str - src: str - type: str - width: str diff --git a/seamless/types/html/html_event_props.py b/seamless/types/html/html_event_props.py deleted file mode 100644 index 1f44adc..0000000 --- a/seamless/types/html/html_event_props.py +++ /dev/null @@ -1,88 +0,0 @@ -from typing import TYPE_CHECKING, Callable, Concatenate, TypeVar, Union - -from typing_extensions import TypedDict - -if TYPE_CHECKING: - from seamless.core.javascript import JS - -from seamless.types.events import ( - CloseEvent, - DragEvent, - ErrorEvent, - Event, - FocusEvent, - KeyboardEvent, - MouseEvent, - ProgressEvent, - SubmitEvent, - UIEvent, - WheelEvent, -) - -EventProps = TypeVar("EventProps", bound=Event) -EventFunction = Union[Callable[Concatenate[EventProps, ...], None], "JS", str] - - -class HTMLEventProps(TypedDict, total=False): - on_abort: EventFunction[Event] - on_auto_complete: EventFunction[Event] - on_auto_complete_error: EventFunction[Event] - on_blur: EventFunction[FocusEvent] - on_cancel: EventFunction[Event] - on_can_play: EventFunction[Event] - on_can_play_through: EventFunction[Event] - on_change: EventFunction[Event] - on_click: EventFunction[MouseEvent] - on_close: EventFunction[CloseEvent] - on_context_menu: EventFunction[MouseEvent] - on_cue_change: EventFunction[Event] - on_dbl_click: EventFunction[MouseEvent] - on_drag: EventFunction[DragEvent] - on_drag_end: EventFunction[DragEvent] - on_drag_enter: EventFunction[DragEvent] - on_drag_leave: EventFunction[DragEvent] - on_drag_over: EventFunction[DragEvent] - on_drag_start: EventFunction[DragEvent] - on_drop: EventFunction[DragEvent] - on_duration_change: EventFunction[Event] - on_emptied: EventFunction[Event] - on_ended: EventFunction[Event] - on_error: EventFunction[ErrorEvent] - on_focus: EventFunction[FocusEvent] - on_input: EventFunction[Event] - on_invalid: EventFunction[Event] - on_key_down: EventFunction[KeyboardEvent] - on_key_press: EventFunction[KeyboardEvent] - on_key_up: EventFunction[KeyboardEvent] - on_load: EventFunction[Event] - on_loaded_data: EventFunction[Event] - on_loaded_metadata: EventFunction[Event] - on_load_start: EventFunction[Event] - on_mouse_down: EventFunction[MouseEvent] - on_mouse_enter: EventFunction[MouseEvent] - on_mouse_leave: EventFunction[MouseEvent] - on_mouse_move: EventFunction[MouseEvent] - on_mouse_out: EventFunction[MouseEvent] - on_mouse_over: EventFunction[MouseEvent] - on_mouse_up: EventFunction[MouseEvent] - on_mouse_wheel: EventFunction[WheelEvent] - on_pause: EventFunction[Event] - on_play: EventFunction[Event] - on_playing: EventFunction[Event] - on_progress: EventFunction[ProgressEvent] - on_rate_change: EventFunction[Event] - on_reset: EventFunction[Event] - on_resize: EventFunction[UIEvent] - on_scroll: EventFunction[UIEvent] - on_seeked: EventFunction[Event] - on_seeking: EventFunction[Event] - on_select: EventFunction[Event] - on_show: EventFunction[Event] - on_sort: EventFunction[Event] - on_stalled: EventFunction[Event] - on_submit: EventFunction[SubmitEvent] - on_suspend: EventFunction[Event] - on_time_update: EventFunction[Event] - on_toggle: EventFunction[Event] - on_volume_change: EventFunction[Event] - on_waiting: EventFunction[Event] diff --git a/seamless/types/html/html_field_set_element.py b/seamless/types/html/html_field_set_element.py deleted file mode 100644 index e79ec67..0000000 --- a/seamless/types/html/html_field_set_element.py +++ /dev/null @@ -1,7 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLFieldSetElement(HTMLElementProps, total=False): - disabled: str - form: str - name: str diff --git a/seamless/types/html/html_form_element.py b/seamless/types/html/html_form_element.py deleted file mode 100644 index 5f45b32..0000000 --- a/seamless/types/html/html_form_element.py +++ /dev/null @@ -1,12 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLFormElement(HTMLElementProps, total=False): - accept_charset: str - action: str - auto_complete: str - enctype: str - method: str - name: str - no_validate: str - target: str diff --git a/seamless/types/html/html_head_element.py b/seamless/types/html/html_head_element.py deleted file mode 100644 index 267c678..0000000 --- a/seamless/types/html/html_head_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLHeadElement(HTMLElementProps, total=False, closed=False): - profile: str diff --git a/seamless/types/html/html_heading_element.py b/seamless/types/html/html_heading_element.py deleted file mode 100644 index 62d1b40..0000000 --- a/seamless/types/html/html_heading_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLHeadingElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_hr_element.py b/seamless/types/html/html_hr_element.py deleted file mode 100644 index 682f38a..0000000 --- a/seamless/types/html/html_hr_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLHRElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_html_element.py b/seamless/types/html/html_html_element.py deleted file mode 100644 index b48b892..0000000 --- a/seamless/types/html/html_html_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLHtmlElement(HTMLElementProps, total=False): - version: str - xmlns: str diff --git a/seamless/types/html/html_iframe_element.py b/seamless/types/html/html_iframe_element.py deleted file mode 100644 index 8e18b77..0000000 --- a/seamless/types/html/html_iframe_element.py +++ /dev/null @@ -1,19 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLIFrameElement(HTMLElementProps, total=False): - allow: str - allow_fullscreen: str - csp: str - frame_border: str - height: str - importance: str - loading: str - name: str - referrer_policy: str - sandbox: str - scrolling: str - seamless: str - src: str - srcdoc: str - width: str diff --git a/seamless/types/html/html_image_element.py b/seamless/types/html/html_image_element.py deleted file mode 100644 index 712c2ab..0000000 --- a/seamless/types/html/html_image_element.py +++ /dev/null @@ -1,18 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLImageElement(HTMLElementProps, total=False): - alt: str - cross_origin: str - decoding: str - height: str - importance: str - intrinsicsize: str - ismap: str - loading: str - referrer_policy: str - sizes: str - src: str - srcset: str - usemap: str - width: str diff --git a/seamless/types/html/html_input_element.py b/seamless/types/html/html_input_element.py deleted file mode 100644 index 88f316c..0000000 --- a/seamless/types/html/html_input_element.py +++ /dev/null @@ -1,39 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLInputElement(HTMLElementProps, total=False): - accept: str - alt: str - auto_complete: str - auto_focus: str - capture: str - checked: str - cross_origin: str - disabled: str - form: str - form_action: str - form_enctype: str - form_method: str - form_no_validate: str - form_target: str - height: str - list: str - max: str - max_length: str - min: str - min_length: str - multiple: str - name: str - pattern: str - placeholder: str - readonly: str - required: str - selection_direction: str - selection_end: str - selection_start: str - size: str - src: str - step: str - type: str - value: str - width: str diff --git a/seamless/types/html/html_label_element.py b/seamless/types/html/html_label_element.py deleted file mode 100644 index 6eb8573..0000000 --- a/seamless/types/html/html_label_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLLabelElement(HTMLElementProps, total=False): - html_for: str diff --git a/seamless/types/html/html_legend_element.py b/seamless/types/html/html_legend_element.py deleted file mode 100644 index 35e5f69..0000000 --- a/seamless/types/html/html_legend_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLLegendElement(HTMLElementProps, total=False): - align: str diff --git a/seamless/types/html/html_link_element.py b/seamless/types/html/html_link_element.py deleted file mode 100644 index 7f7d9e8..0000000 --- a/seamless/types/html/html_link_element.py +++ /dev/null @@ -1,14 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLLinkElement(HTMLElementProps, total=False): - html_as: str - cross_origin: str - disabled: str - href: str - hreflang: str - media: str - referrer_policy: str - rel: str - sizes: str - type: str diff --git a/seamless/types/html/html_list_item_element.py b/seamless/types/html/html_list_item_element.py deleted file mode 100644 index d55651c..0000000 --- a/seamless/types/html/html_list_item_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLListItemElement(HTMLElementProps, total=False): - value: str diff --git a/seamless/types/html/html_map_element.py b/seamless/types/html/html_map_element.py deleted file mode 100644 index 24aa353..0000000 --- a/seamless/types/html/html_map_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLMapElement(HTMLElementProps, total=False): - name: str diff --git a/seamless/types/html/html_meter_element.py b/seamless/types/html/html_meter_element.py deleted file mode 100644 index 3b613b3..0000000 --- a/seamless/types/html/html_meter_element.py +++ /dev/null @@ -1,11 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLMeterElement(HTMLElementProps, total=False): - form: str - high: str - low: str - max: str - min: str - optimum: str - value: str diff --git a/seamless/types/html/html_mod_element.py b/seamless/types/html/html_mod_element.py deleted file mode 100644 index ba842bb..0000000 --- a/seamless/types/html/html_mod_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLModElement(HTMLElementProps, total=False): - cite: str - datetime: str diff --git a/seamless/types/html/html_object_element.py b/seamless/types/html/html_object_element.py deleted file mode 100644 index 711cbc9..0000000 --- a/seamless/types/html/html_object_element.py +++ /dev/null @@ -1,11 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLObjectElement(HTMLElementProps, total=False): - data: str - form: str - height: str - name: str - type: str - usemap: str - width: str diff --git a/seamless/types/html/html_opt_group_element.py b/seamless/types/html/html_opt_group_element.py deleted file mode 100644 index 609bd70..0000000 --- a/seamless/types/html/html_opt_group_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLOptGroupElement(HTMLElementProps, total=False): - disabled: str - label: str diff --git a/seamless/types/html/html_option_element.py b/seamless/types/html/html_option_element.py deleted file mode 100644 index 8c8c701..0000000 --- a/seamless/types/html/html_option_element.py +++ /dev/null @@ -1,8 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLOptionElement(HTMLElementProps, total=False): - disabled: str - label: str - selected: str - value: str diff --git a/seamless/types/html/html_ordered_list_element.py b/seamless/types/html/html_ordered_list_element.py deleted file mode 100644 index 02a16c4..0000000 --- a/seamless/types/html/html_ordered_list_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLOrderedListElement(HTMLElementProps, total=False): - reversed: str - start: str diff --git a/seamless/types/html/html_output_element.py b/seamless/types/html/html_output_element.py deleted file mode 100644 index 720e151..0000000 --- a/seamless/types/html/html_output_element.py +++ /dev/null @@ -1,7 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLOutputElement(HTMLElementProps, total=False): - html_for: str # 'for' is a reserved keyword in Python, so using 'html_for' - form: str - name: str diff --git a/seamless/types/html/html_paragraph_element.py b/seamless/types/html/html_paragraph_element.py deleted file mode 100644 index ce7dc27..0000000 --- a/seamless/types/html/html_paragraph_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLParagraphElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_param_element.py b/seamless/types/html/html_param_element.py deleted file mode 100644 index 18d6db9..0000000 --- a/seamless/types/html/html_param_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLParamElement(HTMLElementProps, total=False): - name: str - value: str diff --git a/seamless/types/html/html_picture_element.py b/seamless/types/html/html_picture_element.py deleted file mode 100644 index 09f7002..0000000 --- a/seamless/types/html/html_picture_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLPictureElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_pragma_meta_element.py b/seamless/types/html/html_pragma_meta_element.py deleted file mode 100644 index 733c057..0000000 --- a/seamless/types/html/html_pragma_meta_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLPragmaMetaElement(HTMLElementProps, total=False): - http_equiv: str diff --git a/seamless/types/html/html_pre_element.py b/seamless/types/html/html_pre_element.py deleted file mode 100644 index 571db88..0000000 --- a/seamless/types/html/html_pre_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLPreElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_progress_element.py b/seamless/types/html/html_progress_element.py deleted file mode 100644 index 6167ca9..0000000 --- a/seamless/types/html/html_progress_element.py +++ /dev/null @@ -1,6 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLProgressElement(HTMLElementProps, total=False): - max: str - value: str diff --git a/seamless/types/html/html_quote_element.py b/seamless/types/html/html_quote_element.py deleted file mode 100644 index 42a08f3..0000000 --- a/seamless/types/html/html_quote_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLQuoteElement(HTMLElementProps, total=False): - cite: str diff --git a/seamless/types/html/html_script_element.py b/seamless/types/html/html_script_element.py deleted file mode 100644 index b127d58..0000000 --- a/seamless/types/html/html_script_element.py +++ /dev/null @@ -1,12 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLScriptElement(HTMLElementProps, total=False): - async_: bool # 'async' is a reserved keyword in Python, so using 'async_' - cross_origin: str - defer: bool - integrity: str - nonce: str - referrer_policy: str - src: str - type: str diff --git a/seamless/types/html/html_select_element.py b/seamless/types/html/html_select_element.py deleted file mode 100644 index 0cb803a..0000000 --- a/seamless/types/html/html_select_element.py +++ /dev/null @@ -1,12 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLSelectElement(HTMLElementProps, total=False): - auto_complete: str - auto_focus: str - disabled: str - form: str - multiple: str - name: str - required: str - size: str diff --git a/seamless/types/html/html_slot_element.py b/seamless/types/html/html_slot_element.py deleted file mode 100644 index e7cee25..0000000 --- a/seamless/types/html/html_slot_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLSlotElement(HTMLElementProps, total=False): - name: str diff --git a/seamless/types/html/html_source_element.py b/seamless/types/html/html_source_element.py deleted file mode 100644 index e1c2235..0000000 --- a/seamless/types/html/html_source_element.py +++ /dev/null @@ -1,9 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLSourceElement(HTMLElementProps, total=False): - media: str - sizes: str - src: str - srcset: str - type: str diff --git a/seamless/types/html/html_span_element.py b/seamless/types/html/html_span_element.py deleted file mode 100644 index d8bb60d..0000000 --- a/seamless/types/html/html_span_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLSpanElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_style_element.py b/seamless/types/html/html_style_element.py deleted file mode 100644 index 4e64f24..0000000 --- a/seamless/types/html/html_style_element.py +++ /dev/null @@ -1,7 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLStyleElement(HTMLElementProps, total=False): - media: str - nonce: str - scoped: str diff --git a/seamless/types/html/html_table_caption_element.py b/seamless/types/html/html_table_caption_element.py deleted file mode 100644 index 74ba3bb..0000000 --- a/seamless/types/html/html_table_caption_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTableCaptionElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_table_cell_element.py b/seamless/types/html/html_table_cell_element.py deleted file mode 100644 index 4d97354..0000000 --- a/seamless/types/html/html_table_cell_element.py +++ /dev/null @@ -1,9 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTableCellElement(HTMLElementProps, total=False): - abbr: str - colspan: str - headers: str - rowspan: str - scope: str diff --git a/seamless/types/html/html_table_col_element.py b/seamless/types/html/html_table_col_element.py deleted file mode 100644 index 8730cf9..0000000 --- a/seamless/types/html/html_table_col_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTableColElement(HTMLElementProps, total=False): - span: str diff --git a/seamless/types/html/html_table_data_cell_element.py b/seamless/types/html/html_table_data_cell_element.py deleted file mode 100644 index c63bc86..0000000 --- a/seamless/types/html/html_table_data_cell_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_table_cell_element import HTMLTableCellElement - - -class HTMLTableDataCellElement(HTMLTableCellElement): - pass # Inherits attributes from HTMLTableCellElement diff --git a/seamless/types/html/html_table_element.py b/seamless/types/html/html_table_element.py deleted file mode 100644 index f829101..0000000 --- a/seamless/types/html/html_table_element.py +++ /dev/null @@ -1,11 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTableElement(HTMLElementProps, total=False): - border: str - cellpadding: str - cellspacing: str - frame: str - rules: str - summary: str - width: str diff --git a/seamless/types/html/html_table_header_cell_element.py b/seamless/types/html/html_table_header_cell_element.py deleted file mode 100644 index 0a9f809..0000000 --- a/seamless/types/html/html_table_header_cell_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_table_cell_element import HTMLTableCellElement - - -class HTMLTableHeaderCellElement(HTMLTableCellElement): - pass # Inherits attributes from HTMLTableCellElement diff --git a/seamless/types/html/html_table_row_element.py b/seamless/types/html/html_table_row_element.py deleted file mode 100644 index d20e264..0000000 --- a/seamless/types/html/html_table_row_element.py +++ /dev/null @@ -1,9 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTableRowElement(HTMLElementProps, total=False): - align: str - bgcolor: str - ch: str - choff: str - v_align: str diff --git a/seamless/types/html/html_table_section_element.py b/seamless/types/html/html_table_section_element.py deleted file mode 100644 index d846ddd..0000000 --- a/seamless/types/html/html_table_section_element.py +++ /dev/null @@ -1,8 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTableSectionElement(HTMLElementProps, total=False): - align: str - ch: str - choff: str - v_align: str diff --git a/seamless/types/html/html_template_element.py b/seamless/types/html/html_template_element.py deleted file mode 100644 index 1190bab..0000000 --- a/seamless/types/html/html_template_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTemplateElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_text_area_element.py b/seamless/types/html/html_text_area_element.py deleted file mode 100644 index 8ef1fa5..0000000 --- a/seamless/types/html/html_text_area_element.py +++ /dev/null @@ -1,18 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTextAreaElement(HTMLElementProps, total=False): - auto_complete: str - auto_focus: str - cols: str - dirname: str - disabled: str - form: str - max_length: str - min_length: str - name: str - placeholder: str - readonly: str - required: str - rows: str - wrap: str diff --git a/seamless/types/html/html_time_element.py b/seamless/types/html/html_time_element.py deleted file mode 100644 index fa6a5cc..0000000 --- a/seamless/types/html/html_time_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTimeElement(HTMLElementProps, total=False): - datetime: str diff --git a/seamless/types/html/html_title_element.py b/seamless/types/html/html_title_element.py deleted file mode 100644 index 0577928..0000000 --- a/seamless/types/html/html_title_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTitleElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_track_element.py b/seamless/types/html/html_track_element.py deleted file mode 100644 index c16593f..0000000 --- a/seamless/types/html/html_track_element.py +++ /dev/null @@ -1,9 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLTrackElement(HTMLElementProps, total=False): - default: str - kind: str - label: str - src: str - srclang: str diff --git a/seamless/types/html/html_unordered_list_element.py b/seamless/types/html/html_unordered_list_element.py deleted file mode 100644 index ba0efd3..0000000 --- a/seamless/types/html/html_unordered_list_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLUnorderedListElement(HTMLElementProps, total=False): - pass # No additional attributes diff --git a/seamless/types/html/html_user_meta_element.py b/seamless/types/html/html_user_meta_element.py deleted file mode 100644 index 099996d..0000000 --- a/seamless/types/html/html_user_meta_element.py +++ /dev/null @@ -1,5 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLUserMetaElement(HTMLElementProps, total=False): - itemprop: str diff --git a/seamless/types/html/html_video_element.py b/seamless/types/html/html_video_element.py deleted file mode 100644 index afa4f81..0000000 --- a/seamless/types/html/html_video_element.py +++ /dev/null @@ -1,15 +0,0 @@ -from seamless.types.html.html_element_props import HTMLElementProps - - -class HTMLVideoElement(HTMLElementProps, total=False): - auto_play: str - controls: str - cross_origin: str - height: str - loop: str - muted: str - plays_inline: str - poster: str - preload: str - src: str - width: str diff --git a/seamless/types/styling/css_properties.py b/seamless/types/styling/css_properties.py deleted file mode 100644 index 10e7018..0000000 --- a/seamless/types/styling/css_properties.py +++ /dev/null @@ -1,280 +0,0 @@ -from typing import Any, Generic, Literal, TypeVar, Union, TypeAlias -from typing_extensions import TypedDict - -float_ = float -T = TypeVar("T") - -AlignContent: TypeAlias = Literal[ - "flex-start", "flex-end", "center", "space-between", "space-around", "stretch" -] - - -class StyleProperty(Generic[T]): - def __call__(self, value: T) -> Any: ... - - -class CSSProperties(TypedDict, total=False, closed=False): - align_content: AlignContent - align_items: Literal["flex-start", "flex-end", "center", "baseline", "stretch"] - align_self: Union[ - str, Literal["auto", "flex-start", "flex-end", "center", "baseline", "stretch"] - ] - animation: str - animation_delay: str - animation_direction: Union[ - str, Literal["normal", "reverse", "alternate", "alternate-reverse"] - ] - animation_duration: str - animation_fill_mode: Union[str, Literal["none", "forwards", "backwards", "both"]] - animation_iteration_count: Union[str, Literal["infinite", "n"]] - animation_name: str - animation_play_state: Union[str, Literal["running", "paused"]] - animation_timing_function: str - backface_visibility: Union[str, Literal["visible", "hidden"]] - background: str - background_attachment: Union[str, Literal["scroll", "fixed", "local"]] - background_blend_mode: str - background_clip: Union[str, Literal["border-box", "padding-box", "content-box"]] - background_color: str - background_image: str - background_origin: Union[str, Literal["padding-box", "border-box", "content-box"]] - background_position: str - background_repeat: Union[ - str, Literal["repeat", "repeat-x", "repeat-y", "no-repeat", "space", "round"] - ] - background_size: str - border: str - border_bottom: str - border_bottom_color: str - border_bottom_left_radius: str - border_bottom_right_radius: str - border_bottom_style: str - border_bottom_width: str - border_collapse: Union[str, Literal["collapse", "separate"]] - border_color: str - border_image: str - border_image_outset: str - border_image_repeat: Union[str, Literal["stretch", "repeat", "round"]] - border_image_slice: str - border_image_source: str - border_image_width: str - border_left: str - border_left_color: str - border_left_style: str - border_left_width: str - border_radius: str - border_right: str - border_right_color: str - border_right_style: str - border_right_width: str - border_spacing: str - border_style: str - border_top: str - border_top_color: str - border_top_left_radius: str - border_top_right_radius: str - border_top_style: str - border_top_width: str - border_width: str - bottom: str - box_shadow: str - box_sizing: Union[str, Literal["content-box", "border-box"]] - caption_side: Union[str, Literal["top", "bottom"]] - clear: Union[str, Literal["none", "left", "right", "both"]] - clip: str - color: str - column_count: Union[str, int] - column_fill: Union[str, Literal["balance", "auto"]] - column_gap: str - column_rule: str - column_rule_color: str - column_rule_style: str - column_rule_width: str - column_span: Union[str, Literal["none", "all"]] - column_width: Union[str, int] - columns: str - content: str - counter_increment: str - counter_reset: str - cursor: str - direction: Union[str, Literal["ltr", "rtl"]] - display: Union[ - str, - Literal[ - "block", - "inline", - "inline-block", - "flex", - "inline-flex", - "grid", - "inline-grid", - "table", - "table-row", - "table-cell", - "none", - ], - ] - empty_cells: Union[str, Literal["show", "hide"]] - filter: str - flex: str - flex_basis: str - flex_direction: Union[str, Literal["row", "row-reverse", "column", "column-reverse"]] - flex_flow: str - flex_grow: str - flex_shrink: str - flex_wrap: Union[str, Literal["nowrap", "wrap", "wrap-reverse"]] - float: Union[str, Literal["left", "right", "none"]] - font: str - font_family: str - font_feature_settings: str - font_kerning: Union[str, Literal["auto", "normal", "none"]] - font_language_override: str - font_size: str - font_size_adjust: Union[str, Literal["none"]] - font_stretch: str - font_style: Union[str, Literal["normal", "italic", "oblique"]] - font_synthesis: str - font_variant: str - font_variant_alternates: str - font_variant_caps: Union[str, Literal["normal", "small-caps"]] - font_variant_east_asian: str - font_variant_ligatures: str - font_variant_numeric: str - font_variant_position: Union[str, Literal["normal", "sub", "super"]] - font_weight: Union[ - str, - Literal[ - "normal", - "bold", - "bolder", - "lighter", - "100", - "200", - "300", - "400", - "500", - "600", - "700", - "800", - "900", - ], - ] - grid: str - grid_area: str - grid_auto_columns: str - grid_auto_flow: str - grid_auto_rows: str - grid_column: str - grid_column_end: str - grid_column_gap: str - grid_column_start: str - grid_gap: str - grid_row: str - grid_row_end: str - grid_row_gap: str - grid_row_start: str - grid_template: str - grid_template_areas: str - grid_template_columns: str - grid_template_rows: str - height: str - hyphens: Union[str, Literal["none", "manual", "auto"]] - image_rendering: str - isolation: Union[str, Literal["auto", "isolate"]] - justify_content: Union[ - str, - Literal[ - "flex-start", - "flex-end", - "center", - "space-between", - "space-around", - "space-evenly", - ], - ] - left: str - letter_spacing: str - line_break: Union[str, Literal["auto", "loose", "normal", "strict"]] - line_height: Union[str, int] - list_style: str - list_style_image: str - list_style_position: Union[str, Literal["inside", "outside"]] - list_style_type: str - margin: str - margin_bottom: str - margin_left: str - margin_right: str - margin_top: str - max_height: str - max_width: str - min_height: str - min_width: str - mix_blend_mode: str - object_fit: Union[str, Literal["fill", "contain", "cover", "none", "scale-down"]] - object_position: str - opacity: Union[str, float_] - order: Union[str, int] - outline: str - outline_color: str - outline_offset: str - outline_style: str - outline_width: str - overflow: Union[str, Literal["auto", "hidden", "scroll", "visible"]] - overflow_wrap: Union[str, Literal["normal", "break-word", "anywhere"]] - overflow_x: Union[str, Literal["auto", "hidden", "scroll", "visible"]] - overflow_y: Union[str, Literal["auto", "hidden", "scroll", "visible"]] - padding: str - padding_bottom: str - padding_left: str - padding_right: str - padding_top: str - page_break_after: Union[str, Literal["auto", "always", "avoid", "left", "right"]] - page_break_before: Union[str, Literal["auto", "always", "avoid", "left", "right"]] - page_break_inside: Union[str, Literal["auto", "avoid"]] - perspective: str - perspective_origin: str - position: Union[str, Literal["static", "relative", "absolute", "fixed", "sticky"]] - quotes: str - resize: Union[str, Literal["none", "both", "horizontal", "vertical"]] - right: str - scroll_behavior: Union[str, Literal["auto", "smooth"]] - tab_size: Union[str, int] - table_layout: Union[str, Literal["auto", "fixed"]] - text_align: Union[str, Literal["left", "right", "center", "justify", "start", "end"]] - text_align_last: Union[str, Literal["auto", "left", "right", "center", "justify", "start", "end"]] - text_decoration: str - text_decoration_color: str - text_decoration_line: str - text_decoration_style: str - text_indent: str - text_justify: Union[str, Literal["auto", "inter-word", "inter-character", "none"]] - text_overflow: Union[str, Literal["clip", "ellipsis"]] - text_shadow: str - text_transform: Union[str, Literal["none", "capitalize", "uppercase", "lowercase", "full-width"]] - text_underline_position: str - top: str - transform: str - transform_origin: str - transform_style: Union[str, Literal["flat", "preserve-3d"]] - transition: str - transition_delay: str - transition_duration: str - transition_property: str - transition_timing_function: str - unicode_bidi: Union[str, Literal["normal", "embed", "isolate", "bidi-override"]] - user_select: Union[str, Literal["auto", "text", "none", "contain", "all"]] - vertical_align: str - visibility: Union[str, Literal["visible", "hidden", "collapse"]] - white_space: Union[str, Literal["normal", "nowrap", "pre", "pre-line", "pre-wrap"]] - widows: Union[str, int] - width: str - will_change: str - word_break: Union[str, Literal["normal", "break-all", "keep-all", "break-word"]] - word_spacing: str - writing_mode: Union[ - str, - Literal[ - "horizontal-tb", "vertical-rl", "vertical-lr", "sideways-rl", "sideways-lr" - ], - ] - z_index: Union[str, int] diff --git a/tests/components/__init__.py b/tests/components/__init__.py index 6fb8b71..28b5287 100644 --- a/tests/components/__init__.py +++ b/tests/components/__init__.py @@ -10,7 +10,7 @@ def __init__(self, name, version) -> None: def render(self): return Div( f"{self.name} v{self.version}", - class_name="plugin", + classes="plugin", ) @@ -21,7 +21,7 @@ def __init__(self, plugins=None) -> None: def render(self): return Div( *[Plugin(plugin.name, plugin.version) for plugin in self.plugins], - class_name="plugin-list", + classes="plugin-list", ) @@ -29,7 +29,7 @@ class Card(Component): def render(self): return Div( *self.children, - class_name="card", + classes="card", ) @@ -37,7 +37,7 @@ class CardTitle(Component): def render(self): return H3( *self.children, - class_name="card-title", + classes="card-title", ) diff --git a/tests/server/common.py b/tests/server/common.py index c25f3f6..f15a905 100644 --- a/tests/server/common.py +++ b/tests/server/common.py @@ -2,7 +2,7 @@ from seamless.components import Page as _Page from seamless.extra.transports.socketio.transport import SocketIOTransport from seamless.html import * -from seamless.styling import CSS, StyleObject +from seamless.styling import CSS, StyleSheet def index(): @@ -57,8 +57,8 @@ def __init__(self, rounded=True) -> None: def render(self): styles = CSS.module("./static/card.css") return Div( - class_name=styles.card, - style=StyleObject(border_radius="5px") if self.rounded else None, + classes=styles.card, + style=StyleSheet(border_radius="5px") if self.rounded else None, )(*self.children) @@ -70,6 +70,6 @@ def __init__(self, rounded=True, is_super=False) -> None: def render(self): styles = CSS.module("./static/card.css") return Div( - class_name=styles.card, - style=StyleObject(border_radius="5px") if self.rounded else None, + classes=styles.card, + style=StyleSheet(border_radius="5px") if self.rounded else None, )(Div("Super card!" if self.is_super else "Card!"), *self.children) diff --git a/tests/test_rendering.py b/tests/test_rendering.py index a1ea742..a679027 100644 --- a/tests/test_rendering.py +++ b/tests/test_rendering.py @@ -122,14 +122,14 @@ def render(self): "Hello", Div(), id="my-id", - class_name="my-class", + classes="my-class", ) class MyComponent2(Component): def render(self): return Div( MyComponent(), - class_name="my-class", + classes="my-class", ) self.assertEqual(