Skip to content

Commit 2607f82

Browse files
committed
add response_mode feature
1 parent 5022291 commit 2607f82

File tree

945 files changed

+991
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

945 files changed

+991
-17
lines changed

code_editor/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# `declare_component` and call it done. The wrapper allows us to customize
4747
# our component's API: we can pre-process its input args, post-process its
4848
# output value, and add a docstring for users.
49-
def code_editor(code, lang='python', theme="default", shortcuts="vscode", height=30, focus=False, allow_reset=False, snippets=["", ""], keybindings={}, buttons=[], menu={}, info={}, options={}, props={}, editor_props={}, component_props={}, key=None):
49+
def code_editor(code, lang='python', theme="default", shortcuts="vscode", height=30, focus=False, allow_reset=False, response_mode="default", snippets=["", ""], keybindings={}, buttons=[], menu={}, info={}, options={}, props={}, editor_props={}, component_props={}, key=None):
5050
"""Create a new instance of "code_editor".
5151
5252
Parameters
@@ -70,7 +70,7 @@ def code_editor(code, lang='python', theme="default", shortcuts="vscode", height
7070
#
7171
# "default" is a special argument that specifies the initial return
7272
# value of the component before the user has interacted with it.
73-
component_value = _component_func(code=code, lang=lang, theme=theme, key=key, height=height, focus=focus, shortcuts=shortcuts, snippets=snippets, keybindings=keybindings, buttons=buttons, options=options, props=props, editor_props=editor_props, component_props=component_props, menu=menu, info=info, allow_reset=allow_reset, default={"id": "", "type": "", "text": "", "lang": "", "cursor": ""})
73+
component_value = _component_func(code=code, lang=lang, theme=theme, key=key, height=height, focus=focus, shortcuts=shortcuts, snippets=snippets, keybindings=keybindings, buttons=buttons, options=options, props=props, editor_props=editor_props, component_props=component_props, menu=menu, info=info, allow_reset=allow_reset, response_mode=response_mode, default={"id": "", "type": "", "lang": "", "text": "", "selected": "", "cursor": ""})
7474

7575
# We could modify the value returned from the component if we wanted.
7676
# There's no need to do this in our simple example - but it's an option.
@@ -172,7 +172,7 @@ def code_editor(code, lang='python', theme="default", shortcuts="vscode", height
172172
ace_props = {"style": {"borderRadius": "0px 0px 8px 8px"}}
173173

174174
input = st.text_area("Input:", demo_sample_python_code, height=200)
175-
response_dict = code_editor(input, height = height, lang=language, theme=theme, shortcuts=shortcuts, focus=focus, buttons=btns, info=info_bar, props=ace_props, options={"wrap": False}, allow_reset=True, key="code_editor_demo")
175+
response_dict = code_editor(input, height = height, lang=language, theme=theme, shortcuts=shortcuts, focus=focus, buttons=btns, info=info_bar, props=ace_props, options={"wrap": False}, allow_reset=True, response_mode=["debounce", "blur", "select"], key="code_editor_demo")
176176

177177
st.write(response_dict)
178178

code_editor/frontend/node_modules/.cache/.eslintcache

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code_editor/frontend/node_modules/.cache/babel-loader/001ed26e5a80158d0df55ff15daf3f09.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code_editor/frontend/node_modules/.cache/babel-loader/007b7ce83cb5337493793b63f458acaf.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)