__init__.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. """Element classes."""
  2. from __future__ import annotations
  3. from reflex.utils import lazy_loader
  4. _MAPPING = {
  5. "forms": [
  6. "button",
  7. "datalist",
  8. "fieldset",
  9. "form",
  10. "input",
  11. "label",
  12. "legend",
  13. "meter",
  14. "optgroup",
  15. "option",
  16. "output",
  17. "progress",
  18. "select",
  19. "textarea",
  20. ],
  21. "inline": [
  22. "a",
  23. "abbr",
  24. "b",
  25. "bdi",
  26. "bdo",
  27. "br",
  28. "cite",
  29. "code",
  30. "data",
  31. "dfn",
  32. "em",
  33. "i",
  34. "kbd",
  35. "mark",
  36. "q",
  37. "rp",
  38. "rt",
  39. "ruby",
  40. "s",
  41. "samp",
  42. "small",
  43. "span",
  44. "strong",
  45. "sub",
  46. "sup",
  47. "time",
  48. "u",
  49. "wbr",
  50. ],
  51. "media": [
  52. "area",
  53. "audio",
  54. "img",
  55. "image",
  56. "map",
  57. "track",
  58. "video",
  59. "embed",
  60. "iframe",
  61. "object",
  62. "picture",
  63. "portal",
  64. "source",
  65. "svg",
  66. ],
  67. "metadata": [
  68. "base",
  69. "head",
  70. "link",
  71. "meta",
  72. "title",
  73. "style",
  74. ],
  75. "other": ["details", "dialog", "summary", "slot", "template", "math", "html"],
  76. "scripts": ["canvas", "noscript", "script"],
  77. "sectioning": [
  78. "address",
  79. "article",
  80. "aside",
  81. "body",
  82. "header",
  83. "footer",
  84. "h1",
  85. "h2",
  86. "h3",
  87. "h4",
  88. "h5",
  89. "h6",
  90. "main",
  91. "nav",
  92. "section",
  93. ],
  94. "tables": [
  95. "caption",
  96. "col",
  97. "colgroup",
  98. "table",
  99. "td",
  100. "tfoot",
  101. "th",
  102. "thead",
  103. "tr",
  104. "tbody",
  105. ],
  106. "typography": [
  107. "blockquote",
  108. "dd",
  109. "div",
  110. "dl",
  111. "dt",
  112. "figcaption",
  113. "hr",
  114. "ol",
  115. "li",
  116. "p",
  117. "pre",
  118. "ul",
  119. "ins",
  120. "del_",
  121. "Del",
  122. ],
  123. }
  124. EXCLUDE = ["del_", "Del", "image"]
  125. for v in _MAPPING.values():
  126. v.extend([mod.capitalize() for mod in v if mod not in EXCLUDE])
  127. _SUBMOD_ATTRS: dict[str, list[str]] = _MAPPING
  128. __getattr__, __dir__, __all__ = lazy_loader.attach(
  129. __name__,
  130. submod_attrs=_SUBMOD_ATTRS,
  131. )