python-fasthtml 0.6.7__tar.gz → 0.6.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python-fasthtml-0.6.7/python_fasthtml.egg-info → python-fasthtml-0.6.8}/PKG-INFO +1 -1
- python-fasthtml-0.6.8/fasthtml/__init__.py +2 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/components.py +27 -12
- python-fasthtml-0.6.8/fasthtml/components.pyi +190 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/core.py +3 -3
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/core.pyi +5 -1
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/jupyter.py +2 -2
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/xtend.pyi +5 -1
- python-fasthtml-0.6.8/pyproject.toml +3 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8/python_fasthtml.egg-info}/PKG-INFO +1 -1
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/SOURCES.txt +1 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/settings.ini +1 -1
- python-fasthtml-0.6.7/fasthtml/__init__.py +0 -2
- python-fasthtml-0.6.7/fasthtml/components.pyi +0 -185
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/CONTRIBUTING.md +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/LICENSE +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/MANIFEST.in +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/README.md +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/_modidx.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/authmw.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/basics.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/cli.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/common.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/fastapp.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/ft.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/js.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/katex.js +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/live_reload.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/oauth.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/pico.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/starlette.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/svg.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/toaster.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/xtend.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/not-zip-safe +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/requires.txt +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/setup.cfg +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/setup.py +0 -0
- {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/tests/test_toaster.py +0 -0
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/01_components.ipynb.
|
|
4
4
|
|
|
5
5
|
# %% auto 0
|
|
6
|
-
__all__ = ['named', 'html_attrs', 'hx_attrs', 'show', 'attrmap_x', 'ft_html', 'ft_hx', 'File',
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
|
|
6
|
+
__all__ = ['named', 'html_attrs', 'hx_attrs', 'hx_attrs_annotations', 'show', 'attrmap_x', 'ft_html', 'ft_hx', 'File',
|
|
7
|
+
'fill_form', 'fill_dataclass', 'find_inputs', 'html2ft', 'sse_message', 'A', 'Abbr', 'Address', 'Area',
|
|
8
|
+
'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas',
|
|
9
|
+
'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog',
|
|
10
|
+
'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1',
|
|
11
|
+
'H2', 'H3', 'H4', 'H5', 'H6', 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins',
|
|
12
|
+
'Kbd', 'Label', 'Legend', 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript',
|
|
13
|
+
'Object', 'Ol', 'Optgroup', 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q',
|
|
14
|
+
'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span',
|
|
15
|
+
'Strong', 'Style', 'Sub', 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th',
|
|
16
|
+
'Thead', 'Time', 'Title', 'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
|
|
17
17
|
|
|
18
18
|
# %% ../nbs/api/01_components.ipynb
|
|
19
19
|
from dataclasses import dataclass, asdict, is_dataclass, make_dataclass, replace, astuple, MISSING
|
|
20
20
|
from bs4 import BeautifulSoup, Comment
|
|
21
|
+
from typing import Literal, Optional
|
|
21
22
|
|
|
22
23
|
from fastcore.utils import *
|
|
23
24
|
from fastcore.xml import *
|
|
@@ -40,7 +41,21 @@ def show(ft,*rest):
|
|
|
40
41
|
named = set('a button form frame iframe img input map meta object param select textarea'.split())
|
|
41
42
|
html_attrs = 'id cls title style accesskey contenteditable dir draggable enterkeyhint hidden inert inputmode lang popover spellcheck tabindex translate'.split()
|
|
42
43
|
hx_attrs = 'get post put delete patch trigger target swap swap_oob include select select_oob indicator push_url confirm disable replace_url vals disabled_elt ext headers history history_elt indicator inherit params preserve prompt replace_url request sync validate'
|
|
43
|
-
hx_attrs =
|
|
44
|
+
hx_attrs = [f'hx_{o}' for o in hx_attrs.split()]
|
|
45
|
+
hx_attrs_annotations = {
|
|
46
|
+
"hx_swap": Literal["innerHTML", "outerHTML", "afterbegin", "beforebegin", "beforeend", "afterend", "delete", "none"] | str,
|
|
47
|
+
"hx_swap_oob": Literal["true", "innerHTML", "outerHTML", "afterbegin", "beforebegin", "beforeend", "afterend", "delete", "none"] | str,
|
|
48
|
+
"hx_push_url": Literal["true", "false"] | str,
|
|
49
|
+
"hx_replace_url": Literal["true", "false"] | str,
|
|
50
|
+
"hx_disabled_elt": Literal["this", "next", "previous"] | str,
|
|
51
|
+
"hx_history": Literal["false"] | str,
|
|
52
|
+
"hx_params": Literal["*", "none"] | str,
|
|
53
|
+
"hx_replace_url": Literal["true", "false"] | str,
|
|
54
|
+
"hx_validate": Literal["true", "false"],
|
|
55
|
+
}
|
|
56
|
+
hx_attrs_annotations |= {o: str for o in set(hx_attrs) - set(hx_attrs_annotations.keys())}
|
|
57
|
+
hx_attrs_annotations = {k: Optional[v] for k,v in hx_attrs_annotations.items()}
|
|
58
|
+
hx_attrs = html_attrs + hx_attrs
|
|
44
59
|
|
|
45
60
|
# %% ../nbs/api/01_components.ipynb
|
|
46
61
|
def attrmap_x(o):
|