reflex/reflex/components/el/elements/__init__.py
Thomas Brandého d7956c19d3
enable PERF rules (#4469)
* enable PERF rules

* fix scripts folder

* Update reflex/compiler/utils.py

Co-authored-by: Masen Furer <m_github@0x26.net>

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-12-13 14:49:37 -08:00

139 lines
2.3 KiB
Python

"""Element classes."""
from __future__ import annotations
from reflex.utils import lazy_loader
_MAPPING = {
"forms": [
"button",
"datalist",
"fieldset",
"form",
"input",
"label",
"legend",
"meter",
"optgroup",
"option",
"output",
"progress",
"select",
"textarea",
],
"inline": [
"a",
"abbr",
"b",
"bdi",
"bdo",
"br",
"cite",
"code",
"data",
"dfn",
"em",
"i",
"kbd",
"mark",
"q",
"rp",
"rt",
"ruby",
"s",
"samp",
"small",
"span",
"strong",
"sub",
"sup",
"time",
"u",
"wbr",
],
"media": [
"area",
"audio",
"img",
"image",
"map",
"track",
"video",
"embed",
"iframe",
"object",
"picture",
"portal",
"source",
"svg",
],
"metadata": [
"base",
"head",
"link",
"meta",
"title",
"style",
],
"other": ["details", "dialog", "summary", "slot", "template", "math", "html"],
"scripts": ["canvas", "noscript", "script"],
"sectioning": [
"address",
"article",
"aside",
"body",
"header",
"footer",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"main",
"nav",
"section",
],
"tables": [
"caption",
"col",
"colgroup",
"table",
"td",
"tfoot",
"th",
"thead",
"tr",
"tbody",
],
"typography": [
"blockquote",
"dd",
"div",
"dl",
"dt",
"figcaption",
"hr",
"ol",
"li",
"p",
"pre",
"ul",
"ins",
"del_",
"Del",
],
}
EXCLUDE = ["del_", "Del", "image"]
for v in _MAPPING.values():
v.extend([mod.capitalize() for mod in v if mod not in EXCLUDE])
_SUBMOD_ATTRS: dict[str, list[str]] = _MAPPING
__getattr__, __dir__, __all__ = lazy_loader.attach(
__name__,
submod_attrs=_SUBMOD_ATTRS,
)