0.1.1-alpha.13 • Published 6 months ago

moroboxai-editor-web v0.1.1-alpha.13

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

moroboxai-editor-web

NPM version Node.js CI gitHub license Code Quality: Javascript Total Alerts

Embeddable code editor for coding AIs for MoroboxAI on the web.

Install

Using npm:

npm install moroboxai-editor-web --save

Or:

git clone https://github.com/moroboxai/moroboxai-editor-web.git
cd moroboxai-editor-web
npm i
npm run build

Usage

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

NameTypeDefaultDescription
elementElementDOM element to attach the editor to
languagestringjavascriptSelected language
valuestringInitial content of the editor
widthstringWidth of the div element
heightstringHeight of the div element
onLoadfuncnoopSignature: function(value: string) => void Function called when the Load button is clicked
onUnloadfuncnoopSignature: function() => void Function called when the Unload button is clicked

License

This content is released under the MIT License.

0.1.1-alpha.8

7 months ago

0.1.1-alpha.7

7 months ago

0.1.1-alpha.9

7 months ago

0.1.1-alpha.11

6 months ago

0.1.1-alpha.10

6 months ago

0.1.1-alpha.13

6 months ago

0.1.1-alpha.12

6 months ago

0.1.1-alpha.4

8 months ago

0.1.1-alpha.6

7 months ago

0.1.1-alpha.5

7 months ago

0.1.1-alpha.3

2 years ago

0.1.1-alpha.2

2 years ago

0.1.1-alpha.1

2 years ago

0.1.0-alpha.1

2 years ago