flint-tools
Advanced tools
Comparing version 1.5.3 to 1.5.4
var packages = {} | ||
packages["babel-runtime/helpers/interop-require-default"] = require("babel-runtime/helpers/interop-require-default"); | ||
packages["keycode"] = require("keycode"); | ||
packages["keycode"] = require("keycode"); | ||
packages["babel-runtime/helpers/interop-require-default"] = require("babel-runtime/helpers/interop-require-default"); | ||
packages["lodash"] = require("lodash"); | ||
packages["babel-runtime/helpers/extends"] = require("babel-runtime/helpers/extends"); | ||
packages["babel-runtime/helpers/to-array"] = require("babel-runtime/helpers/to-array"); | ||
packages["babel-runtime/helpers/sliced-to-array"] = require("babel-runtime/helpers/sliced-to-array"); | ||
packages["lodash"] = require("lodash"); | ||
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"); | ||
@@ -14,3 +15,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"); | ||
@@ -17,0 +17,0 @@ |
@@ -1,1 +0,1 @@ | ||
["babel-runtime/helpers/interop-require-default","keycode","babel-runtime/helpers/extends","babel-runtime/helpers/to-array","babel-runtime/helpers/sliced-to-array","lodash","babel-runtime/core-js/object/keys","md5-o-matic","ellipsize","mouse-event-offset","babel-runtime/core-js/object/assign"] | ||
["keycode","babel-runtime/helpers/interop-require-default","lodash","babel-runtime/helpers/extends","babel-runtime/helpers/to-array","babel-runtime/helpers/sliced-to-array","babel-runtime/core-js/object/assign","babel-runtime/core-js/object/keys","md5-o-matic","ellipsize","mouse-event-offset"] |
@@ -5,2 +5,3 @@ | ||
packages["keys"] = require("./internal/keys"); | ||
packages["errors/helpers"] = require("./internal/errors/helpers"); | ||
packages["lib/createFilterer"] = require("./internal/lib/createFilterer"); | ||
@@ -7,0 +8,0 @@ packages["lib/getType"] = require("./internal/lib/getType"); |
@@ -52,7 +52,8 @@ exports["flinttools-internals"] = | ||
packages["keys"] = __webpack_require__(1); | ||
packages["lib/createFilterer"] = __webpack_require__(4); | ||
packages["lib/getType"] = __webpack_require__(7); | ||
packages["lib/inspecting"] = __webpack_require__(8); | ||
packages["lib/lens"] = __webpack_require__(9); | ||
packages["lib/uid"] = __webpack_require__(10); | ||
packages["errors/helpers"] = __webpack_require__(4); | ||
packages["lib/createFilterer"] = __webpack_require__(5); | ||
packages["lib/getType"] = __webpack_require__(8); | ||
packages["lib/inspecting"] = __webpack_require__(9); | ||
packages["lib/lens"] = __webpack_require__(10); | ||
packages["lib/uid"] = __webpack_require__(11); | ||
@@ -153,7 +154,141 @@ | ||
/* 4 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var browser = window._DT; | ||
exports.browser = browser; | ||
var isLive = function isLive() { | ||
return browser.editor && browser.editor.live; | ||
}; | ||
exports.isLive = isLive; | ||
var split = function split(s, i) { | ||
return [s.substring(0, i), s.substring(i, i + 1), s.substring(i + 1)]; | ||
}; | ||
function showFlintErrorDiv() { | ||
setTimeout(function () { | ||
// avoid showing if error fixed in meantime | ||
if (!browser.curError) return; | ||
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 : 100); | ||
} | ||
exports.showFlintErrorDiv = showFlintErrorDiv; | ||
function niceRuntimeError(err) { | ||
if (err.file) err.file = err.file.replace(new RegExp('.*' + window.location.origin + '(\/[_]+\/)?'), ''); | ||
if (err.file && err.file === 'flint.dev.js') { | ||
err.file = 'Flint'; | ||
err.line = null; | ||
} | ||
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; | ||
} | ||
exports.niceRuntimeError = niceRuntimeError; | ||
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 }; | ||
} | ||
exports.niceNpmError = niceNpmError; | ||
var niceCompilerError = function niceCompilerError(err) { | ||
return niceCompilerMessage(fullStack(niceStack(err))); | ||
}; | ||
exports.niceCompilerError = niceCompilerError; | ||
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; | ||
}; | ||
exports.niceCompilerMessage = niceCompilerMessage; | ||
var matchErrorLine = /\>?\s*([0-9]*)\s*\|(.*)/g; | ||
var indicator = /\s*\|\s*\^\s*$/g; | ||
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; | ||
} | ||
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); | ||
}; | ||
exports.log = log; | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$assign = __webpack_require__(5).default; | ||
var _Object$assign = __webpack_require__(6).default; | ||
var _Object$keys = __webpack_require__(6).default; | ||
var _Object$keys = __webpack_require__(7).default; | ||
@@ -242,3 +377,3 @@ Object.defineProperty(exports, '__esModule', { | ||
/***/ }, | ||
/* 5 */ | ||
/* 6 */ | ||
/***/ function(module, exports) { | ||
@@ -249,3 +384,3 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
@@ -256,3 +391,3 @@ | ||
/***/ }, | ||
/* 7 */ | ||
/* 8 */ | ||
/***/ function(module, exports) { | ||
@@ -272,6 +407,6 @@ | ||
/***/ }, | ||
/* 8 */ | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$keys = __webpack_require__(6).default; | ||
var _Object$keys = __webpack_require__(7).default; | ||
@@ -349,3 +484,3 @@ Object.defineProperty(exports, '__esModule', { | ||
/***/ }, | ||
/* 9 */ | ||
/* 10 */ | ||
/***/ function(module, exports) { | ||
@@ -383,3 +518,3 @@ | ||
/***/ }, | ||
/* 10 */ | ||
/* 11 */ | ||
/***/ function(module, exports) { | ||
@@ -386,0 +521,0 @@ |
@@ -1,1 +0,1 @@ | ||
{"opts":{"appDir":"/Users/nw/flint/apps/tools","name":"flint-tools","saneName":"flinttools","hasRunInitialBuild":false,"defaultPort":4000,"version":"1.5.9","watch":true,"build":true,"flintDir":"/Users/nw/flint/apps/tools/.flint","modulesDir":"/Users/nw/flint/apps/tools/.flint/node_modules","internalDir":"/Users/nw/flint/apps/tools/.flint/.internal","depsDir":"/Users/nw/flint/apps/tools/.flint/.internal/deps","template":".flint/index.html","buildDir":"/Users/nw/flint/apps/tools/.flint/build","deps":{"dir":"/Users/nw/flint/apps/tools/.flint/.internal/deps","assetsDir":"/Users/nw/flint/apps/tools/.flint/.internal/deps/assets","internalsIn":"/Users/nw/flint/apps/tools/.flint/.internal/deps/internals.in.js","internalsOut":"/Users/nw/flint/apps/tools/.flint/.internal/deps/internals.js","externalsIn":"/Users/nw/flint/apps/tools/.flint/.internal/deps/externals.in.js","externalsOut":"/Users/nw/flint/apps/tools/.flint/.internal/deps/externals.js","externalsPaths":"/Users/nw/flint/apps/tools/.flint/.internal/deps/externals.paths.js"},"configFile":"/Users/nw/flint/apps/tools/.flint/flint.json","stateFile":"/Users/nw/flint/apps/tools/.flint/.internal/state.json","outDir":"/Users/nw/flint/apps/tools/.flint/.internal/out","styleDir":"/Users/nw/flint/apps/tools/.flint/.internal/styles","styleOutDir":"/Users/nw/flint/apps/tools/.flint/build/_/styles.css","config":{"minify":false,"debug":false,"selectorPrefix":"#_flintdevtools ","tools":"false","build":{"minify":false},"pretty":true}},"installed":["keycode","lodash","md5-o-matic","ellipsize","mouse-event-offset"],"port":4001,"wport":6284,"cache":{"files":{"main.js":{"added":1454458396845,"views":["Main"],"isInternal":false,"meta":{"Main":{"location":[[22,0],[43,1]],"file":"/Users/nw/flint/apps/tools/main.js","styles":{"":{"location":[[36,2],[42,3]]}},"els":{"link":{"location":[[27,2],[27,92]],"key":2},"Errors":{"location":[[29,2],[29,12]],"key":1},"Installer":{"location":[[30,2],[30,15]],"key":1},"DevBar":{"location":[[31,2],[31,12]],"key":1},"Menu":{"location":[[32,2],[32,29]],"key":1},"Inspector":{"location":[[33,2],[33,34]],"key":1},"StateTests":{"location":[[34,2],[34,30]],"key":1}}}},"externals":["babel-runtime/helpers/interop-require-default","keycode"],"internals":[],"outsideSrc":"var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;(function () { Flint.file('main.js', function (require) { var _keycode = require('keycode'); var _keycode2 = _interopRequireDefault(_keycode); window.___keycode = _keycode2.default; var keysCorrect = function keysCorrect(_ref) { var altKey = _ref.altKey; var metaKey = _ref.metaKey; return altKey && !metaKey; }; var offAlt = null; function checkInspect(e) { if (keysCorrect(e)) { // wait a little so were not toooo eager offAlt = on.delay(180, function () { if (keysCorrect(e)) { }); 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 view.el(['DevBar', 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' }; }; }); })})();","writtenAt":1454458397007,"error":null},"close.js":{"added":1454458396977,"views":["Close"],"isInternal":false,"meta":{"Close":{"location":[[0,0],[24,1]],"file":"/Users/nw/flint/apps/tools/close.js","styles":{"":{"location":[[5,2],[23,3]]}},"els":{"close":{"location":[[1,2],[1,38]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":" { 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 } }; }; }); })})();","writtenAt":1454458397008,"error":null},"debounce.js":{"added":1454458397013,"views":["Debounce"],"isInternal":false,"meta":{"Debounce":{"location":[[10,0],[67,1]],"file":"/Users/nw/flint/apps/tools/debounce.js","styles":{},"els":{}}},"externals":[],"internals":[],"outsideSrc":"(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; view.update(); } // debounce clearTimeout(timeout); view.set(\"timeout\", timeout = setTimeout(show, curDelay)); view.updateSoft(); }); }); })})();","writtenAt":1454458397048,"error":null},"devbar.js":{"added":1454458397052,"views":["DevBar"],"isInternal":false,"meta":{"DevBar":{"location":[[9,0],[78,1]],"file":"/Users/nw/flint/apps/tools/devbar.js","styles":{"bar":{"location":[[45,2],[56,3]]},"pin":{"location":[[58,2],[62,3]]},"label":{"location":[[64,2],[69,3]]},"fps":{"location":[[71,2],[73,3]]},"button":{"location":[[75,2],[77,3]]}},"els":{"bar":{"location":[[37,2],[37,26]],"key":1},"fps":{"location":[[38,4],[38,9]],"key":1},"label":{"location":[[39,6],[39,13]],"key":1},"button":{"location":[[40,6],[40,55]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":"(function () { Flint.file('devbar.js', function (require) { var avg = function avg(xs) { var sum = 0; if (xs.length === 0) return 0; for (var i = 0; i < xs.length; i++) { sum += parseInt(xs[i], 10); } return sum / xs.length; ;view.render(function () { return Flint.iff(hud || pinned) && view.el( ['bar', 1], { if: hud || pinned }, view.el( ['fps', 1], null, view.el( ['label', 1], null, 'Live: ', ('' + fps).substr(0, 6), ' FPS' ), view.el( ['button', 1], { onClick: function () { view.set('times', times = []);setAvg();view.updateSoft(); } }, 'reset' ) ) ); }); }); })})();/*<pin onClick={togglePin }>Pin</pin>*/","writtenAt":1454458397093,"error":null},"errors.js":{"added":1454458397097,"views":["Errors","ErrorMessage","ErrorIcon"],"isInternal":false,"meta":{"Errors":{"location":[[125,0],[190,1]],"file":"/Users/nw/flint/apps/tools/errors.js","styles":{},"els":{"ErrorMessage":{"location":[[185,2],[189,4]],"key":1}}},"ErrorMessage":{"location":[[197,0],[370,1]],"file":"/Users/nw/flint/apps/tools/errors.js","styles":{"bar":{"location":[[273,2],[290,3]]},"inner":{"location":[[292,2],[296,3]]},"top":{"location":[[298,2],[301,3]]},"where":{"location":[[303,2],[308,3]]},"line":{"location":[[310,2],[314,3]]},"flint":{"location":[[316,2],[320,3]]},"shortError":{"location":[[322,2],[325,3]]},"niceStack":{"location":[[334,2],[334,20]]},"cur":{"location":[[336,2],[338,3]]},"errCol":{"location":[[340,2],[346,3]]},"fullStack":{"location":[[348,2],[359,4]]},"ln":{"location":[[361,2],[363,3]]},"flintline":{"location":[[365,2],[369,3]]}},"els":{"Debounce":{"location":[[226,2],[232,3]],"key":1},"bar":{"location":[[233,4],[233,9]],"key":1},"Close":{"location":[[234,6],[234,52]],"key":1},"inner":{"location":[[239,6],[239,13]],"key":2},"where":{"location":[[241,10],[241,17]],"key":2},"flint":{"location":[[243,40],[243,57]],"key":3},"top":{"location":[[240,8],[240,13]],"key":1},"span":{"location":[[242,12],[242,18]],"key":1},"line":{"location":[[243,12],[243,18]],"key":1},"shortError":{"location":[[248,10],[248,22]],"key":1},"niceStack":{"location":[[250,12],[250,44]],"key":1},"errCol":{"location":[[252,14],[252,22]],"key":1},"help":{"location":[[257,10],[257,32]],"key":1},"fullStack":{"location":[[262,8],[262,34]],"key":1},"ln":{"location":[[265,10],[265,14]],"key":3}}},"ErrorIcon":{"location":[[372,0],[390,1]],"file":"/Users/nw/flint/apps/tools/errors.js","styles":{"svg":{"location":[[382,2],[389,3]]}},"els":{"svg":{"location":[[373,2],[373,35]],"key":1},"path":{"location":[[378,4],[379,53]],"key":2},"polygon":{"location":[[377,4],[377,78]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":"(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; }; // TODO make beautiful var CUR_ERROR = undefined; function showFlintErrorDiv() { setTimeout(function () { // avoid showing if error fixed in meantime if (!CUR_ERROR) return; 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 : 100); } function niceRuntimeError(err) { if (err.file) err.file = err.file.replace(new RegExp('.*' + window.location.origin + '(\\/[_]+\\/)?'), ''); if (err.file && err.file === 'flint.dev.js') { err.file = 'Flint'; err.line = null; } 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, $) { var error = null; var compileError = null; 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)' }, $[\"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' }) ); }); }); })})();","writtenAt":1454458397240,"error":null},"inspector.js":{"added":1454458397245,"views":["Inspector"],"isInternal":false,"meta":{"Inspector":{"location":[[122,0],[219,1]],"file":"/Users/nw/flint/apps/tools/inspector.js","styles":{"":{"location":[[214,2],[218,3]]}},"els":{"Inspector.View":{"location":[[206,2],[212,4]],"key":1}}}},"externals":["babel-runtime/helpers/extends","babel-runtime/helpers/to-array","babel-runtime/helpers/sliced-to-array","babel-runtime/helpers/interop-require-default","lodash"],"internals":["./lib/inspecting","./keys"],"outsideSrc":"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 _libInspecting = require('./lib/inspecting'); var _libInspecting2 = _interopRequireDefault(_libInspecting); var _keys = require('./keys'); 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 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; })); view.updateSoft(); }); view.updateSoft(); } function glue(_ref4) { var target = _ref4.target; var inspector = ReactDOM.findDOMNode(view); if (inspector.contains(target)) return; view.set('views', views = toggleView(removeTemp(views), findPath(target))); return false; view.updateSoft(); } function showInspect() { inspect(lastTarget); view.set('hudActive', hudActive = true); view.set('clickOff', clickOff = on.click(window, glue)); view.updateSoft(); } function hideInspect() { internal().isInspecting = false; view.set('hudActive', hudActive = false); hideHighlight(); clickOff && clickOff(); view.set('views', views = removeTemp(views)); view.updateSoft(); } 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); } })); }); }); }); })})();","writtenAt":1454458397330,"error":null},"keys.js":{"added":1454458397330,"views":[],"isInternal":true,"meta":{},"externals":["babel-runtime/helpers/interop-require-default","keycode"],"internals":[]},"menu.js":{"added":1454458397355,"views":["Menu"],"isInternal":false,"meta":{"Menu":{"location":[[6,0],[125,1]],"file":"/Users/nw/flint/apps/tools/menu.js","styles":{"menu":{"location":[[74,2],[88,3]]},"active":{"location":[[90,2],[94,3]]},"item":{"location":[[96,2],[100,3]]},"first":{"location":[[102,2],[106,3]]},"last":{"location":[[108,2],[112,3]]},"hl":{"location":[[114,2],[120,3]]},"main":{"location":[[122,2],[124,3]]}},"els":{"menu":{"location":[[59,2],[59,43]],"key":1},"item":{"location":[[60,4],[66,5]],"key":1},"main":{"location":[[67,6],[67,49]],"key":1},"sub":{"location":[[68,6],[68,46]],"key":1}}}},"externals":["babel-runtime/helpers/interop-require-default"],"internals":["./keys","./lib/inspecting"],"outsideSrc":"var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;(function () { Flint.file('menu.js', function (require) { var _keys = require('./keys'); ['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] } }; }; }); })})();","writtenAt":1454458397431,"error":null},"modal.js":{"added":1454458397406,"views":["FlintModal"],"isInternal":false,"meta":{"FlintModal":{"location":[[0,0],[40,1]],"file":"/Users/nw/flint/apps/tools/modal.js","styles":{"":{"location":[[13,2],[28,3]]},"title":{"location":[[30,2],[35,3]]},"message":{"location":[[37,2],[39,3]]}},"els":{"Close":{"location":[[9,2],[9,21]],"key":1},"title":{"location":[[10,2],[10,24]],"key":1},"message":{"location":[[11,2],[11,25]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":" }); var lastTitle = undefined; on.props(function () { view.set('lastTitle', lastTitle = title || lastTitle); view.updateSoft(); });view.render(function () { return view.el(['Close', 1], { size: 25 }); });view.render(function () { return Flint.iff(lastTitle) && view.el( ['title', 1], { if: lastTitle }, lastTitle ); });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' }; }; }); })})();","writtenAt":1454458397431,"error":null},"inspector/highlighter.js":{"added":1454458397433,"views":["Highlighter"],"isInternal":false,"meta":{"Highlighter":{"location":[[2,0],[12,1]],"file":"/Users/nw/flint/apps/tools/inspector/highlighter.js","styles":{},"els":{"name":{"location":[[3,2],[3,93]],"key":1},"span":{"location":[[7,4],[7,45]],"key":2},"highlight":{"location":[[8,6],[8,33]],"key":1}}}},"externals":["babel-runtime/core-js/object/keys"],"internals":[],"outsideSrc":"var _Object$keys = require(\"babel-runtime/core-js/object/keys\").default; 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 ), _ ); }) ); }); }); })})();","writtenAt":1454458397481,"error":null},"inspector/label.js":{"added":1454458397450,"views":["Label"],"isInternal":false,"meta":{"Label":{"location":[[2,0],[72,1]],"file":"/Users/nw/flint/apps/tools/inspector/label.js","styles":{"input":{"location":[[53,2],[67,3]]},"focus":{"location":[[69,2],[71,3]]}},"els":{"input":{"location":[[40,2],[51,4]],"key":1}}}},"externals":["babel-runtime/helpers/extends","lodash"],"internals":[],"outsideSrc":"var _extends = require('babel-runtime/helpers/extends').default; view.updateSoft(); }; 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' }; }; }); })})();","writtenAt":1454458397587,"error":null},"inspector/leaf.js":{"added":1454458397487,"views":["Leaf"],"isInternal":false,"meta":{"Leaf":{"location":[[19,0],[211,1]],"file":"/Users/nw/flint/apps/tools/inspector/leaf.js","styles":{"leaf":{"location":[[151,2],[154,3]]},"label":{"location":[[160,2],[165,4]]},"helper":{"location":[[167,2],[167,32]]},"boolean":{"location":[[168,2],[168,50]]},"number":{"location":[[169,2],[169,63]]},"string":{"location":[[170,2],[170,32]]},"key":{"location":[[172,2],[176,4]]},"function":{"location":[[178,2],[182,3]]},"colon":{"location":[[184,2],[187,3]]},"name":{"location":[[189,2],[193,3]]},"expand":{"location":[[195,2],[195,17]]},"value":{"location":[[197,2],[200,4]]},"children":{"location":[[202,2],[204,3]]},"type":{"location":[[206,2],[210,3]]}},"els":{"Highlighter":{"location":[[78,4],[78,51]],"key":1},"Label":{"location":[[82,4],[86,6]],"key":1},"leaf":{"location":[[102,2],[102,25]],"key":1},"label":{"location":[[103,4],[103,63]],"key":1},"key":{"location":[[104,6],[104,11]],"key":1},"name":{"location":[[105,8],[105,14]],"key":1},"colon":{"location":[[107,6],[107,13]],"key":1},"value":{"location":[[108,6],[108,13]],"key":1},"fn":{"location":[[109,8],[109,46]],"key":1},"i":{"location":[[110,10],[110,13]],"key":1},"array":{"location":[[112,8],[112,29]],"key":1},"type":{"location":[[116,10],[116,16]],"key":2},"obj":{"location":[[115,8],[115,28]],"key":1},"nested":{"location":[[118,8],[118,58]],"key":1},"str":{"location":[[119,10],[119,30]],"key":1},"else":{"location":[[122,10],[122,46]],"key":1},"children":{"location":[[129,4],[129,14]],"key":1},"child":{"location":[[130,6],[132,26]],"key":1},"Leaf":{"location":[[133,8],[146,10]],"key":1}}}},"externals":["babel-runtime/core-js/object/keys","babel-runtime/helpers/interop-require-default","md5-o-matic","ellipsize","lodash"],"internals":["../lib/getType"],"outsideSrc":"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 _lodash = require('lodash'); null, ':' ), view.el( ['value', 1], null, Flint.iff(is['function']) && view.el( ['fn', 1], { className: 'function', if: is['function'] }, view.el( ['i', 1], null, 'fn (', fnParams(_data).join(', '), ')' ) ), Flint.iff(is.array) && view.el( ['array', 1], { if: is.array }, view.el( ['type', 1], null, 'Array[', _data.length, ']' ) ), Flint.iff(is.object) && view.el( ['obj', 1], { if: is.object }, view.el( ['type', 2], null, '{} ' + dataKeys.length + ' keys' ) ), Flint.iff(is.nested) && view.el( ['nested', 1], { if: is.nested, className: type.toLowerCase() }, Flint.iff(is.string) && view.el( ['str', 1], { if: is.string }, format((0, _ellipsize2.default)(String(_data), 25)) ), Flint.iff(!is.string && is.literal) && view.el( ['else', 1], { if: !is.string && is.literal }, 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] }]; }; }); })})();","writtenAt":1454458397603,"error":null},"inspector/section.js":{"added":1454458397588,"views":["Inspector.Section"],"isInternal":false,"meta":{"Inspector.Section":{"location":[[0,0],[21,1]],"file":"/Users/nw/flint/apps/tools/inspector/section.js","styles":{"":{"location":[[10,2],[12,3]]},"body":{"location":[[14,2],[16,3]]},"inactive":{"location":[[18,2],[20,3]]}},"els":{"Inspector.Title":{"location":[[3,2],[3,48]],"key":1},"body":{"location":[[6,2],[6,8]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":" view.set('open', open = val); view.updateSoft(); } }, view.props.title ); });view.render(function () { return view.el( ['body', 1], null, view.props.children ); }); }); })})();","writtenAt":1454458397604,"error":null},"inspector/statetests.js":{"added":1454458397605,"views":["StateTests","Tests.Boolean","Tests.Props","Test.PropsChild","Tests.Counter","Tests.Deep","Tests.Name","Tests.Circles","Tests.Circle"],"isInternal":false,"meta":{"StateTests":{"location":[[2,0],[8,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"Tests.Name":{"location":[[3,2],[3,16]],"key":1},"Tests.Boolean":{"location":[[4,2],[4,19]],"key":1},"Tests.Counter":{"location":[[5,2],[5,19]],"key":1},"Tests.Props":{"location":[[6,2],[6,17]],"key":1},"Tests.Circles":{"location":[[7,2],[7,19]],"key":1}}},"Tests.Boolean":{"location":[[10,0],[14,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[12,2],[12,6]],"key":1},"button":{"location":[[13,2],[13,39]],"key":1}}},"Tests.Props":{"location":[[16,0],[23,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{"":{"location":[[22,2],[22,23]]}},"els":{"input":{"location":[[19,2],[19,23]],"key":1},"Test.PropsChild":{"location":[[20,2],[20,33]],"key":1}}},"Test.PropsChild":{"location":[[25,0],[32,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[29,2],[29,6]],"key":1},"h4":{"location":[[30,2],[30,6]],"key":1},"button":{"location":[[31,2],[31,34]],"key":1}}},"Tests.Counter":{"location":[[34,0],[39,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[36,2],[36,6]],"key":1},"button":{"location":[[38,2],[38,34]],"key":2}}},"Tests.Deep":{"location":[[41,0],[45,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[43,2],[43,6]],"key":1},"h2":{"location":[[44,2],[44,6]],"key":1}}},"Tests.Name":{"location":[[47,0],[57,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h2":{"location":[[50,2],[50,6]],"key":1},"input":{"location":[[52,2],[52,23]],"key":2},"button":{"location":[[53,2],[56,5]],"key":1}}},"Tests.Circles":{"location":[[59,0],[76,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{"circles":{"location":[[75,2],[75,82]]}},"els":{"circles":{"location":[[66,2],[66,31]],"key":1},"Tests.Circle":{"location":[[67,4],[72,6]],"key":1}}},"Tests.Circle":{"location":[[78,0],[92,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"circle":{"location":[[91,2],[91,29]],"key":1}}}},"externals":["babel-runtime/helpers/extends","babel-runtime/helpers/interop-require-default","mouse-event-offset"],"internals":[],"outsideSrc":"var _extends = require('babel-runtime/helpers/extends').default; 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); }); Flint.view('Tests.Boolean', function (view, on, $) { var dead = false;view.render(function () { return view.el( ['h1', 1], null, view.updateSoft(); } }, 'toggle' ); }); }); Flint.staticStyles('Tests.Props', { '$': '#_flintdevtools .ViewTests-Props' }, { view.updateSoft(); } }); });view.render(function () { return view.el(['Test.PropsChild', 1], { name: name }); }); }); Flint.view('Test.PropsChild', function (view, on, $) { var name = view.prop('name', undefined); null, 'my name is ', name ); });view.render(function () { return view.el( ['h4', 1], return view.el( ['button', 1], { onClick: function () { view.set('count', count++, count, true); view.updateSoft(); } }, ); });view.render(function () { return view.el( ['button', 1], { onClick: function () { view.set('count', count++, count, true); view.updateSoft(); } }, 'up' ); });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], { return view.el( ['button', 1], { onClick: function () { view.set('first', first = 'nate'); view.set('last', last = 'wienert'); view.updateSoft(); } }, '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.updateSoft(); } ;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) }); }); }); })})();","writtenAt":1454458397659,"error":null},"inspector/title.js":{"added":1454458397660,"views":["Inspector.Title"],"isInternal":false,"meta":{"Inspector.Title":{"location":[[0,0],[32,1]],"file":"/Users/nw/flint/apps/tools/inspector/title.js","styles":{"title":{"location":[[13,2],[20,3]]},"closed":{"location":[[22,2],[25,3]]},"inner":{"location":[[27,2],[31,3]]}},"els":{"title":{"location":[[9,2],[9,26]],"key":1},"inner":{"location":[[10,4],[10,11]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":" ;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'] }; }; }); })})();","writtenAt":1454458397674,"error":null},"inspector/tree.js":{"added":1454458397677,"views":["Tree"],"isInternal":false,"meta":{"Tree":{"location":[[2,0],[27,1]],"file":"/Users/nw/flint/apps/tools/inspector/tree.js","styles":{"":{"location":[[23,2],[26,3]]}},"els":{"Leaf":{"location":[[8,2],[21,4]],"key":1}}}},"externals":["babel-runtime/helpers/interop-require-default"],"internals":["../lib/lens"],"outsideSrc":"var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default; 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); } }); }); }); })})();","writtenAt":1454458397697,"error":null},"inspector/view.js":{"added":1454458397698,"views":["Inspector.View"],"isInternal":false,"meta":{"Inspector.View":{"location":[[12,0],[159,1]],"file":"/Users/nw/flint/apps/tools/inspector/view.js","styles":{"view":{"location":[[74,2],[95,3]]},"top":{"location":[[97,2],[99,3]]},"active":{"location":[[101,2],[106,3]]},"highlight":{"location":[[108,2],[110,3]]},"Close":{"location":[[112,2],[116,3]]},"name":{"location":[[118,2],[124,3]]},"edit":{"location":[[126,2],[133,3]]},"expanded":{"location":[[135,2],[137,3]]},"input":{"location":[[139,2],[146,3]]},"title":{"location":[[148,2],[154,3]]},"section":{"location":[[156,2],[158,3]]}},"els":{"view":{"location":[[54,2],[54,38]],"key":1},"Close":{"location":[[55,4],[55,55]],"key":1},"top":{"location":[[56,4],[56,9]],"key":1},"name":{"location":[[57,6],[57,12]],"key":1},"edit":{"location":[[58,6],[58,38]],"key":1},"Inspector.Section":{"location":[[65,4],[65,57]],"key":2},"Tree":{"location":[[66,6],[70,8]],"key":2}}}},"externals":["babel-runtime/core-js/object/keys","lodash"],"internals":[],"outsideSrc":"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) { 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'; }); })})();","writtenAt":1454458397789,"error":null},"lib/createFilterer.js":{"added":1454458397759,"views":[],"isInternal":true,"meta":{},"externals":["babel-runtime/core-js/object/assign","babel-runtime/core-js/object/keys"],"internals":[]},"lib/getType.js":{"added":1454458397790,"views":[],"isInternal":true,"meta":{},"externals":[],"internals":[]},"lib/inspecting.js":{"added":1454458397798,"views":[],"isInternal":true,"meta":{},"externals":["babel-runtime/core-js/object/keys"],"internals":[]},"lib/lens.js":{"added":1454458397831,"views":[],"isInternal":true,"meta":{},"externals":[],"internals":[]},"lib/uid.js":{"added":1454458397845,"views":[],"isInternal":true,"meta":{},"externals":[],"internals":[]},"npm/installer.js":{"added":1454458397854,"views":["Installer","Versions"],"isInternal":false,"meta":{"Installer":{"location":[[2,0],[67,1]],"file":"/Users/nw/flint/apps/tools/npm/installer.js","styles":{},"els":{"Versions":{"location":[[54,21],[54,78]],"key":1},"FlintModal":{"location":[[59,2],[63,52]],"key":1},"InstallerLoading":{"location":[[64,4],[64,48]],"key":1}}},"Versions":{"location":[[69,0],[100,1]],"file":"/Users/nw/flint/apps/tools/npm/installer.js","styles":{"version":{"location":[[78,2],[82,3]]},"inner":{"location":[[84,2],[86,3]]},"v":{"location":[[88,2],[96,3]]},"info":{"location":[[98,2],[99,3]]}},"els":{"version":{"location":[[70,2],[70,79]],"key":1},"inner":{"location":[[71,4],[71,11]],"key":1},"v":{"location":[[72,6],[72,28]],"key":1},"info":{"location":[[73,6],[73,12]],"key":1},"a":{"location":[[74,6],[74,43]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":"(function () { Flint.file('npm/installer.js', function (require) { 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],","writtenAt":1454458397909,"error":null}},"imports":[],"fileMeta":{}}} | ||
{"opts":{"appDir":"/Users/nw/flint/apps/tools","name":"flint-tools","saneName":"flinttools","hasRunInitialBuild":false,"defaultPort":4000,"version":"1.5.26","build":true,"flintDir":"/Users/nw/flint/apps/tools/.flint","modulesDir":"/Users/nw/flint/apps/tools/.flint/node_modules","internalDir":"/Users/nw/flint/apps/tools/.flint/.internal","template":".flint/index.html","buildDir":"/Users/nw/flint/apps/tools/.flint/build","deps":{"dir":"/Users/nw/flint/apps/tools/.flint/.internal/deps","internalDir":"/Users/nw/flint/apps/tools/.flint/.internal/deps/internal","assetsDir":"/Users/nw/flint/apps/tools/.flint/.internal/deps/assets","internalsIn":"/Users/nw/flint/apps/tools/.flint/.internal/deps/internals.in.js","internalsOut":"/Users/nw/flint/apps/tools/.flint/.internal/deps/internals.js","externalsIn":"/Users/nw/flint/apps/tools/.flint/.internal/deps/externals.in.js","externalsOut":"/Users/nw/flint/apps/tools/.flint/.internal/deps/externals.js","externalsPaths":"/Users/nw/flint/apps/tools/.flint/.internal/deps/externals.paths.js"},"configFile":"/Users/nw/flint/apps/tools/.flint/flint.json","stateFile":"/Users/nw/flint/apps/tools/.flint/.internal/state.json","outDir":"/Users/nw/flint/apps/tools/.flint/.internal/out","styleDir":"/Users/nw/flint/apps/tools/.flint/.internal/styles","styleOutDir":"/Users/nw/flint/apps/tools/.flint/build/_","styleOutName":"styles.css","config":{"minify":false,"debug":false,"routing":true,"selectorPrefix":"#_flintdevtools ","tools":"false","build":{"minify":false},"pretty":true}},"port":4000,"wport":6283,"cache":{"files":{"main.js":{"added":1455298614686,"views":["Main"],"meta":{"Main":{"location":[[22,0],[43,1]],"file":"/Users/nw/flint/apps/tools/main.js","styles":{"":{"location":[[36,2],[42,3]]}},"els":{"link":{"location":[[27,2],[27,92]],"key":2},"Errors":{"location":[[29,2],[29,12]],"key":1},"Installer":{"location":[[30,2],[30,15]],"key":1},"DevBar":{"location":[[31,2],[31,12]],"key":1},"Menu":{"location":[[32,2],[32,29]],"key":1},"Inspector":{"location":[[33,2],[33,34]],"key":1},"StateTests":{"location":[[34,2],[34,30]],"key":1}}}},"outsideSrc":"var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;(function () { Flint.file('main.js', function (require) { var _keycode = require('keycode'); var _keycode2 = _interopRequireDefault(_keycode); window.___keycode = _keycode2.default; var keysCorrect = function keysCorrect(_ref) { var altKey = _ref.altKey; var metaKey = _ref.metaKey; return altKey && !metaKey; }; var offAlt = null; function checkInspect(e) { if (keysCorrect(e)) { // wait a little so were not toooo eager offAlt = on.delay(180, function () { if (keysCorrect(e)) { }); 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 view.el(['DevBar', 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' }; }; }); })})();","writtenAt":1455298614804,"error":null},"close.js":{"added":1455298614857,"views":["Close"],"meta":{"Close":{"location":[[0,0],[24,1]],"file":"/Users/nw/flint/apps/tools/close.js","styles":{"":{"location":[[5,2],[23,3]]}},"els":{"close":{"location":[[1,2],[1,38]],"key":1}}}},"outsideSrc":" { 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 } }; }; }); })})();","writtenAt":1455298614885,"error":null},"debounce.js":{"added":1455298614892,"views":["Debounce"],"meta":{"Debounce":{"location":[[10,0],[67,1]],"file":"/Users/nw/flint/apps/tools/debounce.js","styles":{},"els":{}}},"outsideSrc":"(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; view.update(); } // debounce clearTimeout(timeout); view.set(\"timeout\", timeout = setTimeout(show, curDelay)); view.updateSoft(); }); }); })})();","writtenAt":1455298614943,"error":null},"devbar.js":{"added":1455298614946,"views":["DevBar"],"meta":{"DevBar":{"location":[[9,0],[78,1]],"file":"/Users/nw/flint/apps/tools/devbar.js","styles":{"bar":{"location":[[45,2],[56,3]]},"pin":{"location":[[58,2],[62,3]]},"label":{"location":[[64,2],[69,3]]},"fps":{"location":[[71,2],[73,3]]},"button":{"location":[[75,2],[77,3]]}},"els":{"bar":{"location":[[37,2],[37,26]],"key":1},"fps":{"location":[[38,4],[38,9]],"key":1},"label":{"location":[[39,6],[39,13]],"key":1},"button":{"location":[[40,6],[40,55]],"key":1}}}},"outsideSrc":"(function () { Flint.file('devbar.js', function (require) { var avg = function avg(xs) { var sum = 0; if (xs.length === 0) return 0; for (var i = 0; i < xs.length; i++) { sum += parseInt(xs[i], 10); } return sum / xs.length; ;view.render(function () { return Flint.iff(hud || pinned) && view.el( ['bar', 1], { if: hud || pinned }, view.el( ['fps', 1], null, view.el( ['label', 1], null, 'Live: ', ('' + fps).substr(0, 6), ' FPS' ), view.el( ['button', 1], { onClick: function () { view.set('times', times = []);setAvg();view.updateSoft(); } }, 'reset' ) ) ); }); }); })})();/*<pin onClick={togglePin }>Pin</pin>*/","writtenAt":1455298614997,"error":null},"errors.js":{"added":1455298615022,"views":["Errors","ErrorMessage","ErrorIcon"],"meta":{"Errors":{"location":[[125,0],[190,1]],"file":"/Users/nw/flint/apps/tools/errors.js","styles":{},"els":{"ErrorMessage":{"location":[[185,2],[189,4]],"key":1}}},"ErrorMessage":{"location":[[197,0],[370,1]],"file":"/Users/nw/flint/apps/tools/errors.js","styles":{"bar":{"location":[[273,2],[290,3]]},"inner":{"location":[[292,2],[296,3]]},"top":{"location":[[298,2],[301,3]]},"where":{"location":[[303,2],[308,3]]},"line":{"location":[[310,2],[314,3]]},"flint":{"location":[[316,2],[320,3]]},"shortError":{"location":[[322,2],[325,3]]},"niceStack":{"location":[[334,2],[334,20]]},"cur":{"location":[[336,2],[338,3]]},"errCol":{"location":[[340,2],[346,3]]},"fullStack":{"location":[[348,2],[359,4]]},"ln":{"location":[[361,2],[363,3]]},"flintline":{"location":[[365,2],[369,3]]}},"els":{"Debounce":{"location":[[226,2],[232,3]],"key":1},"bar":{"location":[[233,4],[233,9]],"key":1},"Close":{"location":[[234,6],[234,52]],"key":1},"inner":{"location":[[239,6],[239,13]],"key":2},"where":{"location":[[241,10],[241,17]],"key":2},"flint":{"location":[[243,40],[243,57]],"key":3},"top":{"location":[[240,8],[240,13]],"key":1},"span":{"location":[[242,12],[242,18]],"key":1},"line":{"location":[[243,12],[243,18]],"key":1},"shortError":{"location":[[248,10],[248,22]],"key":1},"niceStack":{"location":[[250,12],[250,44]],"key":1},"errCol":{"location":[[252,14],[252,22]],"key":1},"help":{"location":[[257,10],[257,32]],"key":1},"fullStack":{"location":[[262,8],[262,34]],"key":1},"ln":{"location":[[265,10],[265,14]],"key":3}}},"ErrorIcon":{"location":[[372,0],[390,1]],"file":"/Users/nw/flint/apps/tools/errors.js","styles":{"svg":{"location":[[382,2],[389,3]]}},"els":{"svg":{"location":[[373,2],[373,35]],"key":1},"path":{"location":[[378,4],[379,53]],"key":2},"polygon":{"location":[[377,4],[377,78]],"key":1}}}},"outsideSrc":"(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; }; // TODO make beautiful var CUR_ERROR = undefined; function showFlintErrorDiv() { setTimeout(function () { // avoid showing if error fixed in meantime if (!CUR_ERROR) return; 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 : 100); } function niceRuntimeError(err) { if (err.file) err.file = err.file.replace(new RegExp('.*' + window.location.origin + '(\\/[_]+\\/)?'), ''); if (err.file && err.file === 'flint.dev.js') { err.file = 'Flint'; err.line = null; } 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, $) { var error = null; var compileError = null; 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)' }, $[\"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' }) ); }); }); })})();","writtenAt":1455298615217,"error":null},"inspector.js":{"added":1455298615224,"views":["Inspector"],"meta":{"Inspector":{"location":[[122,0],[219,1]],"file":"/Users/nw/flint/apps/tools/inspector.js","styles":{"":{"location":[[214,2],[218,3]]}},"els":{"Inspector.View":{"location":[[206,2],[212,4]],"key":1}}}},"outsideSrc":"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 _libInspecting = require('./lib/inspecting'); var _libInspecting2 = _interopRequireDefault(_libInspecting); var _keys = require('./keys'); 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 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; })); view.updateSoft(); }); view.updateSoft(); } function glue(_ref4) { var target = _ref4.target; var inspector = ReactDOM.findDOMNode(view); if (inspector.contains(target)) return; view.set('views', views = toggleView(removeTemp(views), findPath(target))); return false; view.updateSoft(); } function showInspect() { inspect(lastTarget); view.set('hudActive', hudActive = true); view.set('clickOff', clickOff = on.click(window, glue)); view.updateSoft(); } function hideInspect() { internal().isInspecting = false; view.set('hudActive', hudActive = false); hideHighlight(); clickOff && clickOff(); view.set('views', views = removeTemp(views)); view.updateSoft(); } 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); } })); }); }); }); })})();","writtenAt":1455298615319,"error":null},"keys.js":{"added":1455298615322,"views":[]},"menu.js":{"added":1455298615548,"views":["Menu"],"meta":{"Menu":{"location":[[6,0],[125,1]],"file":"/Users/nw/flint/apps/tools/menu.js","styles":{"menu":{"location":[[74,2],[88,3]]},"active":{"location":[[90,2],[94,3]]},"item":{"location":[[96,2],[100,3]]},"first":{"location":[[102,2],[106,3]]},"last":{"location":[[108,2],[112,3]]},"hl":{"location":[[114,2],[120,3]]},"main":{"location":[[122,2],[124,3]]}},"els":{"menu":{"location":[[59,2],[59,43]],"key":1},"item":{"location":[[60,4],[66,5]],"key":1},"main":{"location":[[67,6],[67,49]],"key":1},"sub":{"location":[[68,6],[68,46]],"key":1}}}},"outsideSrc":"var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;(function () { Flint.file('menu.js', function (require) { var _keys = require('./keys'); ['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] } }; }; }); })})();","writtenAt":1455298615609,"error":null},"modal.js":{"added":1455298615612,"views":["FlintModal"],"meta":{"FlintModal":{"location":[[0,0],[40,1]],"file":"/Users/nw/flint/apps/tools/modal.js","styles":{"":{"location":[[13,2],[28,3]]},"title":{"location":[[30,2],[35,3]]},"message":{"location":[[37,2],[39,3]]}},"els":{"Close":{"location":[[9,2],[9,21]],"key":1},"title":{"location":[[10,2],[10,24]],"key":1},"message":{"location":[[11,2],[11,25]],"key":1}}}},"outsideSrc":" }); var lastTitle = undefined; on.props(function () { view.set('lastTitle', lastTitle = title || lastTitle); view.updateSoft(); });view.render(function () { return view.el(['Close', 1], { size: 25 }); });view.render(function () { return Flint.iff(lastTitle) && view.el( ['title', 1], { if: lastTitle }, lastTitle ); });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' }; }; }); })})();","writtenAt":1455298615639,"error":null},"inspector/highlighter.js":{"added":1455298615643,"views":["Highlighter"],"meta":{"Highlighter":{"location":[[2,0],[12,1]],"file":"/Users/nw/flint/apps/tools/inspector/highlighter.js","styles":{},"els":{"name":{"location":[[3,2],[3,93]],"key":1},"span":{"location":[[7,4],[7,45]],"key":2},"highlight":{"location":[[8,6],[8,33]],"key":1}}}},"outsideSrc":"var _Object$keys = require(\"babel-runtime/core-js/object/keys\").default; 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 ), _ ); }) ); }); }); })})();","writtenAt":1455298615679,"error":null},"inspector/label.js":{"added":1455298615682,"views":["Label"],"meta":{"Label":{"location":[[2,0],[72,1]],"file":"/Users/nw/flint/apps/tools/inspector/label.js","styles":{"input":{"location":[[53,2],[67,3]]},"focus":{"location":[[69,2],[71,3]]}},"els":{"input":{"location":[[40,2],[51,4]],"key":1}}}},"outsideSrc":"var _extends = require('babel-runtime/helpers/extends').default; if (newVal === 'false') view.set('newVal', newVal = false); if (newVal === 'true') view.set('newVal', newVal = true); onSet(newVal); view.updateSoft(); }; 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' }; }; }); })})();","writtenAt":1455298615728,"error":null},"inspector/leaf.js":{"added":1455298615731,"views":["Leaf"],"meta":{"Leaf":{"location":[[19,0],[211,1]],"file":"/Users/nw/flint/apps/tools/inspector/leaf.js","styles":{"leaf":{"location":[[151,2],[154,3]]},"label":{"location":[[160,2],[165,4]]},"helper":{"location":[[167,2],[167,32]]},"boolean":{"location":[[168,2],[168,50]]},"number":{"location":[[169,2],[169,63]]},"string":{"location":[[170,2],[170,32]]},"key":{"location":[[172,2],[176,4]]},"function":{"location":[[178,2],[182,3]]},"colon":{"location":[[184,2],[187,3]]},"name":{"location":[[189,2],[193,3]]},"expand":{"location":[[195,2],[195,17]]},"value":{"location":[[197,2],[200,4]]},"children":{"location":[[202,2],[204,3]]},"type":{"location":[[206,2],[210,3]]}},"els":{"Highlighter":{"location":[[78,4],[78,51]],"key":1},"Label":{"location":[[82,4],[86,6]],"key":1},"leaf":{"location":[[102,2],[102,25]],"key":1},"label":{"location":[[103,4],[103,63]],"key":1},"key":{"location":[[104,6],[104,11]],"key":1},"name":{"location":[[105,8],[105,14]],"key":1},"colon":{"location":[[107,6],[107,13]],"key":1},"value":{"location":[[108,6],[108,13]],"key":1},"fn":{"location":[[109,8],[109,46]],"key":1},"i":{"location":[[110,10],[110,13]],"key":1},"array":{"location":[[112,8],[112,29]],"key":1},"type":{"location":[[116,10],[116,16]],"key":2},"obj":{"location":[[115,8],[115,28]],"key":1},"nested":{"location":[[118,8],[118,58]],"key":1},"str":{"location":[[119,10],[119,30]],"key":1},"else":{"location":[[122,10],[122,46]],"key":1},"children":{"location":[[129,4],[129,14]],"key":1},"child":{"location":[[130,6],[132,26]],"key":1},"Leaf":{"location":[[133,8],[146,10]],"key":1}}}},"outsideSrc":"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 _lodash = require('lodash'); null, ':' ), view.el( ['value', 1], null, Flint.iff(is['function']) && view.el( ['fn', 1], { className: 'function', if: is['function'] }, view.el( ['i', 1], null, 'fn (', fnParams(_data).join(', '), ')' ) ), Flint.iff(is.array) && view.el( ['array', 1], { if: is.array }, view.el( ['type', 1], null, 'Array[', _data.length, ']' ) ), Flint.iff(is.object) && view.el( ['obj', 1], { if: is.object }, view.el( ['type', 2], null, '{} ' + dataKeys.length + ' keys' ) ), Flint.iff(is.nested) && view.el( ['nested', 1], { if: is.nested, className: type.toLowerCase() }, Flint.iff(is.string) && view.el( ['str', 1], { if: is.string }, format((0, _ellipsize2.default)(String(_data), 25)) ), Flint.iff(!is.string && is.literal) && view.el( ['else', 1], { if: !is.string && is.literal }, 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] }]; }; }); })})();","writtenAt":1455298615891,"error":null},"inspector/section.js":{"added":1455298615895,"views":["Inspector.Section"],"meta":{"Inspector.Section":{"location":[[0,0],[21,1]],"file":"/Users/nw/flint/apps/tools/inspector/section.js","styles":{"":{"location":[[10,2],[12,3]]},"body":{"location":[[14,2],[16,3]]},"inactive":{"location":[[18,2],[20,3]]}},"els":{"Inspector.Title":{"location":[[3,2],[3,48]],"key":1},"body":{"location":[[6,2],[6,8]],"key":1}}}},"outsideSrc":" view.set('open', open = val); view.updateSoft(); } }, view.props.title ); });view.render(function () { return view.el( ['body', 1], null, view.props.children ); }); }); })})();","writtenAt":1455298615909,"error":null},"inspector/statetests.js":{"added":1455298615912,"views":["StateTests","Tests.Boolean","Tests.Props","Test.PropsChild","Tests.Counter","Tests.Deep","Tests.Name","Tests.Circles","Tests.Circle"],"meta":{"StateTests":{"location":[[2,0],[8,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"Tests.Name":{"location":[[3,2],[3,16]],"key":1},"Tests.Boolean":{"location":[[4,2],[4,19]],"key":1},"Tests.Counter":{"location":[[5,2],[5,19]],"key":1},"Tests.Props":{"location":[[6,2],[6,17]],"key":1},"Tests.Circles":{"location":[[7,2],[7,19]],"key":1}}},"Tests.Boolean":{"location":[[10,0],[14,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[12,2],[12,6]],"key":1},"button":{"location":[[13,2],[13,39]],"key":1}}},"Tests.Props":{"location":[[16,0],[23,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{"":{"location":[[22,2],[22,23]]}},"els":{"input":{"location":[[19,2],[19,23]],"key":1},"Test.PropsChild":{"location":[[20,2],[20,33]],"key":1}}},"Test.PropsChild":{"location":[[25,0],[32,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[29,2],[29,6]],"key":1},"h4":{"location":[[30,2],[30,6]],"key":1},"button":{"location":[[31,2],[31,34]],"key":1}}},"Tests.Counter":{"location":[[34,0],[39,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[36,2],[36,6]],"key":1},"button":{"location":[[38,2],[38,34]],"key":2}}},"Tests.Deep":{"location":[[41,0],[45,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h1":{"location":[[43,2],[43,6]],"key":1},"h2":{"location":[[44,2],[44,6]],"key":1}}},"Tests.Name":{"location":[[47,0],[57,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"h2":{"location":[[50,2],[50,6]],"key":1},"input":{"location":[[52,2],[52,23]],"key":2},"button":{"location":[[53,2],[56,5]],"key":1}}},"Tests.Circles":{"location":[[59,0],[76,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{"circles":{"location":[[75,2],[75,82]]}},"els":{"circles":{"location":[[66,2],[66,31]],"key":1},"Tests.Circle":{"location":[[67,4],[72,6]],"key":1}}},"Tests.Circle":{"location":[[78,0],[92,1]],"file":"/Users/nw/flint/apps/tools/inspector/statetests.js","styles":{},"els":{"circle":{"location":[[91,2],[91,29]],"key":1}}}},"outsideSrc":"var _extends = require('babel-runtime/helpers/extends').default; 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); }); Flint.view('Tests.Boolean', function (view, on, $) { var dead = false;view.render(function () { return view.el( ['h1', 1], null, view.updateSoft(); } }, 'toggle' ); }); }); Flint.staticStyles('Tests.Props', { '$': '#_flintdevtools .ViewTests-Props' }, { view.updateSoft(); } }); });view.render(function () { return view.el(['Test.PropsChild', 1], { name: name }); }); }); Flint.view('Test.PropsChild', function (view, on, $) { var name = view.prop('name', undefined); null, 'my name is ', name ); });view.render(function () { return view.el( ['h4', 1], return view.el( ['button', 1], { onClick: function () { view.set('count', count++, count, true); view.updateSoft(); } }, ); });view.render(function () { return view.el( ['button', 1], { onClick: function () { view.set('count', count++, count, true); view.updateSoft(); } }, 'up' ); });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], { return view.el( ['button', 1], { onClick: function () { view.set('first', first = 'nate'); view.set('last', last = 'wienert'); view.updateSoft(); } }, '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.updateSoft(); } ;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) }); }); }); })})();","writtenAt":1455298615994,"error":null},"inspector/title.js":{"added":1455298615998,"views":["Inspector.Title"],"meta":{"Inspector.Title":{"location":[[0,0],[32,1]],"file":"/Users/nw/flint/apps/tools/inspector/title.js","styles":{"title":{"location":[[13,2],[20,3]]},"closed":{"location":[[22,2],[25,3]]},"inner":{"location":[[27,2],[31,3]]}},"els":{"title":{"location":[[9,2],[9,26]],"key":1},"inner":{"location":[[10,4],[10,11]],"key":1}}}},"outsideSrc":" ;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'] }; }; }); })})();","writtenAt":1455298616009,"error":null},"inspector/tree.js":{"added":1455298616014,"views":["Tree"],"meta":{"Tree":{"location":[[2,0],[27,1]],"file":"/Users/nw/flint/apps/tools/inspector/tree.js","styles":{"":{"location":[[23,2],[26,3]]}},"els":{"Leaf":{"location":[[8,2],[21,4]],"key":1}}}},"outsideSrc":"var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default; 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); } }); }); }); })})();","writtenAt":1455298616037,"error":null},"inspector/view.js":{"added":1455298616040,"views":["Inspector.View"],"meta":{"Inspector.View":{"location":[[12,0],[159,1]],"file":"/Users/nw/flint/apps/tools/inspector/view.js","styles":{"view":{"location":[[74,2],[95,3]]},"top":{"location":[[97,2],[99,3]]},"active":{"location":[[101,2],[106,3]]},"highlight":{"location":[[108,2],[110,3]]},"Close":{"location":[[112,2],[116,3]]},"name":{"location":[[118,2],[124,3]]},"edit":{"location":[[126,2],[133,3]]},"expanded":{"location":[[135,2],[137,3]]},"input":{"location":[[139,2],[146,3]]},"title":{"location":[[148,2],[154,3]]},"section":{"location":[[156,2],[158,3]]}},"els":{"view":{"location":[[54,2],[54,38]],"key":1},"Close":{"location":[[55,4],[55,55]],"key":1},"top":{"location":[[56,4],[56,9]],"key":1},"name":{"location":[[57,6],[57,12]],"key":1},"edit":{"location":[[58,6],[58,38]],"key":1},"Inspector.Section":{"location":[[65,4],[65,57]],"key":2},"Tree":{"location":[[66,6],[70,8]],"key":2}}}},"outsideSrc":"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) { 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'; }); })})();","writtenAt":1455298616115,"error":null},"lib/createFilterer.js":{"added":1455298616190,"views":[]},"lib/getType.js":{"added":1455298616211,"views":[]},"lib/inspecting.js":{"added":1455298616221,"views":[]},"lib/lens.js":{"added":1455298616287,"views":[]},"lib/uid.js":{"added":1455298616301,"views":[]},"npm/installer.js":{"added":1455298616325,"views":["Installer","Versions"],"meta":{"Installer":{"location":[[2,0],[67,1]],"file":"/Users/nw/flint/apps/tools/npm/installer.js","styles":{},"els":{"Versions":{"location":[[54,21],[54,78]],"key":1},"FlintModal":{"location":[[59,2],[63,52]],"key":1},"InstallerLoading":{"location":[[64,4],[64,48]],"key":1}}},"Versions":{"location":[[69,0],[100,1]],"file":"/Users/nw/flint/apps/tools/npm/installer.js","styles":{"version":{"location":[[78,2],[82,3]]},"inner":{"location":[[84,2],[86,3]]},"v":{"location":[[88,2],[96,3]]},"info":{"location":[[98,2],[99,3]]}},"els":{"version":{"location":[[70,2],[70,79]],"key":1},"inner":{"location":[[71,4],[71,11]],"key":1},"v":{"location":[[72,6],[72,28]],"key":1},"info":{"location":[[73,6],[73,12]],"key":1},"a":{"location":[[74,6],[74,43]],"key":1}}}},"outsideSrc":"(function () { Flint.file('npm/installer.js', function (require) { 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],","writtenAt":1455298616377,"error":null}},"imports":[],"fileMeta":{}},"installed":["keycode","lodash","md5-o-matic","ellipsize","mouse-event-offset"]} |
@@ -236,125 +236,7 @@ exports["flinttools"] = function(Flint,opts){(function(Flint){(function(){ | ||
(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)];}; | ||
Flint.file('errors/errors.js',function(require){ | ||
var _helpers=require('./helpers'); | ||
var isLive=function isLive(){ | ||
return browser.editor && browser.editor.live;}; | ||
// TODO make beautiful | ||
var CUR_ERROR=undefined; | ||
function showFlintErrorDiv(){ | ||
setTimeout(function(){ | ||
// avoid showing if error fixed in meantime | ||
if(!CUR_ERROR)return; | ||
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:100);} | ||
function niceRuntimeError(err){ | ||
if(err.file)err.file = err.file.replace(new RegExp('.*' + window.location.origin + '(\/[_]+\/)?'),''); | ||
if(err.file && err.file === 'flint.dev.js'){ | ||
err.file = 'Flint'; | ||
err.line = null;} | ||
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,$){ | ||
var error=null; | ||
var error=null; //{ message: "hello", file: 'where' } | ||
var compileError=null; | ||
@@ -366,9 +248,7 @@ var runtimeError=null; | ||
function setError(){ | ||
if(compileError)view.set('error',error = niceCompilerError(compileError));else if(runtimeError)view.set('error',error = niceRuntimeError(runtimeError));else { | ||
if(compileError)view.set('error',error = (0,_helpers.niceCompilerError)(compileError));else if(runtimeError)view.set('error',error = (0,_helpers.niceRuntimeError)(runtimeError));else { | ||
view.set('error',error = null);} | ||
CUR_ERROR = error; | ||
log('tools: view.update()'); | ||
_helpers.browser.curError = error; | ||
view.updateSoft();} | ||
@@ -385,5 +265,5 @@ | ||
browser.on('compile:error',function(){ | ||
log('compile:error'); | ||
view.set('compileError',compileError = browser.data.error); | ||
_helpers.browser.on('compile:error',function(){ | ||
(0,_helpers.log)('compile:error'); | ||
view.set('compileError',compileError = _helpers.browser.data.error); | ||
setError(); | ||
@@ -393,6 +273,6 @@ view.updateSoft();}); | ||
browser.on('runtime:error',function(){ | ||
_helpers.browser.on('runtime:error',function(){ | ||
// if (runtimeError) return // prefer first error | ||
view.set('runtimeError',runtimeError = browser.data); | ||
log('runtime:error',runtimeError); | ||
view.set('runtimeError',runtimeError = _helpers.browser.data); | ||
(0,_helpers.log)('runtime:error',runtimeError); | ||
setError(); | ||
@@ -402,10 +282,10 @@ view.updateSoft();}); | ||
browser.on('npm:error',function(){ | ||
view.set('npmError',npmError = niceNpmError(browser.data.error)); | ||
log('npm:error',npmError); | ||
_helpers.browser.on('npm:error',function(){ | ||
view.set('npmError',npmError = (0,_helpers.niceNpmError)(_helpers.browser.data.error)); | ||
(0,_helpers.log)('npm:error',npmError); | ||
view.updateSoft();}); | ||
browser.on('runtime:success',function(){ | ||
log('runtime:success'); | ||
_helpers.browser.on('runtime:success',function(){ | ||
(0,_helpers.log)('runtime:success'); | ||
view.set('runtimeError',runtimeError = null); | ||
@@ -417,4 +297,4 @@ view.set('npmError',npmError = null); | ||
browser.on('compile:success',function(){ | ||
log('compile:success'); | ||
_helpers.browser.on('compile:success',function(){ | ||
(0,_helpers.log)('compile:success'); | ||
view.set('compileError',compileError = null); | ||
@@ -425,6 +305,6 @@ view.set('npmError',npmError = null); | ||
view.render(function(){ | ||
return view.el(['ErrorMessage',1],{ | ||
return view.el(['Errors.Message',1],{ | ||
error:error, | ||
npmError:npmError, | ||
close:close});});}); | ||
close:close});});});});})(); | ||
@@ -434,3 +314,9 @@ | ||
var flintAddedLines=0; | ||
//# sourceMappingURL=errors.js.map | ||
(function(){ | ||
Flint.file('errors/message.js',function(require){ | ||
var _helpers=require('./helpers'); | ||
var last=function last(arr){ | ||
@@ -446,14 +332,14 @@ return arr[arr.length - 1];}; | ||
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'}, | ||
Flint.staticStyles('Errors.Message',{ | ||
'$bar':'#_flintdevtools bar.Errors-Message, #_flintdevtools .Errors-Message.bar, #_flintdevtools .ViewErrors-Message.bar, #_flintdevtools .Errors-Message > .bar', | ||
'$inner':'#_flintdevtools inner.Errors-Message, #_flintdevtools .Errors-Message.inner, #_flintdevtools .ViewErrors-Message.inner, #_flintdevtools .Errors-Message > .inner', | ||
'$top':'#_flintdevtools top.Errors-Message, #_flintdevtools .Errors-Message.top, #_flintdevtools .ViewErrors-Message.top, #_flintdevtools .Errors-Message > .top', | ||
'$where':'#_flintdevtools where.Errors-Message, #_flintdevtools .Errors-Message.where, #_flintdevtools .ViewErrors-Message.where, #_flintdevtools .Errors-Message > .where', | ||
'$line':'#_flintdevtools line.Errors-Message, #_flintdevtools .Errors-Message.line, #_flintdevtools .ViewErrors-Message.line, #_flintdevtools .Errors-Message > .line', | ||
'$flint':'#_flintdevtools flint.Errors-Message, #_flintdevtools .Errors-Message.flint, #_flintdevtools .ViewErrors-Message.flint, #_flintdevtools .Errors-Message > .flint', | ||
'$shortError':'#_flintdevtools shortError.Errors-Message, #_flintdevtools .Errors-Message.shortError, #_flintdevtools .ViewErrors-Message.shortError, #_flintdevtools .Errors-Message > .shortError', | ||
'$cur':'#_flintdevtools cur.Errors-Message, #_flintdevtools .Errors-Message.cur, #_flintdevtools .ViewErrors-Message.cur, #_flintdevtools .Errors-Message > .cur', | ||
'$errCol':'#_flintdevtools errCol.Errors-Message, #_flintdevtools .Errors-Message.errCol, #_flintdevtools .ViewErrors-Message.errCol, #_flintdevtools .Errors-Message > .errCol', | ||
'$ln':'#_flintdevtools ln.Errors-Message, #_flintdevtools .Errors-Message.ln, #_flintdevtools .ViewErrors-Message.ln, #_flintdevtools .Errors-Message > .ln', | ||
'$flintline':'#_flintdevtools flintline.Errors-Message, #_flintdevtools .Errors-Message.flintline, #_flintdevtools .ViewErrors-Message.flintline, #_flintdevtools .Errors-Message > .flintline'}, | ||
{ | ||
@@ -474,3 +360,3 @@ '$bar':{ | ||
pointerEvents:'all', | ||
overflow:'scroll', | ||
overflow:'hidden', | ||
zIndex:2147483647, | ||
@@ -527,3 +413,3 @@ boxShadow:'0 -6px 12px rgba(0,0,0,0.06)'}, | ||
Flint.view('ErrorMessage',function(view,on,$){ | ||
Flint.view('Errors.Message',function(view,on,$){ | ||
var hasError=false; | ||
@@ -558,3 +444,3 @@ var error={}; | ||
// update on editor state | ||
browser.emitter.on('editor:state',function(){ | ||
_helpers.browser.emitter.on('editor:state',function(){ | ||
return setTimeout(view.update);}); | ||
@@ -566,6 +452,6 @@ view.render(function(){ | ||
// delay more during live typing | ||
delay:isLive()?2000:1000, | ||
delay:(0,_helpers.isLive)()?2000:1000, | ||
force:hasError === false, | ||
showKey:fullStack || error && error.message, | ||
onUpdate:showFlintErrorDiv}, | ||
onUpdate:_helpers.showFlintErrorDiv}, | ||
@@ -618,3 +504,3 @@ view.el( | ||
{if:line}, | ||
line - flintAddedLines))), | ||
line))), | ||
@@ -698,33 +584,10 @@ | ||
borderRadius:3, | ||
margin:2}];};}); | ||
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=message.js.map | ||
//# sourceMappingURL=errors.js.map | ||
var _extends=require('babel-runtime/helpers/extends').default; | ||
@@ -1117,5 +980,8 @@ | ||
// dont let them change from num to str | ||
if(newVal === '' || isNaN(newVal))return;} | ||
if(newVal === '' || isNaN(newVal)){ | ||
view.updateSoft(); | ||
return;}} | ||
// todo: debate | ||
@@ -1213,4 +1079,3 @@ if(newVal === 'false')view.set('newVal',newVal = false); | ||
'$colon':{ | ||
opacity:0.3, | ||
color:'#000'}, | ||
color:'rgba(0,0,0,0.2)'}, | ||
@@ -1273,3 +1138,2 @@ '$name':{ | ||
expanded=undefined; | ||
var dataKeys=[]; | ||
@@ -1403,5 +1267,2 @@ var _query=''; | ||
Flint.iff(is.nested) && view.el( | ||
['nested',1], | ||
{if:is.nested,className:type.toLowerCase()}, | ||
Flint.iff(is.string) && view.el( | ||
@@ -1417,2 +1278,5 @@ ['str',1], | ||
Flint.iff(is.nested) && view.el( | ||
['nested',1], | ||
{if:is.nested,className:type.toLowerCase()}, | ||
getLabel('val',_data,key,editable)))), | ||
@@ -1501,3 +1365,3 @@ | ||
'$':{ | ||
padding:[5,0]}, | ||
padding:[0,0,5]}, | ||
@@ -1764,6 +1628,7 @@ '$body':{ | ||
fontWeight:300, | ||
borderBottom:'1px solid #eee', | ||
fontSize:11, | ||
borderBottom:'1px solid #f4f4f4', | ||
height:10, | ||
margin:[5,5,8], | ||
color:'#999', | ||
margin:[0,5,4], | ||
color:'rgba(0,0,0,0.4)', | ||
flexFlow:'row'}, | ||
@@ -1903,3 +1768,3 @@ | ||
pointerEvents:'auto', | ||
margin:10, | ||
margin:6, | ||
marginBottom:0, | ||
@@ -1913,5 +1778,5 @@ padding:[0,0,1], | ||
background:'#fff', | ||
boxShadow:'0px 2px 16px rgba(0,0,0,0.2)', | ||
boxShadow:'0px 2px 10px rgba(0,0,0,0.15)', | ||
border:'1px solid #ccc', | ||
borderRadius:5, | ||
borderRadius:4, | ||
color:'#333', | ||
@@ -1922,3 +1787,4 @@ transition:'all ease-in 60ms', | ||
'$top':{ | ||
flexFlow:'row'}, | ||
flexFlow:'row', | ||
paddingBottom:10}, | ||
@@ -2063,3 +1929,3 @@ '$active':{ | ||
'68270699'; | ||
'788fafa9'; | ||
@@ -2073,4 +1939,4 @@ $["view"] = function(_,_index){ | ||
'c59a100e'; | ||
'14ed20fc'; | ||
'd38b4a40'; | ||
'45bafd14'; | ||
@@ -2084,5 +1950,5 @@ $["active"] = function(_,_index){ | ||
'73fd2ce7'; | ||
'4c3860b8'; | ||
'6f330b54'; | ||
'2b6eec62'; | ||
'73bd5771'; | ||
'70140dec'; | ||
@@ -2093,3 +1959,3 @@ $["name"] = function(_,_index){ | ||
'748b11a6'; | ||
'8fc3ee24'; | ||
@@ -2106,5 +1972,5 @@ $["edit"] = function(_,_index){ | ||
'a91c0042'; | ||
'22691102'; | ||
'1d45081d';});});})(); | ||
'7e27a56e'; | ||
'20639b6a'; | ||
'72d32211';});});})(); | ||
@@ -2111,0 +1977,0 @@ |
@@ -52,7 +52,8 @@ exports["flinttools-internals"] = | ||
packages["keys"] = __webpack_require__(1); | ||
packages["lib/createFilterer"] = __webpack_require__(4); | ||
packages["lib/getType"] = __webpack_require__(7); | ||
packages["lib/inspecting"] = __webpack_require__(8); | ||
packages["lib/lens"] = __webpack_require__(9); | ||
packages["lib/uid"] = __webpack_require__(10); | ||
packages["errors/helpers"] = __webpack_require__(4); | ||
packages["lib/createFilterer"] = __webpack_require__(5); | ||
packages["lib/getType"] = __webpack_require__(8); | ||
packages["lib/inspecting"] = __webpack_require__(9); | ||
packages["lib/lens"] = __webpack_require__(10); | ||
packages["lib/uid"] = __webpack_require__(11); | ||
@@ -153,7 +154,141 @@ | ||
/* 4 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var browser = window._DT; | ||
exports.browser = browser; | ||
var isLive = function isLive() { | ||
return browser.editor && browser.editor.live; | ||
}; | ||
exports.isLive = isLive; | ||
var split = function split(s, i) { | ||
return [s.substring(0, i), s.substring(i, i + 1), s.substring(i + 1)]; | ||
}; | ||
function showFlintErrorDiv() { | ||
setTimeout(function () { | ||
// avoid showing if error fixed in meantime | ||
if (!browser.curError) return; | ||
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 : 100); | ||
} | ||
exports.showFlintErrorDiv = showFlintErrorDiv; | ||
function niceRuntimeError(err) { | ||
if (err.file) err.file = err.file.replace(new RegExp('.*' + window.location.origin + '(\/[_]+\/)?'), ''); | ||
if (err.file && err.file === 'flint.dev.js') { | ||
err.file = 'Flint'; | ||
err.line = null; | ||
} | ||
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; | ||
} | ||
exports.niceRuntimeError = niceRuntimeError; | ||
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 }; | ||
} | ||
exports.niceNpmError = niceNpmError; | ||
var niceCompilerError = function niceCompilerError(err) { | ||
return niceCompilerMessage(fullStack(niceStack(err))); | ||
}; | ||
exports.niceCompilerError = niceCompilerError; | ||
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; | ||
}; | ||
exports.niceCompilerMessage = niceCompilerMessage; | ||
var matchErrorLine = /\>?\s*([0-9]*)\s*\|(.*)/g; | ||
var indicator = /\s*\|\s*\^\s*$/g; | ||
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; | ||
} | ||
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); | ||
}; | ||
exports.log = log; | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$assign = __webpack_require__(5).default; | ||
var _Object$assign = __webpack_require__(6).default; | ||
var _Object$keys = __webpack_require__(6).default; | ||
var _Object$keys = __webpack_require__(7).default; | ||
@@ -242,3 +377,3 @@ Object.defineProperty(exports, '__esModule', { | ||
/***/ }, | ||
/* 5 */ | ||
/* 6 */ | ||
/***/ function(module, exports) { | ||
@@ -249,3 +384,3 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
@@ -256,3 +391,3 @@ | ||
/***/ }, | ||
/* 7 */ | ||
/* 8 */ | ||
/***/ function(module, exports) { | ||
@@ -272,6 +407,6 @@ | ||
/***/ }, | ||
/* 8 */ | ||
/* 9 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$keys = __webpack_require__(6).default; | ||
var _Object$keys = __webpack_require__(7).default; | ||
@@ -349,3 +484,3 @@ Object.defineProperty(exports, '__esModule', { | ||
/***/ }, | ||
/* 9 */ | ||
/* 10 */ | ||
/***/ function(module, exports) { | ||
@@ -383,3 +518,3 @@ | ||
/***/ }, | ||
/* 10 */ | ||
/* 11 */ | ||
/***/ function(module, exports) { | ||
@@ -386,0 +521,0 @@ |
{ | ||
"name": "flint-tools", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"dependencies": { | ||
@@ -16,5 +16,5 @@ "ellipsize": { | ||
"lodash": { | ||
"version": "4.2.0", | ||
"from": "lodash@>=4.1.0 <5.0.0", | ||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.2.0.tgz" | ||
"version": "4.3.0", | ||
"from": "lodash@>=4.3.0 <5.0.0", | ||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz" | ||
}, | ||
@@ -21,0 +21,0 @@ "md5-o-matic": { |
@@ -6,3 +6,3 @@ { | ||
"description": "tools", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"main": "index.js", | ||
@@ -13,3 +13,3 @@ "scripts": {}, | ||
"keycode": "^2.1.0", | ||
"lodash": "^4.2.0", | ||
"lodash": "^4.3.0", | ||
"md5-o-matic": "^0.1.1", | ||
@@ -16,0 +16,0 @@ "mouse-event-offset": "^3.0.2" |
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
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
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
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
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
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 not supported yet
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5630828
35305
56
Updatedlodash@^4.3.0