flint-tools
Advanced tools
Comparing version 1.4.24 to 1.4.25
@@ -10,2 +10,3 @@ | ||
packages["keycode"] = require("keycode"); | ||
packages["babel-runtime/core-js/object/assign"] = require("babel-runtime/core-js/object/assign"); | ||
packages["babel-runtime/core-js/object/keys"] = require("babel-runtime/core-js/object/keys"); | ||
@@ -15,3 +16,2 @@ packages["md5-o-matic"] = require("md5-o-matic"); | ||
packages["mouse-event-offset"] = require("mouse-event-offset"); | ||
packages["babel-runtime/core-js/object/assign"] = require("babel-runtime/core-js/object/assign"); | ||
@@ -18,0 +18,0 @@ |
@@ -8,7 +8,7 @@ [ | ||
"keycode", | ||
"babel-runtime/core-js/object/assign", | ||
"babel-runtime/core-js/object/keys", | ||
"md5-o-matic", | ||
"ellipsize", | ||
"mouse-event-offset", | ||
"babel-runtime/core-js/object/assign" | ||
"mouse-event-offset" | ||
] |
@@ -1,2386 +0,3 @@ | ||
exports["flinttools"] = function(Flint,opts){(function(Flint){(function(){ | ||
Flint.file('close.js',function(require){ | ||
Flint.staticStyles('Close',{ | ||
'$':'#_flintdevtools .ViewClose'}, | ||
{ | ||
'$':{ | ||
position:'absolute', | ||
right:0, | ||
top:0, | ||
display:'flex', | ||
justifyContent:'center', | ||
alignItems:'center', | ||
lineHeight:1, | ||
opacity:0.15, | ||
cursor:'pointer', | ||
transition:'all ease-in 200ms'}}); | ||
Flint.viewRoots["Close"] = 'close'; | ||
Flint.view('Close',function(view,on,$){ | ||
;view.render(function(){ | ||
return view.el( | ||
['close',1], | ||
{onClick:view.props.onClick}, | ||
'x');}); | ||
$["$"] = function(_,_index){ | ||
return {fontSize:view.props.fontSize || 13, | ||
width:view.props.size || 50, | ||
height:view.props.size || 50,':hover':{ | ||
opacity:0.4}};};});});})(); | ||
//# sourceMappingURL=close.js.map | ||
(function(){ | ||
Flint.file("debounce.js",function(require){ | ||
// fancy debounce | ||
// detects if we are in autosave mode | ||
var sum=function sum(a,b){ | ||
return a + b;}; | ||
var Delay=300; | ||
var AutoDelay=800; | ||
var Avg=5000; | ||
var Clear=1000 * 10; | ||
var AutoDetectAvgDiff=1000; | ||
Flint.view("Debounce",function(view,on,$){ | ||
var showKey=undefined, | ||
timeout=undefined, | ||
lastTime=undefined, | ||
delay=undefined, | ||
curDelay=undefined, | ||
avgDiff=undefined; | ||
var isAutoSaving=false; | ||
var lastFew=[]; | ||
// dont update unless we want to | ||
view.pause(); | ||
on.props(function(){ | ||
// override | ||
if(view.props.force){ | ||
view.set("showKey",showKey = Math.random()); | ||
return show();} | ||
if(view.props.showKey && view.props.showKey == showKey)return; | ||
view.set("showKey",showKey = view.props.showKey); | ||
view.set("delay",delay = view.props.delay || Delay); | ||
view.set("curDelay",curDelay = curDelay || delay); | ||
// find diff | ||
var now=Date.now(); | ||
var diff=lastTime?now - lastTime:Avg; // or init to 5s | ||
view.set("lastTime",lastTime = now); | ||
// update queue | ||
view.set("lastFew",lastFew.unshift(diff),lastFew,true); | ||
if(lastFew.length > 3)view.set("lastFew",lastFew.pop(),lastFew,true); | ||
// if its been a while, clear running avg | ||
if(diff > Clear){ | ||
view.set("lastFew",lastFew = []);} | ||
// otherwise update avg | ||
else { | ||
if(lastFew.length == 3){ | ||
// find avg of last few | ||
view.set("avgDiff",avgDiff = lastFew.reduce(sum,0) / lastFew.length); | ||
// set autosaving | ||
view.set("isAutoSaving",isAutoSaving = avgDiff < AutoDetectAvgDiff); | ||
view.set("curDelay",curDelay = isAutoSaving?AutoDelay:delay);}} | ||
function show(){ | ||
if(view.props.onUpdate)view.props.onUpdate(); | ||
view.update();} | ||
// debounce | ||
clearTimeout(timeout); | ||
view.set("timeout",timeout = setTimeout(show,curDelay));});});});})(); | ||
//# sourceMappingURL=debounce.js.map | ||
(function(){ | ||
Flint.file('errors.js',function(require){ | ||
var browser=window._DT; | ||
var split=function split(s,i){ | ||
return [s.substring(0,i),s.substring(i,i + 1),s.substring(i + 1)];}; | ||
var isLive=function isLive(){ | ||
return browser.editor && browser.editor.live;}; | ||
function showFlintErrorDiv(){ | ||
setTimeout(function(){ | ||
var errors=document.querySelectorAll('.__flintError'); | ||
if(!errors.length)return; | ||
// add active class to show them | ||
[].forEach.call(errors,function(error){ | ||
if(error.className.indexOf('active') == -1)error.className += ' active';});}, | ||
isLive()?1000:0);} | ||
function niceRuntimeError(err){ | ||
if(err.file)err.file = err.file.replace(new RegExp('.*' + window.location.origin + '(\/[_]+\/)?'),''); | ||
if(err.file && err.file.indexOf('internals.js') >= 0){ | ||
if(err.message && err.message.indexOf('Cannot find module') == 0){ | ||
var badModule=err.message.match(/(fs|path)/); | ||
if(badModule && badModule.length){ | ||
err.file = 'imported module:'; | ||
err.message = 'Cannot import node-only module: ' + badModule[0];}}else | ||
{ | ||
err.message = 'Error in a locally required file. ' + err.message;}} | ||
if(err.message)err.niceMessage = err.message.replace(/Uncaught .*Error:\s*/,''); | ||
return err;} | ||
function niceNpmError(_ref){ | ||
var msg=_ref.msg; | ||
var name=_ref.name; | ||
if(msg)msg = msg.replace(/(npm WARN.*\n|ERR\!)/g,'').replace(/npm argv.*\n/g,'').replace(/npm node v.*\n/g,'').replace(/npm npm.*\n/g,'').replace(/npm code.*\n/g,'').replace(/npm peerinvalid /g,'').replace(/npm 404 /g,''); | ||
return {msg:msg,name:name};} | ||
var niceCompilerError=function niceCompilerError(err){ | ||
return niceCompilerMessage(fullStack(niceStack(err)));}; | ||
var replaceCompilerMsg=function replaceCompilerMsg(msg){ | ||
if(!msg)return ''; | ||
return msg.replace(/.*\.js\:/,'').replace(/\([0-9]+\:[0-9]+\)/,'').replace(/Line [0-9]+\:\s*/,'');}; | ||
var niceCompilerMessage=function niceCompilerMessage(err){ | ||
err.niceMessage = replaceCompilerMsg(err.message,err.fileName); | ||
return err;}; | ||
var matchErrorLine=/\>?\s*([0-9]*)\s*\|(.*)/g; | ||
var indicator=/\s*\|\s*\^\s*$/g; | ||
var fullStack=function fullStack(err){ | ||
if(!err)return; | ||
if(err.stack){ | ||
(function(){ | ||
err.fullStack = ['','','']; | ||
var index=0; | ||
err.stack.split("\n").forEach(function(line){ | ||
if(indicator.test(line))return; | ||
if(!matchErrorLine.test(line))return; | ||
var isLine=line[0] === '>'; | ||
if(isLine)index = 1; | ||
if(!isLine && index === 1)index = 2; | ||
var result=line.replace(matchErrorLine,'$1$2').replace(/^(\s*[0-9]+\s*)[;]/,'$1 '); | ||
err.fullStack[index] += result + "\n";});})();} | ||
return err;}; | ||
var niceStack=function niceStack(err){ | ||
if(!err)return; | ||
if(err.stack){ | ||
err.stack.split("\n").map(function(line){ | ||
if(line[0] === '>'){ | ||
var result=line; | ||
if(!result)return; | ||
// remove the babel " > |" before the line | ||
result = result.replace(/\>\s*[0-9]+\s*\|\s*/,''); | ||
result = replaceCompilerMsg(result); | ||
var colIndex=err.loc.column - 4; // 4 because we remove babel prefix | ||
err.niceStack = split(result,colIndex);}});} | ||
return err;}; | ||
var log=function log(){ | ||
if(false)console.log.apply(console,arguments);}; | ||
Flint.view('Errors',function(view,on,$){ | ||
view.pause(); | ||
var error=null; | ||
var compileError=null; | ||
var runtimeError=null; | ||
var npmError=null; | ||
/* only set error if there is an error, | ||
giving compile priority */ | ||
function setError(){ | ||
if(compileError)view.set('error',error = niceCompilerError(compileError));else if(runtimeError)view.set('error',error = niceRuntimeError(runtimeError));else { | ||
view.set('error',error = null);} | ||
log('tools: view.update()'); | ||
view.update();} | ||
function close(){ | ||
view.set('error',error = null); | ||
view.set('compileError',compileError = null); | ||
view.set('runtimeError',runtimeError = null); | ||
view.set('npmError',npmError = null); | ||
view.update();} | ||
browser.on('compile:error',function(){ | ||
log('compile:error'); | ||
view.set('compileError',compileError = browser.data.error); | ||
setError();}); | ||
browser.on('runtime:error',function(){ | ||
// if (runtimeError) return // prefer first error | ||
view.set('runtimeError',runtimeError = browser.data); | ||
log('runtime:error',runtimeError); | ||
setError();}); | ||
browser.on('npm:error',function(){ | ||
view.set('npmError',npmError = niceNpmError(browser.data.error)); | ||
log('npm:error',npmError); | ||
view.update();}); | ||
browser.on('runtime:success',function(){ | ||
log('runtime:success'); | ||
view.set('runtimeError',runtimeError = null); | ||
view.set('npmError',npmError = null); | ||
setError();}); | ||
browser.on('compile:success',function(){ | ||
log('compile:success'); | ||
view.set('compileError',compileError = null); | ||
view.set('npmError',npmError = null); | ||
setError();}); | ||
view.render(function(){ | ||
return view.el(['ErrorMessage',1],{ | ||
error:error, | ||
npmError:npmError, | ||
close:close});});}); | ||
var flintAddedLines=0; | ||
var last=function last(arr){ | ||
return arr[arr.length - 1];}; | ||
var fileName=function fileName(url){ | ||
return url && url.replace(/[\?\)].*/,'');}; | ||
var getLine=function getLine(err){ | ||
return err && (err.line || err.loc && err.loc.line);}; | ||
Flint.staticStyles('ErrorMessage',{ | ||
'$bar':'#_flintdevtools bar.ErrorMessage, #_flintdevtools .ErrorMessage.bar, #_flintdevtools .ViewErrorMessage.bar, #_flintdevtools .ErrorMessage > .bar', | ||
'$inner':'#_flintdevtools inner.ErrorMessage, #_flintdevtools .ErrorMessage.inner, #_flintdevtools .ViewErrorMessage.inner, #_flintdevtools .ErrorMessage > .inner', | ||
'$top':'#_flintdevtools top.ErrorMessage, #_flintdevtools .ErrorMessage.top, #_flintdevtools .ViewErrorMessage.top, #_flintdevtools .ErrorMessage > .top', | ||
'$where':'#_flintdevtools where.ErrorMessage, #_flintdevtools .ErrorMessage.where, #_flintdevtools .ViewErrorMessage.where, #_flintdevtools .ErrorMessage > .where', | ||
'$line':'#_flintdevtools line.ErrorMessage, #_flintdevtools .ErrorMessage.line, #_flintdevtools .ViewErrorMessage.line, #_flintdevtools .ErrorMessage > .line', | ||
'$flint':'#_flintdevtools flint.ErrorMessage, #_flintdevtools .ErrorMessage.flint, #_flintdevtools .ViewErrorMessage.flint, #_flintdevtools .ErrorMessage > .flint', | ||
'$shortError':'#_flintdevtools shortError.ErrorMessage, #_flintdevtools .ErrorMessage.shortError, #_flintdevtools .ViewErrorMessage.shortError, #_flintdevtools .ErrorMessage > .shortError', | ||
'$cur':'#_flintdevtools cur.ErrorMessage, #_flintdevtools .ErrorMessage.cur, #_flintdevtools .ViewErrorMessage.cur, #_flintdevtools .ErrorMessage > .cur', | ||
'$errCol':'#_flintdevtools errCol.ErrorMessage, #_flintdevtools .ErrorMessage.errCol, #_flintdevtools .ViewErrorMessage.errCol, #_flintdevtools .ErrorMessage > .errCol', | ||
'$ln':'#_flintdevtools ln.ErrorMessage, #_flintdevtools .ErrorMessage.ln, #_flintdevtools .ViewErrorMessage.ln, #_flintdevtools .ErrorMessage > .ln', | ||
'$flintline':'#_flintdevtools flintline.ErrorMessage, #_flintdevtools .ErrorMessage.flintline, #_flintdevtools .ViewErrorMessage.flintline, #_flintdevtools .ErrorMessage > .flintline'}, | ||
{ | ||
'$bar':{ | ||
display:'block', | ||
position:'fixed', | ||
left:0, | ||
transition:'all 200ms ease-in', | ||
right:0, | ||
fontFamily:'-apple-system, "San Francisco", Roboto, "Segou UI", "Helvetica Neue", Helvetica, Arial, sans-serif', | ||
fontWeight:300, | ||
color:'#fff', | ||
fontSize:'14px', | ||
padding:2, | ||
pointerEvents:'all', | ||
overflow:'scroll', | ||
zIndex:2147483647, | ||
boxShadow:'0 -6px 12px rgba(0,0,0,0.06)'}, | ||
'$inner':{ | ||
display:'block', | ||
maxHeight:200, | ||
overflowY:'scroll'}, | ||
'$top':{ | ||
padding:8, | ||
display:'block'}, | ||
'$where':{ | ||
display:'inline-block', | ||
pointerEvents:'all', | ||
fontWeight:300, | ||
color:'rgba(255,255,255,0.8)'}, | ||
'$line':{ | ||
display:'inline-block', | ||
whiteSpace:'pre', | ||
pointerEvents:'all'}, | ||
'$flint':{ | ||
display:'inline', | ||
fontWeight:700, | ||
color:'#fff'}, | ||
'$shortError':{ | ||
display:'inline', | ||
color:'rgba(255,255,255,0.7)'}, | ||
'$cur':{ | ||
background:'#fff'}, | ||
'$errCol':{ | ||
display:'inline', | ||
borderBottom:'2px solid #f5d64c', | ||
margin:-3, | ||
padding:3, | ||
color:'#fff'}, | ||
'$ln':{ | ||
padding:[0,20]}, | ||
'$flintline':{ | ||
whiteSpace:'pre', | ||
pointerEvents:'all', | ||
fontWeight:'flint'}}); | ||
Flint.view('ErrorMessage',function(view,on,$){ | ||
view.pause(); | ||
var hasError=false; | ||
var error={}; | ||
var npmError=undefined, | ||
fullStack=undefined; | ||
var line=getLine(view.props.error); | ||
var clearDelay=undefined; | ||
on.props(function(){ | ||
clearDelay && clearDelay(); | ||
view.set('npmError',npmError = view.props.npmError); | ||
view.set('hasError',hasError = !!(view.props.error || view.props.npmError)); | ||
view.set('error',error = view.props.error || error); // keep old | ||
view.set('line',line = getLine(error)); | ||
view.set('fullStack',fullStack = null); | ||
view.update(); | ||
// show full stack after a delay | ||
if(error){ | ||
view.set('clearDelay',clearDelay = on.delay(2500,function(){ | ||
if(hasError && error.fullStack){ | ||
view.set('fullStack',fullStack = error.fullStack); | ||
view.update();}}));}}); | ||
// update on editor state | ||
browser.emitter.on('editor:state',function(){ | ||
return setTimeout(view.update);}); | ||
view.render(function(){ | ||
return view.el( | ||
['Debounce',1], | ||
{ | ||
// delay more during live typing | ||
delay:isLive()?2000:1000, | ||
force:hasError === false, | ||
showKey:fullStack || error && error.message, | ||
onUpdate:showFlintErrorDiv}, | ||
view.el( | ||
['bar',1], | ||
null, | ||
view.el(['Close',1],{onClick:view.props.close,size:35}), | ||
Flint.iff(npmError) && view.el( | ||
['inner',1], | ||
{if:npmError}, | ||
view.el( | ||
['where',1], | ||
null, | ||
view.el( | ||
['flint',1], | ||
null, | ||
npmError.name)), | ||
' ', | ||
npmError.msg), | ||
view.el( | ||
['inner',2], | ||
null, | ||
view.el( | ||
['top',1], | ||
null, | ||
view.el( | ||
['where',2], | ||
null, | ||
view.el( | ||
['span',1], | ||
null, | ||
'In ', | ||
view.el( | ||
['flint',2], | ||
null, | ||
fileName(error.file))), | ||
view.el( | ||
['line',1], | ||
null, | ||
line?' line':'', | ||
' ', | ||
Flint.iff(line) && view.el( | ||
['flint',3], | ||
{if:line}, | ||
line - flintAddedLines))), | ||
' ', | ||
view.el( | ||
['shortError',1], | ||
null, | ||
(error.niceMessage || error.message || '').trim(), | ||
Flint.iff(error.niceStack) && view.el( | ||
['niceStack',1], | ||
{if:error.niceStack}, | ||
error.niceStack[0], | ||
view.el( | ||
['errCol',1], | ||
null, | ||
error.niceStack[1]), | ||
error.niceStack[2])), | ||
Flint.iff(error.help) && view.el( | ||
['help',1], | ||
{if:error.help}, | ||
error.help)), | ||
Flint.iff(fullStack) && view.el( | ||
['fullStack',1], | ||
{if:fullStack}, | ||
view.el( | ||
['ln',1], | ||
null, | ||
'' + fullStack[0]), | ||
view.el( | ||
['ln',2], | ||
{className:'cur'}, | ||
'' + fullStack[1]), | ||
view.el( | ||
['ln',3], | ||
null, | ||
'' + fullStack[2])))));}); | ||
var red='#cd423e'; | ||
$["bar"] = function(_,_index){ | ||
return {background:red,bottom:hasError?0:-100};}; | ||
var stack={ | ||
color:'rgba(255,255,255,0.85)', | ||
display:'inline', | ||
fontFamily:'Meslo, Menlo, Monaco, monospace', | ||
padding:[0,5]}; | ||
$["niceStack"] = function(_,_index){ | ||
return stack;}; | ||
$["fullStack"] = function(_,_index){ | ||
return [stack,{ | ||
maxHeight:fullStack?600:0, | ||
padding:fullStack?[10,0]:0, | ||
transition:'maxHeight ease-in 300ms', | ||
color:'rgba(0,0,0,0.85)', | ||
background:'rgba(255,255,255,0.9)', | ||
display:'block', | ||
whiteSpace:'pre', | ||
fontSize:14, | ||
borderRadius:3, | ||
margin:2}];};}); | ||
Flint.staticStyles('ErrorIcon',{ | ||
'$svg':'#_flintdevtools svg.ErrorIcon, #_flintdevtools .ErrorIcon.svg, #_flintdevtools .ViewErrorIcon.svg, #_flintdevtools .ErrorIcon > .svg'}, | ||
{ | ||
'$svg':{ | ||
width:19, | ||
fill:'red', | ||
margin:-4, | ||
marginLeft:3, | ||
marginRight:6, | ||
opacity:0.9}}); | ||
Flint.view('ErrorIcon',function(view,on,$){ | ||
;view.render(function(){ | ||
return view.el( | ||
['svg',1], | ||
{viewBox:'0 0 27.963 27.963'}, | ||
view.el(['path',1],{d:'M13.983,0C6.261,0,0.001,6.259,0.001,13.979c0,7.724,6.26,13.984,13.982,13.984s13.98-6.261,13.98-13.984 C27.963,6.259,21.705,0,13.983,0z M13.983,26.531c-6.933,0-12.55-5.62-12.55-12.553c0-6.93,5.617-12.548,12.55-12.548 c6.931,0,12.549,5.618,12.549,12.548C26.531,20.911,20.913,26.531,13.983,26.531z'}), | ||
view.el(['polygon',1],{points:'15.579,17.158 16.191,4.579 11.804,4.579 12.414,17.158'}), | ||
view.el(['path',2],{d:'M13.998,18.546c-1.471,0-2.5,1.029-2.5,2.526c0,1.443,0.999,2.528,2.444,2.528h0.056c1.499,0,2.469-1.085,2.469-2.528 C16.441,19.575,15.468,18.546,13.998,18.546z'}));});});});})(); | ||
//# sourceMappingURL=errors.js.map | ||
var _extends=require('babel-runtime/helpers/extends').default; | ||
var _toArray=require('babel-runtime/helpers/to-array').default; | ||
var _slicedToArray=require('babel-runtime/helpers/sliced-to-array').default; | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector.js',function(require){ | ||
var _keys=require('./keys'); | ||
var _libInspecting=require('./lib/inspecting'); | ||
var _libInspecting2=_interopRequireDefault(_libInspecting); | ||
var _lodash=require('lodash'); | ||
var removeHead=function removeHead(_ref){ | ||
var _ref2=_toArray(_ref); | ||
var l=_ref2[0]; | ||
var ls=_ref2.slice(1); | ||
return ls;}; | ||
var isAlt=function isAlt(cb){ | ||
return function(e){ | ||
return e.keyIdentifier === 'Alt' && cb();};}; | ||
var isEsc=function isEsc(cb){ | ||
return function(e){ | ||
return e.keyCode === 27 && cb();};}; | ||
var setLocal=function setLocal(k,v){ | ||
return localStorage.setItem('__flint.state.' + k,JSON.stringify(v));}; | ||
var getLocal=function getLocal(k,d){ | ||
return JSON.parse(localStorage.getItem('__flint.state.' + k)) || d;}; | ||
var round=Math.round; | ||
var highlighter=undefined; | ||
function positionHighlight(node){ | ||
var bounds=node.getBoundingClientRect(); | ||
var winW=window.innerWidth; | ||
var winH=window.innerHeight; | ||
var width=round(bounds.right - bounds.left); | ||
var height=round(bounds.bottom - bounds.top); | ||
var opacity=1; | ||
if(width >= winW && height >= winH)opacity = 0.2; | ||
highlighter.setAttribute('style','\n top: ' + round(bounds.top) + 'px;\n left: ' + round(bounds.left) + 'px;\n width: ' + width + 'px;\n height: ' + height + 'px;\n opacity: ' + opacity + ';\n ');} | ||
function hideHighlight(){ | ||
highlighter.setAttribute('style','');} | ||
function findPath(node){ | ||
if(!node || !node.getAttribute)return null; | ||
var flintid=node.__flintID; | ||
if(!flintid)return findPath(node.parentNode); | ||
positionHighlight(node); | ||
return flintid;} | ||
function tempActive(views){ | ||
return views.filter(function(v){ | ||
return !v.temp;}). | ||
length > 0;} | ||
function pathActive(views,path){ | ||
return views.filter(function(v){ | ||
return v.path == path;}). | ||
length > 0;} | ||
function removeTemp(views){ | ||
return views.filter(function(v){ | ||
return !v.temp;}). | ||
map(function(v){ | ||
return _extends({},v,{highlight:false});});} | ||
function addTemp(views,path){ | ||
return [{path:path,highlight:false,temp:true}].concat(views);} | ||
function setClosing(views,path){ | ||
return views.map(function(v){ | ||
if(v.path == path)v.closing = true; | ||
return v;});} | ||
function highlightPath(views,path){ | ||
return views.map(function(v){ | ||
if(v.path == path)v.highlight = true; | ||
return v;});} | ||
function toggleView(views,path){ | ||
if(pathActive(views,path)){ | ||
return views.map(function(v){ | ||
if(v.path == path)v.temp = true; | ||
return v;});}else | ||
{ | ||
var added={temp:false,highlight:false,closing:false,path:path}; | ||
return [].concat([added],views);}} | ||
function internal(){ | ||
return window._Flint;} | ||
function writeBack(path,writePath){ | ||
var Int=internal(); | ||
var cache=Int.getCache[path]; | ||
// update getCache | ||
writePath.reduce(function(acc,cur){ | ||
if(cur == 'root')return acc; | ||
if(!Array.isArray(cur))return acc[cur]; | ||
// is end of path: [key, val] | ||
var _cur=_slicedToArray(cur,2); | ||
var key=_cur[0]; | ||
var val=_cur[1]; | ||
var current=acc[key]; | ||
if(typeof current == 'number')val = +val; | ||
// write | ||
acc[key] = val;}, | ||
cache); | ||
Int.inspectorRefreshing = path; | ||
Int.getInitialStates[path](); | ||
Int.viewsAtPath[path].forceUpdate(); | ||
Int.inspectorRefreshing = null;} | ||
Flint.staticStyles('Inspector',{ | ||
'$':'#_flintdevtools .ViewInspector'}, | ||
{ | ||
'$':{ | ||
position:'fixed', | ||
top:0,right:0, | ||
padding:2}}); | ||
Flint.view('Inspector',function(view,on,$){ | ||
var clickOff=undefined, | ||
hoverOff=undefined, | ||
lastTarget=undefined; | ||
var hudActive=false; | ||
var views=[]; | ||
on.mount(function(){ | ||
view.set('hoverOff',hoverOff = on.mousemove(window,(0,_lodash.throttle)(mouseMove,40))); | ||
if(highlighter)return; | ||
highlighter = document.createElement('div'); | ||
highlighter.className = "_flintHighlighter"; | ||
document.body.appendChild(highlighter);}); | ||
// key events | ||
(0,_keys.onKeyDown)('esc',closeLast); | ||
var offAlt=undefined; | ||
var keysCorrect=function keysCorrect(_ref3){ | ||
var altKey=_ref3.altKey; | ||
var metaKey=_ref3.metaKey; | ||
return altKey && !metaKey;}; | ||
function checkInspect(e){ | ||
if(keysCorrect(e)){ | ||
// wait a little so were not toooo eager | ||
view.set('offAlt',offAlt = on.delay(180,function(){ | ||
if(keysCorrect(e)){ | ||
showInspect();}}));}else | ||
{ | ||
offAlt && offAlt(); | ||
hideInspect();}} | ||
on.keydown(window,checkInspect); | ||
on.keyup(window,checkInspect); | ||
function inspect(target){ | ||
internal().isInspecting = true; | ||
var path=findPath(target); | ||
if(path === null)return; | ||
view.set('views',views = removeTemp(views)); | ||
view.set('views',views = pathActive(views,path)?highlightPath(views,path):addTemp(views,path));} | ||
function mouseMove(_ref4){ | ||
var target=_ref4.target; | ||
var inspector=ReactDOM.findDOMNode(view); | ||
if(lastTarget != target){ | ||
if(inspector.contains(target))return; | ||
view.set('lastTarget',lastTarget = target); | ||
_libInspecting2.default.set(target); | ||
if(hudActive)inspect(lastTarget);}} | ||
function closeLast(){ | ||
if(!views.length)return; | ||
view.set('views',views = removeHead(views));} | ||
function close(path,e){ | ||
if(e)e.stopPropagation(); | ||
view.set('views',views = setClosing(views,path)); | ||
on.delay(200,function(){ | ||
view.set('views',views = views.filter(function(v){ | ||
return path != v.path;}));});} | ||
function glue(_ref5){ | ||
var target=_ref5.target; | ||
var inspector=ReactDOM.findDOMNode(view); | ||
if(inspector.contains(target))return; | ||
view.set('views',views = toggleView(removeTemp(views),findPath(target))); | ||
return false;} | ||
function showInspect(){ | ||
inspect(lastTarget); | ||
view.set('hudActive',hudActive = true); | ||
view.set('clickOff',clickOff = on.click(window,glue));} | ||
function hideInspect(){ | ||
internal().isInspecting = false; | ||
view.set('hudActive',hudActive = false); | ||
hideHighlight(); | ||
clickOff && clickOff(); | ||
view.set('views',views = removeTemp(views));} | ||
function onWriteBack(path,data){ | ||
writeBack(path,data); | ||
view.update();} | ||
;view.render(function(){ | ||
return Flint.range(views).map(function(_,_index){ | ||
return view.el(['Inspector.View',1,_,_index],_extends({ | ||
repeat:views, | ||
key:_.path}, | ||
_,{ | ||
writeBack:onWriteBack, | ||
onClose:function(e){ | ||
return close(_.path,e);}}));});});});});})(); | ||
//# sourceMappingURL=inspector.js.map | ||
var _Object$keys=require("babel-runtime/core-js/object/keys").default; | ||
(function(){ | ||
Flint.file("inspector/highlighter.js",function(require){ | ||
var isEmpty=function isEmpty(obj){ | ||
return _Object$keys(object).length === 0;}; | ||
Flint.view("Highlighter",function(view,on,$){ | ||
;view.render(function(){ | ||
return Flint.iff(!view.props.highlight || view.props.string.indexOf(view.props.highlight) === -1) && view.el( | ||
["name",1], | ||
{if:!view.props.highlight || view.props.string.indexOf(view.props.highlight) === -1}, | ||
view.props.string);}); | ||
view.render(function(){ | ||
return Flint.iff(view.props.highlight) && view.el( | ||
["span",1], | ||
{if:view.props.highlight}, | ||
Flint.range(view.props.string.split()).map(function(_,_index){ | ||
return view.el( | ||
["span",2,_,_index], | ||
{repeat:view.props.string.split()}, | ||
Flint.iff(_index > 0) && view.el( | ||
["highlight",1,_,_index], | ||
{if:_index > 0}, | ||
view.props.highlight), | ||
_);}));});});});})(); | ||
//# sourceMappingURL=highlighter.js.map | ||
var _extends=require('babel-runtime/helpers/extends').default; | ||
(function(){ | ||
Flint.file('inspector/label.js',function(require){ | ||
var _lodash=require('lodash'); | ||
Flint.staticStyles('Label',{ | ||
'$input':'#_flintdevtools input.Label, #_flintdevtools .Label.input, #_flintdevtools .ViewLabel.input, #_flintdevtools .Label > .input', | ||
'$focus':'#_flintdevtools focus.Label, #_flintdevtools .Label.focus, #_flintdevtools .ViewLabel.focus, #_flintdevtools .Label > .focus'}, | ||
{ | ||
'$input':{ | ||
position:'absolute', | ||
top:0, | ||
left:-1, | ||
right:0, | ||
color:'#333', | ||
padding:1, | ||
width:140, | ||
outline:'none', | ||
border:'none', | ||
opacity:0, | ||
boxShadow:'1px 1px 2px rgba(0,0,0,0.4)'}, | ||
'$focus':{ | ||
opacity:'1 !important'}}); | ||
Flint.view('Label',function(view,on,$){ | ||
var val=view.prop('val',undefined), | ||
editable=view.prop('editable',undefined), | ||
onSet=view.prop('onSet',undefined); | ||
on.props(function(){ | ||
val = view.getProp('val'); | ||
editable = view.getProp('editable'); | ||
onSet = view.getProp('onSet');}); | ||
var input=null; | ||
var focus=undefined, | ||
newVal=undefined; | ||
on.props(function(){ | ||
if(!focus)view.set('newVal',newVal = val);}); | ||
var onFocus=function onFocus(e){ | ||
if(!editable)return; | ||
if((0,_lodash.isBoolean)(val))return onSet(!val); | ||
view.set('focus',focus = true); | ||
e.stopPropagation();}; | ||
var onBlur=function onBlur(e){ | ||
view.set('focus',focus = false);}; | ||
var onChange=function onChange(e){ | ||
view.set('newVal',newVal = e.target.value); | ||
view.update({immediate:true}); | ||
if((0,_lodash.isNumber)(val)){ | ||
// dont let them change from num to str | ||
if(newVal === '' || isNaN(newVal))return;} | ||
// todo: debate | ||
if(newVal === 'false')view.set('newVal',newVal = false); | ||
if(newVal === 'true')view.set('newVal',newVal = true); | ||
onSet(newVal);}; | ||
var tabIndex=function tabIndex(editable){ | ||
return editable?{}:{tabIndex:5000,disabled:true};}; | ||
view.render(function(){ | ||
return view.el(['input',1],_extends({ | ||
defaultValue:val.toString(), | ||
value:newVal, | ||
className:{focus:focus}, | ||
size:Math.max(4,val && val.length || 0), | ||
spellCheck:false, | ||
onMouseDown:onFocus, | ||
onFocus:onFocus, | ||
onEnter:onBlur}, | ||
tabIndex(editable),{onFocus:onFocus,onBlur:onBlur,onChange:onChange}));}); | ||
$["input"] = function(_,_index){ | ||
return { // nice cursor on boolean toggle | ||
cursor:(0,_lodash.isBoolean)(val)?'pointer':'auto'};};});});})(); | ||
//# sourceMappingURL=label.js.map | ||
var _Object$keys=require('babel-runtime/core-js/object/keys').default; | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector/leaf.js',function(require){ | ||
var _md5OMatic=require('md5-o-matic'); | ||
var _md5OMatic2=_interopRequireDefault(_md5OMatic); | ||
var _libGetType=require('../lib/getType'); | ||
var _libGetType2=_interopRequireDefault(_libGetType); | ||
var _ellipsize=require('ellipsize'); | ||
var _ellipsize2=_interopRequireDefault(_ellipsize); | ||
var PATH_PREFIX='.root.'; | ||
var contains=function contains(string,substring){ | ||
return string.indexOf(substring) !== -1;}; | ||
var isPrimitive=function isPrimitive(v){ | ||
return (0,_libGetType2.default)(v) !== 'Object' && (0,_libGetType2.default)(v) !== 'Array';}; | ||
var noop=function noop(){}; | ||
Flint.staticStyles('Leaf',{ | ||
'$leaf':'#_flintdevtools .ViewLeaf', | ||
'$helper':'#_flintdevtools helper.Leaf, #_flintdevtools .Leaf.helper, #_flintdevtools .ViewLeaf.helper, #_flintdevtools .Leaf > .helper', | ||
'$boolean':'#_flintdevtools boolean.Leaf, #_flintdevtools .Leaf.boolean, #_flintdevtools .ViewLeaf.boolean, #_flintdevtools .Leaf > .boolean', | ||
'$number':'#_flintdevtools number.Leaf, #_flintdevtools .Leaf.number, #_flintdevtools .ViewLeaf.number, #_flintdevtools .Leaf > .number', | ||
'$string':'#_flintdevtools string.Leaf, #_flintdevtools .Leaf.string, #_flintdevtools .ViewLeaf.string, #_flintdevtools .Leaf > .string', | ||
'$function':'#_flintdevtools function.Leaf, #_flintdevtools .Leaf.function, #_flintdevtools .ViewLeaf.function, #_flintdevtools .Leaf > .function', | ||
'$colon':'#_flintdevtools colon.Leaf, #_flintdevtools .Leaf.colon, #_flintdevtools .ViewLeaf.colon, #_flintdevtools .Leaf > .colon', | ||
'$name':'#_flintdevtools name.Leaf, #_flintdevtools .Leaf.name, #_flintdevtools .ViewLeaf.name, #_flintdevtools .Leaf > .name', | ||
'$children':'#_flintdevtools children.Leaf, #_flintdevtools .Leaf.children, #_flintdevtools .ViewLeaf.children, #_flintdevtools .Leaf > .children', | ||
'$type':'#_flintdevtools type.Leaf, #_flintdevtools .Leaf.type, #_flintdevtools .ViewLeaf.type, #_flintdevtools .Leaf > .type'}, | ||
{ | ||
'$leaf':{ | ||
padding:[1,0], | ||
fontSize:13}, | ||
'$helper':{color:'#ffff05'}, | ||
'$boolean':{color:'#32a3cd',fontWeight:700}, | ||
'$number':{color:'#b92222',marginTop:2,fontWeight:500}, | ||
'$string':{color:'#698c17'}, | ||
'$function':{marginLeft:10,marginTop:2,color:'#962eba'}, | ||
'$colon':{ | ||
opacity:0.3, | ||
color:'#000'}, | ||
'$name':{ | ||
color:"#ff2f2f", | ||
fontWeight:400, | ||
margin:['auto',0]}, | ||
'$children':{ | ||
paddingLeft:10}, | ||
'$type':{ | ||
margin:[1,0,0,8], | ||
opacity:0.7, | ||
flexFlow:'row'}}); | ||
Flint.viewRoots["Leaf"] = 'leaf'; | ||
Flint.view('Leaf',function(view,on,$){ | ||
var isExpanded=view.prop('isExpanded',undefined), | ||
data=view.prop('data',undefined), | ||
prefix=view.prop('prefix',undefined), | ||
query=view.prop('query',undefined), | ||
label=view.prop('label',undefined), | ||
id=view.prop('id',undefined), | ||
editable=view.prop('editable',undefined); | ||
on.props(function(){ | ||
isExpanded = view.getProp('isExpanded'); | ||
data = view.getProp('data'); | ||
prefix = view.getProp('prefix'); | ||
query = view.getProp('query'); | ||
label = view.getProp('label'); | ||
id = view.getProp('id'); | ||
editable = view.getProp('editable');}); | ||
var getOriginal=view.prop('getOriginal',noop), | ||
onSet=view.prop('onSet',noop), | ||
onClick=view.prop('onClick',noop); | ||
on.props(function(){ | ||
getOriginal = view.getProp('getOriginal'); | ||
onSet = view.getProp('onSet'); | ||
onClick = view.getProp('onClick');}); | ||
view.pause(); | ||
var rootPath=undefined, | ||
path=undefined, | ||
_data=undefined, | ||
type=undefined, | ||
key=undefined, | ||
original=undefined, | ||
expanded=undefined; | ||
var dataKeys=[]; | ||
var _query=''; | ||
var isInitiallyExpanded=function isInitiallyExpanded(){ | ||
return view.props.root || !_query && isExpanded(path,data) || !contains(path,_query) && typeof getOriginal === 'function';}; | ||
var transformData=function transformData(){ | ||
var data=arguments.length <= 0 || arguments[0] === undefined?{}:arguments[0]; | ||
data = _Object$keys(_data).sort();}; | ||
on.props(function(){ | ||
view.set('rootPath',rootPath = prefix + '.' + label); | ||
view.set('key',key = label.toString()); | ||
view.set('path',path = rootPath.substr(PATH_PREFIX.length)); | ||
// originally was stream of ||s, but 0 was turning into false | ||
view.set('_data',_data = data); | ||
// multiline strings | ||
if(typeof _data === 'string' && _data.indexOf('\n') > -1){ | ||
view.set('_data',_data = _data.split('\n'));} | ||
if(_data)view.set('dataKeys',dataKeys = _Object$keys(_data).sort()); | ||
if(_data === undefined)view.set('_data',_data = data); | ||
if(_data === undefined)view.set('_data',_data = {}); | ||
view.set('type',type = (0,_libGetType2.default)(_data)); | ||
view.set('_query',_query = query || ''); | ||
if(view.props.root)view.set('expanded',expanded = true);else if(_query)view.set('expanded',expanded = !contains(label,_query)); | ||
if(query && !_query)view.set('expanded',expanded = isInitiallyExpanded()); | ||
view.update();}); | ||
function toggle(e){ | ||
if(!view.props.root)view.set('expanded',expanded = !expanded); | ||
view.update(); | ||
onClick(_data); | ||
e.stopPropagation();} | ||
var getLeafKey=function getLeafKey(key,value){ | ||
return isPrimitive(value)?key + ':' + (0,_md5OMatic2.default)(String(key)):key + '[' + (0,_libGetType2.default)(value) + ']';}; | ||
var format=function format(key){ | ||
return view.el(['Highlighter',1],{string:key,highlight:_query});}; | ||
var fnParams=function fnParams(fn){ | ||
return fn.toString().replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s))/mg,'').match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].split(/,/);}; | ||
var getLabel=function getLabel(type,val,sets,editable){ | ||
return view.el(['Label',1],{ | ||
val:val, | ||
editable:editable, | ||
onSet:function(_){ | ||
return onSet([sets,_]);}});}; | ||
view.render(function(){ | ||
return view.el( | ||
['leaf',1], | ||
{className:rootPath}, | ||
Flint.iff(!view.props.root) && view.el( | ||
['label',1], | ||
{if:!view.props.root,htmlFor:id,onClick:toggle}, | ||
view.el( | ||
['key',1], | ||
null, | ||
view.el( | ||
['name',1], | ||
null, | ||
format(key)), | ||
getLabel('key',key,key,false)), | ||
view.el( | ||
['colon',1], | ||
null, | ||
':'), | ||
Flint.iff(type == 'Function') && view.el( | ||
['expand',1], | ||
{className:'function',if:type == 'Function'}, | ||
view.el( | ||
['i',1], | ||
null, | ||
'fn (', | ||
fnParams(_data).join(', '), | ||
')')), | ||
Flint.iff(type == 'Array') && view.el( | ||
['expand',2], | ||
{if:type == 'Array'}, | ||
view.el( | ||
['type',1], | ||
null, | ||
'Array[', | ||
_data.length, | ||
']')), | ||
Flint.iff(type == 'Object') && view.el( | ||
['expand',3], | ||
{if:type == 'Object'}, | ||
view.el( | ||
['type',2], | ||
null, | ||
'{} ' + dataKeys.length + ' keys')), | ||
Flint.iff(['Array','Object','Function'].indexOf(type) == -1) && view.el( | ||
['value',1], | ||
{if:['Array','Object','Function'].indexOf(type) == -1,className:type.toLowerCase()}, | ||
Flint.iff(type.toLowerCase() == 'string') && view.el( | ||
['str',1], | ||
{if:type.toLowerCase() == 'string'}, | ||
format((0,_ellipsize2.default)(String(_data),25))), | ||
Flint.iff(type.toLowerCase() != 'string') && view.el( | ||
['else',1], | ||
{if:type.toLowerCase() != 'string'}, | ||
format(String(_data))), | ||
getLabel('val',_data,key,editable))), | ||
view.el( | ||
['children',1], | ||
null, | ||
Flint.iff(expanded && !isPrimitive(_data)) && Flint.range(dataKeys).map(function(_,_index){ | ||
return view.el( | ||
['child',1,_,_index], | ||
{ | ||
if:expanded && !isPrimitive(_data), | ||
repeat:dataKeys}, | ||
Flint.iff(_.indexOf('__') == -1) && view.el(['Leaf',1,_,_index],{ | ||
if:_.indexOf('__') == -1, | ||
key:getLeafKey(_,_data[_]), | ||
onSet:function(){ | ||
for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) { | ||
args[_key] = arguments[_key];} | ||
return onSet.apply(undefined,[key].concat(args));}, | ||
data:_data[_], | ||
editable:editable, | ||
label:_, | ||
prefix:rootPath, | ||
onClick:onClick, | ||
id:id, | ||
query:_query, | ||
getOriginal:original?null:getOriginal, | ||
isExpanded:isExpanded}));})));}); | ||
var row={ | ||
flexFlow:'row'}; | ||
$["label"] = function(_,_index){ | ||
return [row,{ | ||
position:'relative', | ||
color:'rgba(0,0,0,0.8)', | ||
opacity:1, | ||
alignItems:'baseline'}];}; | ||
$["key"] = function(_,_index){ | ||
return [row,{ | ||
color:'rgba(0,0,0,0.9)', | ||
margin:[0], | ||
fontWeight:'bold'}];}; | ||
$["expand"] = function(_,_index){ | ||
return [row,{}];}; | ||
$["value"] = function(_,_index){ | ||
return [row,{ | ||
position:'relative', | ||
margin:[0,4,0]}];};});});})(); | ||
//# sourceMappingURL=leaf.js.map | ||
(function(){ | ||
Flint.file('inspector/section.js',function(require){ | ||
Flint.staticStyles('Inspector.Section',{ | ||
'$':'#_flintdevtools .ViewInspector-Section', | ||
'$body':'#_flintdevtools body.Inspector-Section, #_flintdevtools .Inspector-Section.body, #_flintdevtools .ViewInspector-Section.body, #_flintdevtools .Inspector-Section > .body', | ||
'$inactive':'#_flintdevtools inactive.Inspector-Section, #_flintdevtools .Inspector-Section.inactive, #_flintdevtools .ViewInspector-Section.inactive, #_flintdevtools .Inspector-Section > .inactive'}, | ||
{ | ||
'$':{ | ||
padding:[5,0]}, | ||
'$body':{ | ||
padding:[0,12]}, | ||
'$inactive':{ | ||
display:'none'}}); | ||
Flint.view('Inspector.Section',function(view,on,$){ | ||
var open=true;view.render(function(){ | ||
return view.el( | ||
['Inspector.Title',1], | ||
{onToggle:function(val){ | ||
return view.set('open',open = val);}}, | ||
view.props.title);}); | ||
view.render(function(){ | ||
return view.el( | ||
['body',1], | ||
null, | ||
view.props.children);});});});})(); | ||
//# sourceMappingURL=section.js.map | ||
var _extends=require('babel-runtime/helpers/extends').default; | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector/statetests.js',function(require){ | ||
var _mouseEventOffset=require('mouse-event-offset'); | ||
var _mouseEventOffset2=_interopRequireDefault(_mouseEventOffset); | ||
Flint.view('StateTests',function(view,on,$){ | ||
;view.render(function(){ | ||
return view.el(['Tests.Name',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Boolean',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Counter',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Props',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Circles',1],null);});}); | ||
Flint.view('Tests.Boolean',function(view,on,$){ | ||
var dead=false;view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'is tupac dead? ', | ||
dead.toString());}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',1], | ||
{onClick:function(){ | ||
return view.set('dead',dead = !dead);}}, | ||
'toggle');});}); | ||
Flint.staticStyles('Tests.Props',{ | ||
'$':'#_flintdevtools .ViewTests-Props'}, | ||
{ | ||
'$':{marginTop:20}}); | ||
Flint.view('Tests.Props',function(view,on,$){ | ||
var name='a string';view.render(function(){ | ||
return view.el(['input',1],{ | ||
'__flintValue':name, | ||
'__flintOnChange':function(e){ | ||
view.setImmediate('name',name = e.target.value);}});}); | ||
view.render(function(){ | ||
return view.el(['Test.PropsChild',1],{name:name});});}); | ||
Flint.view('Test.PropsChild',function(view,on,$){ | ||
var name=view.prop('name',undefined); | ||
on.props(function(){ | ||
name = view.getProp('name');}); | ||
var count=0;view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'my name is ', | ||
name);}); | ||
view.render(function(){ | ||
return view.el( | ||
['h4',1], | ||
null, | ||
'counter to test state ', | ||
count);}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',1], | ||
{onClick:function(){ | ||
return view.set('count',count++,count,true);}}, | ||
'up');});}); | ||
Flint.view('Tests.Counter',function(view,on,$){ | ||
var count=0;view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'count is ', | ||
count);}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',1], | ||
{onClick:function(){ | ||
return view.set('count',count++,count,true);}}, | ||
'up');}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',2], | ||
{onClick:function(){ | ||
return view.set('count',count--,count,true);}}, | ||
'down');});}); | ||
Flint.view('Tests.Deep',function(view,on,$){ | ||
var person={name:'nick',tools:['js','juggling balls','coffee']};view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'deep');}); | ||
view.render(function(){ | ||
return view.el( | ||
['h2',1], | ||
null, | ||
JSON.stringify(person));});}); | ||
Flint.view('Tests.Name',function(view,on,$){ | ||
var first='nick'; | ||
var last='cammarata';view.render(function(){ | ||
return view.el( | ||
['h2',1], | ||
null, | ||
'name is ', | ||
first, | ||
' ', | ||
last);}); | ||
view.render(function(){ | ||
return view.el(['input',1],{ | ||
'__flintValue':first, | ||
'__flintOnChange':function(e){ | ||
view.setImmediate('first',first = e.target.value);}});}); | ||
view.render(function(){ | ||
return view.el(['input',2],{ | ||
'__flintValue':last, | ||
'__flintOnChange':function(e){ | ||
view.setImmediate('last',last = e.target.value);}});}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',1], | ||
{onClick:function(){ | ||
view.set('first',first = 'nate'); | ||
view.set('last',last = 'wienert');}}, | ||
'nateify');});}); | ||
Flint.staticStyles('Tests.Circles',{ | ||
'$circles':'#_flintdevtools circles.Tests-Circles, #_flintdevtools .Tests-Circles.circles, #_flintdevtools .ViewTests-Circles.circles, #_flintdevtools .Tests-Circles > .circles'}, | ||
{ | ||
'$circles':{position:'relative',background:'#eee',height:400,width:400}}); | ||
Flint.view('Tests.Circles',function(view,on,$){ | ||
var coords=[[200,200]]; | ||
function addCircle(click){ | ||
view.set('coords',coords.push((0,_mouseEventOffset2.default)(click)),coords,true);} | ||
;view.render(function(){ | ||
return view.el( | ||
['circles',1], | ||
{onClick:addCircle}, | ||
Flint.range(coords).map(function(_,_index){ | ||
return view.el(['Tests.Circle',1,_,_index],{ | ||
repeat:coords, | ||
key:'' + _[0] + _[1], | ||
left:_[0], | ||
top:_[1]});}));});}); | ||
Flint.view('Tests.Circle',function(view,on,$){ | ||
var c=function c(){ | ||
return Math.round(Math.random() * 255);}; | ||
var base={ | ||
background:[c(),c(),c()], | ||
position:'absolute', | ||
top:view.props.top, | ||
left:view.props.left, | ||
width:118,height:29, | ||
borderRadius:27}; | ||
var style=function style(scale){ | ||
return _extends({},base,{transform:{scale:scale}});}; | ||
view.render(function(){ | ||
return view.el(['circle',1],{style:style(1)});});});});})(); | ||
//# sourceMappingURL=statetests.js.map | ||
(function(){ | ||
Flint.file('inspector/title.js',function(require){ | ||
Flint.staticStyles('Inspector.Title',{ | ||
'$title':'#_flintdevtools title.Inspector-Title, #_flintdevtools .Inspector-Title.title, #_flintdevtools .ViewInspector-Title.title, #_flintdevtools .Inspector-Title > .title', | ||
'$closed':'#_flintdevtools closed.Inspector-Title, #_flintdevtools .Inspector-Title.closed, #_flintdevtools .ViewInspector-Title.closed, #_flintdevtools .Inspector-Title > .closed', | ||
'$inner':'#_flintdevtools inner.Inspector-Title, #_flintdevtools .Inspector-Title.inner, #_flintdevtools .ViewInspector-Title.inner, #_flintdevtools .Inspector-Title > .inner'}, | ||
{ | ||
'$title':{ | ||
fontWeight:300, | ||
borderBottom:'1px solid #eee', | ||
height:10, | ||
margin:[5,5,8], | ||
color:'#999', | ||
flexFlow:'row'}, | ||
'$closed':{ | ||
marginTop:1}, | ||
'$inner':{ | ||
padding:[4,10], | ||
background:'#fff'}}); | ||
Flint.view('Inspector.Title',function(view,on,$){ | ||
var open=true; | ||
function toggle(){ | ||
if(!view.props.onToggle)return; | ||
view.set('open',open = !open); | ||
view.props.onToggle(open);} | ||
;view.render(function(){ | ||
return view.el( | ||
['title',1], | ||
{onClick:toggle}, | ||
view.el( | ||
['inner',1], | ||
null, | ||
view.props.children));}); | ||
$["closed"] = function(_,_index){ | ||
return { | ||
transform:{scale:0.8}};}; | ||
$["inner"] = function(_,_index){ | ||
return {margin:[-2,'auto']};};});});})(); | ||
//# sourceMappingURL=title.js.map | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector/tree.js',function(require){ | ||
var _libLens=require('../lib/lens'); | ||
var _libLens2=_interopRequireDefault(_libLens); | ||
Flint.staticStyles('Tree',{ | ||
'$':'#_flintdevtools .ViewTree'}, | ||
{ | ||
'$':{ | ||
pointerEvents:'auto', | ||
marginLeft:-10}}); | ||
Flint.viewRoots["Tree"] = 'Leaf'; | ||
Flint.view('Tree',function(view,on,$){ | ||
var query=''; | ||
var search=function search(q){ | ||
return query === '' || view.props.validateQuery(query)?view.set('query',query = q):false;}; | ||
var getOriginal=function getOriginal(path){ | ||
return (0,_libLens2.default)(view.props.data,path);}; | ||
view.render(function(){ | ||
return view.el(['Leaf',1],{ | ||
data:view.props.data, | ||
onClick:view.props.onClick, | ||
id:view.props.id, | ||
getOriginal:getOriginal, | ||
query:query, | ||
label:'root', | ||
editable:view.props.editable, | ||
root:true, | ||
validateQuery:function(query){ | ||
return query.length >= 2;}, | ||
isExpanded:view.props.isExpanded || function(){ | ||
return false;}, | ||
interactiveLabel:view.props.interactiveLabel, | ||
onSet:function(){ | ||
for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) { | ||
args[_key] = arguments[_key];} | ||
return view.props.onSet(args);}});});});});})(); | ||
//# sourceMappingURL=tree.js.map | ||
var _Object$keys=require('babel-runtime/core-js/object/keys').default; | ||
(function(){ | ||
Flint.file('inspector/view.js',function(require){ | ||
var _lodash=require('lodash'); | ||
function pathToName(path){ | ||
var p=path.split(','); | ||
return p[p.length - 1].split('-')[0];} | ||
function filterProps(props){ | ||
var leaveOut=['if','repeat','style','yield','__flint']; | ||
return _lodash.omit.apply(null,[props].concat(leaveOut));} | ||
Flint.staticStyles('Inspector.View',{ | ||
'$view':'#_flintdevtools view.Inspector-View, #_flintdevtools .Inspector-View.view, #_flintdevtools .ViewInspector-View.view, #_flintdevtools .Inspector-View > .view', | ||
'$top':'#_flintdevtools top.Inspector-View, #_flintdevtools .Inspector-View.top, #_flintdevtools .ViewInspector-View.top, #_flintdevtools .Inspector-View > .top', | ||
'$active':'#_flintdevtools active.Inspector-View, #_flintdevtools .Inspector-View.active, #_flintdevtools .ViewInspector-View.active, #_flintdevtools .Inspector-View > .active', | ||
'$highlight':'#_flintdevtools highlight.Inspector-View, #_flintdevtools .Inspector-View.highlight, #_flintdevtools .ViewInspector-View.highlight, #_flintdevtools .Inspector-View > .highlight', | ||
'$Close':'#_flintdevtools .ViewInspector-View .ViewClose', | ||
'$name':'#_flintdevtools name.Inspector-View, #_flintdevtools .Inspector-View.name, #_flintdevtools .ViewInspector-View.name, #_flintdevtools .Inspector-View > .name', | ||
'$edit':'#_flintdevtools edit.Inspector-View, #_flintdevtools .Inspector-View.edit, #_flintdevtools .ViewInspector-View.edit, #_flintdevtools .Inspector-View > .edit', | ||
'$expanded':'#_flintdevtools expanded.Inspector-View, #_flintdevtools .Inspector-View.expanded, #_flintdevtools .ViewInspector-View.expanded, #_flintdevtools .Inspector-View > .expanded', | ||
'$input':'#_flintdevtools input.Inspector-View, #_flintdevtools .Inspector-View.input, #_flintdevtools .ViewInspector-View.input, #_flintdevtools .Inspector-View > .input', | ||
'$title':'#_flintdevtools title.Inspector-View, #_flintdevtools .Inspector-View.title, #_flintdevtools .ViewInspector-View.title, #_flintdevtools .Inspector-View > .title', | ||
'$section':'#_flintdevtools section.Inspector-View, #_flintdevtools .Inspector-View.section, #_flintdevtools .ViewInspector-View.section, #_flintdevtools .Inspector-View > .section'}, | ||
{ | ||
'$view':{ | ||
position:'relative', | ||
pointerEvents:'auto', | ||
margin:10, | ||
marginBottom:0, | ||
padding:[0,0,1], | ||
minWidth:220, | ||
minHeight:34, | ||
fontSize:12, | ||
userSelect:'none', | ||
cursor:'default', | ||
background:'#fff', | ||
boxShadow:'0px 2px 16px rgba(0,0,0,0.2)', | ||
border:'1px solid #ccc', | ||
borderRadius:5, | ||
color:'#333', | ||
transition:'all ease-in 60ms', | ||
opacity:0}, | ||
'$top':{ | ||
flexFlow:'row'}, | ||
'$active':{ | ||
opacity:1}, | ||
'$highlight':{ | ||
border:'2px solid #afb4e2'}, | ||
'$Close':{ | ||
top:-5, | ||
right:-5, | ||
fontSize:13}, | ||
'$name':{ | ||
fontWeight:400, | ||
color:'rgba(0,0,0,0.8)', | ||
padding:[8,8,0], | ||
fontSize:14}, | ||
'$edit':{ | ||
padding:[8,8,0], | ||
fontSize:14, | ||
marginLeft:4, | ||
fontWeight:400, | ||
color:'rgba(24, 101, 227, 0.8)'}, | ||
'$expanded':{}, | ||
'$input':{ | ||
borderRadius:100, | ||
border:'1px solid #ccc', | ||
width:'100%', | ||
padding:[2,12], | ||
color:'#333', | ||
fontSize:14}, | ||
'$title':{ | ||
display:'none', | ||
color:'#333', | ||
fontWeight:200, | ||
fontSize:12, | ||
margin:[3,0]}, | ||
'$section':{ | ||
background:[0,0,0,0.05]}}); | ||
Flint.view('Inspector.View',function(view,on,$){ | ||
var highlight=view.prop('highlight',undefined), | ||
closing=view.prop('closing',undefined), | ||
path=view.prop('path',undefined), | ||
onClose=view.prop('onClose',undefined); | ||
on.props(function(){ | ||
highlight = view.getProp('highlight'); | ||
closing = view.getProp('closing'); | ||
path = view.getProp('path'); | ||
onClose = view.getProp('onClose');}); | ||
var inspect=window.Flint.inspect; | ||
var name=undefined; | ||
var active=false; | ||
var state={}; | ||
var props=null; | ||
var writeBack=null; | ||
function onSet(write){ | ||
view.props.writeBack(path,write);} | ||
on.delay(60,function(){ | ||
view.set('active',active = true);}); | ||
on.unmount(function(){ | ||
delete window._Flint.inspector[path];}); | ||
on.props(function(){ | ||
if(closing === true)view.set('active',active = false); | ||
if(!path)return; | ||
view.set('name',name = pathToName(path)); | ||
// if not inspecting, inspect | ||
if(!_Flint.inspector[path]){ | ||
inspect(path,function(_props,_state,_wb){ | ||
console.log('props are',_props); | ||
view.set('props',props = filterProps(_props || {})); | ||
view.set('state',state = _state || {}); | ||
view.set('writeBack',writeBack = _wb); | ||
view.update();});}}); | ||
var hasKeys=function hasKeys(o){ | ||
return o && _Object$keys(o).length > 0;}; | ||
var edit=function edit(){ | ||
return _DT.messageEditor({type:'focus:element',view:name});}; | ||
view.render(function(){ | ||
return view.el( | ||
['view',1], | ||
{className:{active:active,highlight:highlight}}, | ||
view.el(['Close',1],{onClick:onClose,fontSize:20,size:35}), | ||
view.el( | ||
['top',1], | ||
null, | ||
view.el( | ||
['name',1], | ||
null, | ||
name), | ||
Flint.iff(false) && view.el( | ||
['edit',1], | ||
{if:false,onClick:edit}, | ||
'edit')), | ||
Flint.iff(hasKeys(props)) && view.el( | ||
['Inspector.Section',1], | ||
{title:'Props',if:hasKeys(props),className:'props'}, | ||
view.el(['Tree',1],{editable:false,data:props})), | ||
Flint.iff(hasKeys(state)) && view.el( | ||
['Inspector.Section',2], | ||
{title:'State',if:hasKeys(state)}, | ||
view.el(['Tree',2],{ | ||
editable:true, | ||
onSet:onSet, | ||
data:state})));}); | ||
'68270699'; | ||
$["view"] = function(_,_index){ | ||
return {transform:{ | ||
x:20}};}; | ||
'c59a100e'; | ||
'14ed20fc'; | ||
$["active"] = function(_,_index){ | ||
return {transform:{ | ||
x:0}};}; | ||
'73fd2ce7'; | ||
'4c3860b8'; | ||
'6f330b54'; | ||
$["name"] = function(_,_index){ | ||
return {margin:[0,0,-6]};}; | ||
'748b11a6'; | ||
$["edit"] = function(_,_index){ | ||
return {margin:[0,0,-6]};}; | ||
$["expanded"] = function(_,_index){ | ||
return { | ||
transform:{y:0}};}; | ||
'a91c0042'; | ||
'22691102'; | ||
'1d45081d';});});})(); | ||
//# sourceMappingURL=view.js.map | ||
(function(){ | ||
Flint.file("main.js",function(require){ | ||
Flint.staticStyles("Main",{ | ||
"$":"#_flintdevtools .ViewMain"}, | ||
{ | ||
"$":{ | ||
position:'fixed', | ||
top:0,left:0, | ||
right:0,bottom:0, | ||
zIndex:2147483647}}); | ||
Flint.view("Main",function(view,on,$){ | ||
var internal=window.__isDevingDevTools; | ||
var showInspector=true;view.render(function(){ | ||
return view.el(["link",1],{rel:"stylesheet",property:"stylesheet",href:"/__/tools/static/tools.css"});}); | ||
view.render(function(){ | ||
return Flint.iff(!internal) && view.el(["link",2],{if:!internal,rel:"stylesheet",property:"stylesheet",href:"/__/tools/styles.css"});}); | ||
view.render(function(){ | ||
return view.el(["Errors",1],null);}); | ||
view.render(function(){ | ||
return view.el(["Installer",1],null);}); | ||
view.render(function(){ | ||
return Flint.iff(showInspector) && view.el(["Menu",1],{if:showInspector});}); | ||
view.render(function(){ | ||
return Flint.iff(showInspector) && view.el(["Inspector",1],{if:showInspector});}); | ||
view.render(function(){ | ||
return Flint.iff(internal) && view.el(["StateTests",1],{if:internal});}); | ||
$["$"] = function(_,_index){ | ||
return {pointerEvents:internal?'auto':'none'};};});});})(); | ||
//# sourceMappingURL=main.js.map | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('menu.js',function(require){ | ||
var _keys=require('./keys'); | ||
var _libInspecting=require('./lib/inspecting'); | ||
var _libInspecting2=_interopRequireDefault(_libInspecting); | ||
var Tools=_DT; | ||
var toEditor=Tools.messageEditor; | ||
Flint.staticStyles('Menu',{ | ||
'$menu':'#_flintdevtools .ViewMenu', | ||
'$active':'#_flintdevtools active.Menu, #_flintdevtools .Menu.active, #_flintdevtools .ViewMenu.active, #_flintdevtools .Menu > .active', | ||
'$item':'#_flintdevtools item.Menu, #_flintdevtools .Menu.item, #_flintdevtools .ViewMenu.item, #_flintdevtools .Menu > .item', | ||
'$first':'#_flintdevtools first.Menu, #_flintdevtools .Menu.first, #_flintdevtools .ViewMenu.first, #_flintdevtools .Menu > .first', | ||
'$last':'#_flintdevtools last.Menu, #_flintdevtools .Menu.last, #_flintdevtools .ViewMenu.last, #_flintdevtools .Menu > .last', | ||
'$hl':'#_flintdevtools hl.Menu, #_flintdevtools .Menu.hl, #_flintdevtools .ViewMenu.hl, #_flintdevtools .Menu > .hl', | ||
'$main':'#_flintdevtools main.Menu, #_flintdevtools .Menu.main, #_flintdevtools .ViewMenu.main, #_flintdevtools .Menu > .main'}, | ||
{ | ||
'$menu':{ | ||
border:'1px solid #ddd', | ||
boxShadow:'0 0 10px rgba(0,0,0,0.2)', | ||
position:'absolute', | ||
background:'#fff', | ||
zIndex:2147483647, | ||
transition:'opacity ease-in 30ms, transform ease-in 30ms', | ||
opacity:0, | ||
pointerEvents:'none', | ||
padding:0}, | ||
'$active':{ | ||
pointerEvents:'auto', | ||
opacity:1}, | ||
'$item':{ | ||
minWidth:120, | ||
cursor:'pointer', | ||
flexFlow:'row'}, | ||
'$first':{ | ||
overflow:'hidden'}, | ||
'$last':{ | ||
overflow:'hidden'}, | ||
'$hl':{ | ||
padding:[4,8]}, | ||
'$main':{ | ||
flexGrow:1}}); | ||
Flint.viewRoots["Menu"] = 'menu'; | ||
Flint.view('Menu',function(view,on,$){ | ||
var active=false; | ||
var top=undefined, | ||
left=undefined; | ||
var elements=[]; | ||
// prevent select and show custom cursor when ready for context | ||
var focused=undefined; | ||
on.keydown(function(){ | ||
if(_keys.keys.alt && _keys.keys.command){ | ||
document.body.classList.add('__flintfocus'); | ||
view.set('focused',focused = true);}}); | ||
on.keyup(function(){ | ||
if(focused){ | ||
document.body.classList.remove('__flintfocus'); | ||
view.set('focused',focused = false);}}); | ||
on.click(window,function(e){ | ||
if(active){ | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
view.set('active',active = false); | ||
return;} | ||
var mode=_keys.keys.alt && _keys.keys.command; | ||
if(!mode)return; | ||
e.preventDefault(); | ||
var clientX=e.clientX; | ||
var clientY=e.clientY; | ||
view.set('left',left = clientX); | ||
view.set('top',top = clientY); | ||
view.set('active',active = true); | ||
view.set('elements',elements = _libInspecting2.default.all());}); | ||
function focusElement(el){ | ||
return function(){ | ||
toEditor({type:'focus:element',key:el.key,view:el.view});};} | ||
function focusStyle(el){ | ||
return function(){ | ||
toEditor({type:'focus:style',el:el.el,view:el.view});};} | ||
;view.render(function(){ | ||
return view.el( | ||
['menu',1], | ||
{className:{internal:true,active:active}}, | ||
Flint.range(elements.filter(function(i){ | ||
return !!i.view;})). | ||
map(function(_,_index){ | ||
return view.el( | ||
['item',1,_,_index], | ||
{ | ||
repeat:elements.filter(function(i){ | ||
return !!i.view;}), | ||
className:{ | ||
first:_index == 0, | ||
last:_index == elements.length - 1}}, | ||
view.el( | ||
['main',1,_,_index], | ||
{className:'hl',onClick:focusElement(_)}, | ||
_.view), | ||
view.el( | ||
['sub',1,_,_index], | ||
{className:'hl',onClick:focusStyle(_)}, | ||
'$'));}));}); | ||
var rad=5; | ||
$["menu"] = function(_,_index){ | ||
return { | ||
borderRadius:rad,top:top, | ||
left:left,transform:{y:-10}};}; | ||
$["active"] = function(_,_index){ | ||
return {transform:{y:0}};}; | ||
$["first"] = function(_,_index){ | ||
return { | ||
borderTopLeftRadius:rad, | ||
borderTopRightRadius:rad};}; | ||
$["last"] = function(_,_index){ | ||
return { | ||
borderBottomLeftRadius:rad, | ||
borderBottomRightRadius:rad};}; | ||
$["hl"] = function(_,_index){ | ||
return {hover:{ | ||
background:[0,0,0,0.1]}};};});});})(); | ||
//# sourceMappingURL=menu.js.map | ||
(function(){ | ||
Flint.file('modal.js',function(require){ | ||
Flint.staticStyles('FlintModal',{ | ||
'$':'#_flintdevtools .ViewFlintModal', | ||
'$title':'#_flintdevtools title.FlintModal, #_flintdevtools .FlintModal.title, #_flintdevtools .ViewFlintModal.title, #_flintdevtools .FlintModal > .title', | ||
'$message':'#_flintdevtools message.FlintModal, #_flintdevtools .FlintModal.message, #_flintdevtools .ViewFlintModal.message, #_flintdevtools .FlintModal > .message'}, | ||
{ | ||
'$':{ | ||
position:'fixed', | ||
right:0, | ||
minWidth:80, | ||
padding:[7,5], | ||
margin:20, | ||
background:'#fff', | ||
boxShadow:'0 5px 26px rgba(0,0,0,0.13)', | ||
border:'1px solid #dadada', | ||
fontSize:14, | ||
transition:'all ease-in 200ms', | ||
textAlign:'center', | ||
borderRadius:6, | ||
pointerEvents:'auto'}, | ||
'$title':{ | ||
fontWeight:500, | ||
fontSize:15, | ||
margin:[0,20]}, | ||
'$message':{ | ||
fontFamily:"-apple-system, 'Helvetica Nueue', Helvetica, Arial, sans-serif"}}); | ||
Flint.view('FlintModal',function(view,on,$){ | ||
view.pause(); | ||
var children=undefined, | ||
title=undefined, | ||
open=undefined; | ||
on.props(setMessage); | ||
function setMessage(){ | ||
view.set('open',open = view.props.open); | ||
// cache last children when empty | ||
if(title && !view.props.title)return view.update(); | ||
view.set('title',title = view.props.title); | ||
view.set('children',children = view.props.children); | ||
view.update();} | ||
;view.render(function(){ | ||
return view.el(['Close',1],{size:25});}); | ||
view.render(function(){ | ||
return Flint.iff(title) && view.el( | ||
['title',1], | ||
{if:title}, | ||
title);}); | ||
view.render(function(){ | ||
return Flint.iff(children) && view.el( | ||
['message',1], | ||
{if:children}, | ||
children);}); | ||
$["$"] = function(_,_index){ | ||
return {top:open?0:-140};}; | ||
$["title"] = function(_,_index){ | ||
return { | ||
color:view.props.titleColor || '#222'};};});});})(); | ||
//# sourceMappingURL=modal.js.map | ||
(function(){ | ||
Flint.file('npm/installer.js',function(require){ | ||
var tools=window._DT; | ||
Flint.view('Installer',function(view,on,$){ | ||
var version=''; | ||
var versions=[]; | ||
var name=''; | ||
var error=''; | ||
var state=0; | ||
tools.on('package:install',function(){ | ||
view.set('state',state = 1); | ||
view.set('name',name = tools.data.name);}); | ||
tools.on('package:installed',function(){ | ||
view.set('state',state = 2); | ||
setTimeout(function(){ | ||
return view.set('state',state = 0);}, | ||
2000);}); | ||
tools.on('package:error',function(){ | ||
view.set('state',state = 3); | ||
view.set('name',name = tools.data.name); | ||
view.set('error',error = tools.data.error); | ||
setTimeout(function(){ | ||
return view.set('state',state = 0);}, | ||
2000);}); | ||
tools.on('package:select',function(){ | ||
view.set('state',state = 4); | ||
view.set('versions',versions = tools.data.versions);}); | ||
var selectVersion=function selectVersion(v){ | ||
view.set('version',version = v); | ||
tools.data.version = v; | ||
tools.emitter.emit('package:select'); | ||
view.set('state',state = 1);}; | ||
var closeModal=function closeModal(){ | ||
return view.set('state',state = 0);}; | ||
var title=function title(state){ | ||
switch(state){ | ||
case 1: | ||
return 'Installing ' + name + (version?' ' + version:'') + '...'; | ||
case 2: | ||
return 'Installed ' + name + '!'; | ||
case 3: | ||
return 'Error: ' + name; | ||
case 4: | ||
return 'Select version';}}; | ||
var body=function body(state){ | ||
switch(state){ | ||
case 1: | ||
return null; | ||
case 2: | ||
return null; | ||
case 3: | ||
return error; | ||
case 4: | ||
return view.el(['Versions',1],{versions:versions,onSelect:selectVersion});}} | ||
// was <modal but collided with bootstrap | ||
;view.render(function(){ | ||
return view.el( | ||
['FlintModal',1], | ||
{ | ||
open:state > 0, | ||
onClose:closeModal, | ||
title:title(state), | ||
titleColor:state == 3?"#8c1919":"#0f8c3c"}, | ||
Flint.iff(false && state < 2) && view.el(['InstallerLoading',1],{if:false && state < 2}), | ||
body(state));});}); | ||
Flint.staticStyles('Versions',{ | ||
'$version':'#_flintdevtools version.Versions, #_flintdevtools .Versions.version, #_flintdevtools .ViewVersions.version, #_flintdevtools .Versions > .version', | ||
'$inner':'#_flintdevtools inner.Versions, #_flintdevtools .Versions.inner, #_flintdevtools .ViewVersions.inner, #_flintdevtools .Versions > .inner', | ||
'$v':'#_flintdevtools v.Versions, #_flintdevtools .Versions.v, #_flintdevtools .ViewVersions.v, #_flintdevtools .Versions > .v', | ||
'$info':'#_flintdevtools info.Versions, #_flintdevtools .Versions.info, #_flintdevtools .ViewVersions.info, #_flintdevtools .Versions > .info'}, | ||
{ | ||
'$version':{ | ||
textAlign:'left', | ||
padding:[2,4], | ||
borderRadius:2}, | ||
'$inner':{ | ||
flexFlow:'row'}, | ||
'$v':{ | ||
flexGrow:1, | ||
fontWeight:'bold'}, | ||
'$info':{}}); | ||
Flint.view('Versions',function(view,on,$){ | ||
;view.render(function(){ | ||
return Flint.range(view.props.versions).map(function(_,_index){ | ||
return view.el( | ||
['version',1,_,_index], | ||
{repeat:view.props.versions,onClick:function(){ | ||
return view.props.onSelect(_);}}, | ||
view.el( | ||
['inner',1,_,_index], | ||
null, | ||
view.el( | ||
['v',1,_,_index], | ||
{key:'v' + _index}, | ||
_.version), | ||
view.el( | ||
['info',1,_,_index], | ||
null, | ||
_.description), | ||
view.el( | ||
['a',1,_,_index], | ||
{href:_.homepage,target:'_blank'}, | ||
'Info')));});}); | ||
$["v"] = function(_,_index){ | ||
return {':hover':{ | ||
background:'#fff', | ||
cursor:'pointer'}};};});});})(); | ||
//# sourceMappingURL=installer.js.map | ||
Flint.start();})(Flint)}; | ||
exports.flinttools=function(e,t){!function(e){!function(){e.file("close.js",function(t){e.staticStyles("Close",{$:"#_flintdevtools .ViewClose"},{$:{position:"absolute",right:0,top:0,display:"flex",justifyContent:"center",alignItems:"center",lineHeight:1,opacity:.15,cursor:"pointer",transition:"all ease-in 200ms"}}),e.viewRoots.Close="close",e.view("Close",function(e,t,n){e.render(function(){return e.el(["close",1],{onClick:e.props.onClick},"x")}),n.$=function(t,n){return{fontSize:e.props.fontSize||13,width:e.props.size||50,height:e.props.size||50,":hover":{opacity:.4}}}})})}(),function(){e.file("debounce.js",function(t){var n=function(e,t){return e+t},o=300,i=800,r=5e3,l=1e4,s=1e3;e.view("Debounce",function(e,t,a){var f=void 0,c=void 0,u=void 0,d=void 0,p=void 0,v=void 0,g=!1,m=[];e.pause(),t.props(function(){function t(){e.props.onUpdate&&e.props.onUpdate(),e.update()}if(e.props.force)return e.set("showKey",f=Math.random()),t();if(!e.props.showKey||e.props.showKey!=f){e.set("showKey",f=e.props.showKey),e.set("delay",d=e.props.delay||o),e.set("curDelay",p=p||d);var a=Date.now(),h=u?a-u:r;e.set("lastTime",u=a),e.set("lastFew",m.unshift(h),m,!0),m.length>3&&e.set("lastFew",m.pop(),m,!0),h>l?e.set("lastFew",m=[]):3==m.length&&(e.set("avgDiff",v=m.reduce(n,0)/m.length),e.set("isAutoSaving",g=s>v),e.set("curDelay",p=g?i:d)),clearTimeout(c),e.set("timeout",c=setTimeout(t,p))}})})})}(),function(){e.file("errors.js",function(t){function n(){setTimeout(function(){var e=document.querySelectorAll(".__flintError");e.length&&[].forEach.call(e,function(e){-1==e.className.indexOf("active")&&(e.className+=" active")})},s()?1e3:0)}function o(e){if(e.file&&(e.file=e.file.replace(new RegExp(".*"+window.location.origin+"(/[_]+/)?"),"")),e.file&&e.file.indexOf("internals.js")>=0)if(e.message&&0==e.message.indexOf("Cannot find module")){var t=e.message.match(/(fs|path)/);t&&t.length&&(e.file="imported module:",e.message="Cannot import node-only module: "+t[0])}else e.message="Error in a locally required file. "+e.message;return e.message&&(e.niceMessage=e.message.replace(/Uncaught .*Error:\s*/,"")),e}function i(e){var t=e.msg,n=e.name;return t&&(t=t.replace(/(npm WARN.*\n|ERR\!)/g,"").replace(/npm argv.*\n/g,"").replace(/npm node v.*\n/g,"").replace(/npm npm.*\n/g,"").replace(/npm code.*\n/g,"").replace(/npm peerinvalid /g,"").replace(/npm 404 /g,"")),{msg:t,name:n}}var r=window._DT,l=function(e,t){return[e.substring(0,t),e.substring(t,t+1),e.substring(t+1)]},s=function(){return r.editor&&r.editor.live},a=function(e){return c(p(v(e)))},f=function(e){return e?e.replace(/.*\.js\:/,"").replace(/\([0-9]+\:[0-9]+\)/,"").replace(/Line [0-9]+\:\s*/,""):""},c=function(e){return e.niceMessage=f(e.message,e.fileName),e},u=/\>?\s*([0-9]*)\s*\|(.*)/g,d=/\s*\|\s*\^\s*$/g,p=function(e){return e?(e.stack&&!function(){e.fullStack=["","",""];var t=0;e.stack.split("\n").forEach(function(n){if(!d.test(n)&&u.test(n)){var o=">"===n[0];o&&(t=1),o||1!==t||(t=2);var i=n.replace(u,"$1$2").replace(/^(\s*[0-9]+\s*)[;]/,"$1 ");e.fullStack[t]+=i+"\n"}})}(),e):void 0},v=function(e){return e?(e.stack&&e.stack.split("\n").map(function(t){if(">"===t[0]){var n=t;if(!n)return;n=n.replace(/\>\s*[0-9]+\s*\|\s*/,""),n=f(n);var o=e.loc.column-4;e.niceStack=l(n,o)}}),e):void 0},g=function(){};e.view("Errors",function(e,t,n){function l(){c?e.set("error",f=a(c)):u?e.set("error",f=o(u)):e.set("error",f=null),g("tools: view.update()"),e.update()}function s(){e.set("error",f=null),e.set("compileError",c=null),e.set("runtimeError",u=null),e.set("npmError",d=null),e.update()}e.pause();var f=null,c=null,u=null,d=null;r.on("compile:error",function(){g("compile:error"),e.set("compileError",c=r.data.error),l()}),r.on("runtime:error",function(){e.set("runtimeError",u=r.data),g("runtime:error",u),l()}),r.on("npm:error",function(){e.set("npmError",d=i(r.data.error)),g("npm:error",d),e.update()}),r.on("runtime:success",function(){g("runtime:success"),e.set("runtimeError",u=null),e.set("npmError",d=null),l()}),r.on("compile:success",function(){g("compile:success"),e.set("compileError",c=null),e.set("npmError",d=null),l()}),e.render(function(){return e.el(["ErrorMessage",1],{error:f,npmError:d,close:s})})});var m=0,h=function(e){return e&&e.replace(/[\?\)].*/,"")},w=function(e){return e&&(e.line||e.loc&&e.loc.line)};e.staticStyles("ErrorMessage",{$bar:"#_flintdevtools bar.ErrorMessage, #_flintdevtools .ErrorMessage.bar, #_flintdevtools .ViewErrorMessage.bar, #_flintdevtools .ErrorMessage > .bar",$inner:"#_flintdevtools inner.ErrorMessage, #_flintdevtools .ErrorMessage.inner, #_flintdevtools .ViewErrorMessage.inner, #_flintdevtools .ErrorMessage > .inner",$top:"#_flintdevtools top.ErrorMessage, #_flintdevtools .ErrorMessage.top, #_flintdevtools .ViewErrorMessage.top, #_flintdevtools .ErrorMessage > .top",$where:"#_flintdevtools where.ErrorMessage, #_flintdevtools .ErrorMessage.where, #_flintdevtools .ViewErrorMessage.where, #_flintdevtools .ErrorMessage > .where",$line:"#_flintdevtools line.ErrorMessage, #_flintdevtools .ErrorMessage.line, #_flintdevtools .ViewErrorMessage.line, #_flintdevtools .ErrorMessage > .line",$flint:"#_flintdevtools flint.ErrorMessage, #_flintdevtools .ErrorMessage.flint, #_flintdevtools .ViewErrorMessage.flint, #_flintdevtools .ErrorMessage > .flint",$shortError:"#_flintdevtools shortError.ErrorMessage, #_flintdevtools .ErrorMessage.shortError, #_flintdevtools .ViewErrorMessage.shortError, #_flintdevtools .ErrorMessage > .shortError",$cur:"#_flintdevtools cur.ErrorMessage, #_flintdevtools .ErrorMessage.cur, #_flintdevtools .ViewErrorMessage.cur, #_flintdevtools .ErrorMessage > .cur",$errCol:"#_flintdevtools errCol.ErrorMessage, #_flintdevtools .ErrorMessage.errCol, #_flintdevtools .ViewErrorMessage.errCol, #_flintdevtools .ErrorMessage > .errCol",$ln:"#_flintdevtools ln.ErrorMessage, #_flintdevtools .ErrorMessage.ln, #_flintdevtools .ViewErrorMessage.ln, #_flintdevtools .ErrorMessage > .ln",$flintline:"#_flintdevtools flintline.ErrorMessage, #_flintdevtools .ErrorMessage.flintline, #_flintdevtools .ViewErrorMessage.flintline, #_flintdevtools .ErrorMessage > .flintline"},{$bar:{display:"block",position:"fixed",left:0,transition:"all 200ms ease-in",right:0,fontFamily:'-apple-system, "San Francisco", Roboto, "Segou UI", "Helvetica Neue", Helvetica, Arial, sans-serif',fontWeight:300,color:"#fff",fontSize:"14px",padding:2,pointerEvents:"all",overflow:"scroll",zIndex:2147483647,boxShadow:"0 -6px 12px rgba(0,0,0,0.06)"},$inner:{display:"block",maxHeight:200,overflowY:"scroll"},$top:{padding:8,display:"block"},$where:{display:"inline-block",pointerEvents:"all",fontWeight:300,color:"rgba(255,255,255,0.8)"},$line:{display:"inline-block",whiteSpace:"pre",pointerEvents:"all"},$flint:{display:"inline",fontWeight:700,color:"#fff"},$shortError:{display:"inline",color:"rgba(255,255,255,0.7)"},$cur:{background:"#fff"},$errCol:{display:"inline",borderBottom:"2px solid #f5d64c",margin:-3,padding:3,color:"#fff"},$ln:{padding:[0,20]},$flintline:{whiteSpace:"pre",pointerEvents:"all",fontWeight:"flint"}}),e.view("ErrorMessage",function(t,o,i){t.pause();var l=!1,a={},f=void 0,c=void 0,u=w(t.props.error),d=void 0;o.props(function(){d&&d(),t.set("npmError",f=t.props.npmError),t.set("hasError",l=!(!t.props.error&&!t.props.npmError)),t.set("error",a=t.props.error||a),t.set("line",u=w(a)),t.set("fullStack",c=null),t.update(),a&&t.set("clearDelay",d=o.delay(2500,function(){l&&a.fullStack&&(t.set("fullStack",c=a.fullStack),t.update())}))}),r.emitter.on("editor:state",function(){return setTimeout(t.update)}),t.render(function(){return t.el(["Debounce",1],{delay:s()?2e3:1e3,force:l===!1,showKey:c||a&&a.message,onUpdate:n},t.el(["bar",1],null,t.el(["Close",1],{onClick:t.props.close,size:35}),e.iff(f)&&t.el(["inner",1],{"if":f},t.el(["where",1],null,t.el(["flint",1],null,f.name))," ",f.msg),t.el(["inner",2],null,t.el(["top",1],null,t.el(["where",2],null,t.el(["span",1],null,"In ",t.el(["flint",2],null,h(a.file))),t.el(["line",1],null,u?" line":""," ",e.iff(u)&&t.el(["flint",3],{"if":u},u-m)))," ",t.el(["shortError",1],null,(a.niceMessage||a.message||"").trim(),e.iff(a.niceStack)&&t.el(["niceStack",1],{"if":a.niceStack},a.niceStack[0],t.el(["errCol",1],null,a.niceStack[1]),a.niceStack[2])),e.iff(a.help)&&t.el(["help",1],{"if":a.help},a.help)),e.iff(c)&&t.el(["fullStack",1],{"if":c},t.el(["ln",1],null,""+c[0]),t.el(["ln",2],{className:"cur"},""+c[1]),t.el(["ln",3],null,""+c[2])))))});var p="#cd423e";i.bar=function(e,t){return{background:p,bottom:l?0:-100}};var v={color:"rgba(255,255,255,0.85)",display:"inline",fontFamily:"Meslo, Menlo, Monaco, monospace",padding:[0,5]};i.niceStack=function(e,t){return v},i.fullStack=function(e,t){return[v,{maxHeight:c?600:0,padding:c?[10,0]:0,transition:"maxHeight ease-in 300ms",color:"rgba(0,0,0,0.85)",background:"rgba(255,255,255,0.9)",display:"block",whiteSpace:"pre",fontSize:14,borderRadius:3,margin:2}]}}),e.staticStyles("ErrorIcon",{$svg:"#_flintdevtools svg.ErrorIcon, #_flintdevtools .ErrorIcon.svg, #_flintdevtools .ViewErrorIcon.svg, #_flintdevtools .ErrorIcon > .svg"},{$svg:{width:19,fill:"red",margin:-4,marginLeft:3,marginRight:6,opacity:.9}}),e.view("ErrorIcon",function(e,t,n){e.render(function(){return e.el(["svg",1],{viewBox:"0 0 27.963 27.963"},e.el(["path",1],{d:"M13.983,0C6.261,0,0.001,6.259,0.001,13.979c0,7.724,6.26,13.984,13.982,13.984s13.98-6.261,13.98-13.984 C27.963,6.259,21.705,0,13.983,0z M13.983,26.531c-6.933,0-12.55-5.62-12.55-12.553c0-6.93,5.617-12.548,12.55-12.548 c6.931,0,12.549,5.618,12.549,12.548C26.531,20.911,20.913,26.531,13.983,26.531z"}),e.el(["polygon",1],{points:"15.579,17.158 16.191,4.579 11.804,4.579 12.414,17.158"}),e.el(["path",2],{d:"M13.998,18.546c-1.471,0-2.5,1.029-2.5,2.526c0,1.443,0.999,2.528,2.444,2.528h0.056c1.499,0,2.469-1.085,2.469-2.528 C16.441,19.575,15.468,18.546,13.998,18.546z"}))})})})}();var t=require("babel-runtime/helpers/extends")["default"],n=require("babel-runtime/helpers/to-array")["default"],o=require("babel-runtime/helpers/sliced-to-array")["default"],i=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector.js",function(r){function l(e){var t=e.getBoundingClientRect(),n=window.innerWidth,o=window.innerHeight,i=V(t.right-t.left),r=V(t.bottom-t.top),l=1;i>=n&&r>=o&&(l=.2),$.setAttribute("style","\n top: "+V(t.top)+"px;\n left: "+V(t.left)+"px;\n width: "+i+"px;\n height: "+r+"px;\n opacity: "+l+";\n ")}function s(){$.setAttribute("style","")}function a(e){if(!e||!e.getAttribute)return null;var t=e.__flintID;return t?(l(e),t):a(e.parentNode)}function f(e,t){return e.filter(function(e){return e.path==t}).length>0}function c(e){return e.filter(function(e){return!e.temp}).map(function(e){return t({},e,{highlight:!1})})}function u(e,t){return[{path:t,highlight:!1,temp:!0}].concat(e)}function d(e,t){return e.map(function(e){return e.path==t&&(e.closing=!0),e})}function p(e,t){return e.map(function(e){return e.path==t&&(e.highlight=!0),e})}function v(e,t){if(f(e,t))return e.map(function(e){return e.path==t&&(e.temp=!0),e});var n={temp:!1,highlight:!1,closing:!1,path:t};return[].concat([n],e)}function g(){return window._Flint}function m(e,t){var n=g(),i=n.getCache[e];t.reduce(function(e,t){if("root"==t)return e;if(!Array.isArray(t))return e[t];var n=o(t,2),i=n[0],r=n[1],l=e[i];"number"==typeof l&&(r=+r),e[i]=r},i),n.inspectorRefreshing=e,n.getInitialStates[e](),n.viewsAtPath[e].forceUpdate(),n.inspectorRefreshing=null}var h=r("./keys"),w=r("./lib/inspecting"),_=i(w),b=r("lodash"),y=function(e){var t=n(e),o=(t[0],t.slice(1));return o},V=Math.round,$=void 0;e.staticStyles("Inspector",{$:"#_flintdevtools .ViewInspector"},{$:{position:"fixed",top:0,right:0,padding:2}}),e.view("Inspector",function(n,o,i){function r(e){P(e)?n.set("offAlt",j=o.delay(180,function(){P(e)&&I()})):(j&&j(),k())}function l(e){g().isInspecting=!0;var t=a(e);null!==t&&(n.set("views",F=c(F)),n.set("views",F=f(F,t)?p(F,t):u(F,t)))}function w(e){var t=e.target,o=ReactDOM.findDOMNode(n);if(L!=t){if(o.contains(t))return;n.set("lastTarget",L=t),_["default"].set(t),T&&l(L)}}function V(){F.length&&n.set("views",F=y(F))}function M(e,t){t&&t.stopPropagation(),n.set("views",F=d(F,e)),o.delay(200,function(){n.set("views",F=F.filter(function(t){return e!=t.path}))})}function E(e){var t=e.target,o=ReactDOM.findDOMNode(n);return o.contains(t)?void 0:(n.set("views",F=v(c(F),a(t))),!1)}function I(){l(L),n.set("hudActive",T=!0),n.set("clickOff",x=o.click(window,E))}function k(){g().isInspecting=!1,n.set("hudActive",T=!1),s(),x&&x(),n.set("views",F=c(F))}function S(e,t){m(e,t),n.update()}var x=void 0,C=void 0,L=void 0,T=!1,F=[];o.mount(function(){n.set("hoverOff",C=o.mousemove(window,(0,b.throttle)(w,40))),$||($=document.createElement("div"),$.className="_flintHighlighter",document.body.appendChild($))}),(0,h.onKeyDown)("esc",V);var j=void 0,P=function(e){var t=e.altKey,n=e.metaKey;return t&&!n};o.keydown(window,r),o.keyup(window,r),n.render(function(){return e.range(F).map(function(e,o){return n.el(["Inspector.View",1,e,o],t({repeat:F,key:e.path},e,{writeBack:S,onClose:function(t){return M(e.path,t)}}))})})})})}();var r=require("babel-runtime/core-js/object/keys")["default"];!function(){e.file("inspector/highlighter.js",function(t){e.view("Highlighter",function(t,n,o){t.render(function(){return e.iff(!t.props.highlight||-1===t.props.string.indexOf(t.props.highlight))&&t.el(["name",1],{"if":!t.props.highlight||-1===t.props.string.indexOf(t.props.highlight)},t.props.string)}),t.render(function(){return e.iff(t.props.highlight)&&t.el(["span",1],{"if":t.props.highlight},e.range(t.props.string.split()).map(function(n,o){return t.el(["span",2,n,o],{repeat:t.props.string.split()},e.iff(o>0)&&t.el(["highlight",1,n,o],{"if":o>0},t.props.highlight),n)}))})})})}();var t=require("babel-runtime/helpers/extends")["default"];!function(){e.file("inspector/label.js",function(n){var o=n("lodash");e.staticStyles("Label",{$input:"#_flintdevtools input.Label, #_flintdevtools .Label.input, #_flintdevtools .ViewLabel.input, #_flintdevtools .Label > .input",$focus:"#_flintdevtools focus.Label, #_flintdevtools .Label.focus, #_flintdevtools .ViewLabel.focus, #_flintdevtools .Label > .focus"},{$input:{position:"absolute",top:0,left:-1,right:0,color:"#333",padding:1,width:140,outline:"none",border:"none",opacity:0,boxShadow:"1px 1px 2px rgba(0,0,0,0.4)"},$focus:{opacity:"1 !important"}}),e.view("Label",function(e,n,i){var r=e.prop("val",void 0),l=e.prop("editable",void 0),s=e.prop("onSet",void 0);n.props(function(){r=e.getProp("val"),l=e.getProp("editable"),s=e.getProp("onSet")});var a=void 0,f=void 0;n.props(function(){a||e.set("newVal",f=r)});var c=function(t){if(l){if((0,o.isBoolean)(r))return s(!r);e.set("focus",a=!0),t.stopPropagation()}},u=function(t){e.set("focus",a=!1)},d=function(t){e.set("newVal",f=t.target.value),e.update({immediate:!0}),(!(0,o.isNumber)(r)||""!==f&&!isNaN(f))&&("false"===f&&e.set("newVal",f=!1),"true"===f&&e.set("newVal",f=!0),s(f))},p=function(e){return e?{}:{tabIndex:5e3,disabled:!0}};e.render(function(){return e.el(["input",1],t({defaultValue:r.toString(),value:f,className:{focus:a},size:Math.max(4,r&&r.length||0),spellCheck:!1,onMouseDown:c,onFocus:c,onEnter:u},p(l),{onFocus:c,onBlur:u,onChange:d}))}),i.input=function(e,t){return{cursor:(0,o.isBoolean)(r)?"pointer":"auto"}}})})}();var r=require("babel-runtime/core-js/object/keys")["default"],i=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector/leaf.js",function(t){var n=t("md5-o-matic"),o=i(n),l=t("../lib/getType"),s=i(l),a=t("ellipsize"),f=i(a),c=".root.",u=function(e,t){return-1!==e.indexOf(t)},d=function(e){return"Object"!==(0,s["default"])(e)&&"Array"!==(0,s["default"])(e)},p=function(){};e.staticStyles("Leaf",{$leaf:"#_flintdevtools .ViewLeaf",$helper:"#_flintdevtools helper.Leaf, #_flintdevtools .Leaf.helper, #_flintdevtools .ViewLeaf.helper, #_flintdevtools .Leaf > .helper",$boolean:"#_flintdevtools boolean.Leaf, #_flintdevtools .Leaf.boolean, #_flintdevtools .ViewLeaf.boolean, #_flintdevtools .Leaf > .boolean",$number:"#_flintdevtools number.Leaf, #_flintdevtools .Leaf.number, #_flintdevtools .ViewLeaf.number, #_flintdevtools .Leaf > .number",$string:"#_flintdevtools string.Leaf, #_flintdevtools .Leaf.string, #_flintdevtools .ViewLeaf.string, #_flintdevtools .Leaf > .string",$function:"#_flintdevtools function.Leaf, #_flintdevtools .Leaf.function, #_flintdevtools .ViewLeaf.function, #_flintdevtools .Leaf > .function",$colon:"#_flintdevtools colon.Leaf, #_flintdevtools .Leaf.colon, #_flintdevtools .ViewLeaf.colon, #_flintdevtools .Leaf > .colon",$name:"#_flintdevtools name.Leaf, #_flintdevtools .Leaf.name, #_flintdevtools .ViewLeaf.name, #_flintdevtools .Leaf > .name",$children:"#_flintdevtools children.Leaf, #_flintdevtools .Leaf.children, #_flintdevtools .ViewLeaf.children, #_flintdevtools .Leaf > .children",$type:"#_flintdevtools type.Leaf, #_flintdevtools .Leaf.type, #_flintdevtools .ViewLeaf.type, #_flintdevtools .Leaf > .type"},{$leaf:{padding:[1,0],fontSize:13},$helper:{color:"#ffff05"},$boolean:{color:"#32a3cd",fontWeight:700},$number:{color:"#b92222",marginTop:2,fontWeight:500},$string:{color:"#698c17"},$function:{marginLeft:10,marginTop:2,color:"#962eba"},$colon:{opacity:.3,color:"#000"},$name:{color:"#ff2f2f",fontWeight:400,margin:["auto",0]},$children:{paddingLeft:10},$type:{margin:[1,0,0,8],opacity:.7,flexFlow:"row"}}),e.viewRoots.Leaf="leaf",e.view("Leaf",function(t,n,i){function l(e){t.props.root||t.set("expanded",x=!x),t.update(),V(E),e.stopPropagation()}var a=t.prop("isExpanded",void 0),v=t.prop("data",void 0),g=t.prop("prefix",void 0),m=t.prop("query",void 0),h=t.prop("label",void 0),w=t.prop("id",void 0),_=t.prop("editable",void 0);n.props(function(){a=t.getProp("isExpanded"),v=t.getProp("data"),g=t.getProp("prefix"),m=t.getProp("query"),h=t.getProp("label"),w=t.getProp("id"),_=t.getProp("editable")});var b=t.prop("getOriginal",p),y=t.prop("onSet",p),V=t.prop("onClick",p);n.props(function(){b=t.getProp("getOriginal"),y=t.getProp("onSet"),V=t.getProp("onClick")}),t.pause();var $=void 0,M=void 0,E=void 0,I=void 0,k=void 0,S=void 0,x=void 0,C=[],L="",T=function(){return t.props.root||!L&&a(M,v)||!u(M,L)&&"function"==typeof b};n.props(function(){t.set("rootPath",$=g+"."+h),t.set("key",k=h.toString()),t.set("path",M=$.substr(c.length)),t.set("_data",E=v),"string"==typeof E&&E.indexOf("\n")>-1&&t.set("_data",E=E.split("\n")),E&&t.set("dataKeys",C=r(E).sort()),void 0===E&&t.set("_data",E=v),void 0===E&&t.set("_data",E={}),t.set("type",I=(0,s["default"])(E)),t.set("_query",L=m||""),t.props.root?t.set("expanded",x=!0):L&&t.set("expanded",x=!u(h,L)),m&&!L&&t.set("expanded",x=T()),t.update()});var F=function(e,t){return d(t)?e+":"+(0,o["default"])(String(e)):e+"["+(0,s["default"])(t)+"]"},j=function(e){return t.el(["Highlighter",1],{string:e,highlight:L})},P=function(e){return e.toString().replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s))/gm,"").match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].split(/,/)},O=function(e,n,o,i){return t.el(["Label",1],{val:n,editable:i,onSet:function(e){return y([o,e])}})};t.render(function(){return t.el(["leaf",1],{className:$},e.iff(!t.props.root)&&t.el(["label",1],{"if":!t.props.root,htmlFor:w,onClick:l},t.el(["key",1],null,t.el(["name",1],null,j(k)),O("key",k,k,!1)),t.el(["colon",1],null,":"),e.iff("Function"==I)&&t.el(["expand",1],{className:"function","if":"Function"==I},t.el(["i",1],null,"fn (",P(E).join(", "),")")),e.iff("Array"==I)&&t.el(["expand",2],{"if":"Array"==I},t.el(["type",1],null,"Array[",E.length,"]")),e.iff("Object"==I)&&t.el(["expand",3],{"if":"Object"==I},t.el(["type",2],null,"{} "+C.length+" keys")),e.iff(-1==["Array","Object","Function"].indexOf(I))&&t.el(["value",1],{"if":-1==["Array","Object","Function"].indexOf(I),className:I.toLowerCase()},e.iff("string"==I.toLowerCase())&&t.el(["str",1],{"if":"string"==I.toLowerCase()},j((0,f["default"])(String(E),25))),e.iff("string"!=I.toLowerCase())&&t.el(["else",1],{"if":"string"!=I.toLowerCase()},j(String(E))),O("val",E,k,_))),t.el(["children",1],null,e.iff(x&&!d(E))&&e.range(C).map(function(n,o){return t.el(["child",1,n,o],{"if":x&&!d(E),repeat:C},e.iff(-1==n.indexOf("__"))&&t.el(["Leaf",1,n,o],{"if":-1==n.indexOf("__"),key:F(n,E[n]),onSet:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return y.apply(void 0,[k].concat(t))},data:E[n],editable:_,label:n,prefix:$,onClick:V,id:w,query:L,getOriginal:S?null:b,isExpanded:a}))})))});var R={flexFlow:"row"};i.label=function(e,t){return[R,{position:"relative",color:"rgba(0,0,0,0.8)",opacity:1,alignItems:"baseline"}]},i.key=function(e,t){return[R,{color:"rgba(0,0,0,0.9)",margin:[0],fontWeight:"bold"}]},i.expand=function(e,t){return[R,{}]},i.value=function(e,t){return[R,{position:"relative",margin:[0,4,0]}]}})})}(),function(){e.file("inspector/section.js",function(t){e.staticStyles("Inspector.Section",{$:"#_flintdevtools .ViewInspector-Section",$body:"#_flintdevtools body.Inspector-Section, #_flintdevtools .Inspector-Section.body, #_flintdevtools .ViewInspector-Section.body, #_flintdevtools .Inspector-Section > .body",$inactive:"#_flintdevtools inactive.Inspector-Section, #_flintdevtools .Inspector-Section.inactive, #_flintdevtools .ViewInspector-Section.inactive, #_flintdevtools .Inspector-Section > .inactive"},{$:{padding:[5,0]},$body:{padding:[0,12]},$inactive:{display:"none"}}),e.view("Inspector.Section",function(e,t,n){var o=!0;e.render(function(){return e.el(["Inspector.Title",1],{onToggle:function(t){return e.set("open",o=t)}},e.props.title)}),e.render(function(){return e.el(["body",1],null,e.props.children)})})})}();var t=require("babel-runtime/helpers/extends")["default"],i=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector/statetests.js",function(n){var o=n("mouse-event-offset"),r=i(o);e.view("StateTests",function(e,t,n){e.render(function(){return e.el(["Tests.Name",1],null)}),e.render(function(){return e.el(["Tests.Boolean",1],null)}),e.render(function(){return e.el(["Tests.Counter",1],null)}),e.render(function(){return e.el(["Tests.Props",1],null)}),e.render(function(){return e.el(["Tests.Circles",1],null)})}),e.view("Tests.Boolean",function(e,t,n){var o=!1;e.render(function(){return e.el(["h1",1],null,"is tupac dead? ",o.toString())}),e.render(function(){return e.el(["button",1],{onClick:function(){return e.set("dead",o=!o)}},"toggle")})}),e.staticStyles("Tests.Props",{$:"#_flintdevtools .ViewTests-Props"},{$:{marginTop:20}}),e.view("Tests.Props",function(e,t,n){var o="a string";e.render(function(){return e.el(["input",1],{__flintValue:o,__flintOnChange:function(t){e.setImmediate("name",o=t.target.value)}})}),e.render(function(){return e.el(["Test.PropsChild",1],{name:o})})}),e.view("Test.PropsChild",function(e,t,n){var o=e.prop("name",void 0);t.props(function(){o=e.getProp("name")});var i=0;e.render(function(){return e.el(["h1",1],null,"my name is ",o)}),e.render(function(){return e.el(["h4",1],null,"counter to test state ",i)}),e.render(function(){return e.el(["button",1],{onClick:function(){return e.set("count",i++,i,!0)}},"up")})}),e.view("Tests.Counter",function(e,t,n){var o=0;e.render(function(){return e.el(["h1",1],null,"count is ",o)}),e.render(function(){return e.el(["button",1],{onClick:function(){return e.set("count",o++,o,!0)}},"up")}),e.render(function(){return e.el(["button",2],{onClick:function(){return e.set("count",o--,o,!0)}},"down")})}),e.view("Tests.Deep",function(e,t,n){var o={name:"nick",tools:["js","juggling balls","coffee"]};e.render(function(){return e.el(["h1",1],null,"deep")}),e.render(function(){return e.el(["h2",1],null,JSON.stringify(o))})}),e.view("Tests.Name",function(e,t,n){var o="nick",i="cammarata";e.render(function(){return e.el(["h2",1],null,"name is ",o," ",i)}),e.render(function(){return e.el(["input",1],{__flintValue:o,__flintOnChange:function(t){e.setImmediate("first",o=t.target.value)}})}),e.render(function(){return e.el(["input",2],{__flintValue:i,__flintOnChange:function(t){e.setImmediate("last",i=t.target.value)}})}),e.render(function(){return e.el(["button",1],{onClick:function(){e.set("first",o="nate"),e.set("last",i="wienert")}},"nateify")})}),e.staticStyles("Tests.Circles",{$circles:"#_flintdevtools circles.Tests-Circles, #_flintdevtools .Tests-Circles.circles, #_flintdevtools .ViewTests-Circles.circles, #_flintdevtools .Tests-Circles > .circles"},{$circles:{position:"relative",background:"#eee",height:400,width:400}}),e.view("Tests.Circles",function(t,n,o){function i(e){t.set("coords",l.push((0,r["default"])(e)),l,!0)}var l=[[200,200]];t.render(function(){return t.el(["circles",1],{onClick:i},e.range(l).map(function(e,n){return t.el(["Tests.Circle",1,e,n],{repeat:l,key:""+e[0]+e[1],left:e[0],top:e[1]})}))})}),e.view("Tests.Circle",function(e,n,o){var i=function(){return Math.round(255*Math.random())},r={background:[i(),i(),i()],position:"absolute",top:e.props.top,left:e.props.left,width:118,height:29,borderRadius:27},l=function(e){return t({},r,{transform:{scale:e}})};e.render(function(){return e.el(["circle",1],{style:l(1)})})})})}(),function(){e.file("inspector/title.js",function(t){e.staticStyles("Inspector.Title",{$title:"#_flintdevtools title.Inspector-Title, #_flintdevtools .Inspector-Title.title, #_flintdevtools .ViewInspector-Title.title, #_flintdevtools .Inspector-Title > .title",$closed:"#_flintdevtools closed.Inspector-Title, #_flintdevtools .Inspector-Title.closed, #_flintdevtools .ViewInspector-Title.closed, #_flintdevtools .Inspector-Title > .closed",$inner:"#_flintdevtools inner.Inspector-Title, #_flintdevtools .Inspector-Title.inner, #_flintdevtools .ViewInspector-Title.inner, #_flintdevtools .Inspector-Title > .inner"},{$title:{fontWeight:300,borderBottom:"1px solid #eee",height:10,margin:[5,5,8],color:"#999",flexFlow:"row"},$closed:{marginTop:1},$inner:{padding:[4,10],background:"#fff"}}),e.view("Inspector.Title",function(e,t,n){function o(){e.props.onToggle&&(e.set("open",i=!i),e.props.onToggle(i))}var i=!0;e.render(function(){return e.el(["title",1],{onClick:o},e.el(["inner",1],null,e.props.children))}),n.closed=function(e,t){return{transform:{scale:.8}}},n.inner=function(e,t){return{margin:[-2,"auto"]}}})})}();var i=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector/tree.js",function(t){var n=t("../lib/lens"),o=i(n);e.staticStyles("Tree",{$:"#_flintdevtools .ViewTree"},{$:{pointerEvents:"auto",marginLeft:-10}}),e.viewRoots.Tree="Leaf",e.view("Tree",function(e,t,n){var i="",r=function(t){return(0,o["default"])(e.props.data,t)};e.render(function(){return e.el(["Leaf",1],{data:e.props.data,onClick:e.props.onClick,id:e.props.id,getOriginal:r,query:i,label:"root",editable:e.props.editable,root:!0,validateQuery:function(e){return e.length>=2},isExpanded:e.props.isExpanded||function(){return!1},interactiveLabel:e.props.interactiveLabel,onSet:function(){for(var t=arguments.length,n=Array(t),o=0;t>o;o++)n[o]=arguments[o];return e.props.onSet(n)}})})})})}();var r=require("babel-runtime/core-js/object/keys")["default"];!function(){e.file("inspector/view.js",function(t){function n(e){var t=e.split(",");return t[t.length-1].split("-")[0]}function o(e){var t=["if","repeat","style","yield","__flint"];return i.omit.apply(null,[e].concat(t))}var i=t("lodash");e.staticStyles("Inspector.View",{$view:"#_flintdevtools view.Inspector-View, #_flintdevtools .Inspector-View.view, #_flintdevtools .ViewInspector-View.view, #_flintdevtools .Inspector-View > .view",$top:"#_flintdevtools top.Inspector-View, #_flintdevtools .Inspector-View.top, #_flintdevtools .ViewInspector-View.top, #_flintdevtools .Inspector-View > .top",$active:"#_flintdevtools active.Inspector-View, #_flintdevtools .Inspector-View.active, #_flintdevtools .ViewInspector-View.active, #_flintdevtools .Inspector-View > .active",$highlight:"#_flintdevtools highlight.Inspector-View, #_flintdevtools .Inspector-View.highlight, #_flintdevtools .ViewInspector-View.highlight, #_flintdevtools .Inspector-View > .highlight",$Close:"#_flintdevtools .ViewInspector-View .ViewClose",$name:"#_flintdevtools name.Inspector-View, #_flintdevtools .Inspector-View.name, #_flintdevtools .ViewInspector-View.name, #_flintdevtools .Inspector-View > .name",$edit:"#_flintdevtools edit.Inspector-View, #_flintdevtools .Inspector-View.edit, #_flintdevtools .ViewInspector-View.edit, #_flintdevtools .Inspector-View > .edit",$expanded:"#_flintdevtools expanded.Inspector-View, #_flintdevtools .Inspector-View.expanded, #_flintdevtools .ViewInspector-View.expanded, #_flintdevtools .Inspector-View > .expanded",$input:"#_flintdevtools input.Inspector-View, #_flintdevtools .Inspector-View.input, #_flintdevtools .ViewInspector-View.input, #_flintdevtools .Inspector-View > .input",$title:"#_flintdevtools title.Inspector-View, #_flintdevtools .Inspector-View.title, #_flintdevtools .ViewInspector-View.title, #_flintdevtools .Inspector-View > .title",$section:"#_flintdevtools section.Inspector-View, #_flintdevtools .Inspector-View.section, #_flintdevtools .ViewInspector-View.section, #_flintdevtools .Inspector-View > .section"},{$view:{position:"relative",pointerEvents:"auto",margin:10,marginBottom:0,padding:[0,0,1],minWidth:220,minHeight:34,fontSize:12,userSelect:"none",cursor:"default",background:"#fff",boxShadow:"0px 2px 16px rgba(0,0,0,0.2)",border:"1px solid #ccc",borderRadius:5,color:"#333",transition:"all ease-in 60ms",opacity:0},$top:{flexFlow:"row"},$active:{opacity:1},$highlight:{border:"2px solid #afb4e2"},$Close:{top:-5,right:-5,fontSize:13},$name:{fontWeight:400,color:"rgba(0,0,0,0.8)",padding:[8,8,0],fontSize:14},$edit:{padding:[8,8,0],fontSize:14,marginLeft:4,fontWeight:400,color:"rgba(24, 101, 227, 0.8)"},$expanded:{},$input:{borderRadius:100,border:"1px solid #ccc",width:"100%",padding:[2,12],color:"#333",fontSize:14},$title:{display:"none",color:"#333",fontWeight:200,fontSize:12,margin:[3,0]},$section:{background:[0,0,0,.05]}}),e.view("Inspector.View",function(t,i,l){function s(e){t.props.writeBack(c,e)}var a=t.prop("highlight",void 0),f=t.prop("closing",void 0),c=t.prop("path",void 0),u=t.prop("onClose",void 0);i.props(function(){a=t.getProp("highlight"),f=t.getProp("closing"),c=t.getProp("path"),u=t.getProp("onClose")});var d=window.Flint.inspect,p=void 0,v=!1,g={},m=null,h=null;i.delay(60,function(){t.set("active",v=!0)}),i.unmount(function(){delete window._Flint.inspector[c]}),i.props(function(){f===!0&&t.set("active",v=!1),c&&(t.set("name",p=n(c)),_Flint.inspector[c]||d(c,function(e,n,i){console.log("props are",e),t.set("props",m=o(e||{})),t.set("state",g=n||{}),t.set("writeBack",h=i),t.update()}))});var w=function(e){return e&&r(e).length>0},_=function(){return _DT.messageEditor({type:"focus:element",view:p})};t.render(function(){return t.el(["view",1],{className:{active:v,highlight:a}},t.el(["Close",1],{onClick:u,fontSize:20,size:35}),t.el(["top",1],null,t.el(["name",1],null,p),e.iff(!1)&&t.el(["edit",1],{"if":!1,onClick:_},"edit")),e.iff(w(m))&&t.el(["Inspector.Section",1],{title:"Props","if":w(m),className:"props"},t.el(["Tree",1],{editable:!1,data:m})),e.iff(w(g))&&t.el(["Inspector.Section",2],{title:"State","if":w(g)},t.el(["Tree",2],{editable:!0,onSet:s,data:g})))}),l.view=function(e,t){return{transform:{x:20}}},l.active=function(e,t){return{transform:{x:0}}},l.name=function(e,t){return{margin:[0,0,-6]}},l.edit=function(e,t){return{margin:[0,0,-6]}},l.expanded=function(e,t){return{transform:{y:0}}}})})}(),function(){e.file("main.js",function(t){e.staticStyles("Main",{$:"#_flintdevtools .ViewMain"},{$:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2147483647}}),e.view("Main",function(t,n,o){var i=window.__isDevingDevTools,r=!0;t.render(function(){return t.el(["link",1],{rel:"stylesheet",property:"stylesheet",href:"/__/tools/static/tools.css"})}),t.render(function(){return e.iff(!i)&&t.el(["link",2],{ | ||
"if":!i,rel:"stylesheet",property:"stylesheet",href:"/__/tools/styles.css"})}),t.render(function(){return t.el(["Errors",1],null)}),t.render(function(){return t.el(["Installer",1],null)}),t.render(function(){return e.iff(r)&&t.el(["Menu",1],{"if":r})}),t.render(function(){return e.iff(r)&&t.el(["Inspector",1],{"if":r})}),t.render(function(){return e.iff(i)&&t.el(["StateTests",1],{"if":i})}),o.$=function(e,t){return{pointerEvents:i?"auto":"none"}}})})}();var i=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("menu.js",function(t){var n=t("./keys"),o=t("./lib/inspecting"),r=i(o),l=_DT,s=l.messageEditor;e.staticStyles("Menu",{$menu:"#_flintdevtools .ViewMenu",$active:"#_flintdevtools active.Menu, #_flintdevtools .Menu.active, #_flintdevtools .ViewMenu.active, #_flintdevtools .Menu > .active",$item:"#_flintdevtools item.Menu, #_flintdevtools .Menu.item, #_flintdevtools .ViewMenu.item, #_flintdevtools .Menu > .item",$first:"#_flintdevtools first.Menu, #_flintdevtools .Menu.first, #_flintdevtools .ViewMenu.first, #_flintdevtools .Menu > .first",$last:"#_flintdevtools last.Menu, #_flintdevtools .Menu.last, #_flintdevtools .ViewMenu.last, #_flintdevtools .Menu > .last",$hl:"#_flintdevtools hl.Menu, #_flintdevtools .Menu.hl, #_flintdevtools .ViewMenu.hl, #_flintdevtools .Menu > .hl",$main:"#_flintdevtools main.Menu, #_flintdevtools .Menu.main, #_flintdevtools .ViewMenu.main, #_flintdevtools .Menu > .main"},{$menu:{border:"1px solid #ddd",boxShadow:"0 0 10px rgba(0,0,0,0.2)",position:"absolute",background:"#fff",zIndex:2147483647,transition:"opacity ease-in 30ms, transform ease-in 30ms",opacity:0,pointerEvents:"none",padding:0},$active:{pointerEvents:"auto",opacity:1},$item:{minWidth:120,cursor:"pointer",flexFlow:"row"},$first:{overflow:"hidden"},$last:{overflow:"hidden"},$hl:{padding:[4,8]},$main:{flexGrow:1}}),e.viewRoots.Menu="menu",e.view("Menu",function(t,o,i){function l(e){return function(){s({type:"focus:element",key:e.key,view:e.view})}}function a(e){return function(){s({type:"focus:style",el:e.el,view:e.view})}}var f=!1,c=void 0,u=void 0,d=[],p=void 0;o.keydown(function(){n.keys.alt&&n.keys.command&&(document.body.classList.add("__flintfocus"),t.set("focused",p=!0))}),o.keyup(function(){p&&(document.body.classList.remove("__flintfocus"),t.set("focused",p=!1))}),o.click(window,function(e){if(f)return e.stopPropagation(),e.preventDefault(),void t.set("active",f=!1);var o=n.keys.alt&&n.keys.command;if(o){e.preventDefault();var i=e.clientX,l=e.clientY;t.set("left",u=i),t.set("top",c=l),t.set("active",f=!0),t.set("elements",d=r["default"].all())}}),t.render(function(){return t.el(["menu",1],{className:{internal:!0,active:f}},e.range(d.filter(function(e){return!!e.view})).map(function(e,n){return t.el(["item",1,e,n],{repeat:d.filter(function(e){return!!e.view}),className:{first:0==n,last:n==d.length-1}},t.el(["main",1,e,n],{className:"hl",onClick:l(e)},e.view),t.el(["sub",1,e,n],{className:"hl",onClick:a(e)},"$"))}))});var v=5;i.menu=function(e,t){return{borderRadius:v,top:c,left:u,transform:{y:-10}}},i.active=function(e,t){return{transform:{y:0}}},i.first=function(e,t){return{borderTopLeftRadius:v,borderTopRightRadius:v}},i.last=function(e,t){return{borderBottomLeftRadius:v,borderBottomRightRadius:v}},i.hl=function(e,t){return{hover:{background:[0,0,0,.1]}}}})})}(),function(){e.file("modal.js",function(t){e.staticStyles("FlintModal",{$:"#_flintdevtools .ViewFlintModal",$title:"#_flintdevtools title.FlintModal, #_flintdevtools .FlintModal.title, #_flintdevtools .ViewFlintModal.title, #_flintdevtools .FlintModal > .title",$message:"#_flintdevtools message.FlintModal, #_flintdevtools .FlintModal.message, #_flintdevtools .ViewFlintModal.message, #_flintdevtools .FlintModal > .message"},{$:{position:"fixed",right:0,minWidth:80,padding:[7,5],margin:20,background:"#fff",boxShadow:"0 5px 26px rgba(0,0,0,0.13)",border:"1px solid #dadada",fontSize:14,transition:"all ease-in 200ms",textAlign:"center",borderRadius:6,pointerEvents:"auto"},$title:{fontWeight:500,fontSize:15,margin:[0,20]},$message:{fontFamily:"-apple-system, 'Helvetica Nueue', Helvetica, Arial, sans-serif"}}),e.view("FlintModal",function(t,n,o){function i(){return t.set("open",s=t.props.open),l&&!t.props.title?t.update():(t.set("title",l=t.props.title),t.set("children",r=t.props.children),void t.update())}t.pause();var r=void 0,l=void 0,s=void 0;n.props(i),t.render(function(){return t.el(["Close",1],{size:25})}),t.render(function(){return e.iff(l)&&t.el(["title",1],{"if":l},l)}),t.render(function(){return e.iff(r)&&t.el(["message",1],{"if":r},r)}),o.$=function(e,t){return{top:s?0:-140}},o.title=function(e,n){return{color:t.props.titleColor||"#222"}}})})}(),function(){e.file("npm/installer.js",function(t){var n=window._DT;e.view("Installer",function(t,o,i){var r="",l=[],s="",a="",f=0;n.on("package:install",function(){t.set("state",f=1),t.set("name",s=n.data.name)}),n.on("package:installed",function(){t.set("state",f=2),setTimeout(function(){return t.set("state",f=0)},2e3)}),n.on("package:error",function(){t.set("state",f=3),t.set("name",s=n.data.name),t.set("error",a=n.data.error),setTimeout(function(){return t.set("state",f=0)},2e3)}),n.on("package:select",function(){t.set("state",f=4),t.set("versions",l=n.data.versions)});var c=function(e){t.set("version",r=e),n.data.version=e,n.emitter.emit("package:select"),t.set("state",f=1)},u=function(){return t.set("state",f=0)},d=function(e){switch(e){case 1:return"Installing "+s+(r?" "+r:"")+"...";case 2:return"Installed "+s+"!";case 3:return"Error: "+s;case 4:return"Select version"}},p=function(e){switch(e){case 1:return null;case 2:return null;case 3:return a;case 4:return t.el(["Versions",1],{versions:l,onSelect:c})}};t.render(function(){return t.el(["FlintModal",1],{open:f>0,onClose:u,title:d(f),titleColor:3==f?"#8c1919":"#0f8c3c"},e.iff(!1)&&t.el(["InstallerLoading",1],{"if":!1}),p(f))})}),e.staticStyles("Versions",{$version:"#_flintdevtools version.Versions, #_flintdevtools .Versions.version, #_flintdevtools .ViewVersions.version, #_flintdevtools .Versions > .version",$inner:"#_flintdevtools inner.Versions, #_flintdevtools .Versions.inner, #_flintdevtools .ViewVersions.inner, #_flintdevtools .Versions > .inner",$v:"#_flintdevtools v.Versions, #_flintdevtools .Versions.v, #_flintdevtools .ViewVersions.v, #_flintdevtools .Versions > .v",$info:"#_flintdevtools info.Versions, #_flintdevtools .Versions.info, #_flintdevtools .ViewVersions.info, #_flintdevtools .Versions > .info"},{$version:{textAlign:"left",padding:[2,4],borderRadius:2},$inner:{flexFlow:"row"},$v:{flexGrow:1,fontWeight:"bold"},$info:{}}),e.view("Versions",function(t,n,o){t.render(function(){return e.range(t.props.versions).map(function(e,n){return t.el(["version",1,e,n],{repeat:t.props.versions,onClick:function(){return t.props.onSelect(e)}},t.el(["inner",1,e,n],null,t.el(["v",1,e,n],{key:"v"+n},e.version),t.el(["info",1,e,n],null,e.description),t.el(["a",1,e,n],{href:e.homepage,target:"_blank"},"Info")))})}),o.v=function(e,t){return{":hover":{background:"#fff",cursor:"pointer"}}}})})}(),e.start()}(e)}; | ||
//# sourceMappingURL=flinttools.js.map |
@@ -1,375 +0,2 @@ | ||
exports["flinttools-internals"] = | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var packages = {} | ||
packages["keys"] = __webpack_require__(1); | ||
packages["lib/createFilterer"] = __webpack_require__(2); | ||
packages["lib/getType"] = __webpack_require__(5); | ||
packages["lib/inspecting"] = __webpack_require__(6); | ||
packages["lib/lens"] = __webpack_require__(7); | ||
packages["lib/uid"] = __webpack_require__(8); | ||
window.require.setApp("flinttools") | ||
module.exports = packages | ||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var keys = {}; | ||
exports.keys = keys; | ||
var listeners = {}; | ||
var pressListeners = {}; | ||
on.keydown(window, function (e) { | ||
var code = ___keycode(e.keyCode); | ||
keys[code] = true; | ||
keyDown(code); | ||
}); | ||
on.keyup(window, function (e) { | ||
var code = ___keycode(e.keyCode); | ||
keys[code] = false; | ||
keyUp(code); | ||
}); | ||
on.keypress(window, function (e) { | ||
var code = ___keycode(e.keyCode); | ||
var queue = pressListeners[code]; | ||
queue && queue.forEach(function (listener) { | ||
return listener(); | ||
}); | ||
}); | ||
function keyDown(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(true); | ||
}); | ||
} | ||
function keyUp(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(false); | ||
}); | ||
} | ||
function onKey(code, fn) { | ||
listeners[code] = listeners[code] || []; | ||
listeners[code].push(fn); | ||
} | ||
exports.onKey = onKey; | ||
function onKeyPress(code, fn) { | ||
pressListeners[code] = pressListeners[code] || []; | ||
pressListeners[code].push(fn); | ||
} | ||
exports.onKeyPress = onKeyPress; | ||
function onKeyDown(code, fn) { | ||
onKey(code, function (val) { | ||
return val && fn(); | ||
}); | ||
} | ||
exports.onKeyDown = onKeyDown; | ||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$assign = __webpack_require__(3).default; | ||
var _Object$keys = __webpack_require__(4).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var assign = _Object$assign; | ||
var keys = _Object$keys; | ||
function createFilterer(data, options) { | ||
options || (options = {}); | ||
var cache = {}; | ||
return function (query) { | ||
var subquery; | ||
if (!cache[query]) { | ||
for (var i = query.length - 1; i > 0; i -= 1) { | ||
subquery = query.substr(0, i); | ||
if (cache[subquery]) { | ||
cache[query] = find(cache[subquery], query, options); | ||
break; | ||
} | ||
} | ||
} | ||
if (!cache[query]) { | ||
cache[query] = find(data, query, options); | ||
} | ||
return cache[query]; | ||
}; | ||
} | ||
exports.default = createFilterer; | ||
; | ||
function find(data, query, options) { | ||
return keys(data).reduce(function (acc, key) { | ||
var value = data[key]; | ||
var matches; | ||
if (isPrimitive(value)) { | ||
if (contains(query, key, options) || contains(query, value, options)) { | ||
acc[key] = value; | ||
} | ||
} else { | ||
if (contains(query, key, options)) { | ||
acc[key] = value; | ||
} else { | ||
matches = find(value, query, options); | ||
if (!isEmpty(matches)) { | ||
assign(acc, pair(key, matches)); | ||
} | ||
} | ||
} | ||
return acc; | ||
}, {}); | ||
} | ||
function contains(query, string, options) { | ||
if (options.ignoreCase) { | ||
query = String(query).toLowerCase(); | ||
return string && String(string).toLowerCase().indexOf(query) !== -1; | ||
} else { | ||
return string && String(string).indexOf(query) !== -1; | ||
} | ||
} | ||
function isPrimitive(value) { | ||
var t = getType(value); | ||
return t !== 'Object' && t !== 'Array'; | ||
} | ||
function pair(key, value) { | ||
var p = {}; | ||
p[key] = value; | ||
return p; | ||
} | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("babel-runtime/core-js/object/assign"); | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("babel-runtime/core-js/object/keys"); | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function getType(value) { | ||
return Object.prototype.toString.call(value).slice(8, -1); | ||
} | ||
exports.default = getType; | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$keys = __webpack_require__(4).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var el = undefined; | ||
var reactKey = null; | ||
var getReactKey = function getReactKey(el) { | ||
return _Object$keys(el).filter(function (k) { | ||
return k.indexOf('__reactInternalInst') == 0; | ||
})[0]; | ||
}; | ||
function getReactId(el) { | ||
if (!reactKey) reactKey = getReactKey(el); | ||
if (!el[reactKey]) return; | ||
var current = el[reactKey]._currentElement; | ||
if (!current || !current.key) return null; | ||
var key = current.key; | ||
var split = key.split('$'); | ||
return split[split.length - 1]; | ||
} | ||
var Inspecting = { | ||
set: function set(_) { | ||
el = _; | ||
}, | ||
get: function get() { | ||
return el; | ||
}, | ||
props: function props(el) { | ||
return { | ||
key: getReactId(el), | ||
el: el.tagName.toLowerCase(), | ||
view: el.className.split(' ').filter(function (s) { | ||
return s.substr(0, 4) != 'View'; | ||
}).filter(function (s) { | ||
return s.charAt(0).toUpperCase() == s.charAt(0); | ||
})[0] | ||
}; | ||
}, | ||
all: function all() { | ||
var cur = el; | ||
var parents = [this.props(cur)]; | ||
// walk upwards, find unique views | ||
while (cur.parentNode && cur.parentNode.tagName) { | ||
var _parent = cur.parentNode; | ||
var last = parents[parents.length - 1]; | ||
var next = this.props(_parent); | ||
if (next.view && next.view != last.view) { | ||
// filter __flintfocus | ||
if (next.view[0] != '_') { | ||
parents.push(next); | ||
} | ||
} | ||
cur = _parent; | ||
} | ||
return parents; | ||
} | ||
}; | ||
exports.default = Inspecting; | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var PATH_DELIMITER = '.'; | ||
function lens(data, path) { | ||
var p = path.split(PATH_DELIMITER); | ||
var segment = p.shift(); | ||
if (!segment) { | ||
return data; | ||
} | ||
var t = getType(data); | ||
if (t === 'Array' && data[integer(segment)]) { | ||
return lens(data[integer(segment)], p.join(PATH_DELIMITER)); | ||
} else if (t === 'Object' && data[segment]) { | ||
return lens(data[segment], p.join(PATH_DELIMITER)); | ||
} | ||
} | ||
exports.default = lens; | ||
function integer(string) { | ||
return parseInt(string, 10); | ||
} | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 8 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var id = Math.ceil(Math.random() * 10); | ||
function uid() { | ||
return id++; | ||
} | ||
exports.default = uid; | ||
module.exports = exports.default; | ||
/***/ } | ||
/******/ ]); | ||
exports["flinttools-internals"]=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){var n={};n.keys=r(1),n["lib/createFilterer"]=r(4),n["lib/getType"]=r(7),n["lib/inspecting"]=r(8),n["lib/lens"]=r(9),n["lib/uid"]=r(10),window.require.setApp("flinttools"),e.exports=n},function(e,t,r){function n(e){d[e]&&d[e].forEach(function(e){return e(!0)})}function o(e){d[e]&&d[e].forEach(function(e){return e(!1)})}function u(e,t){d[e]=d[e]||[],d[e].push(t)}function i(e,t){p[e]=p[e]||[],p[e].push(t)}function a(e,t){u(e,function(e){return e&&t()})}var f=r(2)["default"];Object.defineProperty(t,"__esModule",{value:!0});var c=r(3),l=f(c),s={};t.keys=s;var d={},p={};on.keydown(window,function(e){var t=(0,l["default"])(e.keyCode);s[t]=!0,n(t)}),on.keyup(window,function(e){var t=(0,l["default"])(e.keyCode);s[t]=!1,o(t)}),on.keypress(window,function(e){var t=(0,l["default"])(e.keyCode),r=p[t];r&&r.forEach(function(e){return e()})}),t.onKey=u,t.onKeyPress=i,t.onKeyDown=a},function(e,t){e.exports=require("babel-runtime/helpers/interop-require-default")},function(e,t){e.exports=require("keycode")},function(e,t,r){function n(e,t){t||(t={});var r={};return function(n){var u;if(!r[n])for(var i=n.length-1;i>0;i-=1)if(u=n.substr(0,i),r[u]){r[n]=o(r[u],n,t);break}return r[n]||(r[n]=o(e,n,t)),r[n]}}function o(e,t,r){return s(e).reduce(function(n,f){var c,s=e[f];return i(s)?(u(t,f,r)||u(t,s,r))&&(n[f]=s):u(t,f,r)?n[f]=s:(c=o(s,t,r),isEmpty(c)||l(n,a(f,c))),n},{})}function u(e,t,r){return r.ignoreCase?(e=String(e).toLowerCase(),t&&-1!==String(t).toLowerCase().indexOf(e)):t&&-1!==String(t).indexOf(e)}function i(e){var t=getType(e);return"Object"!==t&&"Array"!==t}function a(e,t){var r={};return r[e]=t,r}var f=r(5)["default"],c=r(6)["default"];Object.defineProperty(t,"__esModule",{value:!0});var l=f,s=c;t["default"]=n,e.exports=t["default"]},function(e,t){e.exports=require("babel-runtime/core-js/object/assign")},function(e,t){e.exports=require("babel-runtime/core-js/object/keys")},function(e,t){function r(e){return Object.prototype.toString.call(e).slice(8,-1)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r,e.exports=t["default"]},function(e,t,r){function n(e){if(i||(i=a(e)),e[i]){var t=e[i]._currentElement;if(!t||!t.key)return null;var r=t.key,n=r.split("$");return n[n.length-1]}}var o=r(6)["default"];Object.defineProperty(t,"__esModule",{value:!0});var u=void 0,i=null,a=function(e){return o(e).filter(function(e){return 0==e.indexOf("__reactInternalInst")})[0]},f={set:function(e){u=e},get:function(){return u},props:function(e){return{key:n(e),el:e.tagName.toLowerCase(),view:e.className.split(" ").filter(function(e){return"View"!=e.substr(0,4)}).filter(function(e){return e.charAt(0).toUpperCase()==e.charAt(0)})[0]}},all:function(){for(var e=u,t=[this.props(e)];e.parentNode&&e.parentNode.tagName;){var r=e.parentNode,n=t[t.length-1],o=this.props(r);o.view&&o.view!=n.view&&"_"!=o.view[0]&&t.push(o),e=r}return t}};t["default"]=f,e.exports=t["default"]},function(e,t){function r(e,t){var u=t.split(o),i=u.shift();if(!i)return e;var a=getType(e);return"Array"===a&&e[n(i)]?r(e[n(i)],u.join(o)):"Object"===a&&e[i]?r(e[i],u.join(o)):void 0}function n(e){return parseInt(e,10)}Object.defineProperty(t,"__esModule",{value:!0});var o=".";t["default"]=r,e.exports=t["default"]},function(e,t){function r(){return n++}Object.defineProperty(t,"__esModule",{value:!0});var n=Math.ceil(10*Math.random());t["default"]=r,e.exports=t["default"]}]); | ||
//# sourceMappingURL=internals.js.map | ||
//# sourceMappingURL=internals.js.map |
{ | ||
"name": "flint-tools", | ||
"version": "1.4.24", | ||
"version": "1.4.25", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "clone": { |
@@ -6,3 +6,3 @@ { | ||
"description": "tools", | ||
"version": "1.4.24", | ||
"version": "1.4.25", | ||
"main": "index.js", | ||
@@ -9,0 +9,0 @@ "scripts": {}, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5288830
19695
3