__init__.py 2.3 KB

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