2525 EventHandlerType ,
2626 ImportSourceDict ,
2727 JavaScript ,
28- JSExecutableDict ,
28+ InlineJavascriptDict ,
2929 VdomAttributes ,
3030 VdomChildren ,
3131 VdomDict ,
3232 VdomJson ,
3333)
3434
35- EVENT_ATTRIBUTE_PATTERN = re .compile (r"^on\w+" )
35+ EVENT_ATTRIBUTE_PATTERN = re .compile (r"^on[A-Z] \w+" )
3636
3737VDOM_JSON_SCHEMA = {
3838 "$schema" : "http://json-schema.org/draft-07/schema" ,
4747 "children" : {"$ref" : "#/definitions/elementChildren" },
4848 "attributes" : {"type" : "object" },
4949 "eventHandlers" : {"$ref" : "#/definitions/elementEventHandlers" },
50- "jsExecutables " : {"$ref" : "#/definitions/elementJSExecutables " },
50+ "inlineJavascript " : {"$ref" : "#/definitions/elementInlineJavascripts " },
5151 "importSource" : {"$ref" : "#/definitions/importSource" },
5252 },
5353 # The 'tagName' is required because its presence is a useful indicator of
7777 },
7878 "required" : ["target" ],
7979 },
80- "elementJSExecutables " : {
80+ "elementInlineJavascripts " : {
8181 "type" : "object" ,
8282 "patternProperties" : {
8383 ".*" : "str" ,
@@ -172,8 +172,8 @@ def __call__(
172172 """The entry point for the VDOM API, for example reactpy.html(<WE_ARE_HERE>)."""
173173 attributes , children = separate_attributes_and_children (attributes_and_children )
174174 key = attributes .get ("key" , None )
175- attributes , event_handlers , js_executables = (
176- separate_attributes_handlers_and_executables (attributes )
175+ attributes , event_handlers , inline_javascript = (
176+ separate_attributes_handlers_and_inline_javascript (attributes )
177177 )
178178 if REACTPY_CHECK_JSON_ATTRS .current :
179179 json .dumps (attributes )
@@ -194,7 +194,7 @@ def __call__(
194194 ** ({"children" : children } if children else {}),
195195 ** ({"attributes" : attributes } if attributes else {}),
196196 ** ({"eventHandlers" : event_handlers } if event_handlers else {}),
197- ** ({"jsExecutables " : js_executables } if js_executables else {}),
197+ ** ({"inlineJavascript " : inline_javascript } if inline_javascript else {}),
198198 ** ({"importSource" : self .import_source } if self .import_source else {}),
199199 }
200200
@@ -227,26 +227,26 @@ def separate_attributes_and_children(
227227 return _attributes , _children
228228
229229
230- def separate_attributes_handlers_and_executables (
230+ def separate_attributes_handlers_and_inline_javascript (
231231 attributes : Mapping [str , Any ],
232- ) -> tuple [VdomAttributes , EventHandlerDict , JSExecutableDict ]:
232+ ) -> tuple [VdomAttributes , EventHandlerDict , InlineJavascriptDict ]:
233233 _attributes : VdomAttributes = {}
234234 _event_handlers : dict [str , EventHandlerType ] = {}
235- _js_executables : dict [str , JavaScript ] = {}
235+ _inline_javascript : dict [str , JavaScript ] = {}
236236
237237 for k , v in attributes .items ():
238238 if callable (v ):
239239 _event_handlers [k ] = EventHandler (to_event_handler_function (v ))
240240 elif isinstance (v , EventHandler ):
241241 _event_handlers [k ] = v
242242 elif EVENT_ATTRIBUTE_PATTERN .match (k ) and isinstance (v , str ):
243- _js_executables [k ] = JavaScript (v )
243+ _inline_javascript [k ] = JavaScript (v )
244244 elif isinstance (v , JavaScript ):
245- _js_executables [k ] = v
245+ _inline_javascript [k ] = v
246246 else :
247247 _attributes [k ] = v
248248
249- return _attributes , _event_handlers , _js_executables
249+ return _attributes , _event_handlers , _inline_javascript
250250
251251
252252def _flatten_children (children : Sequence [Any ]) -> list [Any ]:
0 commit comments