scripts.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. """Scripts classes."""
  2. from reflex.components.el.elements.inline import ReferrerPolicy
  3. from reflex.components.el.elements.media import CrossOrigin
  4. from reflex.vars.base import Var
  5. from .base import BaseHTML
  6. class Canvas(BaseHTML):
  7. """Display the canvas element."""
  8. tag = "canvas"
  9. class Noscript(BaseHTML):
  10. """Display the noscript element."""
  11. tag = "noscript"
  12. class Script(BaseHTML):
  13. """Display the script element."""
  14. tag = "script"
  15. # Indicates that the script should be executed asynchronously
  16. async_: Var[bool]
  17. # Character encoding of the external script
  18. char_set: Var[str]
  19. # Configures the CORS requests for the script
  20. cross_origin: Var[CrossOrigin]
  21. # Indicates that the script should be executed after the page has finished parsing
  22. defer: Var[bool]
  23. # Security feature allowing browsers to verify what they fetch
  24. integrity: Var[str]
  25. # Specifies which referrer information to send when fetching the script
  26. referrer_policy: Var[ReferrerPolicy]
  27. # URL of an external script
  28. src: Var[str]
  29. # Specifies the MIME type of the script
  30. type: Var[str]
  31. canvas = Canvas.create
  32. noscript = Noscript.create
  33. script = Script.create