123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- """Stub file for reflex/components/suneditor/editor.py"""
- # ------------------- DO NOT EDIT ----------------------
- # This file was generated by `reflex/utils/pyi_generator.py`!
- # ------------------------------------------------------
- import enum
- from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload
- from reflex.base import Base
- from reflex.components.component import NoSSRComponent
- from reflex.event import EventType
- from reflex.style import Style
- from reflex.utils.imports import ImportDict
- from reflex.vars.base import Var
- class EditorButtonList(list, enum.Enum):
- BASIC = [["font", "fontSize"], ["fontColor"], ["horizontalRule"], ["link", "image"]]
- FORMATTING = [
- ["undo", "redo"],
- ["bold", "underline", "italic", "strike", "subscript", "superscript"],
- ["removeFormat"],
- ["outdent", "indent"],
- ["fullScreen", "showBlocks", "codeView"],
- ["preview", "print"],
- ]
- COMPLEX = [
- ["undo", "redo"],
- ["font", "fontSize", "formatBlock"],
- ["bold", "underline", "italic", "strike", "subscript", "superscript"],
- ["removeFormat"],
- "/",
- ["fontColor", "hiliteColor"],
- ["outdent", "indent"],
- ["align", "horizontalRule", "list", "table"],
- ["link", "image", "video"],
- ["fullScreen", "showBlocks", "codeView"],
- ["preview", "print"],
- ["save", "template"],
- ]
- class EditorOptions(Base):
- default_tag: Optional[str]
- mode: Optional[str]
- rtl: Optional[bool]
- button_list: Optional[List[Union[List[str], str]]]
- def on_blur_spec(e: Var, content: Var[str]) -> Tuple[Var[str]]: ...
- def on_paste_spec(
- e: Var, clean_data: Var[str], max_char_count: Var[bool]
- ) -> Tuple[Var[str], Var[bool]]: ...
- class Editor(NoSSRComponent):
- def add_imports(self) -> ImportDict: ...
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- lang: Optional[
- Union[
- Literal[
- "ckb",
- "da",
- "de",
- "en",
- "es",
- "fr",
- "he",
- "it",
- "ja",
- "ko",
- "lv",
- "pl",
- "pt_br",
- "ro",
- "ru",
- "se",
- "ua",
- "zh_cn",
- ],
- Var[
- Union[
- Literal[
- "ckb",
- "da",
- "de",
- "en",
- "es",
- "fr",
- "he",
- "it",
- "ja",
- "ko",
- "lv",
- "pl",
- "pt_br",
- "ro",
- "ru",
- "se",
- "ua",
- "zh_cn",
- ],
- dict,
- ]
- ],
- dict,
- ]
- ] = None,
- name: Optional[Union[Var[str], str]] = None,
- default_value: Optional[Union[Var[str], str]] = None,
- width: Optional[Union[Var[str], str]] = None,
- height: Optional[Union[Var[str], str]] = None,
- placeholder: Optional[Union[Var[str], str]] = None,
- auto_focus: Optional[Union[Var[bool], bool]] = None,
- set_options: Optional[Union[Dict, Var[Dict]]] = None,
- set_all_plugins: Optional[Union[Var[bool], bool]] = None,
- set_contents: Optional[Union[Var[str], str]] = None,
- append_contents: Optional[Union[Var[str], str]] = None,
- set_default_style: Optional[Union[Var[str], str]] = None,
- disable: Optional[Union[Var[bool], bool]] = None,
- hide: Optional[Union[Var[bool], bool]] = None,
- hide_toolbar: Optional[Union[Var[bool], bool]] = None,
- disable_toolbar: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
- on_blur: Optional[Union[EventType[()], EventType[str]]] = None,
- on_change: Optional[Union[EventType[()], EventType[str]]] = None,
- on_click: Optional[EventType[()]] = None,
- on_context_menu: Optional[EventType[()]] = None,
- on_copy: Optional[EventType[()]] = None,
- on_cut: Optional[EventType[()]] = None,
- on_double_click: Optional[EventType[()]] = None,
- on_focus: Optional[EventType[()]] = None,
- on_input: Optional[EventType[()]] = None,
- on_load: Optional[Union[EventType[()], EventType[bool]]] = None,
- on_mount: Optional[EventType[()]] = None,
- on_mouse_down: Optional[EventType[()]] = None,
- on_mouse_enter: Optional[EventType[()]] = None,
- on_mouse_leave: Optional[EventType[()]] = None,
- on_mouse_move: Optional[EventType[()]] = None,
- on_mouse_out: Optional[EventType[()]] = None,
- on_mouse_over: Optional[EventType[()]] = None,
- on_mouse_up: Optional[EventType[()]] = None,
- on_paste: Optional[
- Union[EventType[()], EventType[str], EventType[str, bool]]
- ] = None,
- on_scroll: Optional[EventType[()]] = None,
- on_unmount: Optional[EventType[()]] = None,
- toggle_code_view: Optional[Union[EventType[()], EventType[bool]]] = None,
- toggle_full_screen: Optional[Union[EventType[()], EventType[bool]]] = None,
- **props,
- ) -> "Editor":
- """Create an instance of Editor. No children allowed.
- Args:
- set_options: Configuration object to further configure the instance.
- lang: Language of the editor. Alternatively to a string, a dict of your language can be passed to this prop. Please refer to the library docs for this. options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" | "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it" default: "en".
- name: This is used to set the HTML form name of the editor. This means on HTML form submission, it will be submitted together with contents of the editor by the name provided.
- default_value: Sets the default value of the editor. This is useful if you don't want the on_change method to be called on render. If you want the on_change method to be called on render please use the set_contents prop
- width: Sets the width of the editor. px and percentage values are accepted, eg width="100%" or width="500px" default: 100%
- height: Sets the height of the editor. px and percentage values are accepted, eg height="100%" or height="100px"
- placeholder: Sets the placeholder of the editor.
- auto_focus: Should the editor receive focus when initialized?
- set_options: Pass an EditorOptions instance to modify the behaviour of Editor even more.
- set_all_plugins: Whether all SunEditor plugins should be loaded. default: True.
- set_contents: Set the content of the editor. Note: To set the initial contents of the editor without calling the on_change event, please use the default_value prop. set_contents is used to set the contents of the editor programmatically. You must be aware that, when the set_contents's prop changes, the on_change event is triggered.
- append_contents: Append editor content
- set_default_style: Sets the default style of the editor's edit area
- disable: Disable the editor default: False.
- hide: Hide the editor default: False.
- hide_toolbar: Hide the editor toolbar default: False.
- disable_toolbar: Disable the editor toolbar default: False.
- on_change: Fired when the editor content changes.
- on_input: Fired when the something is inputted in the editor.
- on_blur: Fired when the editor loses focus.
- on_load: Fired when the editor is loaded.
- on_copy: Fired when the editor content is copied.
- on_cut: Fired when the editor content is cut.
- on_paste: Fired when the editor content is pasted.
- toggle_code_view: Fired when the code view is toggled.
- toggle_full_screen: Fired when the full screen mode is toggled.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: Any properties to be passed to the Editor
- Returns:
- An Editor instance.
- Raises:
- ValueError: If set_options is a state Var.
- """
- ...
|