Socket
Socket
Sign inDemoInstall

react-json-editor-ajrm

Package Overview
Dependencies
14
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.3 to 2.3.0

2

dist/index.js

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define("react-json-editor-ajrm",["React"],n):"object"==typeof exports?exports["react-json-editor-ajrm"]=n(require("react")):e["react-json-editor-ajrm"]=n(e.React)}("undefined"!=typeof self?self:this,function(e){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/dist/",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n,t){var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),a=t(2),l=(r=a)&&r.__esModule?r:{default:r};var c=function(e){function n(e){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));if(!("id"in t.props))throw"An 'id' property must be specified. Must be unique";t.createMarkup=t.createMarkup.bind(t),t.onClick=t.onClick.bind(t),t.onBlur=t.onBlur.bind(t),t.update=t.update.bind(t),t.renderLabels=t.renderLabels.bind(t),t.newSpan=t.newSpan.bind(t),t.renderErrorMessage=t.renderErrorMessage.bind(t),t.onScroll=t.onScroll.bind(t),t.showPlaceholder=t.showPlaceholder.bind(t),t.tokenize=t.tokenize.bind(t),t.onKeyPress=t.onKeyPress.bind(t),t.onKeyDown=t.onKeyDown.bind(t),t.onPaste=t.onPaste.bind(t),t.stopEvent=t.stopEvent.bind(t),t.uniqueID="AJRM-JSON-EDITOR-"+t.props.id;var r={},o={};r="colors"in t.props?{default:"default"in t.props.colors?t.props.colors.default:"#D4D4D4",string:"string"in t.props.colors?t.props.colors.string:"#CE8453",number:"number"in t.props.colors?t.props.colors.number:"#B5CE9F",colon:"colon"in t.props.colors?t.props.colors.colon:"#49B8F7",keys:"keys"in t.props.colors?t.props.colors.keys:"#9CDCFE",keys_whiteSpace:"keys_whiteSpace"in t.props.colors?t.props.colors.keys_whiteSpace:"#AF74A5",primitive:"primitive"in t.props.colors?t.props.colors.primitive:"#6392C6",error:"error"in t.props.colors?t.props.colors.error:"#ED0000",background:"background"in t.props.colors?t.props.colors.background:"#1E1E1E",background_warning:"background_warning"in t.props.colors?t.props.colors.background_warning:"#1E1E1E"}:{default:"#D4D4D4",string:"#CE8453",number:"#B5CE9F",colon:"#49B8F7",keys:"#9CDCFE",keys_whiteSpace:"#AF74A5",primitive:"#6392C6",error:"#ED0000",background:"#1E1E1E",background_warning:"#1E1E1E"},t.colors=r,o="style"in t.props?{outerBox:"outerBox"in t.props.style?t.props.style.outerBox:{},container:"container"in t.props.style?t.props.style.container:{},warningBox:"warningBox"in t.props.style?t.props.style.warningBox:{},errorMessage:"errorMessage"in t.props.style?t.props.style.errorMessage:{},body:"body"in t.props.style?t.props.style.body:{},labelColumn:"labelColumn"in t.props.style?t.props.style.labelColumn:{},labels:"labels"in t.props.style?t.props.style.labels:{},contentBox:"contentBox"in t.props.style?t.props.style.contentBox:{}}:{outerBox:{},container:{},warningBox:{},errorMessage:{},body:{},labelColumn:{},labels:{},contentBox:{}},t.style=o,t.confirmGood=!("confirmGood"in t.props)||t.props.confirmGood;var i="height"in t.props?parseInt(t.props.height.replace(/px/,""))+60+"px":"610px",s="width"in t.props?parseInt(t.props.width.replace(/px/,""))+"px":"479px",a=parseInt(i.replace(/px/,""))-60+"px",l=parseInt(s.replace(/px/,""))-44+"px",c=parseInt(s.replace(/px/,""))-60+"px";return t.totalHeight=i,t.totalWidth=s,t.bodyHeight=a,t.bodyWidth=l,t.messageWidth=c,t.renderCount=1,t.state={preText:"",markupText:"",plainText:"",json:"",jsObject:void 0,lines:!1,error:!1},t}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(n,a.Component),s(n,[{key:"render",value:function(){var e=this.state.markupText,n=this.state.error,t=this.uniqueID,r=this.colors,o=this.style,s=this.confirmGood,a=this.totalHeight,c=this.totalWidth,p=this.bodyHeight,u=this.bodyWidth,k=this.messageWidth,f=!!n&&"token"in n;return this.renderCount++,l.default.createElement("div",{name:"outer-box",id:t+"-outer-box",style:i({display:"block",overflow:"none",height:a,width:c,margin:0,boxSizing:"border-box",position:"relative"},o.outerBox)},s?l.default.createElement("div",{style:{opacity:f?0:1,height:"30px",width:"30px",position:"absolute",top:0,right:0,transform:"translate(-25%,25%)",pointerEvents:"none",transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"}},l.default.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},l.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"green",opacity:"0.85",d:"M39.363,79L16,55.49l11.347-11.419L39.694,56.49L72.983,23L84,34.085L39.363,79z"}))):void 0,l.default.createElement("div",{name:"container",id:t+"-container",style:i({display:"block",height:a,width:c,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},o.container),onClick:this.onClick},l.default.createElement("div",{name:"warning-box",id:t+"-warning-box",style:i({display:"block",overflow:"hidden",height:f?"60px":"0px",width:c,margin:0,backgroundColor:r.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},o.warningBox),onClick:this.onClick},l.default.createElement("span",{style:{display:"inline-block",height:"60px",width:"60px",margin:0,boxSizing:"border-box",overflow:"hidden",verticalAlign:"top",pointerEvents:"none"},onClick:this.onClick},l.default.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},l.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},l.default.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},l.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"red",d:"M73.9,5.75c0.467-0.467,1.067-0.7,1.8-0.7c0.7,0,1.283,0.233,1.75,0.7l16.8,16.8 c0.467,0.5,0.7,1.084,0.7,1.75c0,0.733-0.233,1.334-0.7,1.801L70.35,50l23.9,23.95c0.5,0.467,0.75,1.066,0.75,1.8 c0,0.667-0.25,1.25-0.75,1.75l-16.8,16.75c-0.534,0.467-1.117,0.7-1.75,0.7s-1.233-0.233-1.8-0.7L50,70.351L26.1,94.25 c-0.567,0.467-1.167,0.7-1.8,0.7c-0.667,0-1.283-0.233-1.85-0.7L5.75,77.5C5.25,77,5,76.417,5,75.75c0-0.733,0.25-1.333,0.75-1.8 L29.65,50L5.75,26.101C5.25,25.667,5,25.066,5,24.3c0-0.666,0.25-1.25,0.75-1.75l16.8-16.8c0.467-0.467,1.05-0.7,1.75-0.7 c0.733,0,1.333,0.233,1.8,0.7L50,29.65L73.9,5.75z"}))))),l.default.createElement("span",{style:{display:"inline-block",height:"60px",width:k,margin:0,overflow:"hidden",verticalAlign:"top",position:"absolute",pointerEvents:"none"},onClick:this.onClick},this.renderErrorMessage())),l.default.createElement("div",{name:"body",id:t+"-body",style:i({display:"block",overflow:"none",height:f?p:a,width:c,margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:r.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},o.body),onClick:this.onClick},l.default.createElement("div",{name:"labels",id:t+"-labels",style:i({display:"inline-block",boxSizing:"border-box",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},o.labelColumn),onClick:this.onClick},this.renderLabels()),l.default.createElement("div",{id:t+"-content-box",contentEditable:!0,style:i({display:"inline-block",boxSizing:"border-box",height:"100%",width:u,margin:0,padding:"5px",overflowX:"hidden",overflowY:"auto",wordWrap:"break-word",whiteSpace:"pre-line",color:"#D4D4D4",outline:"none"},o.contentBox),dangerouslySetInnerHTML:this.createMarkup(e),onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,onClick:this.onClick,onBlur:this.onBlur,onScroll:this.onScroll,onPaste:this.onPaste,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}))))}},{key:"renderErrorMessage",value:function(){var e=this.messageWidth,n=this.state.error,t=this.style;if(n)return l.default.createElement("p",{style:i({color:"red",fontSize:"12px",position:"absolute",width:e,height:"60px",boxSizing:"border-box",margin:0,padding:0,paddingRight:"10px",overflowWrap:"break-word",display:"flex",flexDirection:"column",justifyContent:"center"},t.errorMessage)},n.reason+" at line "+n.line)}},{key:"renderLabels",value:function(){for(var e=this.uniqueID+"-line-",n=this.colors,t=this.style,r=this.state.error?this.state.error.line:-1,o=this.state.lines?this.state.lines:1,s=new Array(o),a=0;a<o-1;a++)s[a]=a+1;return s.map(function(o){var s=o!==r?n.default:"red";return l.default.createElement("div",{key:e+o,id:e+o,style:i({},t.labels,{color:s})},o)})}},{key:"createMarkup",value:function(e){return void 0===e?{__html:""}:{__html:""+e}}},{key:"newSpan",value:function(e,n,t){var r=this.uniqueID+"-token-"+e+"-rc-"+this.renderCount,o=this.colors,i=n.type,s=n.string,a="";switch(i){case"string":case"number":case"primitive":case"error":a=o[n.type];break;case"key":a=" "===s?o.keys_whiteSpace:o.keys;break;case"symbol":a=":"===s?o.colon:o.default;break;default:a=o.default}return'<span id="'+r+'" key="'+r+'" type="'+i+'" value="'+s+'" depth="'+t+'" style="color:'+a+'">'+s+"</span>"}},{key:"update",value:function(){var e=this.uniqueID,n=document.getElementById(e+"-content-box"),t=this.tokenize(n);"onChange"in this.props&&this.props.onChange({plainText:t.indentation,markupText:t.markup,json:t.json,jsObject:t.jsObject,lines:t.lines,error:t.error}),this.setState({plainText:t.indentation,markupText:t.markup,json:t.json,jsObject:t.jsObject,lines:t.lines,error:t.error})}},{key:"stopEvent",value:function(e){e&&(e.preventDefault(),e.stopPropagation())}},{key:"onKeyPress",value:function(e){"viewOnly"in this.props&&this.props.viewOnly&&this.stopEvent(e)}},{key:"onKeyDown",value:function(e){"viewOnly"in this.props&&this.props.viewOnly&&this.stopEvent(e)}},{key:"onPaste",value:function(e){"viewOnly"in this.props&&this.props.viewOnly&&this.stopEvent(e),this.update()}},{key:"onClick",value:function(){"viewOnly"in this.props&&this.props.viewOnly}},{key:"onBlur",value:function(){"viewOnly"in this.props&&this.props.viewOnly||this.update()}},{key:"onScroll",value:function(e){var n=this.uniqueID;document.getElementById(n+"-labels").scrollTop=e.target.scrollTop}},{key:"componentDidUpdate",value:function(){this.showPlaceholder()}},{key:"componentDidMount",value:function(){var e=this.uniqueID;document.getElementById(e+"-content-box").addEventListener("paste",function(e){e.preventDefault();var n=e.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,n)}),this.showPlaceholder()}},{key:"showPlaceholder",value:function(){var e=this.state.preText;if("placeholder"in this.props){var n=this.props.placeholder;if(!([e,void 0,null].indexOf(n)>-1)&&"object"===(void 0===n?"undefined":o(n))){var t=this.tokenize(n);this.setState({preText:n,plainText:t.indentation,markupText:t.markup,lines:t.lines,error:t.error})}}}},{key:"tokenize",value:function(e){if("object"!==(void 0===e?"undefined":o(e)))return console.error("tokenize() expects object type properties only. Got '"+(void 0===e?"undefined":o(e))+"' type instead.");var n,t=this.newSpan;if("nodeType"in e){var r=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function r(e,r){switch(r){case"symbol":case"delimiter":t.active&&t.quarks.push({string:t[t.active],type:n+"-"+t.active}),t[t.active]="",t.active=r,t[t.active]=e;break;default:var o="\n"===e&&"string"===t.active&&t.string.length>0;r!==t.active||o?(t.active&&t.quarks.push({string:t[t.active],type:n+"-"+t.active}),t[t.active]="",t.active=r,t[t.active]=e):t[r]+=e}}for(var o=0;o<e.length;o++){var i=e.charAt(o);switch(i){case'"':case"'":r(i,"delimiter");break;case" ":case" ":r(i,"space");break;case"{":case"}":case"[":case"]":case":":case",":r(i,"symbol");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":"string"===t.active?r(i,"string"):r(i,"number");break;case"-":if(o<e.length-1&&"0123456789".indexOf(e.charAt(o+1))>-1){r(i,"number");break}case".":if(o<e.length-1&&o>0&&"0123456789".indexOf(e.charAt(o+1))>-1&&"0123456789".indexOf(e.charAt(o-1))>-1){r(i,"number");break}default:r(i,"string")}}return t.active&&(t.quarks.push({string:t[t.active],type:n+"-"+t.active}),t[t.active]="",t.active=!1),t.quarks},i=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;m={token:e,line:x,reason:n},u.tokens_merge[e+t].type="error"},s=function(e,n){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===n&&console.error("options argument must be an array."),e===u.tokens_merge.length-1)return!1;for(var t=e+1;t<u.tokens_merge.length;t++){var r=u.tokens_merge[t];switch(r.type){case"space":case"linebreak":break;case"symbol":case"colon":return n.indexOf(r.string)>-1&&t;default:return!1}}return!1},a=function(e,n){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===n&&console.error("options argument must be an array."),0===e)return!1;for(var t=e-1;t>=0;t--){var r=u.tokens_merge[t];switch(r.type){case"space":case"linebreak":break;case"symbol":case"colon":return n.indexOf(r.string)>-1;default:return!1}}return!1},l=function(e){if(void 0===e&&console.error("tokenID argument must be an integer."),0===e)return!1;for(var n=e-1;n>=0;n--){var t=u.tokens_merge[n];switch(t.type){case"space":case"linebreak":break;default:return t.type}}return!1},c=function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return J++,X>0||e?"<br>":""}(arguments.length>0&&void 0!==arguments[0]&&arguments[0])+function(){for(var e=[],n=0;n<2*X;n++)e.push("&nbsp;");return e.join("")}()},p=e.cloneNode(!0);if(!p.hasChildNodes())return"";var u={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};p.childNodes.forEach(function(e,n){var t={};switch(e.nodeName){case"SPAN":t={string:e.textContent,type:e.attributes.type.textContent},u.tokens_unknown.push(t);case"BR":""===e.textContent&&u.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":u.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":u.tokens_unknown.push({string:e.textContent,type:"unknown"})}}),u.tokens_unknown.forEach(function(e,n){u.tokens_proto=u.tokens_proto.concat(r(e.string,"proto"))}),u.tokens_proto.forEach(function(e,n){-1===e.type.indexOf("proto")&&!function(e,n){var t="",r="",o=!1;switch(n){case"primitive":if(-1===["true","false","null","undefined"].indexOf(e))return!1;break;case"string":if(e.length<2)return!1;if(t=e.charAt(0),r=e.charAt(e.length-1),-1===(o="'\"".indexOf(t)))return!1;if(t!==r)return!1;for(var i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[o]&&"\\"!==e.charAt(i-1))return!1;break;case"key":if(0===e.length)return!1;if(t=e.charAt(0),r=e.charAt(e.length-1),(o="'\"".indexOf(t))>-1){if(1===e.length)return!1;if(t!==r)return!1;for(i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[o]&&"\\"!==e.charAt(i-1))return!1}else for(i=0;i<"'\"`.,:;{}[]&<>=~*%<>\\|/-+!?@^  ".length;i++){var s="'\"`.,:;{}[]&<>=~*%<>\\|/-+!?@^  ".charAt(i);if(e.indexOf(s)>-1)return!1}break;case"number":for(i=0;i<e.length;i++)if(-1==="0123456789".indexOf(e.charAt(i)))if(0===i){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(i))return!1;break;case"symbol":if(e.length>1)return!1;if(-1==="{[:]},".indexOf(e))return!1;break;case"colon":if(e.length>1)return!1;if(":"!==e)return!1;break;default:return!0}return!0}(e.string,e.type)?u.tokens_split=u.tokens_split.concat(r(e.string,"split")):u.tokens_split.push(e)}),u.tokens_split.forEach(function(e){var n=e.type,t=e.string,r=t.length,o=[];n.indexOf("-")>-1&&("string"!==(n=n.slice(n.indexOf("-")+1))&&o.push("string"),o.push("key"),o.push("error"));var i={string:t,length:r,type:n,fallback:o};u.tokens_fallback.push(i)});var k={brackets:[],stringOpen:!1,isValue:!1};u.tokens_fallback.forEach(function(e,n){var t=e.type,r=e.string,o={type:t,string:r};switch(t){case"symbol":case"colon":if(k.stringOpen){k.isValue?o.type="string":o.type="key";break}switch(r){case"[":case"{":k.brackets.push(r),k.isValue="["===k.brackets[k.brackets.length-1];break;case"]":case"}":k.brackets.pop(),k.isValue="["===k.brackets[k.brackets.length-1];break;case",":if("colon"===function(){var e=u.tokens_normalize.length-1;if(e<1)return!1;for(var n=e;n>=0;n--){var t=u.tokens_normalize[n];switch(t.type){case"space":case"linebreak":break;default:return t}}return!1}().type)break;k.isValue="["===k.brackets[k.brackets.length-1];break;case":":o.type="colon",k.isValue=!0}break;case"delimiter":if(k.isValue?o.type="string":o.type="key",!k.stringOpen){k.stringOpen=r;break}if(n>0){var i=u.tokens_fallback[n-1],s=i.string,a=i.type,l=s.charAt(s.length-1);if("string"===a&&"\\"===l)break}if(k.stringOpen===r){k.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(r)>-1){o.type="primitive";break}if("\n"===r&&!k.stringOpen){o.type="linebreak";break}k.isValue?o.type="string":o.type="key";break;case"space":case"number":k.stringOpen&&(k.isValue?o.type="string":o.type="key")}u.tokens_normalize.push(o)});for(var f=0;f<u.tokens_normalize.length;f++){var d=u.tokens_normalize[f],b={string:d.string,type:d.type,tokens:[f]};if(-1===["symbol","colon"].indexOf(d.type)&&f+1<u.tokens_normalize.length){for(var h=0,g=f+1;g<u.tokens_normalize.length;g++){var y=u.tokens_normalize[g];if(d.type!==y.type)break;b.string+=y.string,b.tokens.push(g),h++}f+=h}u.tokens_merge.push(b)}var v="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$",m=!1,x=u.tokens_merge.length>0?1:0;k={brackets:[],stringOpen:!1,isValue:!1};var w=[];for(f=0;f<u.tokens_merge.length&&!m;f++){var O=u.tokens_merge[f],C=O.string,_=O.type,E=!1;switch(_){case"space":break;case"linebreak":x++;break;case"symbol":switch(C){case"{":case"[":if(E=a(f,["}","]"])){i(f,"'"+u.tokens_merge[E].string+"' token cannot be followed by '"+C+"' token");break}if("["===C&&f>0&&!a(f,[":","[",","])){i(f,"'[' token can only follow ':', '[', and ',' tokens");break}if("{"===C&&a(f,["{"])){i(f,"'{' token cannot follow another '{' token");break}k.brackets.push(C),k.isValue="["===k.brackets[k.brackets.length-1],w.push({i:f,line:x,string:C});break;case"}":case"]":if("}"===C&&"{"!==k.brackets[k.brackets.length-1]){i(f,"Missing '{' open curly brace");break}if("}"===C&&a(f,[","])){i(f,"'}' token cannot follow a comma");break}if("]"===C&&"["!==k.brackets[k.brackets.length-1]){i(f,"Missing '[' open brace");break}if("]"===C&&a(f,[":"])){i(f,"']' token cannot follow a colon");break}k.brackets.pop(),k.isValue="["===k.brackets[k.brackets.length-1],w.push({i:f,line:x,string:C});break;case",":if(E=a(f,["{"])){if(s(f,["}"])){i(f,"Comma can only be wrapped by brackets");break}i(f,"Comma cannot follow '{' token");break}if(s(f,["}",",","]"])){i(f,"Values are always specified. Comma cannot be followed by '}', ']' tokens or another comma");break}switch(E=l(f)){case"key":case"colon":i(f,"Comma cannot follow "+E);break;case"symbol":if(a(f,["{"])){i(f,"Comma cannot follow '{' token");break}}k.isValue="["===k.brackets[k.brackets.length-1]}u.json+=C;break;case"colon":if((E=a(f,["["]))&&s(f,["]"])){i(f,"Colon can only be wrapped by curly brackets");break}if(E){i(f,"Colon cannot follow '[' token");break}if("key"!==l(f)){i(f,"Colon can only follow key");break}k.isValue=!0,u.json+=C;break;case"key":case"string":var j=C.charAt(0),S=C.charAt(C.length-1);"'\"".indexOf(j);if(-1==="'\"".indexOf(j)&&-1!=="'\"".indexOf(S)){i(f,"Missing opening "+S+" quote on "+_);break}if(-1==="'\"".indexOf(S)&&-1!=="'\"".indexOf(j)){i(f,"Missing closing "+j+" quote on "+_);break}if("'\"".indexOf(j)>-1&&j!==S){i(f,"Missing closing "+j+" quote on "+_);break}if("string"===_&&-1==="'\"".indexOf(j)&&-1==="'\"".indexOf(S)){i(f,"String must be wrapped by quotes");break}if("key"===_&&"'\"".indexOf(j)>-1&&C.length<=2){i(f,"Key cannot be an empty string");break}if("key"===_&&-1==="'\"".indexOf(j)&&-1==="'\"".indexOf(S))for(var D=0;D<C.length&&!m;D++){var T=C.charAt(D);if(-1===v.indexOf(T)){i(f,"Non-alphanemeric token '"+T+"' is not allowed outside string notation");break}}if("'"===j?C='"'+C.slice(1,-1)+'"':'"'!==j&&(C='"'+C+'"'),"key"===_&&"key"===l(f)){i(f,"Key containing space must be wrapped by quotes");break}if("key"===_&&!a(f,["{",","])){i(f,"Key can only follow '{' or ',' tokens");break}if("string"===_&&!a(f,["[",":",","])){i(f,_+" can only follow '[' ':' ',' tokens");break}if("key"===_&&k.isValue){i(f,"Unexpected key found at value position");break}if("string"===_&&!k.isValue){i(f,"Unexpected string found at key position");break}u.json+=C;break;case"number":case"primitive":if(!a(f,["[",":",","])){i(f,_+" can only follow '[' ':' ',' tokens");break}if(!k.isValue){i(f,"Unexpected "+_+" found at key position");break}"primitive"===_&&"undefined"===C&&i(f,"'undefined' token is not accepted. Use 'null' token instead"),u.json+=C}}if(!m){for(var A=Math.ceil(w.length/2),z=0,B=!1;w.length>0;){B=!1;for(var M=0;M<w.length-1;M++){var V=w[M].string+w[M+1].string;["[]","{}"].indexOf(V)>-1&&(n=M,w.splice(n+1,1),w.splice(n,1),B||(B=!0))}if(z++,!B)break;if(z>=A)break}if(w.length>0){var P=w[0].string,I=w[0].i,q="["===P?"]":"}";x=w[0].line,i(I,"'"+P+"' token is missing closing '"+q+"' token")}}if(!m&&-1===[void 0,""].indexOf(u.json))try{u.jsObject=JSON.parse(u.json)}catch(e){var L=e.message,F=L.indexOf("position");if(-1===F)throw new Error("Error parsing failed");for(var K=L.substring(F+9,L.length),R=parseInt(K),N=0,W=0,H=!1,U=1,G=!1;N<R&&!G&&("linebreak"===(H=u.tokens_merge[W]).type&&U++,-1===["space","linebreak"].indexOf(H.type)&&(N+=H.string.length),!(N>=R));)W++,u.tokens_merge[W+1]||(G=!0);x=U,i(W,"Unexpected token '"+H.string+"' found")}this.colors;var J=1,X=0;if(!m)for(f=0;f<u.tokens_merge.length;f++){var Y=u.tokens_merge[f],Q=Y.string;switch(Y.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":u.markup+=(a(f,[",","["])?c():"")+t(f,Y,X);break;case"key":u.markup+=c()+t(f,Y,X);break;case"colon":u.markup+=t(f,Y,X)+"&nbsp;";break;case"symbol":switch(Q){case"[":case"{":u.markup+=(a(f,[":"])?"":c())+t(f,Y,X),X++;break;case"]":case"}":X--;var Z=f===u.tokens_merge.length-1,$=f>0?["[","{"].indexOf(u.tokens_merge[f-1].string)>-1?"":c(Z):"";u.markup+=$+t(f,Y,X);break;case",":u.markup+=t(f,Y,X)}}}if(m){var ee=function(e){for(var n=0,t=0;t<e.length;t++)["\n","\r"].indexOf(e[t])>-1&&n++;return n},ne=1;J=1;for(f=0;f<u.tokens_merge.length;f++){var te=u.tokens_merge[f],re=te.type,oe=te.string;"linebreak"===re&&J++,u.markup+=t(f,te,X),ne+=ee(oe)}++J<++ne&&(J=ne)}return u.tokens_merge.forEach(function(e){u.indented+=e.string}),{tokens:u.tokens_merge,noSpaces:u.tokens_plainText,indented:u.indented,json:u.json,jsObject:u.jsObject,markup:u.markup,lines:J,error:m}}if(!("nodeType"in e)){var ie=function(e,n){return e.slice(0,n)+e.slice(n+1)},se=function(){if(-1==="'\"".indexOf(ke.currentChar))return!1;if(!ke.stringOpen)return le(),ke.stringStart=ke.position,ke.stringOpen=ke.currentChar,!0;if(ke.stringOpen===ke.currentChar){le();var e=ke.inputText.substring(ke.stringStart,ke.position+1);return ce(e),ke.stringOpen=!1,!0}return!1},ae=function(){if(-1===":,{}[]".indexOf(ke.currentChar))return!1;if(ke.stringOpen)return!1;switch(le(),ce(ke.currentChar),ke.currentChar){case":":return ke.isValue=!0,!0;case"{":case"[":ke.brackets.push(ke.currentChar);break;case"}":case"]":ke.brackets.pop()}return":"!==ke.currentChar&&(ke.isValue="["===ke.brackets[ke.brackets.length-1]),!0},le=function(){return 0!==ke.tokenSecondary.length&&(ke.tokens.push(ke.tokenSecondary),ke.tokenSecondary="",!0)},ce=function(e){return 0!==e.length&&(ke.tokens.push(e),!0)},pe=function(e){for(var n=[],t=0;t<2*e;t++)n.push(" ");return(e>0?"\n":"")+n.join("")},ue=function(e){var n=[];e>0&&ve++;for(var t=0;t<2*e;t++)n.push("&nbsp;");return(e>0?"<br>":"")+n.join("")},ke={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};for(f=0;f<ke.inputText.length;f++){ke.position=f,ke.currentChar=ke.inputText.charAt(ke.position);var fe=ae(),de=se(),be="\\"===ke.currentChar&&(ke.inputText=ie(ke.inputText,ke.position),!0);fe||de||be||ke.stringOpen||(ke.tokenSecondary+=ke.currentChar)}var he={brackets:[],isValue:!1,tokens:[]};he.tokens=ke.tokens.map(function(e){var n="",t="",r="";switch(e){case",":n="symbol",t=e,r=e,he.isValue="["===he.brackets[he.brackets.length-1];break;case":":n="symbol",t=e,r=e,he.isValue=!0;break;case"{":case"[":n="symbol",t=e,r=e,he.brackets.push(e),he.isValue="["===he.brackets[he.brackets.length-1];break;case"}":case"]":n="symbol",t=e,r=e,he.brackets.pop(),he.isValue="["===he.brackets[he.brackets.length-1];break;case"undefined":n="primitive",t=e,r=void 0;break;case"null":n="primitive",t=e,r=null;break;case"false":n="primitive",t=e,r=!1;break;case"true":n="primitive",t=e,r=!0;break;default:var o=e.charAt(0);if("'\"".indexOf(o)>-1){n=he.isValue?"string":"key",t=e.slice(1,-1),"key"===n&&t.indexOf(" ")>-1&&(t="'"+t+"'"),"string"===n&&(t=t.indexOf("'")>-1?'"'+t+'"':"'"+t+"'"),r=t;break}if("0123456789".indexOf(o)>-1){n="number",t=e,r=Number(e);break}if(e.length>0&&!he.isValue){n="key",(t=e).indexOf(" ")>-1&&(t="'"+t+"'"),r=t;break}}return{type:n,string:t,value:r,depth:he.brackets.length}});var ge="";he.tokens.forEach(function(e){ge+=e.string});var ye="";he.tokens.forEach(function(e,n){switch(e.string){case"[":case"{":var t=n<he.tokens.length-1-1?he.tokens[n+1]:"";-1==="}]".indexOf(t.string)?ye+=e.string+pe(e.depth):ye+=e.string;break;case"]":case"}":var r=n>0?he.tokens[n-1]:"";-1==="[{".indexOf(r.string)?ye+=pe(e.depth)+e.string:ye+=e.string;break;case":":ye+=e.string+" ";break;case",":ye+=e.string+pe(e.depth);break;default:ye+=e.string}});this.colors;var ve=1,me="",xe=he.tokens.length-1;return he.tokens.forEach(function(e,n){var r=t(n,e,e.depth);switch(e.string){case"{":case"[":var o=n<he.tokens.length-1-1?he.tokens[n+1]:"";-1==="}]".indexOf(o.string)?me+=r+ue(e.depth):me+=r;break;case"}":case"]":var i=n>0?he.tokens[n-1]:"";-1==="[{".indexOf(i.string)?me+=ue(e.depth)+(xe===n?"<br>":"")+r:me+=r;break;case":":me+=r+" ";break;case",":me+=r+ue(e.depth);break;default:me+=r}}),ve+=2,{tokens:he.tokens,noSpaces:ge,indented:ye,json:JSON.stringify(e),jsObject:e,markup:me,lines:ve}}}}]),n}();e.exports=c},function(n,t){n.exports=e}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("react-json-editor-ajrm",["React"],t):"object"==typeof exports?exports["react-json-editor-ajrm"]=t(require("react")):e["react-json-editor-ajrm"]=t(e.React)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(2),c=(r=a)&&r.__esModule?r:{default:r};var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(!("id"in n.props))throw"An 'id' property must be specified. Must be unique";n.randomString=n.randomString.bind(n),n.createMarkup=n.createMarkup.bind(n),n.onClick=n.onClick.bind(n),n.onBlur=n.onBlur.bind(n),n.update=n.update.bind(n),n.getCursorPosition=n.getCursorPosition.bind(n),n.setCursorPosition=n.setCursorPosition.bind(n),n.scheduledUpdate=n.scheduledUpdate.bind(n),n.setUpdateTime=n.setUpdateTime.bind(n),n.renderLabels=n.renderLabels.bind(n),n.newSpan=n.newSpan.bind(n),n.renderErrorMessage=n.renderErrorMessage.bind(n),n.onScroll=n.onScroll.bind(n),n.showPlaceholder=n.showPlaceholder.bind(n),n.tokenize=n.tokenize.bind(n),n.onKeyPress=n.onKeyPress.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.onPaste=n.onPaste.bind(n),n.stopEvent=n.stopEvent.bind(n),n.uniqueID="AJRM-JSON-EDITOR-"+n.randomString(10)+"-"+n.props.id,n.contentID=n.uniqueID+"-content-box";var r={},o={};r="colors"in n.props?{default:"default"in n.props.colors?n.props.colors.default:"#D4D4D4",string:"string"in n.props.colors?n.props.colors.string:"#CE8453",number:"number"in n.props.colors?n.props.colors.number:"#B5CE9F",colon:"colon"in n.props.colors?n.props.colors.colon:"#49B8F7",keys:"keys"in n.props.colors?n.props.colors.keys:"#9CDCFE",keys_whiteSpace:"keys_whiteSpace"in n.props.colors?n.props.colors.keys_whiteSpace:"#AF74A5",primitive:"primitive"in n.props.colors?n.props.colors.primitive:"#6392C6",error:"error"in n.props.colors?n.props.colors.error:"#ED0000",background:"background"in n.props.colors?n.props.colors.background:"#1E1E1E",background_warning:"background_warning"in n.props.colors?n.props.colors.background_warning:"#1E1E1E"}:{default:"#D4D4D4",string:"#CE8453",number:"#B5CE9F",colon:"#49B8F7",keys:"#9CDCFE",keys_whiteSpace:"#AF74A5",primitive:"#6392C6",error:"#ED0000",background:"#1E1E1E",background_warning:"#1E1E1E"},n.colors=r,o="style"in n.props?{outerBox:"outerBox"in n.props.style?n.props.style.outerBox:{},container:"container"in n.props.style?n.props.style.container:{},warningBox:"warningBox"in n.props.style?n.props.style.warningBox:{},errorMessage:"errorMessage"in n.props.style?n.props.style.errorMessage:{},body:"body"in n.props.style?n.props.style.body:{},labelColumn:"labelColumn"in n.props.style?n.props.style.labelColumn:{},labels:"labels"in n.props.style?n.props.style.labels:{},contentBox:"contentBox"in n.props.style?n.props.style.contentBox:{}}:{outerBox:{},container:{},warningBox:{},errorMessage:{},body:{},labelColumn:{},labels:{},contentBox:{}},n.style=o,n.confirmGood=!("confirmGood"in n.props)||n.props.confirmGood;var i="height"in n.props?parseInt(n.props.height.replace(/px/,""))+60+"px":"610px",s="width"in n.props?parseInt(n.props.width.replace(/px/,""))+"px":"479px",a=parseInt(i.replace(/px/,""))-60+"px",c=parseInt(s.replace(/px/,""))-44+"px",l=parseInt(s.replace(/px/,""))-60+"px";return n.totalHeight=i,n.totalWidth=s,n.bodyHeight=a,n.bodyWidth=c,n.messageWidth=l,n.renderCount=1,"onKeyPressUpdate"in n.props&&!n.props.onKeyPressUpdate||(n.timer=setInterval(n.scheduledUpdate,100)),n.updateTime=!1,n.waitAfterKeyPress="waitAfterKeyPress"in n.props?n.props.waitAfterKeyPress:1e3,n.state={preText:"",markupText:"",plainText:"",json:"",jsObject:void 0,lines:!1,error:!1},n}return 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&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.Component),s(t,[{key:"render",value:function(){var e=this.state.markupText,t=this.state.error,n=this.uniqueID,r=this.contentID,o=this.colors,s=this.style,a=this.confirmGood,l=this.totalHeight,p=this.totalWidth,u=this.bodyHeight,d=this.bodyWidth,f=this.messageWidth,k=!!t&&"token"in t;return this.renderCount++,c.default.createElement("div",{name:"outer-box",id:n+"-outer-box",style:i({display:"block",overflow:"none",height:l,width:p,margin:0,boxSizing:"border-box",position:"relative"},s.outerBox)},a?c.default.createElement("div",{style:{opacity:k?0:1,height:"30px",width:"30px",position:"absolute",top:0,right:0,transform:"translate(-25%,25%)",pointerEvents:"none",transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"}},c.default.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},c.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"green",opacity:"0.85",d:"M39.363,79L16,55.49l11.347-11.419L39.694,56.49L72.983,23L84,34.085L39.363,79z"}))):void 0,c.default.createElement("div",{name:"container",id:n+"-container",style:i({display:"block",height:l,width:p,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},s.container),onClick:this.onClick},c.default.createElement("div",{name:"warning-box",id:n+"-warning-box",style:i({display:"block",overflow:"hidden",height:k?"60px":"0px",width:p,margin:0,backgroundColor:o.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},s.warningBox),onClick:this.onClick},c.default.createElement("span",{style:{display:"inline-block",height:"60px",width:"60px",margin:0,boxSizing:"border-box",overflow:"hidden",verticalAlign:"top",pointerEvents:"none"},onClick:this.onClick},c.default.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},c.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},c.default.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},c.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"red",d:"M73.9,5.75c0.467-0.467,1.067-0.7,1.8-0.7c0.7,0,1.283,0.233,1.75,0.7l16.8,16.8 c0.467,0.5,0.7,1.084,0.7,1.75c0,0.733-0.233,1.334-0.7,1.801L70.35,50l23.9,23.95c0.5,0.467,0.75,1.066,0.75,1.8 c0,0.667-0.25,1.25-0.75,1.75l-16.8,16.75c-0.534,0.467-1.117,0.7-1.75,0.7s-1.233-0.233-1.8-0.7L50,70.351L26.1,94.25 c-0.567,0.467-1.167,0.7-1.8,0.7c-0.667,0-1.283-0.233-1.85-0.7L5.75,77.5C5.25,77,5,76.417,5,75.75c0-0.733,0.25-1.333,0.75-1.8 L29.65,50L5.75,26.101C5.25,25.667,5,25.066,5,24.3c0-0.666,0.25-1.25,0.75-1.75l16.8-16.8c0.467-0.467,1.05-0.7,1.75-0.7 c0.733,0,1.333,0.233,1.8,0.7L50,29.65L73.9,5.75z"}))))),c.default.createElement("span",{style:{display:"inline-block",height:"60px",width:f,margin:0,overflow:"hidden",verticalAlign:"top",position:"absolute",pointerEvents:"none"},onClick:this.onClick},this.renderErrorMessage())),c.default.createElement("div",{name:"body",id:n+"-body",style:i({display:"block",overflow:"none",height:k?u:l,width:p,margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:o.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},s.body),onClick:this.onClick},c.default.createElement("div",{name:"labels",id:n+"-labels",style:i({display:"inline-block",boxSizing:"border-box",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},s.labelColumn),onClick:this.onClick},this.renderLabels()),c.default.createElement("div",{id:r,contentEditable:!0,style:i({display:"inline-block",boxSizing:"border-box",height:"100%",width:d,margin:0,padding:"5px",overflowX:"hidden",overflowY:"auto",wordWrap:"break-word",whiteSpace:"pre-line",color:"#D4D4D4",outline:"none"},s.contentBox),dangerouslySetInnerHTML:this.createMarkup(e),onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,onClick:this.onClick,onBlur:this.onBlur,onScroll:this.onScroll,onPaste:this.onPaste,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}))))}},{key:"renderErrorMessage",value:function(){var e=this.messageWidth,t=this.state.error,n=this.style;if(t)return c.default.createElement("p",{style:i({color:"red",fontSize:"12px",position:"absolute",width:e,height:"60px",boxSizing:"border-box",margin:0,padding:0,paddingRight:"10px",overflowWrap:"break-word",display:"flex",flexDirection:"column",justifyContent:"center"},n.errorMessage)},t.reason+" at line "+t.line)}},{key:"renderLabels",value:function(){for(var e=this.uniqueID+"-line-",t=this.colors,n=this.style,r=this.state.error?this.state.error.line:-1,o=this.state.lines?this.state.lines:1,s=new Array(o),a=0;a<o-1;a++)s[a]=a+1;return s.map(function(o){var s=o!==r?t.default:"red";return c.default.createElement("div",{key:e+o,id:e+o,style:i({},n.labels,{color:s})},o)})}},{key:"createMarkup",value:function(e){return void 0===e?{__html:""}:{__html:""+e}}},{key:"newSpan",value:function(e,t,n){var r=this.uniqueID+"-token-"+e+"-rc-"+this.renderCount,o=this.colors,i=t.type,s=t.string,a="";switch(i){case"string":case"number":case"primitive":case"error":a=o[t.type];break;case"key":a=" "===s?o.keys_whiteSpace:o.keys;break;case"symbol":a=":"===s?o.colon:o.default;break;default:a=o.default}return'<span id="'+r+'" key="'+r+'" type="'+i+'" value="'+s+'" depth="'+n+'" style="color:'+a+'">'+s+"</span>"}},{key:"randomString",value:function(e){if("number"!=typeof e)throw"@randomString: Expected 'length' to be a number";for(var t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n="",r=e;r>0;--r)n+=t[Math.floor(Math.random()*t.length)];return n}},{key:"getCursorPosition",value:function(){var e=this.contentID;var t=window.getSelection(),n=-1,r=void 0;if(t.focusNode&&function(t){for(;null!==t;){if(t.id===e)return!0;t=t.parentNode}return!1}(t.focusNode))for(r=t.focusNode,n=t.focusOffset;r&&r.id!==e;)if(r.previousSibling)n+=(r=r.previousSibling).textContent.length;else if(null===(r=r.parentNode))break;return n}},{key:"setCursorPosition",value:function(e){if(!([!1,null,void 0].indexOf(e)>-1)){var t=this.contentID;e>0?function(e){if(!(e<0)){var n=window.getSelection(),r=function e(t,n,r){if(r||((r=document.createRange()).selectNode(t),r.setStart(t,0)),0===n.count)r.setEnd(t,n.count);else if(t&&n.count>0)if(t.nodeType===Node.TEXT_NODE)t.textContent.length<n.count?n.count-=t.textContent.length:(r.setEnd(t,n.count),n.count=0);else for(var o=0;o<t.childNodes.length&&(r=e(t.childNodes[o],n,r),0!==n.count);o++);return r}(document.getElementById(t),{count:e});r&&(r.collapse(!1),n.removeAllRanges(),n.addRange(r))}}(e):document.getElementById(t).focus()}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.getCursorPosition()+e,n=this.contentID,r=document.getElementById(n),o=this.tokenize(r);"onChange"in this.props&&this.props.onChange({plainText:o.indentation,markupText:o.markup,json:o.json,jsObject:o.jsObject,lines:o.lines,error:o.error}),this.setState({plainText:o.indentation,markupText:o.markup,json:o.json,jsObject:o.jsObject,lines:o.lines,error:o.error}),this.updateTime=!1,this.setCursorPosition(t)}},{key:"scheduledUpdate",value:function(){if(!("onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate)){var e=this.updateTime;!1!==e&&(e>(new Date).getTime()||this.update())}}},{key:"setUpdateTime",value:function(){"onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate||(this.updateTime=(new Date).getTime()+this.waitAfterKeyPress)}},{key:"stopEvent",value:function(e){e&&(e.preventDefault(),e.stopPropagation())}},{key:"onKeyPress",value:function(e){"viewOnly"in this.props&&this.props.viewOnly&&this.stopEvent(e),this.setUpdateTime()}},{key:"onKeyDown",value:function(e){switch("viewOnly"in this.props&&this.props.viewOnly&&this.stopEvent(e),e.key){case"Backspace":case"Delete":return void this.setUpdateTime()}}},{key:"onPaste",value:function(e){"viewOnly"in this.props&&this.props.viewOnly&&this.stopEvent(e),this.update()}},{key:"onClick",value:function(){"viewOnly"in this.props&&this.props.viewOnly}},{key:"onBlur",value:function(){"viewOnly"in this.props&&this.props.viewOnly||this.update()}},{key:"onScroll",value:function(e){var t=this.uniqueID;document.getElementById(t+"-labels").scrollTop=e.target.scrollTop}},{key:"componentDidUpdate",value:function(){this.showPlaceholder(),"onKeyPressUpdate"in this.props&&!this.props.onKeyPressUpdate?this.timer&&(clearInterval(this.timer),this.timer=!1):this.timer||(this.timer=setInterval(this.scheduledUpdate,500))}},{key:"componentDidMount",value:function(){var e=this.contentID;document.getElementById(e).addEventListener("paste",function(e){e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,t)}),this.showPlaceholder()}},{key:"componentWillUnmount",value:function(){this.timer&&clearInterval(this.timer)}},{key:"showPlaceholder",value:function(){var e=this.state.preText;if("placeholder"in this.props){var t=this.props.placeholder;if(!([e,void 0,null].indexOf(t)>-1)&&"object"===(void 0===t?"undefined":o(t))){var n=this.tokenize(t);this.setState({preText:t,plainText:n.indentation,markupText:n.markup,lines:n.lines,error:n.error})}}}},{key:"tokenize",value:function(e){if("object"!==(void 0===e?"undefined":o(e)))return console.error("tokenize() expects object type properties only. Got '"+(void 0===e?"undefined":o(e))+"' type instead.");var t,n=this.newSpan;if("nodeType"in e){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function r(e,r){switch(r){case"symbol":case"delimiter":n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e;break;default:var o="\n"===e&&"string"===n.active&&n.string.length>0;r!==n.active||o?(n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e):n[r]+=e}}for(var o=0;o<e.length;o++){var i=e.charAt(o);switch(i){case'"':case"'":r(i,"delimiter");break;case" ":case" ":r(i,"space");break;case"{":case"}":case"[":case"]":case":":case",":r(i,"symbol");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":"string"===n.active?r(i,"string"):r(i,"number");break;case"-":if(o<e.length-1&&"0123456789".indexOf(e.charAt(o+1))>-1){r(i,"number");break}case".":if(o<e.length-1&&o>0&&"0123456789".indexOf(e.charAt(o+1))>-1&&"0123456789".indexOf(e.charAt(o-1))>-1){r(i,"number");break}default:r(i,"string")}}return n.active&&(n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=!1),n.quarks},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;v={token:e,line:x,reason:t},u.tokens_merge[e+n].type="error"},s=function(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),e===u.tokens_merge.length-1)return!1;for(var n=e+1;n<u.tokens_merge.length;n++){var r=u.tokens_merge[n];switch(r.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(r.string)>-1&&n;default:return!1}}return!1},a=function(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),0===e)return!1;for(var n=e-1;n>=0;n--){var r=u.tokens_merge[n];switch(r.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(r.string)>-1;default:return!1}}return!1},c=function(e){if(void 0===e&&console.error("tokenID argument must be an integer."),0===e)return!1;for(var t=e-1;t>=0;t--){var n=u.tokens_merge[t];switch(n.type){case"space":case"linebreak":break;default:return n.type}}return!1},l=function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return J++,X>0||e?"<br>":""}(arguments.length>0&&void 0!==arguments[0]&&arguments[0])+function(){for(var e=[],t=0;t<2*X;t++)e.push("&nbsp;");return e.join("")}()},p=e.cloneNode(!0);if(!p.hasChildNodes())return"";var u={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};p.childNodes.forEach(function(e,t){var n={};switch(e.nodeName){case"SPAN":n={string:e.textContent,type:e.attributes.type.textContent},u.tokens_unknown.push(n);case"BR":""===e.textContent&&u.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":u.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":u.tokens_unknown.push({string:e.textContent,type:"unknown"})}}),u.tokens_unknown.forEach(function(e,t){u.tokens_proto=u.tokens_proto.concat(r(e.string,"proto"))}),u.tokens_proto.forEach(function(e,t){-1===e.type.indexOf("proto")&&!function(e,t){var n="",r="",o=!1;switch(t){case"primitive":if(-1===["true","false","null","undefined"].indexOf(e))return!1;break;case"string":if(e.length<2)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),-1===(o="'\"".indexOf(n)))return!1;if(n!==r)return!1;for(var i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[o]&&"\\"!==e.charAt(i-1))return!1;break;case"key":if(0===e.length)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),(o="'\"".indexOf(n))>-1){if(1===e.length)return!1;if(n!==r)return!1;for(i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[o]&&"\\"!==e.charAt(i-1))return!1}else for(i=0;i<"'\"`.,:;{}[]&<>=~*%<>\\|/-+!?@^  ".length;i++){var s="'\"`.,:;{}[]&<>=~*%<>\\|/-+!?@^  ".charAt(i);if(e.indexOf(s)>-1)return!1}break;case"number":for(i=0;i<e.length;i++)if(-1==="0123456789".indexOf(e.charAt(i)))if(0===i){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(i))return!1;break;case"symbol":if(e.length>1)return!1;if(-1==="{[:]},".indexOf(e))return!1;break;case"colon":if(e.length>1)return!1;if(":"!==e)return!1;break;default:return!0}return!0}(e.string,e.type)?u.tokens_split=u.tokens_split.concat(r(e.string,"split")):u.tokens_split.push(e)}),u.tokens_split.forEach(function(e){var t=e.type,n=e.string,r=n.length,o=[];t.indexOf("-")>-1&&("string"!==(t=t.slice(t.indexOf("-")+1))&&o.push("string"),o.push("key"),o.push("error"));var i={string:n,length:r,type:t,fallback:o};u.tokens_fallback.push(i)});var d={brackets:[],stringOpen:!1,isValue:!1};u.tokens_fallback.forEach(function(e,t){var n=e.type,r=e.string,o={type:n,string:r};switch(n){case"symbol":case"colon":if(d.stringOpen){d.isValue?o.type="string":o.type="key";break}switch(r){case"[":case"{":d.brackets.push(r),d.isValue="["===d.brackets[d.brackets.length-1];break;case"]":case"}":d.brackets.pop(),d.isValue="["===d.brackets[d.brackets.length-1];break;case",":if("colon"===function(){var e=u.tokens_normalize.length-1;if(e<1)return!1;for(var t=e;t>=0;t--){var n=u.tokens_normalize[t];switch(n.type){case"space":case"linebreak":break;default:return n}}return!1}().type)break;d.isValue="["===d.brackets[d.brackets.length-1];break;case":":o.type="colon",d.isValue=!0}break;case"delimiter":if(d.isValue?o.type="string":o.type="key",!d.stringOpen){d.stringOpen=r;break}if(t>0){var i=u.tokens_fallback[t-1],s=i.string,a=i.type,c=s.charAt(s.length-1);if("string"===a&&"\\"===c)break}if(d.stringOpen===r){d.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(r)>-1){o.type="primitive";break}if("\n"===r&&!d.stringOpen){o.type="linebreak";break}d.isValue?o.type="string":o.type="key";break;case"space":case"number":d.stringOpen&&(d.isValue?o.type="string":o.type="key")}u.tokens_normalize.push(o)});for(var f=0;f<u.tokens_normalize.length;f++){var k=u.tokens_normalize[f],h={string:k.string,type:k.type,tokens:[f]};if(-1===["symbol","colon"].indexOf(k.type)&&f+1<u.tokens_normalize.length){for(var b=0,g=f+1;g<u.tokens_normalize.length;g++){var y=u.tokens_normalize[g];if(k.type!==y.type)break;h.string+=y.string,h.tokens.push(g),b++}f+=b}u.tokens_merge.push(h)}var m="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$",v=!1,x=u.tokens_merge.length>0?1:0;d={brackets:[],stringOpen:!1,isValue:!1};var w=[];for(f=0;f<u.tokens_merge.length&&!v;f++){var O=u.tokens_merge[f],C=O.string,E=O.type,_=!1;switch(E){case"space":break;case"linebreak":x++;break;case"symbol":switch(C){case"{":case"[":if(_=a(f,["}","]"])){i(f,"'"+u.tokens_merge[_].string+"' token cannot be followed by '"+C+"' token");break}if("["===C&&f>0&&!a(f,[":","[",","])){i(f,"'[' token can only follow ':', '[', and ',' tokens");break}if("{"===C&&a(f,["{"])){i(f,"'{' token cannot follow another '{' token");break}d.brackets.push(C),d.isValue="["===d.brackets[d.brackets.length-1],w.push({i:f,line:x,string:C});break;case"}":case"]":if("}"===C&&"{"!==d.brackets[d.brackets.length-1]){i(f,"Missing '{' open curly brace");break}if("}"===C&&a(f,[","])){i(f,"'}' token cannot follow a comma");break}if("]"===C&&"["!==d.brackets[d.brackets.length-1]){i(f,"Missing '[' open brace");break}if("]"===C&&a(f,[":"])){i(f,"']' token cannot follow a colon");break}d.brackets.pop(),d.isValue="["===d.brackets[d.brackets.length-1],w.push({i:f,line:x,string:C});break;case",":if(_=a(f,["{"])){if(s(f,["}"])){i(f,"Comma can only be wrapped by brackets");break}i(f,"Comma cannot follow '{' token");break}if(s(f,["}",",","]"])){i(f,"Values are always specified. Comma cannot be followed by '}', ']' tokens or another comma");break}switch(_=c(f)){case"key":case"colon":i(f,"Comma cannot follow "+_);break;case"symbol":if(a(f,["{"])){i(f,"Comma cannot follow '{' token");break}}d.isValue="["===d.brackets[d.brackets.length-1]}u.json+=C;break;case"colon":if((_=a(f,["["]))&&s(f,["]"])){i(f,"Colon can only be wrapped by curly brackets");break}if(_){i(f,"Colon cannot follow '[' token");break}if("key"!==c(f)){i(f,"Colon can only follow key");break}d.isValue=!0,u.json+=C;break;case"key":case"string":var j=C.charAt(0),S=C.charAt(C.length-1);"'\"".indexOf(j);if(-1==="'\"".indexOf(j)&&-1!=="'\"".indexOf(S)){i(f,"Missing opening "+S+" quote on "+E);break}if(-1==="'\"".indexOf(S)&&-1!=="'\"".indexOf(j)){i(f,"Missing closing "+j+" quote on "+E);break}if("'\"".indexOf(j)>-1&&j!==S){i(f,"Missing closing "+j+" quote on "+E);break}if("string"===E&&-1==="'\"".indexOf(j)&&-1==="'\"".indexOf(S)){i(f,"String must be wrapped by quotes");break}if("key"===E&&"'\"".indexOf(j)>-1&&C.length<=2){i(f,"Key cannot be an empty string");break}if("key"===E&&-1==="'\"".indexOf(j)&&-1==="'\"".indexOf(S))for(var D=0;D<C.length&&!v;D++){var T=C.charAt(D);if(-1===m.indexOf(T)){i(f,"Non-alphanemeric token '"+T+"' is not allowed outside string notation");break}}if("'"===j?C='"'+C.slice(1,-1)+'"':'"'!==j&&(C='"'+C+'"'),"key"===E&&"key"===c(f)){i(f,"Key containing space must be wrapped by quotes");break}if("key"===E&&!a(f,["{",","])){i(f,"Key can only follow '{' or ',' tokens");break}if("string"===E&&!a(f,["[",":",","])){i(f,E+" can only follow '[' ':' ',' tokens");break}if("key"===E&&d.isValue){i(f,"Unexpected key found at value position");break}if("string"===E&&!d.isValue){i(f,"Unexpected string found at key position");break}u.json+=C;break;case"number":case"primitive":if(!a(f,["[",":",","])){i(f,E+" can only follow '[' ':' ',' tokens");break}if(!d.isValue){i(f,"Unexpected "+E+" found at key position");break}"primitive"===E&&"undefined"===C&&i(f,"'undefined' token is not accepted. Use 'null' token instead"),u.json+=C}}if(!v){for(var P=Math.ceil(w.length/2),A=0,B=!1;w.length>0;){B=!1;for(var I=0;I<w.length-1;I++){var M=w[I].string+w[I+1].string;["[]","{}"].indexOf(M)>-1&&(t=I,w.splice(t+1,1),w.splice(t,1),B||(B=!0))}if(A++,!B)break;if(A>=P)break}if(w.length>0){var z=w[0].string,V=w[0].i,K="["===z?"]":"}";x=w[0].line,i(V,"'"+z+"' token is missing closing '"+K+"' token")}}if(!v&&-1===[void 0,""].indexOf(u.json))try{u.jsObject=JSON.parse(u.json)}catch(e){var U=e.message,N=U.indexOf("position");if(-1===N)throw new Error("Error parsing failed");for(var L=U.substring(N+9,U.length),q=parseInt(L),R=0,F=0,W=!1,H=1,G=!1;R<q&&!G&&("linebreak"===(W=u.tokens_merge[F]).type&&H++,-1===["space","linebreak"].indexOf(W.type)&&(R+=W.string.length),!(R>=q));)F++,u.tokens_merge[F+1]||(G=!0);x=H,i(F,"Unexpected token '"+W.string+"' found")}this.colors;var J=1,X=0;if(!v)for(f=0;f<u.tokens_merge.length;f++){var Y=u.tokens_merge[f],Q=Y.string;switch(Y.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":u.markup+=(a(f,[",","["])?l():"")+n(f,Y,X);break;case"key":u.markup+=l()+n(f,Y,X);break;case"colon":u.markup+=n(f,Y,X)+"&nbsp;";break;case"symbol":switch(Q){case"[":case"{":u.markup+=(a(f,[":"])?"":l())+n(f,Y,X),X++;break;case"]":case"}":X--;var Z=f===u.tokens_merge.length-1,$=f>0?["[","{"].indexOf(u.tokens_merge[f-1].string)>-1?"":l(Z):"";u.markup+=$+n(f,Y,X);break;case",":u.markup+=n(f,Y,X)}}}if(v){var ee=function(e){for(var t=0,n=0;n<e.length;n++)["\n","\r"].indexOf(e[n])>-1&&t++;return t},te=1;J=1;for(f=0;f<u.tokens_merge.length;f++){var ne=u.tokens_merge[f],re=ne.type,oe=ne.string;"linebreak"===re&&J++,u.markup+=n(f,ne,X),te+=ee(oe)}++J<++te&&(J=te)}return u.tokens_merge.forEach(function(e){u.indented+=e.string}),{tokens:u.tokens_merge,noSpaces:u.tokens_plainText,indented:u.indented,json:u.json,jsObject:u.jsObject,markup:u.markup,lines:J,error:v}}if(!("nodeType"in e)){var ie=function(e,t){return e.slice(0,t)+e.slice(t+1)},se=function(){if(-1==="'\"".indexOf(de.currentChar))return!1;if(!de.stringOpen)return ce(),de.stringStart=de.position,de.stringOpen=de.currentChar,!0;if(de.stringOpen===de.currentChar){ce();var e=de.inputText.substring(de.stringStart,de.position+1);return le(e),de.stringOpen=!1,!0}return!1},ae=function(){if(-1===":,{}[]".indexOf(de.currentChar))return!1;if(de.stringOpen)return!1;switch(ce(),le(de.currentChar),de.currentChar){case":":return de.isValue=!0,!0;case"{":case"[":de.brackets.push(de.currentChar);break;case"}":case"]":de.brackets.pop()}return":"!==de.currentChar&&(de.isValue="["===de.brackets[de.brackets.length-1]),!0},ce=function(){return 0!==de.tokenSecondary.length&&(de.tokens.push(de.tokenSecondary),de.tokenSecondary="",!0)},le=function(e){return 0!==e.length&&(de.tokens.push(e),!0)},pe=function(e){for(var t=[],n=0;n<2*e;n++)t.push(" ");return(e>0?"\n":"")+t.join("")},ue=function(e){var t=[];e>0&&me++;for(var n=0;n<2*e;n++)t.push("&nbsp;");return(e>0?"<br>":"")+t.join("")},de={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};for(f=0;f<de.inputText.length;f++){de.position=f,de.currentChar=de.inputText.charAt(de.position);var fe=ae(),ke=se(),he="\\"===de.currentChar&&(de.inputText=ie(de.inputText,de.position),!0);fe||ke||he||de.stringOpen||(de.tokenSecondary+=de.currentChar)}var be={brackets:[],isValue:!1,tokens:[]};be.tokens=de.tokens.map(function(e){var t="",n="",r="";switch(e){case",":t="symbol",n=e,r=e,be.isValue="["===be.brackets[be.brackets.length-1];break;case":":t="symbol",n=e,r=e,be.isValue=!0;break;case"{":case"[":t="symbol",n=e,r=e,be.brackets.push(e),be.isValue="["===be.brackets[be.brackets.length-1];break;case"}":case"]":t="symbol",n=e,r=e,be.brackets.pop(),be.isValue="["===be.brackets[be.brackets.length-1];break;case"undefined":t="primitive",n=e,r=void 0;break;case"null":t="primitive",n=e,r=null;break;case"false":t="primitive",n=e,r=!1;break;case"true":t="primitive",n=e,r=!0;break;default:var o=e.charAt(0);if("'\"".indexOf(o)>-1){t=be.isValue?"string":"key",n=e.slice(1,-1),"key"===t&&n.indexOf(" ")>-1&&(n="'"+n+"'"),"string"===t&&(n=n.indexOf("'")>-1?'"'+n+'"':"'"+n+"'"),r=n;break}if("0123456789".indexOf(o)>-1){t="number",n=e,r=Number(e);break}if(e.length>0&&!be.isValue){t="key",(n=e).indexOf(" ")>-1&&(n="'"+n+"'"),r=n;break}}return{type:t,string:n,value:r,depth:be.brackets.length}});var ge="";be.tokens.forEach(function(e){ge+=e.string});var ye="";be.tokens.forEach(function(e,t){switch(e.string){case"[":case"{":var n=t<be.tokens.length-1-1?be.tokens[t+1]:"";-1==="}]".indexOf(n.string)?ye+=e.string+pe(e.depth):ye+=e.string;break;case"]":case"}":var r=t>0?be.tokens[t-1]:"";-1==="[{".indexOf(r.string)?ye+=pe(e.depth)+e.string:ye+=e.string;break;case":":ye+=e.string+" ";break;case",":ye+=e.string+pe(e.depth);break;default:ye+=e.string}});this.colors;var me=1,ve="",xe=be.tokens.length-1;return be.tokens.forEach(function(e,t){var r=n(t,e,e.depth);switch(e.string){case"{":case"[":var o=t<be.tokens.length-1-1?be.tokens[t+1]:"";-1==="}]".indexOf(o.string)?ve+=r+ue(e.depth):ve+=r;break;case"}":case"]":var i=t>0?be.tokens[t-1]:"";-1==="[{".indexOf(i.string)?ve+=ue(e.depth)+(xe===t?"<br>":"")+r:ve+=r;break;case":":ve+=r+" ";break;case",":ve+=r+ue(e.depth);break;default:ve+=r}}),me+=2,{tokens:be.tokens,noSpaces:ge,indented:ye,json:JSON.stringify(e),jsObject:e,markup:ve,lines:me}}}}]),t}();e.exports=l},function(t,n){t.exports=e}])});
{
"name": "react-json-editor-ajrm-example",
"version": "1.0.0",
"version": "1.5.0",
"description": "A simple website to showcase react-json-editor-ajrm component",

@@ -14,3 +14,3 @@ "author": "andrew.redican.mejia@gmail.com",

"react-dom": "^16.2.0",
"react-json-editor-ajrm": "^2.1.6"
"react-json-editor-ajrm": "^2.3.0"
},

@@ -17,0 +17,0 @@ "devDependencies": {

{
"name": "react-json-editor-ajrm",
"version": "2.2.3",
"version": "2.3.0",
"description": "A stylish, editor-like, modular, react component for viewing, editing, and debugging javascript object syntax!",

@@ -5,0 +5,0 @@ "author": "andrew.redican.mejia@gmail.com",

@@ -43,4 +43,6 @@ # react-json-editor-ajrm

## Latest Release Notes [v2.2.3] - May 15, 2018
1. Code optimizations.
## Latest Release Notes [v2.3.0] - May 22, 2018
1. Component now rerenders on every keystroke by default, but can be opt-out. Delay can also be customized.
2. Cursor now gets positioned on the same place it was originally located after the content has been rerendered.
3. Other code optimizations.

@@ -63,5 +65,7 @@ ## Features

| [onChange]() | Whenever `onBlur` event takes place it will return content values | object | Optional |
| [confirmGood]() | Send `false` if you would like for the checkmark to confirm good syntax to be hidden. | boolean | Optional |
| [confirmGood]() | Send `false` if you would like for the checkmark to confirm good syntax to be hidden | boolean | Optional |
| [height]() | A shorthand property to set a specific height for the entire component | string | Optional |
| [width]() | A shorthand property to set a specific width for the entire component | string | Optional |
| [onKeyPressUpdate]() | Send `false` if you would like for component not to automatically update on key press | boolean | Optional |
| [waitAfterKeyPress]() | Amount of milliseconds to wait before re-rendering content after keypress. Value defaults to `1000` when not specified. In other words, component will update if there is no additional keystroke after the last one within 1 second. Less than `100` milliseconds does not makes a difference. | number | Optional |
| [colors]() | **Contains the following properties:** | object | Optional |

@@ -68,0 +72,0 @@ | colors.[default]() | Hex color code for any symbols, like curly `braces`, and `comma`. | string | Optional |

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc