"""Stub file for reflex_components_markdown/markdown.py""" # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from collections.abc import Callable, Mapping, Sequence from functools import lru_cache from types import SimpleNamespace from typing import Any, Literal from reflex_base.components.component import Component, ComponentNamespace from reflex_base.event import EventType, PointerEventInfo from reflex_base.utils.imports import ImportDict, ImportTypes, ImportVar from reflex_base.vars.base import Var from reflex_components_core.core.breakpoints import Breakpoints from reflex_components_core.el.elements.typography import Div _CHILDREN = Var(_js_expr="children", _var_type=str) _PROPS = Var(_js_expr="props") _PROPS_SPREAD = Var(_js_expr="...props") _REST = Var(_js_expr="rest") _REST_SPREAD = Var(_js_expr="...rest") _MOCK_ARG = Var(_js_expr="", _var_type=str) _LANGUAGE = Var(_js_expr="_language", _var_type=str) class Plugin(SimpleNamespace): @staticmethod def create( package: str, tag: str, additional_imports: dict[str, ImportTypes] | None = None, **import_var_kwargs, ) -> Var: ... math = create("remark-math@6.0.0", "remarkMath") gfm = create("remark-gfm@4.0.1", "remarkGfm") unwrap_images = create("rehype-unwrap-images@1.0.0", "rehypeUnwrapImages") katex = create( "rehype-katex@7.0.1", "rehypeKatex", additional_imports={"": "katex/dist/katex.min.css"}, ) raw = create("rehype-raw@7.0.0", "rehypeRaw") _undefined = Var(_js_expr="() => undefined") @staticmethod def __call__( package: str, tag: str, additional_imports: dict[ str, ImportVar | list[ImportVar | str] | list[ImportVar] | str ] | None = None, **props, ) -> Var: """Create a plugin Var. Args: package: The package to import the plugin from. tag: The imported identifier. additional_imports: Additional imports to include in the VarData, such as CSS. **import_var_kwargs: Additional kwargs to pass to the ImportVar. Returns: The plugin Var. """ @lru_cache def get_base_component_map() -> dict[str, Callable]: ... class Markdown(Component): @classmethod def create( cls, *children, component_map: dict[str, Any] | None = None, component_map_hash: str | None = None, remark_plugins: Sequence[Var | tuple[Var, Var]] | Var[Sequence[Var | tuple[Var, Var]]] | None = None, rehype_plugins: Sequence[Var | tuple[Var, Var]] | Var[Sequence[Var | tuple[Var, Var]]] | None = None, style: Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None = None, key: Any | None = None, id: Any | None = None, ref: Var | None = None, class_name: Any | None = None, custom_attrs: dict[str, Any | Var] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_focus: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, on_mouse_enter: EventType[()] | None = None, on_mouse_leave: EventType[()] | None = None, on_mouse_move: EventType[()] | None = None, on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, **props, ) -> Markdown: """Create a markdown component. Args: *children: The children of the component. component_map: The component map from a tag to a lambda that creates a component. component_map_hash: The hash of the component map, generated at create() time. remark_plugins: Remark plugins to use when rendering the content. Provide (plugin, options) if the plugin requires options. rehype_plugins: Rehype (HTML processor) plugins to use when rendering the content. Provide (plugin, options) if the plugin requires options. style: The style of the component. key: A unique key for the component. id: The id for the component. ref: The Var to pass as the ref to the component. class_name: The class name for the component. custom_attrs: Attributes passed directly to the component. on_focus: Fired when the element (or some element inside of it) receives focus. For example, it is called when the user clicks on a text input. on_blur: Fired when focus has left the element (or left some element inside of it). For example, it is called when the user clicks outside of a focused text input. on_click: Fired when the user clicks on an element. For example, it's called when the user clicks on a button. on_context_menu: Fired when the user right-clicks on an element. on_double_click: Fired when the user double-clicks on an element. on_mouse_down: Fired when the user presses a mouse button on an element. on_mouse_enter: Fired when the mouse pointer enters the element. on_mouse_leave: Fired when the mouse pointer leaves the element. on_mouse_move: Fired when the mouse pointer moves over the element. on_mouse_out: Fired when the mouse pointer moves out of the element. on_mouse_over: Fired when the mouse pointer moves onto the element. on_mouse_up: Fired when the user releases a mouse button on an element. on_scroll: Fired when the user scrolls the element. on_scroll_end: Fired when scrolling ends on the element. on_mount: Fired when the component is mounted to the page. on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh. **props: The properties of the component. Returns: The markdown component. Raises: ValueError: If the children are not valid. """ def add_imports(self) -> ImportDict | list[ImportDict]: ... def format_component_map(self) -> dict[str, Var]: ... def get_component(self, tag: str, **props) -> Component: ... def format_component(self, tag: str, **props) -> str: ... class MarkdownWrapper(Div): @classmethod def create( cls, *children, use_math: bool | Var[bool] | bool = True, use_gfm: bool | Var[bool] | bool = True, use_unwrap_images: bool | Var[bool] | bool = True, use_katex: bool | Var[bool] | bool = True, use_raw: bool | Var[bool] | bool = True, access_key: Var[str] | str | None = None, auto_capitalize: Literal[ "characters", "none", "off", "on", "sentences", "words" ] | Var[Literal["characters", "none", "off", "on", "sentences", "words"]] | None = None, content_editable: Literal["inherit", "plaintext-only"] | Var[Literal["inherit", "plaintext-only"] | bool] | bool | None = None, context_menu: Var[str] | str | None = None, dir: Var[str] | str | None = None, draggable: Var[bool] | bool | None = None, enter_key_hint: Literal[ "done", "enter", "go", "next", "previous", "search", "send" ] | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]] | None = None, hidden: Var[bool] | bool | None = None, input_mode: Literal[ "decimal", "email", "none", "numeric", "search", "tel", "text", "url" ] | Var[ Literal[ "decimal", "email", "none", "numeric", "search", "tel", "text", "url" ] ] | None = None, item_prop: Var[str] | str | None = None, lang: Var[str] | str | None = None, role: Literal[ "alert", "alertdialog", "application", "article", "banner", "button", "cell", "checkbox", "columnheader", "combobox", "complementary", "contentinfo", "definition", "dialog", "directory", "document", "feed", "figure", "form", "grid", "gridcell", "group", "heading", "img", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "navigation", "none", "note", "option", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem", ] | Var[ Literal[ "alert", "alertdialog", "application", "article", "banner", "button", "cell", "checkbox", "columnheader", "combobox", "complementary", "contentinfo", "definition", "dialog", "directory", "document", "feed", "figure", "form", "grid", "gridcell", "group", "heading", "img", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "navigation", "none", "note", "option", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem", ] ] | None = None, slot: Var[str] | str | None = None, spell_check: Var[bool] | bool | None = None, tab_index: Var[int] | int | None = None, title: Var[str] | str | None = None, style: Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None = None, key: Any | None = None, id: Any | None = None, ref: Var | None = None, class_name: Any | None = None, custom_attrs: dict[str, Any | Var] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_focus: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, on_mouse_enter: EventType[()] | None = None, on_mouse_leave: EventType[()] | None = None, on_mouse_move: EventType[()] | None = None, on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, **props, ) -> MarkdownWrapper: """Create a markdown component. Args: *children: The children of the component. use_math: Whether to use the remark-math plugin. use_gfm: Whether to use the GitHub Flavored Markdown plugin. use_unwrap_images: Whether to use the unwrap images plugin. use_katex: Whether to use the KaTeX plugin. use_raw: Whether to use the raw HTML plugin. access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) draggable: Defines whether the element can be dragged. enter_key_hint: Hints what media types the media element is able to play. hidden: Defines whether the element is hidden. input_mode: Defines the type of the element. item_prop: Defines the name of the element for metadata purposes. lang: Defines the language used in the element. role: Defines the role of the element. slot: Assigns a slot in a shadow DOM shadow tree to an element. spell_check: Defines whether the element may be checked for spelling errors. tab_index: Defines the position of the current element in the tabbing order. title: Defines a tooltip for the element. style: The style of the component. key: A unique key for the component. id: The id for the component. ref: The Var to pass as the ref to the component. class_name: The class name for the component. custom_attrs: Attributes passed directly to the component. on_focus: Fired when the element (or some element inside of it) receives focus. For example, it is called when the user clicks on a text input. on_blur: Fired when focus has left the element (or left some element inside of it). For example, it is called when the user clicks outside of a focused text input. on_click: Fired when the user clicks on an element. For example, it's called when the user clicks on a button. on_context_menu: Fired when the user right-clicks on an element. on_double_click: Fired when the user double-clicks on an element. on_mouse_down: Fired when the user presses a mouse button on an element. on_mouse_enter: Fired when the mouse pointer enters the element. on_mouse_leave: Fired when the mouse pointer leaves the element. on_mouse_move: Fired when the mouse pointer moves over the element. on_mouse_out: Fired when the mouse pointer moves out of the element. on_mouse_over: Fired when the mouse pointer moves onto the element. on_mouse_up: Fired when the user releases a mouse button on an element. on_scroll: Fired when the user scrolls the element. on_scroll_end: Fired when scrolling ends on the element. on_mount: Fired when the component is mounted to the page. on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh. **props: The properties of the component. Returns: The markdown component or div wrapping markdown component. Raises: ValueError: If the children are not valid. """ class MarkdownNamespace(ComponentNamespace): root = staticmethod(Markdown.create) plugin = Plugin() @staticmethod def __call__( *children, use_math: bool | Var[bool] | bool = True, use_gfm: bool | Var[bool] | bool = True, use_unwrap_images: bool | Var[bool] | bool = True, use_katex: bool | Var[bool] | bool = True, use_raw: bool | Var[bool] | bool = True, access_key: Var[str] | str | None = None, auto_capitalize: Literal[ "characters", "none", "off", "on", "sentences", "words" ] | Var[Literal["characters", "none", "off", "on", "sentences", "words"]] | None = None, content_editable: Literal["inherit", "plaintext-only"] | Var[Literal["inherit", "plaintext-only"] | bool] | bool | None = None, context_menu: Var[str] | str | None = None, dir: Var[str] | str | None = None, draggable: Var[bool] | bool | None = None, enter_key_hint: Literal[ "done", "enter", "go", "next", "previous", "search", "send" ] | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]] | None = None, hidden: Var[bool] | bool | None = None, input_mode: Literal[ "decimal", "email", "none", "numeric", "search", "tel", "text", "url" ] | Var[ Literal[ "decimal", "email", "none", "numeric", "search", "tel", "text", "url" ] ] | None = None, item_prop: Var[str] | str | None = None, lang: Var[str] | str | None = None, role: Literal[ "alert", "alertdialog", "application", "article", "banner", "button", "cell", "checkbox", "columnheader", "combobox", "complementary", "contentinfo", "definition", "dialog", "directory", "document", "feed", "figure", "form", "grid", "gridcell", "group", "heading", "img", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "navigation", "none", "note", "option", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem", ] | Var[ Literal[ "alert", "alertdialog", "application", "article", "banner", "button", "cell", "checkbox", "columnheader", "combobox", "complementary", "contentinfo", "definition", "dialog", "directory", "document", "feed", "figure", "form", "grid", "gridcell", "group", "heading", "img", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "navigation", "none", "note", "option", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem", ] ] | None = None, slot: Var[str] | str | None = None, spell_check: Var[bool] | bool | None = None, tab_index: Var[int] | int | None = None, title: Var[str] | str | None = None, style: Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None = None, key: Any | None = None, id: Any | None = None, ref: Var | None = None, class_name: Any | None = None, custom_attrs: dict[str, Any | Var] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_focus: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, on_mouse_enter: EventType[()] | None = None, on_mouse_leave: EventType[()] | None = None, on_mouse_move: EventType[()] | None = None, on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, **props, ) -> MarkdownWrapper: """Create a markdown component. Args: *children: The children of the component. use_math: Whether to use the remark-math plugin. use_gfm: Whether to use the GitHub Flavored Markdown plugin. use_unwrap_images: Whether to use the unwrap images plugin. use_katex: Whether to use the KaTeX plugin. use_raw: Whether to use the raw HTML plugin. access_key: Provides a hint for generating a keyboard shortcut for the current element. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. content_editable: Indicates whether the element's content is editable. context_menu: Defines the ID of a element which will serve as the element's context menu. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) draggable: Defines whether the element can be dragged. enter_key_hint: Hints what media types the media element is able to play. hidden: Defines whether the element is hidden. input_mode: Defines the type of the element. item_prop: Defines the name of the element for metadata purposes. lang: Defines the language used in the element. role: Defines the role of the element. slot: Assigns a slot in a shadow DOM shadow tree to an element. spell_check: Defines whether the element may be checked for spelling errors. tab_index: Defines the position of the current element in the tabbing order. title: Defines a tooltip for the element. style: The style of the component. key: A unique key for the component. id: The id for the component. ref: The Var to pass as the ref to the component. class_name: The class name for the component. custom_attrs: Attributes passed directly to the component. on_focus: Fired when the element (or some element inside of it) receives focus. For example, it is called when the user clicks on a text input. on_blur: Fired when focus has left the element (or left some element inside of it). For example, it is called when the user clicks outside of a focused text input. on_click: Fired when the user clicks on an element. For example, it's called when the user clicks on a button. on_context_menu: Fired when the user right-clicks on an element. on_double_click: Fired when the user double-clicks on an element. on_mouse_down: Fired when the user presses a mouse button on an element. on_mouse_enter: Fired when the mouse pointer enters the element. on_mouse_leave: Fired when the mouse pointer leaves the element. on_mouse_move: Fired when the mouse pointer moves over the element. on_mouse_out: Fired when the mouse pointer moves out of the element. on_mouse_over: Fired when the mouse pointer moves onto the element. on_mouse_up: Fired when the user releases a mouse button on an element. on_scroll: Fired when the user scrolls the element. on_scroll_end: Fired when scrolling ends on the element. on_mount: Fired when the component is mounted to the page. on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh. **props: The properties of the component. Returns: The markdown component or div wrapping markdown component. Raises: ValueError: If the children are not valid. """ markdown = MarkdownNamespace()