reflex 0.7.14a6__py3-none-any.whl → 0.8.0a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

Files changed (211) hide show
  1. reflex/.templates/jinja/app/rxconfig.py.jinja2 +4 -1
  2. reflex/.templates/jinja/web/package.json.jinja2 +1 -1
  3. reflex/.templates/jinja/web/pages/_app.js.jinja2 +16 -10
  4. reflex/.templates/jinja/web/pages/_document.js.jinja2 +1 -1
  5. reflex/.templates/jinja/web/pages/base_page.js.jinja2 +0 -1
  6. reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +4 -0
  7. reflex/.templates/jinja/web/utils/context.js.jinja2 +25 -8
  8. reflex/.templates/web/app/entry.client.js +8 -0
  9. reflex/.templates/web/app/routes.js +10 -0
  10. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +12 -37
  11. reflex/.templates/web/postcss.config.js +1 -1
  12. reflex/.templates/web/react-router.config.js +6 -0
  13. reflex/.templates/web/utils/client_side_routing.js +21 -19
  14. reflex/.templates/web/utils/react-theme.js +92 -0
  15. reflex/.templates/web/utils/state.js +160 -67
  16. reflex/.templates/web/vite.config.js +32 -0
  17. reflex/__init__.py +1 -6
  18. reflex/__init__.pyi +0 -4
  19. reflex/app.py +53 -116
  20. reflex/base.py +1 -87
  21. reflex/compiler/compiler.py +41 -8
  22. reflex/compiler/templates.py +3 -3
  23. reflex/compiler/utils.py +73 -33
  24. reflex/components/__init__.py +0 -2
  25. reflex/components/__init__.pyi +0 -3
  26. reflex/components/base/__init__.py +1 -5
  27. reflex/components/base/__init__.pyi +4 -6
  28. reflex/components/base/app_wrap.pyi +5 -4
  29. reflex/components/base/body.pyi +5 -4
  30. reflex/components/base/document.py +18 -14
  31. reflex/components/base/document.pyi +83 -27
  32. reflex/components/base/error_boundary.pyi +5 -4
  33. reflex/components/base/fragment.pyi +5 -4
  34. reflex/components/base/link.pyi +9 -7
  35. reflex/components/base/meta.pyi +17 -13
  36. reflex/components/base/script.py +60 -58
  37. reflex/components/base/script.pyi +246 -31
  38. reflex/components/base/strict_mode.pyi +5 -4
  39. reflex/components/component.py +146 -217
  40. reflex/components/core/__init__.py +1 -0
  41. reflex/components/core/__init__.pyi +1 -0
  42. reflex/components/core/auto_scroll.pyi +5 -4
  43. reflex/components/core/banner.pyi +25 -19
  44. reflex/components/core/client_side_routing.py +7 -6
  45. reflex/components/core/client_side_routing.pyi +6 -56
  46. reflex/components/core/clipboard.pyi +5 -4
  47. reflex/components/core/debounce.py +1 -0
  48. reflex/components/core/debounce.pyi +5 -4
  49. reflex/components/core/foreach.py +3 -2
  50. reflex/components/core/helmet.py +14 -0
  51. reflex/components/{next/base.pyi → core/helmet.pyi} +10 -7
  52. reflex/components/core/html.pyi +5 -4
  53. reflex/components/core/sticky.pyi +17 -13
  54. reflex/components/core/upload.py +2 -1
  55. reflex/components/core/upload.pyi +21 -16
  56. reflex/components/datadisplay/code.py +2 -72
  57. reflex/components/datadisplay/code.pyi +9 -10
  58. reflex/components/datadisplay/dataeditor.pyi +11 -6
  59. reflex/components/datadisplay/shiki_code_block.pyi +13 -10
  60. reflex/components/dynamic.py +5 -5
  61. reflex/components/el/element.pyi +5 -4
  62. reflex/components/el/elements/base.pyi +5 -4
  63. reflex/components/el/elements/forms.pyi +69 -52
  64. reflex/components/el/elements/inline.pyi +113 -85
  65. reflex/components/el/elements/media.pyi +105 -79
  66. reflex/components/el/elements/metadata.pyi +25 -19
  67. reflex/components/el/elements/other.pyi +29 -22
  68. reflex/components/el/elements/scripts.pyi +13 -10
  69. reflex/components/el/elements/sectioning.pyi +61 -46
  70. reflex/components/el/elements/tables.pyi +41 -31
  71. reflex/components/el/elements/typography.pyi +61 -46
  72. reflex/components/field.py +175 -0
  73. reflex/components/gridjs/datatable.py +2 -2
  74. reflex/components/gridjs/datatable.pyi +11 -9
  75. reflex/components/lucide/icon.py +6 -2
  76. reflex/components/lucide/icon.pyi +15 -10
  77. reflex/components/markdown/markdown.pyi +5 -4
  78. reflex/components/moment/moment.pyi +5 -4
  79. reflex/components/plotly/plotly.pyi +19 -10
  80. reflex/components/props.py +376 -27
  81. reflex/components/radix/primitives/accordion.py +8 -1
  82. reflex/components/radix/primitives/accordion.pyi +29 -22
  83. reflex/components/radix/primitives/base.pyi +9 -7
  84. reflex/components/radix/primitives/drawer.pyi +45 -34
  85. reflex/components/radix/primitives/form.pyi +41 -31
  86. reflex/components/radix/primitives/progress.pyi +21 -16
  87. reflex/components/radix/primitives/slider.pyi +21 -16
  88. reflex/components/radix/themes/base.py +3 -3
  89. reflex/components/radix/themes/base.pyi +33 -25
  90. reflex/components/radix/themes/color_mode.pyi +13 -10
  91. reflex/components/radix/themes/components/alert_dialog.pyi +29 -22
  92. reflex/components/radix/themes/components/aspect_ratio.pyi +5 -4
  93. reflex/components/radix/themes/components/avatar.pyi +5 -4
  94. reflex/components/radix/themes/components/badge.pyi +5 -4
  95. reflex/components/radix/themes/components/button.pyi +5 -4
  96. reflex/components/radix/themes/components/callout.pyi +21 -16
  97. reflex/components/radix/themes/components/card.pyi +5 -4
  98. reflex/components/radix/themes/components/checkbox.pyi +13 -10
  99. reflex/components/radix/themes/components/checkbox_cards.pyi +9 -7
  100. reflex/components/radix/themes/components/checkbox_group.pyi +9 -7
  101. reflex/components/radix/themes/components/context_menu.pyi +53 -40
  102. reflex/components/radix/themes/components/data_list.pyi +17 -13
  103. reflex/components/radix/themes/components/dialog.pyi +29 -22
  104. reflex/components/radix/themes/components/dropdown_menu.pyi +33 -25
  105. reflex/components/radix/themes/components/hover_card.pyi +17 -13
  106. reflex/components/radix/themes/components/icon_button.pyi +5 -4
  107. reflex/components/radix/themes/components/inset.pyi +5 -4
  108. reflex/components/radix/themes/components/popover.pyi +17 -13
  109. reflex/components/radix/themes/components/progress.pyi +5 -4
  110. reflex/components/radix/themes/components/radio.pyi +5 -4
  111. reflex/components/radix/themes/components/radio_cards.pyi +9 -7
  112. reflex/components/radix/themes/components/radio_group.pyi +17 -13
  113. reflex/components/radix/themes/components/scroll_area.pyi +5 -4
  114. reflex/components/radix/themes/components/segmented_control.pyi +9 -7
  115. reflex/components/radix/themes/components/select.pyi +37 -28
  116. reflex/components/radix/themes/components/separator.pyi +5 -4
  117. reflex/components/radix/themes/components/skeleton.pyi +5 -4
  118. reflex/components/radix/themes/components/slider.pyi +5 -4
  119. reflex/components/radix/themes/components/spinner.pyi +5 -4
  120. reflex/components/radix/themes/components/switch.pyi +5 -4
  121. reflex/components/radix/themes/components/table.pyi +29 -22
  122. reflex/components/radix/themes/components/tabs.pyi +21 -16
  123. reflex/components/radix/themes/components/text_area.pyi +5 -4
  124. reflex/components/radix/themes/components/text_field.pyi +13 -10
  125. reflex/components/radix/themes/components/tooltip.pyi +5 -4
  126. reflex/components/radix/themes/layout/base.pyi +5 -4
  127. reflex/components/radix/themes/layout/box.pyi +5 -4
  128. reflex/components/radix/themes/layout/center.pyi +5 -4
  129. reflex/components/radix/themes/layout/container.pyi +5 -4
  130. reflex/components/radix/themes/layout/flex.pyi +5 -4
  131. reflex/components/radix/themes/layout/grid.pyi +5 -4
  132. reflex/components/radix/themes/layout/list.pyi +21 -16
  133. reflex/components/radix/themes/layout/section.pyi +5 -4
  134. reflex/components/radix/themes/layout/spacer.pyi +5 -4
  135. reflex/components/radix/themes/layout/stack.pyi +13 -10
  136. reflex/components/radix/themes/typography/blockquote.pyi +5 -4
  137. reflex/components/radix/themes/typography/code.pyi +5 -4
  138. reflex/components/radix/themes/typography/heading.pyi +5 -4
  139. reflex/components/radix/themes/typography/link.py +46 -11
  140. reflex/components/radix/themes/typography/link.pyi +311 -6
  141. reflex/components/radix/themes/typography/text.pyi +29 -22
  142. reflex/components/react_player/audio.pyi +5 -4
  143. reflex/components/react_player/react_player.pyi +5 -4
  144. reflex/components/react_player/video.pyi +5 -4
  145. reflex/components/recharts/cartesian.py +2 -1
  146. reflex/components/recharts/cartesian.pyi +65 -46
  147. reflex/components/recharts/charts.py +4 -2
  148. reflex/components/recharts/charts.pyi +36 -24
  149. reflex/components/recharts/general.pyi +24 -18
  150. reflex/components/recharts/polar.py +8 -4
  151. reflex/components/recharts/polar.pyi +16 -10
  152. reflex/components/recharts/recharts.pyi +9 -7
  153. reflex/components/sonner/toast.py +2 -2
  154. reflex/components/sonner/toast.pyi +10 -8
  155. reflex/config.py +3 -77
  156. reflex/constants/__init__.py +2 -2
  157. reflex/constants/base.py +28 -11
  158. reflex/constants/compiler.py +5 -3
  159. reflex/constants/event.py +1 -0
  160. reflex/constants/installer.py +22 -16
  161. reflex/constants/route.py +19 -7
  162. reflex/constants/state.py +2 -0
  163. reflex/custom_components/custom_components.py +0 -14
  164. reflex/environment.py +1 -1
  165. reflex/event.py +178 -81
  166. reflex/experimental/__init__.py +0 -30
  167. reflex/istate/proxy.py +5 -3
  168. reflex/page.py +0 -27
  169. reflex/plugins/__init__.py +3 -2
  170. reflex/plugins/base.py +5 -1
  171. reflex/plugins/shared_tailwind.py +158 -0
  172. reflex/plugins/sitemap.py +206 -0
  173. reflex/plugins/tailwind_v3.py +13 -106
  174. reflex/plugins/tailwind_v4.py +15 -108
  175. reflex/reflex.py +1 -0
  176. reflex/route.py +15 -21
  177. reflex/state.py +134 -140
  178. reflex/testing.py +58 -10
  179. reflex/utils/build.py +38 -82
  180. reflex/utils/exec.py +59 -161
  181. reflex/utils/export.py +2 -2
  182. reflex/utils/imports.py +0 -4
  183. reflex/utils/misc.py +28 -0
  184. reflex/utils/prerequisites.py +65 -62
  185. reflex/utils/processes.py +8 -7
  186. reflex/utils/pyi_generator.py +21 -9
  187. reflex/utils/serializers.py +14 -1
  188. reflex/utils/types.py +196 -61
  189. reflex/vars/__init__.py +2 -0
  190. reflex/vars/base.py +367 -134
  191. {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/METADATA +12 -5
  192. {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/RECORD +195 -202
  193. reflex/.templates/web/next.config.js +0 -7
  194. reflex/components/base/head.py +0 -20
  195. reflex/components/base/head.pyi +0 -116
  196. reflex/components/next/__init__.py +0 -10
  197. reflex/components/next/base.py +0 -7
  198. reflex/components/next/image.py +0 -117
  199. reflex/components/next/image.pyi +0 -94
  200. reflex/components/next/link.py +0 -20
  201. reflex/components/next/link.pyi +0 -67
  202. reflex/components/next/video.py +0 -38
  203. reflex/components/next/video.pyi +0 -68
  204. reflex/components/suneditor/__init__.py +0 -5
  205. reflex/components/suneditor/editor.py +0 -269
  206. reflex/components/suneditor/editor.pyi +0 -199
  207. reflex/experimental/layout.py +0 -254
  208. reflex/experimental/layout.pyi +0 -814
  209. {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/WHEEL +0 -0
  210. {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/entry_points.txt +0 -0
  211. {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/licenses/LICENSE +0 -0
@@ -1,269 +0,0 @@
1
- """A Rich Text Editor based on SunEditor."""
2
-
3
- from __future__ import annotations
4
-
5
- import enum
6
- from typing import Any, Literal
7
-
8
- from reflex.base import Base
9
- from reflex.components.component import Component, NoSSRComponent
10
- from reflex.event import EventHandler, no_args_event_spec, passthrough_event_spec
11
- from reflex.utils.format import to_camel_case
12
- from reflex.utils.imports import ImportDict, ImportVar
13
- from reflex.vars.base import Var
14
-
15
-
16
- class EditorButtonList(list, enum.Enum):
17
- """List enum that provides three predefined button lists."""
18
-
19
- BASIC = [
20
- ["font", "fontSize"],
21
- ["fontColor"],
22
- ["horizontalRule"],
23
- ["link", "image"],
24
- ]
25
- FORMATTING = [
26
- ["undo", "redo"],
27
- ["bold", "underline", "italic", "strike", "subscript", "superscript"],
28
- ["removeFormat"],
29
- ["outdent", "indent"],
30
- ["fullScreen", "showBlocks", "codeView"],
31
- ["preview", "print"],
32
- ]
33
- COMPLEX = [
34
- ["undo", "redo"],
35
- ["font", "fontSize", "formatBlock"],
36
- ["bold", "underline", "italic", "strike", "subscript", "superscript"],
37
- ["removeFormat"],
38
- "/",
39
- ["fontColor", "hiliteColor"],
40
- ["outdent", "indent"],
41
- ["align", "horizontalRule", "list", "table"],
42
- ["link", "image", "video"],
43
- ["fullScreen", "showBlocks", "codeView"],
44
- ["preview", "print"],
45
- ["save", "template"],
46
- ]
47
-
48
-
49
- class EditorOptions(Base):
50
- """Some of the additional options to configure the Editor.
51
- Complete list of options found here:
52
- https://github.com/JiHong88/SunEditor/blob/master/README.md#options.
53
- """
54
-
55
- # Specifies default tag name of the editor.
56
- # default: 'p' {String}
57
- default_tag: str | None = None
58
-
59
- # The mode of the editor ('classic', 'inline', 'balloon', 'balloon-always').
60
- # default: 'classic' {String}
61
- mode: str | None = None
62
-
63
- # If true, the editor is set to RTL(Right To Left) mode.
64
- # default: false {Boolean}
65
- rtl: bool | None = None
66
-
67
- # List of buttons to use in the toolbar.
68
- button_list: list[list[str] | str] | None
69
-
70
-
71
- def on_blur_spec(e: Var, content: Var[str]) -> tuple[Var[str]]:
72
- """A helper function to specify the on_blur event handler.
73
-
74
- Args:
75
- e: The event.
76
- content: The content of the editor.
77
-
78
- Returns:
79
- A tuple containing the content of the editor.
80
- """
81
- return (content,)
82
-
83
-
84
- def on_paste_spec(
85
- e: Var, clean_data: Var[str], max_char_count: Var[bool]
86
- ) -> tuple[Var[str], Var[bool]]:
87
- """A helper function to specify the on_paste event handler.
88
-
89
- Args:
90
- e: The event.
91
- clean_data: The clean data.
92
- max_char_count: The maximum character count.
93
-
94
- Returns:
95
- A tuple containing the clean data and the maximum character count.
96
- """
97
- return (clean_data, max_char_count)
98
-
99
-
100
- class Editor(NoSSRComponent):
101
- """A Rich Text Editor component based on SunEditor.
102
- Not every JS prop is listed here (some are not easily usable from python),
103
- refer to the library docs for a complete list.
104
- """
105
-
106
- library = "suneditor-react@3.6.1"
107
-
108
- tag = "SunEditor"
109
-
110
- is_default = True
111
-
112
- lib_dependencies: list[str] = ["suneditor"]
113
-
114
- # Language of the editor.
115
- # Alternatively to a string, a dict of your language can be passed to this prop.
116
- # Please refer to the library docs for this.
117
- # options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" |
118
- # "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it"
119
- # default: "en".
120
- lang: Var[
121
- Literal[
122
- "en",
123
- "da",
124
- "de",
125
- "es",
126
- "fr",
127
- "ja",
128
- "ko",
129
- "pt_br",
130
- "ru",
131
- "zh_cn",
132
- "ro",
133
- "pl",
134
- "ckb",
135
- "lv",
136
- "se",
137
- "ua",
138
- "he",
139
- "it",
140
- ]
141
- | dict
142
- ]
143
-
144
- # This is used to set the HTML form name of the editor.
145
- # This means on HTML form submission,
146
- # it will be submitted together with contents of the editor by the name provided.
147
- name: Var[str]
148
-
149
- # Sets the default value of the editor.
150
- # This is useful if you don't want the on_change method to be called on render.
151
- # If you want the on_change method to be called on render please use the set_contents prop
152
- default_value: Var[str]
153
-
154
- # Sets the width of the editor.
155
- # px and percentage values are accepted, eg width="100%" or width="500px"
156
- # default: 100%
157
- width: Var[str]
158
-
159
- # Sets the height of the editor.
160
- # px and percentage values are accepted, eg height="100%" or height="100px"
161
- height: Var[str]
162
-
163
- # Sets the placeholder of the editor.
164
- placeholder: Var[str]
165
-
166
- # Should the editor receive focus when initialized?
167
- auto_focus: Var[bool]
168
-
169
- # Pass an EditorOptions instance to modify the behaviour of Editor even more.
170
- set_options: Var[dict]
171
-
172
- # Whether all SunEditor plugins should be loaded.
173
- # default: True.
174
- set_all_plugins: Var[bool]
175
-
176
- # Set the content of the editor.
177
- # Note: To set the initial contents of the editor
178
- # without calling the on_change event,
179
- # please use the default_value prop.
180
- # set_contents is used to set the contents of the editor programmatically.
181
- # You must be aware that, when the set_contents's prop changes,
182
- # the on_change event is triggered.
183
- set_contents: Var[str]
184
-
185
- # Append editor content
186
- append_contents: Var[str]
187
-
188
- # Sets the default style of the editor's edit area
189
- set_default_style: Var[str]
190
-
191
- # Disable the editor
192
- # default: False.
193
- disable: Var[bool]
194
-
195
- # Hide the editor
196
- # default: False.
197
- hide: Var[bool]
198
-
199
- # Hide the editor toolbar
200
- # default: False.
201
- hide_toolbar: Var[bool]
202
-
203
- # Disable the editor toolbar
204
- # default: False.
205
- disable_toolbar: Var[bool]
206
-
207
- # Fired when the editor content changes.
208
- on_change: EventHandler[passthrough_event_spec(str)]
209
-
210
- # Fired when the something is inputted in the editor.
211
- on_input: EventHandler[no_args_event_spec]
212
-
213
- # Fired when the editor loses focus.
214
- on_blur: EventHandler[on_blur_spec]
215
-
216
- # Fired when the editor is loaded.
217
- on_load: EventHandler[passthrough_event_spec(bool)]
218
-
219
- # Fired when the editor content is copied.
220
- on_copy: EventHandler[no_args_event_spec]
221
-
222
- # Fired when the editor content is cut.
223
- on_cut: EventHandler[no_args_event_spec]
224
-
225
- # Fired when the editor content is pasted.
226
- on_paste: EventHandler[on_paste_spec]
227
-
228
- # Fired when the code view is toggled.
229
- toggle_code_view: EventHandler[passthrough_event_spec(bool)]
230
-
231
- # Fired when the full screen mode is toggled.
232
- toggle_full_screen: EventHandler[passthrough_event_spec(bool)]
233
-
234
- def add_imports(self) -> ImportDict:
235
- """Add imports for the Editor component.
236
-
237
- Returns:
238
- The import dict.
239
- """
240
- return {
241
- "": ImportVar(tag="suneditor/dist/css/suneditor.min.css", install=False)
242
- }
243
-
244
- @classmethod
245
- def create(
246
- cls, set_options: EditorOptions | None = None, **props: Any
247
- ) -> Component:
248
- """Create an instance of Editor. No children allowed.
249
-
250
- Args:
251
- set_options: Configuration object to further configure the instance.
252
- **props: Any properties to be passed to the Editor
253
-
254
- Returns:
255
- An Editor instance.
256
-
257
- Raises:
258
- ValueError: If set_options is a state Var.
259
- """
260
- if set_options is not None:
261
- if isinstance(set_options, Var):
262
- msg = "EditorOptions cannot be a state Var"
263
- raise ValueError(msg)
264
- props["set_options"] = {
265
- to_camel_case(k): v
266
- for k, v in set_options.dict().items()
267
- if v is not None
268
- }
269
- return super().create(*[], **props)
@@ -1,199 +0,0 @@
1
- """Stub file for reflex/components/suneditor/editor.py"""
2
-
3
- # ------------------- DO NOT EDIT ----------------------
4
- # This file was generated by `reflex/utils/pyi_generator.py`!
5
- # ------------------------------------------------------
6
- import enum
7
- from collections.abc import Mapping, Sequence
8
- from typing import Any, Literal, overload
9
-
10
- from reflex.base import Base
11
- from reflex.components.component import NoSSRComponent
12
- from reflex.components.core.breakpoints import Breakpoints
13
- from reflex.event import EventType
14
- from reflex.utils.imports import ImportDict
15
- from reflex.vars.base import Var
16
-
17
- class EditorButtonList(list, enum.Enum):
18
- BASIC = [["font", "fontSize"], ["fontColor"], ["horizontalRule"], ["link", "image"]]
19
- FORMATTING = [
20
- ["undo", "redo"],
21
- ["bold", "underline", "italic", "strike", "subscript", "superscript"],
22
- ["removeFormat"],
23
- ["outdent", "indent"],
24
- ["fullScreen", "showBlocks", "codeView"],
25
- ["preview", "print"],
26
- ]
27
- COMPLEX = [
28
- ["undo", "redo"],
29
- ["font", "fontSize", "formatBlock"],
30
- ["bold", "underline", "italic", "strike", "subscript", "superscript"],
31
- ["removeFormat"],
32
- "/",
33
- ["fontColor", "hiliteColor"],
34
- ["outdent", "indent"],
35
- ["align", "horizontalRule", "list", "table"],
36
- ["link", "image", "video"],
37
- ["fullScreen", "showBlocks", "codeView"],
38
- ["preview", "print"],
39
- ["save", "template"],
40
- ]
41
-
42
- class EditorOptions(Base):
43
- default_tag: str | None
44
- mode: str | None
45
- rtl: bool | None
46
- button_list: list[list[str] | str] | None
47
-
48
- def on_blur_spec(e: Var, content: Var[str]) -> tuple[Var[str]]: ...
49
- def on_paste_spec(
50
- e: Var, clean_data: Var[str], max_char_count: Var[bool]
51
- ) -> tuple[Var[str], Var[bool]]: ...
52
-
53
- class Editor(NoSSRComponent):
54
- def add_imports(self) -> ImportDict: ...
55
- @overload
56
- @classmethod
57
- def create( # type: ignore
58
- cls,
59
- *children,
60
- lang: Literal[
61
- "ckb",
62
- "da",
63
- "de",
64
- "en",
65
- "es",
66
- "fr",
67
- "he",
68
- "it",
69
- "ja",
70
- "ko",
71
- "lv",
72
- "pl",
73
- "pt_br",
74
- "ro",
75
- "ru",
76
- "se",
77
- "ua",
78
- "zh_cn",
79
- ]
80
- | Var[
81
- Literal[
82
- "ckb",
83
- "da",
84
- "de",
85
- "en",
86
- "es",
87
- "fr",
88
- "he",
89
- "it",
90
- "ja",
91
- "ko",
92
- "lv",
93
- "pl",
94
- "pt_br",
95
- "ro",
96
- "ru",
97
- "se",
98
- "ua",
99
- "zh_cn",
100
- ]
101
- | dict
102
- ]
103
- | dict
104
- | None = None,
105
- name: Var[str] | str | None = None,
106
- default_value: Var[str] | str | None = None,
107
- width: Var[str] | str | None = None,
108
- height: Var[str] | str | None = None,
109
- placeholder: Var[str] | str | None = None,
110
- auto_focus: Var[bool] | bool | None = None,
111
- set_options: Var[dict] | dict | None = None,
112
- set_all_plugins: Var[bool] | bool | None = None,
113
- set_contents: Var[str] | str | None = None,
114
- append_contents: Var[str] | str | None = None,
115
- set_default_style: Var[str] | str | None = None,
116
- disable: Var[bool] | bool | None = None,
117
- hide: Var[bool] | bool | None = None,
118
- hide_toolbar: Var[bool] | bool | None = None,
119
- disable_toolbar: Var[bool] | bool | None = None,
120
- style: Sequence[Mapping[str, Any]]
121
- | Mapping[str, Any]
122
- | Var[Mapping[str, Any]]
123
- | Breakpoints
124
- | None = None,
125
- key: Any | None = None,
126
- id: Any | None = None,
127
- ref: Var | None = None,
128
- class_name: Any | None = None,
129
- autofocus: bool | None = None,
130
- custom_attrs: dict[str, Var | Any] | None = None,
131
- on_blur: EventType[()] | EventType[str] | None = None,
132
- on_change: EventType[()] | EventType[str] | None = None,
133
- on_click: EventType[()] | None = None,
134
- on_context_menu: EventType[()] | None = None,
135
- on_copy: EventType[()] | None = None,
136
- on_cut: EventType[()] | None = None,
137
- on_double_click: EventType[()] | None = None,
138
- on_focus: EventType[()] | None = None,
139
- on_input: EventType[()] | None = None,
140
- on_load: EventType[()] | EventType[bool] | None = None,
141
- on_mount: EventType[()] | None = None,
142
- on_mouse_down: EventType[()] | None = None,
143
- on_mouse_enter: EventType[()] | None = None,
144
- on_mouse_leave: EventType[()] | None = None,
145
- on_mouse_move: EventType[()] | None = None,
146
- on_mouse_out: EventType[()] | None = None,
147
- on_mouse_over: EventType[()] | None = None,
148
- on_mouse_up: EventType[()] | None = None,
149
- on_paste: EventType[()] | EventType[str] | EventType[str, bool] | None = None,
150
- on_scroll: EventType[()] | None = None,
151
- on_unmount: EventType[()] | None = None,
152
- toggle_code_view: EventType[()] | EventType[bool] | None = None,
153
- toggle_full_screen: EventType[()] | EventType[bool] | None = None,
154
- **props,
155
- ) -> Editor:
156
- """Create an instance of Editor. No children allowed.
157
-
158
- Args:
159
- set_options: Configuration object to further configure the instance.
160
- 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".
161
- 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.
162
- 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
163
- width: Sets the width of the editor. px and percentage values are accepted, eg width="100%" or width="500px" default: 100%
164
- height: Sets the height of the editor. px and percentage values are accepted, eg height="100%" or height="100px"
165
- placeholder: Sets the placeholder of the editor.
166
- auto_focus: Should the editor receive focus when initialized?
167
- set_options: Pass an EditorOptions instance to modify the behaviour of Editor even more.
168
- set_all_plugins: Whether all SunEditor plugins should be loaded. default: True.
169
- 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.
170
- append_contents: Append editor content
171
- set_default_style: Sets the default style of the editor's edit area
172
- disable: Disable the editor default: False.
173
- hide: Hide the editor default: False.
174
- hide_toolbar: Hide the editor toolbar default: False.
175
- disable_toolbar: Disable the editor toolbar default: False.
176
- on_change: Fired when the editor content changes.
177
- on_input: Fired when the something is inputted in the editor.
178
- on_blur: Fired when the editor loses focus.
179
- on_load: Fired when the editor is loaded.
180
- on_copy: Fired when the editor content is copied.
181
- on_cut: Fired when the editor content is cut.
182
- on_paste: Fired when the editor content is pasted.
183
- toggle_code_view: Fired when the code view is toggled.
184
- toggle_full_screen: Fired when the full screen mode is toggled.
185
- style: The style of the component.
186
- key: A unique key for the component.
187
- id: The id for the component.
188
- ref: The Var to pass as the ref to the component.
189
- class_name: The class name for the component.
190
- autofocus: Whether the component should take the focus once the page is loaded
191
- custom_attrs: custom attribute
192
- **props: Any properties to be passed to the Editor
193
-
194
- Returns:
195
- An Editor instance.
196
-
197
- Raises:
198
- ValueError: If set_options is a state Var.
199
- """