0.1.1-alpha.13 • Published 2 years ago
moroboxai-editor-web v0.1.1-alpha.13
moroboxai-editor-web
Embeddable code editor for coding AIs for MoroboxAI on the web.
Install
Using npm:
npm install moroboxai-editor-web --saveOr:
git clone https://github.com/moroboxai/moroboxai-editor-web.git
cd moroboxai-editor-web
npm i
npm run buildUsage
Create a sample.html file in the moroboxai-editor-web folder:
<html>
<div id="editor"></div>
<script type="text/javascript" src="./lib/umd/moroboxai-editor-web.js"></script>
<script type="text/javascript">
// Initialize the editor on our div
const editor = MoroboxAIEditor.init({
element: document.getElementById("editor"),
value: 'function foo() {\n console.log("foo");\n}\n',
width: "500px",
height: "400px"
});
</script>
</html>Open sample.html in your browser and check the console output.
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| element | Element | DOM element to attach the editor to | |
| language | string | javascript | Selected language |
| value | string | Initial content of the editor | |
| width | string | Width of the div element | |
| height | string | Height of the div element | |
| onLoad | func | noop | Signature: function(value: string) => void Function called when the Load button is clicked |
| onUnload | func | noop | Signature: function() => void Function called when the Unload button is clicked |
License
This content is released under the MIT License.
0.1.1-alpha.8
2 years ago
0.1.1-alpha.7
2 years ago
0.1.1-alpha.9
2 years ago
0.1.1-alpha.11
2 years ago
0.1.1-alpha.10
2 years ago
0.1.1-alpha.13
2 years ago
0.1.1-alpha.12
2 years ago
0.1.1-alpha.4
2 years ago
0.1.1-alpha.6
2 years ago
0.1.1-alpha.5
2 years ago
0.1.1-alpha.3
3 years ago
0.1.1-alpha.2
3 years ago
0.1.1-alpha.1
3 years ago
0.1.0-alpha.1
3 years ago