initial commit
This commit is contained in:
1
lib/atom-react/atom-integration.js
Normal file
1
lib/atom-react/atom-integration.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=require("../../node_modules/react/lib/ReactInjection"),t={isCustomAttribute:function(e){return-1!==["mini","gutter-hidden","placeholder-text"].indexOf(e)},Properties:{mini:null,"gutter-hidden":null,"placeholder-text":null},DOMAttributeNames:{},DOMPropertyNames:{}};e.DOMProperty.injectDOMPropertyConfig(t),module.exports={activate:function(){},deactivate:function(){}};
|
||||
1
lib/atom-react/components/config-menu.js
Normal file
1
lib/atom-react/components/config-menu.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},n=e(require("react"));module.exports=n.createClass({displayName:"config-menu",getInitialState:function(){return{}},render:function(){var e=this,t=[],a=0;return this.props.data.forEach(function(i){t.push(n.createElement("li",{key:a,name:i,onClick:e.onClick.bind(e,i)},n.createElement("a",{key:a++,className:"icon icon-settings"},i)))}),n.createElement("div",{className:"settings-view pane-item",tabindex:"-1",is:"space-pen-div"},n.createElement("div",{className:"config-menu"},n.createElement("ul",{className:"panels-menu nav nav-pills nav-stacked"},t)),n.createElement("div",{className:"panels"},this.props.activeSection))},onClick:function(e){this.props.onSelect(e)}});
|
||||
1
lib/atom-react/components/float-input-view.js
Normal file
1
lib/atom-react/components/float-input-view.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react")),n=t.createClass({displayName:"FloatInputView",getDefaultProps:function(){return{style:{width:"100%"},tabIndex:-1,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,defaultValue:0,value:0,precision:20,onChange:function(){}}},getInitialState:function(){return{value:this.toPrecision(this.props.value)}},componentWillMount:function(){this.textValue=this.props.value},componentWillReceiveProps:function(e){var t=this.toPrecision(e.value),n=this.getDOMNode().childNodes[0];this.textValue!==t&&(this.textValue=t,n.value=t,this.setState({value:t}))},toPrecision:function(e){return parseFloat(e.toFixed(this.props.precision))},onFocus:function(){this.getDOMNode().childNodes[0].select(),this.becameSelected=!0},onMouseUp:function(e){this.becameSelected===!0&&(this.becameSelected=!1,e.preventDefault(),e.stopPropagation())},render:function(){var e={width:"100%"};return t.createElement("div",{className:"native-key-bindings",tabIndex:-1},t.createElement("input",{onFocus:this.onFocus,onKeyPress:this.onKeyPress,className:"native-key-bindings",style:Object.assign({},e,this.props.style),tabIndex:this.props.tabIndex,type:"number",onMouseUpCapture:this.onMouseUp,onChange:this.onChange,defaultValue:this.state.value,min:this.props.min,max:this.props.max,onKeyDown:this.onKeyDown,step:"any"}))},onKeyDown:function(){},onKeyPress:function(e){13===e.nativeEvent.keyCode&&(this.getDOMNode().childNodes[0].value=this.state.value)},onChange:function(e){var t=e.target.value;0!==t.length&&(t=parseFloat(t),t=Math.max(this.props.min,t),t=Math.min(this.props.max,t),t=this.toPrecision(t),t!==this.state.value&&(this.setState({value:t}),this.textValue=t,this.props.onChange(t)))}});module.exports=n;
|
||||
1
lib/atom-react/components/integer-input-view.js
Normal file
1
lib/atom-react/components/integer-input-view.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react")),n=t.createClass({displayName:"IntegerInputView",getDefaultProps:function(){return{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,tabIndex:-1,defaultValue:0,value:0,precision:0,onChange:function(){}}},getInitialState:function(){return{value:this.toPrecision(this.props.value)}},componentWillMount:function(){this.textValue=this.props.value},componentWillReceiveProps:function(e){var t=this.toPrecision(e.value),n=this.getDOMNode().childNodes[0];this.textValue!==t&&(this.textValue=t,n.value=t,this.setState({value:t}))},toPrecision:function(e){return parseFloat(e.toFixed(this.props.precision))},render:function(){var e={width:"100%"};return t.createElement("div",{className:"native-key-bindings",tabIndex:-1},t.createElement("input",{onKeyPress:this.onKeyPress,className:"native-key-bindings",style:Object.assign({},e,this.props.style),tabIndex:this.props.tabIndex,type:"number",onChange:this.onChange,defaultValue:this.state.value,min:this.props.min,max:this.props.max,step:"any"}))},onKeyPress:function(e){13===e.nativeEvent.keyCode&&(this.getDOMNode().childNodes[0].value=this.state.value)},onChange:function(e){var t=e.target.value;0!==t.length&&(t=parseFloat(t),t=Math.max(this.props.min,t),t=Math.min(this.props.max,t),t=this.toPrecision(t),t!==this.state.value&&(this.setState({value:t}),this.textValue=t,this.props.onChange(t)))}});module.exports=n;
|
||||
1
lib/atom-react/components/jibo-checkbox.js
Normal file
1
lib/atom-react/components/jibo-checkbox.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react"));module.exports=t.createClass({displayName:"jibo-checkbox",getInitialState:function(){return{isVisible:this.props.isVisible}},render:function(){var e={paddingLeft:30},i={"float":"left",marginTop:4},s={marginTop:1};return t.createElement("div",null,t.createElement("div",{className:"settings-view checkbox"},t.createElement("label",{"for":"velocityBoxLabel",style:e},t.createElement("input",{id:"velocityBoxLabel",type:"checkbox",checked:this.state.isVisible,label:this.props.label,style:i,onClick:this.onClick}),t.createElement("div",{className:"setting-title",style:s},this.props.label)),t.createElement("div",{className:"setting-description"})))},onClick:function(){this.props.clickHandler(!this.state.isVisible),this.setState({isVisible:!this.state.isVisible})}});
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react")),$=e(require("jquery")),i=t.createClass({displayName:"List",getInitialState:function(){return{hoveredElement:void 0}},onMouseOver:function(e){this.state.hoveredElement=e,this.setState(this.state)},onMouseOut:function(){this.state.hoveredElement=void 0,this.setState(this.state)},onClick:function(e){this.props.onSelect(e)},render:function(){var e=this,i=[];return this.props.data.forEach(function(n,s){var o="list-item";n===e.state.hoveredElement&&(o+=" selected");var l={},r=null;"string"==typeof n.label?(l={marginLeft:0},r=n.label):r=n.label(),i.push(t.createElement("li",{key:s,className:o,onMouseOver:e.onMouseOver.bind(e,n),onMouseOut:e.onMouseOut.bind(e,n),onClick:e.onClick.bind(e,n)},t.createElement("span",{style:l},r)))}),t.createElement("ul",{className:"list-group"},i)}});module.exports=t.createClass({displayName:"jibo-combo-box-unidirectional",getInitialState:function(){return{clickHandler:this.clickHandler.bind(this)}},render:function(){var e=null;if(this.props.current.display)if("function"==typeof this.props.current.display)e=this.props.current.display();else{var i=null;i=this.props.titleDisplay?this.props.titleDisplay:this.props.current.display,e="\xa0\xa0"+i,e=[t.createElement("i",{className:"fa fa-caret-down",style:{fontSize:20}}),e]}var n="combo-box btn";return this.props.hideButton&&(n="combo-box"),t.createElement("div",null,t.createElement("div",{ref:"button",className:n,onClick:this.onClick},e))},removeList:function(){$(document).off("click",this.state.clickHandler),this.node.remove(),this.node=null},onSelect:function(e){this.props.keepFocusAfterClick||this.removeList(),this.props.onSelected(e)},clickHandler:function(e){0===$(e.target).closest(this.node).length&&this.removeList()},onClick:function(e){if(e.preventDefault(),e.stopPropagation(),this.node)this.removeList();else{var n=t.findDOMNode(this.refs.button),s=n.getBoundingClientRect();this.node=$("<div />").addClass("combo-box-list").css({left:s.left+"px",top:s.bottom+"px"}).appendTo(document.body),$(document).on("click",this.state.clickHandler),t.render(t.createElement(i,{data:this.props.data,onSelect:this.onSelect}),this.node[0])}}});
|
||||
1
lib/atom-react/components/jibo-combo-box.js
Normal file
1
lib/atom-react/components/jibo-combo-box.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=t(require("react")),$=t(require("jquery")),s=e.createClass({displayName:"List",getInitialState:function(){return{hoveredElement:void 0}},onMouseOver:function(t){this.state.hoveredElement=t,this.setState(this.state)},onMouseOut:function(){this.state.hoveredElement=void 0,this.setState(this.state)},onClick:function(t){this.props.onSelect(t)},render:function(){var t=this,s=[];return this.props.data.forEach(function(i,n){var o="list-item";i===t.state.hoveredElement&&(o+=" selected");var r={},l=null;"string"==typeof i.label?(r={marginLeft:5},l=i.label):l=i.label(),s.push(e.createElement("li",{key:n,className:o,onMouseOver:t.onMouseOver.bind(t,i),onMouseOut:t.onMouseOut.bind(t,i),onClick:t.onClick.bind(t,i)},e.createElement("span",{style:r},l)))}),e.createElement("ul",{className:"list-group"},s)}});module.exports=e.createClass({displayName:"jibo-combo-box",getInitialState:function(){return{clickHandler:this.clickHandler.bind(this),current:this.props.init}},render:function(){var t=null;if(this.state.current.display)if("function"==typeof this.state.current.display)t=this.state.current.display();else{var s=null;s=this.props.titleDisplay?this.props.titleDisplay:this.state.current.display,t="\xa0\xa0"+s,t=[e.createElement("i",{className:"fa fa-caret-down",style:{fontSize:20}}),t]}var i="combo-box btn";return this.props.hideButton&&(i="combo-box"),e.createElement("div",null,e.createElement("div",{ref:"button",className:i,onClick:this.onClick},t))},removeList:function(){$(document).off("click",this.state.clickHandler),this.node.remove(),this.node=null},onSelect:function(t){this.state.current=t,this.setState(this.state),this.props.keepFocusAfterClick||this.removeList(),this.props.onSelected(t)},clickHandler:function(t){0===$(t.target).closest(this.node).length&&this.removeList()},onClick:function(t){if(t.preventDefault(),t.stopPropagation(),this.node)this.removeList();else{var i=e.findDOMNode(this.refs.button),n=i.getBoundingClientRect();this.node=$("<div />").addClass("combo-box-list").css({left:n.left+"px",top:n.bottom+"px"}).appendTo(document.body),$(document).on("click",this.state.clickHandler),e.render(e.createElement(s,{data:this.props.data,onSelect:this.onSelect}),this.node[0])}}});
|
||||
1
lib/atom-react/core/atom-view-react-bridge.js
Normal file
1
lib/atom-react/core/atom-view-react-bridge.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),e=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=require("atom-space-pen-views"),o=n.View,r=require("atom"),a=r.CompositeDisposable,s=require("react");module.exports=function(n,r){var u={};if(u[r])return u[r];var c=function(o){function u(){i(this,u),null!=o&&o.apply(this,arguments)}return e(u,o),t(u,{detached:{value:function(){return s.unmountComponentAtNode(this[0]),this.editor.dispose(),this.disposables.dispose()}},initialize:{value:function(t){this.disposables=new a,this.editor=t,t.shouldScroll&&(this[0].style.overflow="auto");var e=s.createElement(n,{parent:this[0],editor:t,paneWidth:this[0].offsetWidth,paneHeight:this[0].offsetHeight});return this.editor.container=this[0],s.render(e,this[0]),this.disposables.add(atom.workspace.onDidChangeActivePaneItem(this.onActivePaneChange.bind(this))),atom.workspace.getActivePaneItem()===this.editor?this.onActivePaneChange(null):void 0}},onActivePaneChange:{value:function(t){return t&&t.constructor.name!==r?this.editor.active===!0?(this.editor.active=!1,this.editor.onPaneDeactivated()):void 0:(this.editor.active=!0,this.editor.onPaneActivated())}}},{content:{value:function(){return this.div({"class":r.match(/[A-Z][a-z]+/g).map(function(t){return t.toLowerCase()}).join("-")})}}}),u}(o);return u[r]=c,c};
|
||||
1
lib/atom-react/core/react-editor.js
vendored
Normal file
1
lib/atom-react/core/react-editor.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=function(){function e(e,t){for(var i in t){var n=t[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n=e(require("path")),o=e(require("fs")),a=e(require("./atom-view-react-bridge")),r=require("atom"),s=r.File,u=r.Emitter,l=function(){function e(t,o){i(this,e);var a=this;this.emitter=new u,this.modifiedStatus=!1,this.shouldScroll=o,this.uri=n.normalize(t),this.tabTitle=n.parse(t).base,this.file=new s(this.uri),this.ignoreFirstReload=!0,this.onDidChangeDisposable=this.file.onDidChange(function(){return a.ignoreFirstReload?void(a.ignoreFirstReload=!1):a.shouldPromptToSave()?void(a.ignoreFirstReload=!0):(a.reload(),void(a.ignoreFirstReload=!0))}),this.onDidRenameDisposable=this.file.onDidRename(function(){a.uri=a.file.getPath(),a.tabTitle=n.parse(a.uri).base,a.emitter.emit("did-change-title")}),this.active=!1,this.container=null}return t(e,{dispose:{value:function(){this.onDidChangeDisposable.dispose(),this.onDidRenameDisposable.dispose()}},isPaneActive:{value:function(){return this.active}},onPaneActivated:{value:function(){}},onPaneDeactivated:{value:function(){}},getTitle:{value:function(){return this.tabTitle}},isModified:{value:function(){return this.modifiedStatus}},shouldPromptToSave:{value:function(){return this.modifiedStatus}},onDidChangeModified:{value:function(e){return this.emitter.on("did-change-modified",e)}},getReactClass:{value:function(){throw new Error("Override ReactEditor.getReactClass()")}},getViewClass:{value:function(){return a(this.getReactClass(),this.constructor.name)}},getURI:{value:function(){return this.uri}},getPath:{value:function(){return this.uri}},onDidChangeTitle:{value:function(e){return this.emitter.on("did-change-title",e)}},setModifiedStatus:{value:function(e){this.modifiedStatus=e,this.emitter.emit("did-change-modified",e)}},serialize:{value:function(){return{filePath:this.uri,tabTitle:this.tabTitle,deserializer:this.constructor.name}}},save:{value:function(){this.saveFile(this.uri)&&(this.ignoreFirstReload=!0,this.setModifiedStatus(!1))}},saveAs:{value:function(e){this.saveFile(e)&&(this.ignoreFirstReload=!0,this.uri=n.normalize(e),this.tabTitle=n.parse(e).base,this.emitter.emit("did-change-title",this.getTitle()))}},saveFile:{value:function(){throw new Error("Override JiboEditor.saveFile()")}},undo:{value:function(){console.log("undo")}},redo:{value:function(){console.log("redo")}},saveUiState:{value:function(e){atom.config.set("jibo-sdk."+this.constructor.name,JSON.stringify(e))}},getUiState:{value:function(){var e=atom.config.get("jibo-sdk."+this.constructor.name);return e?JSON.parse(e):void 0}},reload:{value:function(){}}},{getProjectRoot:{value:function(e){e=n.normalize(e).toLowerCase();for(var t=atom.project.getPaths(),i=0;i<t.length;i++){var o=n.normalize(t[i]).toLowerCase();if("."===e||e.includes(o))return o}return null}},deserialize:{value:function(e){return 0===e.filePath.search("atom:/")||o.existsSync(e.filePath)?new this(e.filePath):void console.warn("Could not deserialize "+this.constructor.name+" for path '"+e.filePath+"' because that file no longer exists")}}}),e}();module.exports=l;
|
||||
1
lib/atom-react/core/react-pane.js
vendored
Normal file
1
lib/atom-react/core/react-pane.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=function(){function t(t,e){for(var i in e){var n=e[i];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=t(require("fs")),r=t(require("./atom-view-react-bridge")),a=function(){function t(e,n,r){i(this,t),this.shouldScroll=n,this.tabTitle=r,this.uri=e}return e(t,{dispose:{value:function(){}},getTitle:{value:function(){return this.tabTitle}},getReactClass:{value:function(){throw new Error("Override ReactEditor.getReactClass()")}},serialize:{value:function(){return{filePath:this.uri,tabTitle:this.tabTitle,deserializer:this.constructor.name}}},getURI:{value:function(){return this.uri}},getPath:{value:function(){return this.uri}},saveUiState:{value:function(t){atom.config.set("jibo-sdk."+this.constructor.name,JSON.stringify(t))}},getUiState:{value:function(){var t=atom.config.get("jibo-sdk."+this.constructor.name);return t?JSON.parse(t):void 0}},onPaneActivated:{value:function(){}},onPaneDeactivated:{value:function(){}},getViewClass:{value:function(){return r(this.getReactClass(),this.constructor.name)}}},{deserialize:{value:function(t){return 0===t.filePath.search("atom:/")||n.existsSync(t.filePath)?new this(t.filePath):void console.warn("Could not deserialize "+this.constructor.name+" for path '"+t.filePath+"' because that file no longer exists")}}}),t}();module.exports=a;
|
||||
1
lib/atom-react/mixins/modal-mixin.js
Normal file
1
lib/atom-react/mixins/modal-mixin.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},$=t(require("jquery")),a=t(require("react")),e={createModal:function(t,e){this._modalContainer=$("<div/>"),e&&(this._modalContainer.width(e),this._modalContainer.addClass("modal-background")),a.render(t,this._modalContainer[0]),this.state=this.state?this.state:{},this.state.modalPanel=atom.workspace.addModalPanel({item:this._modalContainer})},destroyModal:function(){a.unmountComponentAtNode(this._modalContainer[0]),this.state.modalPanel&&(this.state.modalPanel.destroy(),this.state.modalPanel=void 0)}};module.exports=e;
|
||||
1
lib/atom-react/mixins/pane-resize-event-mixin.js
Normal file
1
lib/atom-react/mixins/pane-resize-event-mixin.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function e(e){var t=$(e).parents(".pane");return 0===t.size()&&(t=$(".item-views")),{width:t.width(),height:t.height()}}function t(t){var i=e(t.getDOMNode());t.setProps({paneWidth:i.width,paneHeight:i.height})}var i=function(e){return e&&e.__esModule?e["default"]:e},$=i(require("jquery")),n={setupPaneResizeEventMixin:function(){function i(n){try{var r=e(n.getDOMNode());(r.width!==n.props.paneWidth||r.height!==n.props.paneHeight)&&t(n),n.requestID=window.requestAnimationFrame(function(){i(n)})}catch(o){console.log(o)}}i(this)},cleanupPaneResizeEventMixin:function(){window.cancelAnimationFrame(this.requestID)}};module.exports=n;
|
||||
1
lib/atom-react/styleguide/styleguide-editor.js
Normal file
1
lib/atom-react/styleguide/styleguide-editor.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=function(){function e(e,t){for(var r in t){var n=t[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),r=function c(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var o=Object.getPrototypeOf(e);return null===o?void 0:c(o,t,r)}if("value"in n&&n.writable)return n.value;var u=n.get;if(void 0!==u)return u.call(r)},n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},u=e(require("../core/react-editor")),i=e(require("./styleguide-view")),a=function(e){function u(e){o(this,u),r(Object.getPrototypeOf(u.prototype),"constructor",this).call(this,e,!0)}return n(u,e),t(u,{getReactClass:{value:function(){return i}},saveFile:{value:function(){return!0}},getTitle:{value:function(){return"Styleguide"}},reload:{value:function(){}}}),u}(u);atom.deserializers.add(a),module.exports=a;
|
||||
1
lib/atom-react/styleguide/styleguide-view.js
Normal file
1
lib/atom-react/styleguide/styleguide-view.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},n=e(require("react")),i=e(require("../mixins/pane-resize-event-mixin")),t=n.createClass({displayName:"StyleguideView",mixins:[i],componentDidMount:function(){this.setupPaneResizeEventMixin()},componentWillUnmount:function(){this.cleanupPaneResizeEventMixin()},render:function(){return n.createElement("div",null)}});module.exports=t;
|
||||
Reference in New Issue
Block a user