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.
Files changed (42) hide show
  1. {python-fasthtml-0.6.7/python_fasthtml.egg-info → python-fasthtml-0.6.8}/PKG-INFO +1 -1
  2. python-fasthtml-0.6.8/fasthtml/__init__.py +2 -0
  3. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/components.py +27 -12
  4. python-fasthtml-0.6.8/fasthtml/components.pyi +190 -0
  5. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/core.py +3 -3
  6. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/core.pyi +5 -1
  7. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/jupyter.py +2 -2
  8. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/xtend.pyi +5 -1
  9. python-fasthtml-0.6.8/pyproject.toml +3 -0
  10. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8/python_fasthtml.egg-info}/PKG-INFO +1 -1
  11. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/SOURCES.txt +1 -0
  12. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/settings.ini +1 -1
  13. python-fasthtml-0.6.7/fasthtml/__init__.py +0 -2
  14. python-fasthtml-0.6.7/fasthtml/components.pyi +0 -185
  15. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/CONTRIBUTING.md +0 -0
  16. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/LICENSE +0 -0
  17. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/MANIFEST.in +0 -0
  18. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/README.md +0 -0
  19. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/_modidx.py +0 -0
  20. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/authmw.py +0 -0
  21. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/basics.py +0 -0
  22. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/cli.py +0 -0
  23. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/common.py +0 -0
  24. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/fastapp.py +0 -0
  25. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/ft.py +0 -0
  26. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/js.py +0 -0
  27. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/katex.js +0 -0
  28. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/live_reload.py +0 -0
  29. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/oauth.py +0 -0
  30. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/pico.py +0 -0
  31. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/starlette.py +0 -0
  32. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/svg.py +0 -0
  33. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/toaster.py +0 -0
  34. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/fasthtml/xtend.py +0 -0
  35. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/dependency_links.txt +0 -0
  36. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/entry_points.txt +0 -0
  37. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/not-zip-safe +0 -0
  38. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/requires.txt +0 -0
  39. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/python_fasthtml.egg-info/top_level.txt +0 -0
  40. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/setup.cfg +0 -0
  41. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/setup.py +0 -0
  42. {python-fasthtml-0.6.7 → python-fasthtml-0.6.8}/tests/test_toaster.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-fasthtml
3
- Version: 0.6.7
3
+ Version: 0.6.8
4
4
  Summary: The fastest way to create an HTML app
5
5
  Home-page: https://github.com/AnswerDotAI/fasthtml
6
6
  Author: Jeremy Howard
@@ -0,0 +1,2 @@
1
+ __version__ = "0.6.8"
2
+ from .core import *
@@ -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', 'fill_form', 'fill_dataclass',
7
- 'find_inputs', 'html2ft', 'sse_message', 'A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B',
8
- 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col',
9
- 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed',
10
- 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
11
- 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend',
12
- 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup',
13
- 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S',
14
- 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub',
15
- 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title',
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 = html_attrs + [f'hx_{o}' for o in hx_attrs.split()]
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):