Skip to content

Commit 6654bf2

Browse files
committed
update readme
1 parent 710c28a commit 6654bf2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,15 @@ function MyBlocklyHookEmbed() {
117117
All properties are optional.
118118

119119
* `initialXml`: The XML of the program to initially load in the editor.
120+
* `initialJson`: The JSON of the program to initially load in the editor.
121+
* `updateXml`: A reference to XML of the program. If this value is changed (i.e. external to the BlocklyWorkspace component or useBlocklyWorkspace hook), the Blockly workspace will update to reflect the new XML.
122+
* `updateJson`: A reference to JSON of the program. If this value is changed (i.e. external to the BlocklyWorkspace component or useBlocklyWorkspace hook), the Blockly workspace will update to reflect the new JSON.
120123
* `workspaceConfiguration`: Any configuration options to be passed into `Blockly.inject` (except for `toolbox`, which is a separate prop).
121124
* `toolboxConfiguration`: A JSON toolbox configuration (see [the Blockly documentation](https://developers.google.com/blockly/guides/configure/web/toolbox#json) for details on this format).
122125
* `className`: The value for the `class` attribute to be used on the `<div>` elements generated by this component. Typically you'll need to use this to set the height of the Blockly editor, using either an explicit `height` style, flexboxes, or some other means.
123126
* `onWorkspaceChange`: A function called every time the content of the workspace changes. It should take a single argument, which is the Blockly workspace object. (You can call methods such as Blockly.JavaScript.workspaceToCode on this object.)
124-
* `onXmlChange`: A function called every time the content of the workspace, debounced to be called at most once every 200 milliseconds. This function should take a single argument, which is the new XML generated from the workspace.
127+
* `onXmlChange`: A function called every time the content of the workspace changes, debounced to be called at most once every 200 milliseconds. This function should take a single argument, which is the new XML generated from the workspace.
128+
* `onJsonChange`: A function called every time the content of the workspace changes, debounced to be called at most once every 200 milliseconds. This function should take a single argument, which is the new JSON generated from the workspace.
125129
* `onImportXmlError`: A function called if `initialXml` can't be imported. This function takes a single argument, which is the error thrown during XML import.
126130
* `onInject`: A function called after the Blockly workspace is injected. This function takes a single argument, which is the newly-injected Blockly workspace object. This is a good place to add Blockly plugins, if desired.
127131
* `onDispose`: A function called after the Blockly workspace is disposed and removed from the page. This function takes a single argument, which is the just-disposed Blockly workspace object. Some Blockly plugins need to use this to dispose their own resources.

0 commit comments

Comments
 (0)