Files
JiboSDK/lib/behavior-editor/arguments/function-view.js

1 line
853 B
JavaScript
Raw Normal View History

2026-03-22 03:21:45 +02:00
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=t(require("react")),a=e.createClass({displayName:"FunctionView",getInitialState:function(){for(var t={isExpanded:!0},e=atom.grammars.getGrammars(),a=0;a<e.length;a++){var r=e[a];if("JavaScript"===r.name){t.javascriptGrammar=r;break}}return t},render:function(){return e.createElement("atom-text-editor",{ref:"editor",style:{height:300,width:"100%"}},this.props.content)},componentDidMount:function(){var t=this,a=e.findDOMNode(this.refs.editor),r=a.getModel();void 0!==this.state.javascriptGrammar&&r.setGrammar(this.state.javascriptGrammar),this.disposable=r.onDidChange(function(){t.props.onChange(r.getText())})},componentWillUnmount:function(){this.disposable&&this.disposable.dispose()}});module.exports=function(t,r,n){return e.createElement(a,{key:r,content:t,onChange:n})};