flint-tools
Advanced tools
Comparing version 1.5.1 to 1.5.2
var packages = {} | ||
packages["babel-runtime/helpers/extends"] = require("babel-runtime/helpers/extends"); | ||
packages["babel-runtime/helpers/interop-require-default"] = require("babel-runtime/helpers/interop-require-default"); | ||
packages["keycode"] = require("keycode"); | ||
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["babel-runtime/helpers/interop-require-default"] = require("babel-runtime/helpers/interop-require-default"); | ||
packages["lodash"] = require("lodash"); | ||
packages["keycode"] = require("keycode"); | ||
packages["babel-runtime/core-js/object/keys"] = require("babel-runtime/core-js/object/keys"); | ||
@@ -11,0 +11,0 @@ packages["md5-o-matic"] = require("md5-o-matic"); |
@@ -1,1 +0,13 @@ | ||
["babel-runtime/helpers/extends","babel-runtime/helpers/to-array","babel-runtime/helpers/sliced-to-array","babel-runtime/helpers/interop-require-default","lodash","keycode","babel-runtime/core-js/object/keys","md5-o-matic","ellipsize","mouse-event-offset","babel-runtime/core-js/object/assign"] | ||
[ | ||
"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" | ||
] |
@@ -1,13 +0,2 @@ | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _keycode = require('keycode'); | ||
var _keycode2 = _interopRequireDefault(_keycode); | ||
var keys = {}; | ||
exports.keys = keys; | ||
Object.defineProperty(exports, "__esModule", { value: true });var keys = {};exports.keys = keys; | ||
var listeners = {}; | ||
@@ -17,55 +6,40 @@ var pressListeners = {}; | ||
on.keydown(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
var code = ___keycode(e.keyCode); | ||
keys[code] = true; | ||
keyDown(code); | ||
}); | ||
keyDown(code);}); | ||
on.keyup(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
var code = ___keycode(e.keyCode); | ||
keys[code] = false; | ||
keyUp(code); | ||
}); | ||
keyUp(code);}); | ||
on.keypress(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
var code = ___keycode(e.keyCode); | ||
var queue = pressListeners[code]; | ||
queue && queue.forEach(function (listener) { | ||
return listener(); | ||
}); | ||
}); | ||
queue && queue.forEach(function (listener) {return listener();});}); | ||
function keyDown(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(true); | ||
}); | ||
} | ||
listeners[code].forEach(function (listener) {return listener(true);});} | ||
function keyUp(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(false); | ||
}); | ||
} | ||
listeners[code].forEach(function (listener) {return listener(false);});} | ||
function onKey(code, fn) { | ||
listeners[code] = listeners[code] || []; | ||
listeners[code].push(fn); | ||
} | ||
listeners[code].push(fn);}exports.onKey = onKey; | ||
exports.onKey = onKey; | ||
function onKeyPress(code, fn) { | ||
pressListeners[code] = pressListeners[code] || []; | ||
pressListeners[code].push(fn); | ||
} | ||
pressListeners[code].push(fn);}exports.onKeyPress = onKeyPress; | ||
exports.onKeyPress = onKeyPress; | ||
function onKeyDown(code, fn) { | ||
onKey(code, function (val) { | ||
return val && fn(); | ||
}); | ||
} | ||
exports.onKeyDown = onKeyDown; | ||
onKey(code, function (val) {return val && fn();});}exports.onKeyDown = onKeyDown; |
@@ -1,9 +0,2 @@ | ||
var _Object$assign = require('babel-runtime/core-js/object/assign').default; | ||
var _Object$keys = require('babel-runtime/core-js/object/keys').default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var assign = _Object$assign; | ||
var _Object$assign = require('babel-runtime/core-js/object/assign').default;var _Object$keys = require('babel-runtime/core-js/object/keys').default;Object.defineProperty(exports, '__esModule', { value: true });var assign = _Object$assign; | ||
var keys = _Object$keys; | ||
@@ -24,16 +17,13 @@ | ||
cache[query] = find(cache[subquery], query, options); | ||
break; | ||
} | ||
} | ||
} | ||
break;}}} | ||
if (!cache[query]) { | ||
cache[query] = find(data, query, options); | ||
} | ||
cache[query] = find(data, query, options);} | ||
return cache[query]; | ||
}; | ||
} | ||
exports.default = createFilterer; | ||
return cache[query];};}exports.default = createFilterer; | ||
; | ||
@@ -48,39 +38,37 @@ | ||
if (contains(query, key, options) || contains(query, value, options)) { | ||
acc[key] = value; | ||
} | ||
} else { | ||
acc[key] = value;}} else | ||
{ | ||
if (contains(query, key, options)) { | ||
acc[key] = value; | ||
} else { | ||
acc[key] = value;} else | ||
{ | ||
matches = find(value, query, options); | ||
if (!isEmpty(matches)) { | ||
assign(acc, pair(key, matches)); | ||
} | ||
} | ||
} | ||
assign(acc, pair(key, matches));}}} | ||
return acc; | ||
}, {}); | ||
} | ||
return acc;}, | ||
{});} | ||
function contains(query, string, options) { | ||
if (options.ignoreCase) { | ||
query = String(query).toLowerCase(); | ||
return string && String(string).toLowerCase().indexOf(query) !== -1; | ||
} else { | ||
return string && String(string).indexOf(query) !== -1; | ||
} | ||
} | ||
return string && String(string).toLowerCase().indexOf(query) !== -1;} else | ||
{ | ||
return string && String(string).indexOf(query) !== -1;}} | ||
function isPrimitive(value) { | ||
var t = getType(value); | ||
return t !== 'Object' && t !== 'Array'; | ||
} | ||
return t !== 'Object' && t !== 'Array';} | ||
function pair(key, value) { | ||
var p = {}; | ||
p[key] = value; | ||
return p; | ||
} | ||
module.exports = exports.default; | ||
return p;}module.exports = exports.default; |
@@ -1,10 +0,2 @@ | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function getType(value) { | ||
return Object.prototype.toString.call(value).slice(8, -1); | ||
} | ||
exports.default = getType; | ||
module.exports = exports.default; | ||
Object.defineProperty(exports, "__esModule", { value: true });function getType(value) { | ||
return Object.prototype.toString.call(value).slice(8, -1);}exports.default = getType;module.exports = exports.default; |
@@ -1,13 +0,5 @@ | ||
var _Object$keys = require('babel-runtime/core-js/object/keys').default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var el = undefined; | ||
var _Object$keys = require('babel-runtime/core-js/object/keys').default;Object.defineProperty(exports, '__esModule', { value: true });var el = undefined; | ||
var reactKey = null; | ||
var getReactKey = function getReactKey(el) { | ||
return _Object$keys(el).filter(function (k) { | ||
return k.indexOf('__reactInternalInst') == 0; | ||
})[0]; | ||
}; | ||
var getReactKey = function getReactKey(el) {return ( | ||
_Object$keys(el).filter(function (k) {return k.indexOf('__reactInternalInst') == 0;})[0]);}; | ||
@@ -22,26 +14,25 @@ function getReactId(el) { | ||
var split = key.split('$'); | ||
return split[split.length - 1]; | ||
} | ||
return split[split.length - 1];} | ||
var Inspecting = { | ||
var Inspecting = { | ||
set: function set(_) { | ||
el = _; | ||
}, | ||
el = _;}, | ||
get: function get() { | ||
return el; | ||
}, | ||
return el;}, | ||
props: function props(el) { | ||
return { | ||
key: getReactId(el), | ||
el: el.tagName.toLowerCase(), | ||
view: el.className.split(' ').filter(function (s) { | ||
return s.substr(0, 4) != 'View'; | ||
}).filter(function (s) { | ||
return s.charAt(0).toUpperCase() == s.charAt(0); | ||
})[0] | ||
}; | ||
}, | ||
return { | ||
key: getReactId(el), | ||
el: el.tagName.toLowerCase(), | ||
view: el.className. | ||
split(' '). | ||
filter(function (s) {return s.substr(0, 4) != 'View';}). | ||
filter(function (s) {return s.charAt(0).toUpperCase() == s.charAt(0);})[0] };}, | ||
all: function all() { | ||
@@ -60,14 +51,13 @@ var cur = el; | ||
if (next.view[0] != '_') { | ||
parents.push(next); | ||
} | ||
} | ||
parents.push(next);}} | ||
cur = _parent; | ||
} | ||
return parents; | ||
} | ||
}; | ||
exports.default = Inspecting; | ||
module.exports = exports.default; | ||
cur = _parent;} | ||
return parents;} };exports.default = | ||
Inspecting;module.exports = exports.default; |
@@ -1,5 +0,2 @@ | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var PATH_DELIMITER = '.'; | ||
Object.defineProperty(exports, '__esModule', { value: true });var PATH_DELIMITER = '.'; | ||
@@ -11,19 +8,15 @@ function lens(data, path) { | ||
if (!segment) { | ||
return data; | ||
} | ||
return data;} | ||
var t = getType(data); | ||
if (t === 'Array' && data[integer(segment)]) { | ||
return lens(data[integer(segment)], p.join(PATH_DELIMITER)); | ||
} else if (t === 'Object' && data[segment]) { | ||
return lens(data[segment], p.join(PATH_DELIMITER)); | ||
} | ||
} | ||
return lens(data[integer(segment)], p.join(PATH_DELIMITER));} else | ||
if (t === 'Object' && data[segment]) { | ||
return lens(data[segment], p.join(PATH_DELIMITER));}}exports.default = lens; | ||
exports.default = lens; | ||
function integer(string) { | ||
return parseInt(string, 10); | ||
} | ||
module.exports = exports.default; | ||
return parseInt(string, 10);}module.exports = exports.default; |
@@ -1,11 +0,4 @@ | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var id = Math.ceil(Math.random() * 10); | ||
Object.defineProperty(exports, "__esModule", { value: true });var id = Math.ceil(Math.random() * 10); | ||
function uid() { | ||
return id++; | ||
} | ||
exports.default = uid; | ||
module.exports = exports.default; | ||
return id++;}exports.default = uid;module.exports = exports.default; |
@@ -52,7 +52,7 @@ 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["lib/createFilterer"] = __webpack_require__(2); | ||
packages["lib/getType"] = __webpack_require__(5); | ||
packages["lib/inspecting"] = __webpack_require__(6); | ||
packages["lib/lens"] = __webpack_require__(7); | ||
packages["lib/uid"] = __webpack_require__(8); | ||
@@ -66,16 +66,5 @@ | ||
/* 1 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ function(module, exports) { | ||
var _interopRequireDefault = __webpack_require__(2).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _keycode = __webpack_require__(3); | ||
var _keycode2 = _interopRequireDefault(_keycode); | ||
var keys = {}; | ||
exports.keys = keys; | ||
Object.defineProperty(exports, "__esModule", { value: true });var keys = {};exports.keys = keys; | ||
var listeners = {}; | ||
@@ -85,81 +74,47 @@ var pressListeners = {}; | ||
on.keydown(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
var code = ___keycode(e.keyCode); | ||
keys[code] = true; | ||
keyDown(code); | ||
}); | ||
keyDown(code);}); | ||
on.keyup(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
var code = ___keycode(e.keyCode); | ||
keys[code] = false; | ||
keyUp(code); | ||
}); | ||
keyUp(code);}); | ||
on.keypress(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
var code = ___keycode(e.keyCode); | ||
var queue = pressListeners[code]; | ||
queue && queue.forEach(function (listener) { | ||
return listener(); | ||
}); | ||
}); | ||
queue && queue.forEach(function (listener) {return listener();});}); | ||
function keyDown(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(true); | ||
}); | ||
} | ||
listeners[code].forEach(function (listener) {return listener(true);});} | ||
function keyUp(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(false); | ||
}); | ||
} | ||
listeners[code].forEach(function (listener) {return listener(false);});} | ||
function onKey(code, fn) { | ||
listeners[code] = listeners[code] || []; | ||
listeners[code].push(fn); | ||
} | ||
listeners[code].push(fn);}exports.onKey = onKey; | ||
exports.onKey = onKey; | ||
function onKeyPress(code, fn) { | ||
pressListeners[code] = pressListeners[code] || []; | ||
pressListeners[code].push(fn); | ||
} | ||
pressListeners[code].push(fn);}exports.onKeyPress = onKeyPress; | ||
exports.onKeyPress = onKeyPress; | ||
function onKeyDown(code, fn) { | ||
onKey(code, function (val) { | ||
return val && fn(); | ||
}); | ||
} | ||
exports.onKeyDown = onKeyDown; | ||
onKey(code, function (val) {return val && fn();});}exports.onKeyDown = onKeyDown; | ||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("babel-runtime/helpers/interop-require-default"); | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("keycode"); | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$assign = __webpack_require__(5).default; | ||
var _Object$keys = __webpack_require__(6).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var assign = _Object$assign; | ||
var _Object$assign = __webpack_require__(3).default;var _Object$keys = __webpack_require__(4).default;Object.defineProperty(exports, '__esModule', { value: true });var assign = _Object$assign; | ||
var keys = _Object$keys; | ||
@@ -180,16 +135,13 @@ | ||
cache[query] = find(cache[subquery], query, options); | ||
break; | ||
} | ||
} | ||
} | ||
break;}}} | ||
if (!cache[query]) { | ||
cache[query] = find(data, query, options); | ||
} | ||
cache[query] = find(data, query, options);} | ||
return cache[query]; | ||
}; | ||
} | ||
exports.default = createFilterer; | ||
return cache[query];};}exports.default = createFilterer; | ||
; | ||
@@ -204,43 +156,41 @@ | ||
if (contains(query, key, options) || contains(query, value, options)) { | ||
acc[key] = value; | ||
} | ||
} else { | ||
acc[key] = value;}} else | ||
{ | ||
if (contains(query, key, options)) { | ||
acc[key] = value; | ||
} else { | ||
acc[key] = value;} else | ||
{ | ||
matches = find(value, query, options); | ||
if (!isEmpty(matches)) { | ||
assign(acc, pair(key, matches)); | ||
} | ||
} | ||
} | ||
assign(acc, pair(key, matches));}}} | ||
return acc; | ||
}, {}); | ||
} | ||
return acc;}, | ||
{});} | ||
function contains(query, string, options) { | ||
if (options.ignoreCase) { | ||
query = String(query).toLowerCase(); | ||
return string && String(string).toLowerCase().indexOf(query) !== -1; | ||
} else { | ||
return string && String(string).indexOf(query) !== -1; | ||
} | ||
} | ||
return string && String(string).toLowerCase().indexOf(query) !== -1;} else | ||
{ | ||
return string && String(string).indexOf(query) !== -1;}} | ||
function isPrimitive(value) { | ||
var t = getType(value); | ||
return t !== 'Object' && t !== 'Array'; | ||
} | ||
return t !== 'Object' && t !== 'Array';} | ||
function pair(key, value) { | ||
var p = {}; | ||
p[key] = value; | ||
return p; | ||
} | ||
module.exports = exports.default; | ||
return p;}module.exports = exports.default; | ||
/***/ }, | ||
/* 5 */ | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
@@ -251,3 +201,3 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/* 4 */ | ||
/***/ function(module, exports) { | ||
@@ -258,32 +208,16 @@ | ||
/***/ }, | ||
/* 7 */ | ||
/* 5 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function getType(value) { | ||
return Object.prototype.toString.call(value).slice(8, -1); | ||
} | ||
exports.default = getType; | ||
module.exports = exports.default; | ||
Object.defineProperty(exports, "__esModule", { value: true });function getType(value) { | ||
return Object.prototype.toString.call(value).slice(8, -1);}exports.default = getType;module.exports = exports.default; | ||
/***/ }, | ||
/* 8 */ | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$keys = __webpack_require__(6).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var el = undefined; | ||
var _Object$keys = __webpack_require__(4).default;Object.defineProperty(exports, '__esModule', { value: true });var el = undefined; | ||
var reactKey = null; | ||
var getReactKey = function getReactKey(el) { | ||
return _Object$keys(el).filter(function (k) { | ||
return k.indexOf('__reactInternalInst') == 0; | ||
})[0]; | ||
}; | ||
var getReactKey = function getReactKey(el) {return ( | ||
_Object$keys(el).filter(function (k) {return k.indexOf('__reactInternalInst') == 0;})[0]);}; | ||
@@ -298,26 +232,25 @@ function getReactId(el) { | ||
var split = key.split('$'); | ||
return split[split.length - 1]; | ||
} | ||
return split[split.length - 1];} | ||
var Inspecting = { | ||
var Inspecting = { | ||
set: function set(_) { | ||
el = _; | ||
}, | ||
el = _;}, | ||
get: function get() { | ||
return el; | ||
}, | ||
return el;}, | ||
props: function props(el) { | ||
return { | ||
key: getReactId(el), | ||
el: el.tagName.toLowerCase(), | ||
view: el.className.split(' ').filter(function (s) { | ||
return s.substr(0, 4) != 'View'; | ||
}).filter(function (s) { | ||
return s.charAt(0).toUpperCase() == s.charAt(0); | ||
})[0] | ||
}; | ||
}, | ||
return { | ||
key: getReactId(el), | ||
el: el.tagName.toLowerCase(), | ||
view: el.className. | ||
split(' '). | ||
filter(function (s) {return s.substr(0, 4) != 'View';}). | ||
filter(function (s) {return s.charAt(0).toUpperCase() == s.charAt(0);})[0] };}, | ||
all: function all() { | ||
@@ -336,24 +269,20 @@ var cur = el; | ||
if (next.view[0] != '_') { | ||
parents.push(next); | ||
} | ||
} | ||
parents.push(next);}} | ||
cur = _parent; | ||
} | ||
return parents; | ||
} | ||
}; | ||
exports.default = Inspecting; | ||
module.exports = exports.default; | ||
cur = _parent;} | ||
return parents;} };exports.default = | ||
Inspecting;module.exports = exports.default; | ||
/***/ }, | ||
/* 9 */ | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var PATH_DELIMITER = '.'; | ||
Object.defineProperty(exports, '__esModule', { value: true });var PATH_DELIMITER = '.'; | ||
@@ -365,36 +294,25 @@ function lens(data, path) { | ||
if (!segment) { | ||
return data; | ||
} | ||
return data;} | ||
var t = getType(data); | ||
if (t === 'Array' && data[integer(segment)]) { | ||
return lens(data[integer(segment)], p.join(PATH_DELIMITER)); | ||
} else if (t === 'Object' && data[segment]) { | ||
return lens(data[segment], p.join(PATH_DELIMITER)); | ||
} | ||
} | ||
return lens(data[integer(segment)], p.join(PATH_DELIMITER));} else | ||
if (t === 'Object' && data[segment]) { | ||
return lens(data[segment], p.join(PATH_DELIMITER));}}exports.default = lens; | ||
exports.default = lens; | ||
function integer(string) { | ||
return parseInt(string, 10); | ||
} | ||
module.exports = exports.default; | ||
return parseInt(string, 10);}module.exports = exports.default; | ||
/***/ }, | ||
/* 10 */ | ||
/* 8 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var id = Math.ceil(Math.random() * 10); | ||
Object.defineProperty(exports, "__esModule", { value: true });var id = Math.ceil(Math.random() * 10); | ||
function uid() { | ||
return id++; | ||
} | ||
exports.default = uid; | ||
module.exports = exports.default; | ||
return id++;}exports.default = uid;module.exports = exports.default; | ||
@@ -401,0 +319,0 @@ /***/ } |
@@ -1,1 +0,1630 @@ | ||
{"opts":{"name":"tools","saneName":"flinttools","version":"1.5.0","watch":true,"pretty":true,"nomin":true,"build":true,"hasRunInitialBuild":false,"defaultPort":4000,"appDir":"/Users/nw/flint/apps/tools","dir":"/Users/nw/flint/apps/tools","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":{"selectorPrefix":"#_flintdevtools ","tools":"false","build":{"minify":"false"}},"url":"tools.dev"},"port":4001,"wport":6284,"cache":{"files":{"main.js":{"added":1454107726170,"views":["Main"],"meta":{"Main":{"location":[[0,0],[20,1]],"file":"/Users/nw/flint/apps/tools/main.js","styles":{"":{"location":[[13,2],[19,3]]}},"els":{"link":{"location":[[5,2],[5,92]],"key":2},"Errors":{"location":[[7,2],[7,12]],"key":1},"Installer":{"location":[[8,2],[8,15]],"key":1},"Menu":{"location":[[9,2],[9,29]],"key":1},"Inspector":{"location":[[10,2],[10,34]],"key":1},"StateTests":{"location":[[11,2],[11,30]],"key":1}}}},"externals":[],"internals":[],"outsideSrc":" });view.render(function () { return view.el([\"Installer\", 1], null); });view.render(function () { return Flint.iff(showInspector) && view.el([\"Menu\", 1], { if: showInspector }); });view.render(function () { return Flint.iff(showInspector) && view.el([\"Inspector\", 1], { if: showInspector }); });view.render(function () { return Flint.iff(internal) && view.el([\"StateTests\", 1], { if: internal }); }); $[\"$\"] = function (_, _index) { return { pointerEvents: internal ? 'auto' : 'none' }; }; }); })})();","isInternal":false,"writtenAt":1454107726254,"error":null},"close.js":{"added":1454107726288,"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}}}},"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 } }; }; }); })})();","isInternal":false,"writtenAt":1454107726307,"error":null},"debounce.js":{"added":1454107726318,"views":["Debounce"],"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(); }); }); })})();","isInternal":false,"writtenAt":1454107726358,"error":null},"errors.js":{"added":1454114518534,"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}}}},"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' }) ); }); }); })})();","isInternal":false,"writtenAt":1454114518746,"error":null},"inspector.js":{"added":1454107726528,"views":["Inspector"],"meta":{"Inspector":{"location":[[122,0],[235,1]],"file":"/Users/nw/flint/apps/tools/inspector.js","styles":{"":{"location":[[230,2],[234,3]]}},"els":{"Inspector.View":{"location":[[222,2],[228,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":["./keys","./lib/inspecting"],"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 _keys = require('./keys'); var _libInspecting = require('./lib/inspecting'); var _libInspecting2 = _interopRequireDefault(_libInspecting); var _lodash = require('lodash'); var removeHead = function removeHead(_ref) { var _ref2 = _toArray(_ref); var l = _ref2[0]; var ls = _ref2.slice(1); return ls; }; var isAlt = function isAlt(cb) { return function (e) { return e.keyIdentifier === 'Alt' && cb(); }; }; var isEsc = function isEsc(cb) { return function (e) { return e.keyCode === 27 && cb(); }; }; var setLocal = function setLocal(k, v) { return localStorage.setItem('__flint.state.' + k, JSON.stringify(v)); }; var getLocal = function getLocal(k, d) { return JSON.parse(localStorage.getItem('__flint.state.' + k)) || d; }; var round = Math.round; var highlighter = undefined; function positionHighlight(node) { var bounds = node.getBoundingClientRect(); var winW = window.innerWidth; var winH = window.innerHeight; var width = round(bounds.right - bounds.left); var height = round(bounds.bottom - bounds.top); var opacity = 1; if (width >= winW && height >= winH) opacity = 0.2; highlighter.setAttribute('style', '\\n top: ' + round(bounds.top) + 'px;\\n left: ' + round(bounds.left) + 'px;\\n width: ' + width + 'px;\\n height: ' + height + 'px;\\n opacity: ' + opacity + ';\\n '); } function hideHighlight() { highlighter.setAttribute('style', ''); } function findPath(node) { if (!node || !node.getAttribute) return null; var flintid = node.__flintID; if (!flintid) return findPath(node.parentNode); positionHighlight(node); return flintid; } function tempActive(views) { return views.filter(function (v) { return !v.temp; }).length > 0; } function pathActive(views, path) { return views.filter(function (v) { return v.path == path; }).length > 0; } function removeTemp(views) { return views.filter(function (v) { return !v.temp; }).map(function (v) { return _extends({}, v, { highlight: false }); }); } function addTemp(views, path) { return [{ path: path, highlight: false, temp: true }].concat(views); } function setClosing(views, path) { return views.map(function (v) { if (v.path == path) v.closing = true; return v; }); } function highlightPath(views, path) { return views.map(function (v) { if (v.path == path) v.highlight = true; return v; }); } function toggleView(views, path) { if (pathActive(views, path)) { return views.map(function (v) { if (v.path == path) v.temp = true; return v; }); } else { var added = { temp: false, highlight: false, closing: false, path: path }; return [].concat([added], views); } function closeLast() { if (!views.length) return; view.set('views', views = removeHead(views)); view.updateSoft(); } 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(_ref5) { var target = _ref5.target; var inspector = ReactDOM.findDOMNode(view); if (inspector.contains(target)) return; view.set('views', views = toggleView(removeTemp(views), findPath(target))); return false; 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); } })); }); }); }); })})();","isInternal":false,"writtenAt":1454107726619,"error":null},"keys.js":{"added":1454107726621,"views":[],"meta":{},"externals":["babel-runtime/helpers/interop-require-default","keycode"],"internals":[],"isInternal":true},"menu.js":{"added":1454107726650,"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}}}},"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] } }; }; }); })})();","isInternal":false,"writtenAt":1454107726702,"error":null},"modal.js":{"added":1454107726714,"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}}}},"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' }; }; }); })})();","isInternal":false,"writtenAt":1454107726743,"error":null},"inspector/highlighter.js":{"added":1454107726745,"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}}}},"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 ), _ ); }) ); }); }); })})();","isInternal":false,"writtenAt":1454107726763,"error":null},"inspector/label.js":{"added":1454107726765,"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}}}},"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' }; }; }); })})();","isInternal":false,"writtenAt":1454107726799,"error":null},"inspector/leaf.js":{"added":1454107726801,"views":["Leaf"],"meta":{"Leaf":{"location":[[16,0],[186,1]],"file":"/Users/nw/flint/apps/tools/inspector/leaf.js","styles":{"leaf":{"location":[[126,2],[129,3]]},"label":{"location":[[135,2],[140,4]]},"helper":{"location":[[142,2],[142,32]]},"boolean":{"location":[[143,2],[143,50]]},"number":{"location":[[144,2],[144,63]]},"string":{"location":[[145,2],[145,32]]},"key":{"location":[[147,2],[151,4]]},"function":{"location":[[153,2],[157,3]]},"colon":{"location":[[159,2],[162,3]]},"name":{"location":[[164,2],[168,3]]},"expand":{"location":[[170,2],[170,17]]},"value":{"location":[[172,2],[175,4]]},"children":{"location":[[177,2],[179,3]]},"type":{"location":[[181,2],[185,3]]}},"els":{"Highlighter":{"location":[[69,24],[69,71]],"key":1},"Label":{"location":[[71,4],[75,6]],"key":1},"leaf":{"location":[[78,2],[78,25]],"key":1},"label":{"location":[[79,4],[79,63]],"key":1},"key":{"location":[[80,6],[80,11]],"key":1},"name":{"location":[[81,8],[81,14]],"key":1},"colon":{"location":[[84,6],[84,13]],"key":1},"expand":{"location":[[91,6],[91,36]],"key":3},"i":{"location":[[86,8],[86,11]],"key":1},"type":{"location":[[92,8],[92,14]],"key":2},"value":{"location":[[94,6],[94,97]],"key":1},"str":{"location":[[95,8],[95,49]],"key":1},"else":{"location":[[98,8],[98,50]],"key":1},"children":{"location":[[104,4],[104,14]],"key":1},"child":{"location":[[105,6],[107,26]],"key":1},"Leaf":{"location":[[108,8],[121,10]],"key":1}}}},"externals":["babel-runtime/core-js/object/keys","babel-runtime/helpers/interop-require-default","md5-o-matic","ellipsize"],"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'); getLabel('key', key, key, false) ), view.el( ['colon', 1], null, ':' ), Flint.iff(type == 'Function') && view.el( ['expand', 1], { className: 'function', if: type == 'Function' }, view.el( ['i', 1], null, 'fn (', fnParams(_data).join(', '), ')' ) ), Flint.iff(type == 'Array') && view.el( ['expand', 2], { if: type == 'Array' }, view.el( ['type', 1], null, 'Array[', _data.length, ']' ) ), Flint.iff(type == 'Object') && view.el( ['expand', 3], { if: type == 'Object' }, view.el( ['type', 2], null, '{} ' + dataKeys.length + ' keys' ) ), Flint.iff(['Array', 'Object', 'Function'].indexOf(type) == -1) && view.el( ['value', 1], { if: ['Array', 'Object', 'Function'].indexOf(type) == -1, className: type.toLowerCase() }, Flint.iff(type.toLowerCase() == 'string') && view.el( ['str', 1], { if: type.toLowerCase() == 'string' }, format((0, _ellipsize2.default)(String(_data), 25)) ), Flint.iff(type.toLowerCase() != 'string') && view.el( ['else', 1], { if: type.toLowerCase() != 'string' }, format(String(_data)) ), getLabel('val', _data, key, editable) ) ), view.el( ['children', 1], null, Flint.iff(expanded && !isPrimitive(_data)) && Flint.range(dataKeys).map(function (_, _index) { return view.el( ['child', 1, _, _index], { if: expanded && !isPrimitive(_data), repeat: dataKeys }, Flint.iff(_.indexOf('__') == -1) && view.el(['Leaf', 1, _, _index], { if: _.indexOf('__') == -1, key: getLeafKey(_, _data[_]), onSet: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return onSet.apply(undefined, [key].concat(args)); }, data: _data[_], editable: editable, label: _, prefix: rootPath, onClick: onClick, id: id, query: _query, getOriginal: original ? null : getOriginal, isExpanded: isExpanded }) ); }) ) ); }); var row = { flexFlow: 'row' }; $[\"label\"] = function (_, _index) { return [row, { position: 'relative', color: 'rgba(0,0,0,0.8)', opacity: 1, alignItems: 'baseline' }]; }; $[\"key\"] = function (_, _index) { return [row, { color: 'rgba(0,0,0,0.9)', margin: [0], fontWeight: 'bold' }]; }; $[\"expand\"] = function (_, _index) { return [row]; }; $[\"value\"] = function (_, _index) { return [row, { position: 'relative', margin: [0, 4, 0] }]; }; }); })})();","isInternal":false,"writtenAt":1454107726892,"error":null},"inspector/section.js":{"added":1454107726895,"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}}}},"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 ); }); }); })})();","isInternal":false,"writtenAt":1454107726907,"error":null},"inspector/statetests.js":{"added":1454107726909,"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}}}},"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) }); }); }); })})();","isInternal":false,"writtenAt":1454107726963,"error":null},"inspector/title.js":{"added":1454107726964,"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}}}},"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'] }; }; }); })})();","isInternal":false,"writtenAt":1454107726986,"error":null},"inspector/tree.js":{"added":1454107726988,"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}}}},"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); } }); }); }); })})();","isInternal":false,"writtenAt":1454107727005,"error":null},"inspector/view.js":{"added":1454107727007,"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}}}},"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'; }); })})();","isInternal":false,"writtenAt":1454107727064,"error":null},"lib/createFilterer.js":{"added":1454107727069,"views":[],"meta":{},"externals":["babel-runtime/core-js/object/assign","babel-runtime/core-js/object/keys"],"internals":[],"isInternal":true},"lib/getType.js":{"added":1454107727099,"views":[],"meta":{},"externals":[],"internals":[],"isInternal":true},"lib/inspecting.js":{"added":1454107727106,"views":[],"meta":{},"externals":["babel-runtime/core-js/object/keys"],"internals":[],"isInternal":true},"lib/lens.js":{"added":1454107727131,"views":[],"meta":{},"externals":[],"internals":[],"isInternal":true},"lib/uid.js":{"added":1454107727143,"views":[],"meta":{},"externals":[],"internals":[],"isInternal":true},"npm/installer.js":{"added":1454107727150,"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}}}},"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],","isInternal":false,"writtenAt":1454107727190,"error":null}},"imports":[],"fileMeta":{}},"installed":["lodash","keycode","md5-o-matic","ellipsize","mouse-event-offset"]} | ||
{ | ||
"opts": { | ||
"name": "tools", | ||
"saneName": "flinttools", | ||
"version": "1.4.76", | ||
"hasRunInitialBuild": false, | ||
"defaultPort": 4000, | ||
"appDir": "/Users/nw/flint/apps/tools", | ||
"dir": "/Users/nw/flint/apps/tools", | ||
"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": { | ||
"selectorPrefix": "#_flintdevtools ", | ||
"tools": "false" | ||
}, | ||
"url": "tools.dev" | ||
}, | ||
"cache": { | ||
"files": { | ||
"main.js": { | ||
"added": 1454397095667, | ||
"views": [ | ||
"Main" | ||
], | ||
"meta": { | ||
"Main": { | ||
"location": { | ||
"start": { | ||
"line": 23, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 44, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/main.js", | ||
"styles": { | ||
"": { | ||
"line": 37, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"link1": { | ||
"line": 27, | ||
"column": 83 | ||
}, | ||
"link2": { | ||
"line": 28, | ||
"column": 92 | ||
}, | ||
"Errors1": { | ||
"line": 30, | ||
"column": 12 | ||
}, | ||
"Installer1": { | ||
"line": 31, | ||
"column": 15 | ||
}, | ||
"DevBar1": { | ||
"line": 32, | ||
"column": 12 | ||
}, | ||
"Menu1": { | ||
"line": 33, | ||
"column": 29 | ||
}, | ||
"Inspector1": { | ||
"line": 34, | ||
"column": 34 | ||
}, | ||
"StateTests1": { | ||
"line": 35, | ||
"column": 30 | ||
} | ||
} | ||
} | ||
}, | ||
"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)) {on.event('hud:show');}});} else { offAlt && offAlt(); on.event('hud:hide');}} on.keydown(window, checkInspect); on.keyup(window, checkInspect);Flint.staticStyles('Main', { '$': '#_flintdevtools .ViewMain' }, { '$': { ", | ||
"isInternal": false, | ||
"writtenAt": 1454397095829, | ||
"error": null | ||
}, | ||
"close.js": { | ||
"added": 1454397095831, | ||
"views": [ | ||
"Close" | ||
], | ||
"meta": { | ||
"Close": { | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 25, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/close.js", | ||
"styles": { | ||
"": { | ||
"line": 6, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"close1": { | ||
"line": 2, | ||
"column": 38 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [], | ||
"internals": [], | ||
"outsideSrc": "", | ||
"isInternal": false, | ||
"writtenAt": 1454397095870, | ||
"error": null | ||
}, | ||
"debounce.js": { | ||
"added": 1454397095872, | ||
"views": [ | ||
"Debounce" | ||
], | ||
"meta": { | ||
"Debounce": { | ||
"location": { | ||
"start": { | ||
"line": 11, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 69, | ||
"column": 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; var Avg = 5000; var Clear = 1000 * 10; var AutoDetectAvgDiff = 1000;Flint.view(\"Debounce\", function (view, on, $) ", | ||
"isInternal": false, | ||
"writtenAt": 1454397095966, | ||
"error": null | ||
}, | ||
"devbar.js": { | ||
"added": 1454397095925, | ||
"views": [ | ||
"DevBar" | ||
], | ||
"meta": { | ||
"DevBar": { | ||
"location": { | ||
"start": { | ||
"line": 10, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 79, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/devbar.js", | ||
"styles": { | ||
"bar": { | ||
"line": 46, | ||
"column": 2 | ||
}, | ||
"pin": { | ||
"line": 59, | ||
"column": 2 | ||
}, | ||
"label": { | ||
"line": 65, | ||
"column": 2 | ||
}, | ||
"fps": { | ||
"line": 72, | ||
"column": 2 | ||
}, | ||
"button": { | ||
"line": 76, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"bar1": { | ||
"line": 38, | ||
"column": 26 | ||
}, | ||
"fps1": { | ||
"line": 39, | ||
"column": 9 | ||
}, | ||
"label1": { | ||
"line": 40, | ||
"column": 13 | ||
}, | ||
"button1": { | ||
"line": 41, | ||
"column": 55 | ||
} | ||
} | ||
} | ||
}, | ||
"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;};Flint.staticStyles('DevBar', { '$bar': '#_flintdevtools bar.DevBar, #_flintdevtools .DevBar.bar, #_flintdevtools .ViewDevBar.bar, #_flintdevtools .DevBar > .bar', '$pin': '#_flintdevtools pin.DevBar, #_flintdevtools .DevBar.pin, #_flintdevtools .ViewDevBar.pin, #_flintdevtools .DevBar > .pin', '$label': '#_flintdevtools label.DevBar, #_flintdevtools .DevBar.label, #_flintdevtools .ViewDevBar.label, #_flintdevtools .DevBar > .label', '$fps': '#_flintdevtools fps.DevBar, #_flintdevtools .DevBar.fps, #_flintdevtools .ViewDevBar.fps, #_flintdevtools .DevBar > .fps', '$button': '#_flintdevtools button.DevBar, #_flintdevtools .DevBar.button, #_flintdevtools .ViewDevBar.button, #_flintdevtools .DevBar > .button' }, { '$bar': { );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();} }, 'reset')));});});})})(); /*<pin onClick={togglePin }>Pin</pin>*/", | ||
"isInternal": false, | ||
"writtenAt": 1454397096146, | ||
"error": null | ||
}, | ||
"errors.js": { | ||
"added": 1454397096005, | ||
"views": [ | ||
"Errors", | ||
"ErrorMessage", | ||
"ErrorIcon" | ||
], | ||
"meta": { | ||
"Errors": { | ||
"location": { | ||
"start": { | ||
"line": 115, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 184, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/errors.js", | ||
"styles": {}, | ||
"els": { | ||
"ErrorMessage1": { | ||
"line": 183, | ||
"column": 4 | ||
} | ||
} | ||
}, | ||
"ErrorMessage": { | ||
"location": { | ||
"start": { | ||
"line": 191, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 370, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/errors.js", | ||
"styles": { | ||
"bar": { | ||
"line": 273, | ||
"column": 2 | ||
}, | ||
"inner": { | ||
"line": 292, | ||
"column": 2 | ||
}, | ||
"top": { | ||
"line": 298, | ||
"column": 2 | ||
}, | ||
"where": { | ||
"line": 303, | ||
"column": 2 | ||
}, | ||
"line": { | ||
"line": 310, | ||
"column": 2 | ||
}, | ||
"flint": { | ||
"line": 316, | ||
"column": 2 | ||
}, | ||
"shortError": { | ||
"line": 322, | ||
"column": 2 | ||
}, | ||
"niceStack": { | ||
"line": 334, | ||
"column": 2 | ||
}, | ||
"cur": { | ||
"line": 336, | ||
"column": 2 | ||
}, | ||
"errCol": { | ||
"line": 340, | ||
"column": 2 | ||
}, | ||
"fullStack": { | ||
"line": 348, | ||
"column": 2 | ||
}, | ||
"ln": { | ||
"line": 361, | ||
"column": 2 | ||
}, | ||
"flintline": { | ||
"line": 365, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"Debounce1": { | ||
"line": 231, | ||
"column": 3 | ||
}, | ||
"bar1": { | ||
"line": 232, | ||
"column": 9 | ||
}, | ||
"Close1": { | ||
"line": 233, | ||
"column": 52 | ||
}, | ||
"inner1": { | ||
"line": 235, | ||
"column": 27 | ||
}, | ||
"where1": { | ||
"line": 236, | ||
"column": 15 | ||
}, | ||
"flint1": { | ||
"line": 236, | ||
"column": 22 | ||
}, | ||
"inner2": { | ||
"line": 239, | ||
"column": 13 | ||
}, | ||
"top1": { | ||
"line": 240, | ||
"column": 13 | ||
}, | ||
"where2": { | ||
"line": 241, | ||
"column": 17 | ||
}, | ||
"span1": { | ||
"line": 242, | ||
"column": 18 | ||
}, | ||
"flint2": { | ||
"line": 242, | ||
"column": 28 | ||
}, | ||
"line1": { | ||
"line": 243, | ||
"column": 18 | ||
}, | ||
"flint3": { | ||
"line": 243, | ||
"column": 57 | ||
}, | ||
"shortError1": { | ||
"line": 248, | ||
"column": 22 | ||
}, | ||
"niceStack1": { | ||
"line": 250, | ||
"column": 44 | ||
}, | ||
"errCol1": { | ||
"line": 252, | ||
"column": 22 | ||
}, | ||
"help1": { | ||
"line": 257, | ||
"column": 32 | ||
}, | ||
"fullStack1": { | ||
"line": 262, | ||
"column": 34 | ||
}, | ||
"ln1": { | ||
"line": 263, | ||
"column": 14 | ||
}, | ||
"ln2": { | ||
"line": 264, | ||
"column": 26 | ||
}, | ||
"ln3": { | ||
"line": 265, | ||
"column": 14 | ||
} | ||
} | ||
}, | ||
"ErrorIcon": { | ||
"location": { | ||
"start": { | ||
"line": 372, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 390, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/errors.js", | ||
"styles": { | ||
"svg": { | ||
"line": 382, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"svg1": { | ||
"line": 373, | ||
"column": 35 | ||
}, | ||
"path1": { | ||
"line": 376, | ||
"column": 88 | ||
}, | ||
"polygon1": { | ||
"line": 377, | ||
"column": 78 | ||
}, | ||
"path2": { | ||
"line": 379, | ||
"column": 53 | ||
} | ||
} | ||
} | ||
}, | ||
"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;}; function showFlintErrorDiv() { setTimeout(function () { var errors = document.querySelectorAll('.__flintError'); if (!errors.length) return; // add active class to show them [].forEach.call(errors, function (error) { if (error.className.indexOf('active') == -1) error.className += ' active';});}, isLive() ? 1000 : 0);} function niceRuntimeError(err) { if (err.file) err.file = err.file.replace(new RegExp('.*' + window.location.origin + '(\\/[_]+\\/)?'), ''); if (err.file && err.file.indexOf('internals.js') >= 0) { if (err.message && err.message.indexOf('Cannot find module') == 0) { var badModule = err.message.match(/(fs|path)/); if (badModule && badModule.length) { err.file = 'imported module:'; err.message = 'Cannot import node-only module: ' + badModule[0];}} else { err.message = 'Error in a locally required file. ' + err.message;}} if (err.message) err.niceMessage = err.message.replace(/Uncaught .*Error:\\s*/, ''); return err;} function niceNpmError(_ref) {var msg = _ref.msg;var name = _ref.name; if (msg) msg = msg. replace(/(npm WARN.*\\n|ERR\\!)/g, ''). replace(/npm argv.*\\n/g, ''). replace(/npm node v.*\\n/g, ''). replace(/npm npm.*\\n/g, ''). replace(/npm code.*\\n/g, ''). replace(/npm peerinvalid /g, ''). replace(/npm 404 /g, ''); return { msg: msg, name: name };} var niceCompilerError = function niceCompilerError(err) {return ( niceCompilerMessage(fullStack(niceStack(err))));}; var replaceCompilerMsg = function replaceCompilerMsg(msg) { if (!msg) return ''; return msg. replace(/.*\\.js\\:/, ''). replace(/\\([0-9]+\\:[0-9]+\\)/, ''). replace(/Line [0-9]+\\:\\s*/, '');}; var niceCompilerMessage = function niceCompilerMessage(err) { err.niceMessage = replaceCompilerMsg(err.message, err.fileName); return err;}; var matchErrorLine = /\\>?\\s*([0-9]*)\\s*\\|(.*)/g; var indicator = /\\s*\\|\\s*\\^\\s*$/g; var fullStack = function fullStack(err) { if (!err) return; if (err.stack) {(function () { err.fullStack = ['', '', '']; var index = 0; err.stack.split(\"\\n\").forEach(function (line) { if (indicator.test(line)) return; if (!matchErrorLine.test(line)) return; var isLine = line[0] === '>'; if (isLine) index = 1; if (!isLine && index === 1) index = 2; var result = line.replace(matchErrorLine, '$1$2').replace(/^(\\s*[0-9]+\\s*)[;]/, '$1 '); err.fullStack[index] += result + \"\\n\";});})();} return err;}; var niceStack = function niceStack(err) { if (!err) return; if (err.stack) { err.stack.split(\"\\n\").map(function (line) { if (line[0] === '>') { var result = line; if (!result) return; // remove the babel \" > |\" before the line result = result.replace(/\\>\\s*[0-9]+\\s*\\|\\s*/, ''); result = replaceCompilerMsg(result); var colIndex = err.loc.column - 4; // 4 because we remove babel prefix err.niceStack = split(result, colIndex);}});} return err;}; var log = function log() { if (false) console.log.apply(console, arguments);};Flint.view('Errors', function (view, on, $) 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': { ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096254, | ||
"error": null | ||
}, | ||
"inspector.js": { | ||
"added": 1454397096153, | ||
"views": [ | ||
"Inspector" | ||
], | ||
"meta": { | ||
"Inspector": { | ||
"location": { | ||
"start": { | ||
"line": 123, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 220, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector.js", | ||
"styles": { | ||
"": { | ||
"line": 215, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"Inspector.View1": { | ||
"line": 213, | ||
"column": 4 | ||
} | ||
} | ||
} | ||
}, | ||
"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 internal() { return window._Flint;} function writeBack(path, writePath) { var Int = internal(); var cache = Int.getCache[path]; // update getCache writePath.reduce(function (acc, cur) { if (cur == 'root') return acc; if (!Array.isArray(cur)) return acc[cur]; // is end of path: [key, val] var _cur = _slicedToArray(cur, 2);var key = _cur[0];var val = _cur[1]; var current = acc[key]; if (typeof current == 'number') val = +val; // write acc[key] = val;}, cache); Int.inspectorRefreshing = path; Int.getInitialStates[path](); Int.viewsAtPath[path].forceUpdate(); Int.inspectorRefreshing = null;}Flint.staticStyles('Inspector', { '$': '#_flintdevtools .ViewInspector' }, { '$': { ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096373, | ||
"error": null | ||
}, | ||
"keys.js": { | ||
"added": 1454397096258, | ||
"views": [], | ||
"meta": {}, | ||
"externals": [], | ||
"internals": [], | ||
"isInternal": true, | ||
"writtenAt": 1454397096402, | ||
"error": null | ||
}, | ||
"menu.js": { | ||
"added": 1454397096308, | ||
"views": [ | ||
"Menu" | ||
], | ||
"meta": { | ||
"Menu": { | ||
"location": { | ||
"start": { | ||
"line": 7, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 126, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/menu.js", | ||
"styles": { | ||
"menu": { | ||
"line": 75, | ||
"column": 2 | ||
}, | ||
"active": { | ||
"line": 91, | ||
"column": 2 | ||
}, | ||
"item": { | ||
"line": 97, | ||
"column": 2 | ||
}, | ||
"first": { | ||
"line": 103, | ||
"column": 2 | ||
}, | ||
"last": { | ||
"line": 109, | ||
"column": 2 | ||
}, | ||
"hl": { | ||
"line": 115, | ||
"column": 2 | ||
}, | ||
"main": { | ||
"line": 123, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"menu1": { | ||
"line": 60, | ||
"column": 43 | ||
}, | ||
"item1": { | ||
"line": 67, | ||
"column": 5 | ||
}, | ||
"main1": { | ||
"line": 68, | ||
"column": 49 | ||
}, | ||
"sub1": { | ||
"line": 69, | ||
"column": 46 | ||
} | ||
} | ||
} | ||
}, | ||
"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');var _libInspecting = require( './lib/inspecting');var _libInspecting2 = _interopRequireDefault(_libInspecting); var Tools = _DT; var toEditor = Tools.messageEditor;Flint.staticStyles('Menu', { '$menu': '#_flintdevtools .ViewMenu', '$active': '#_flintdevtools active.Menu, #_flintdevtools .Menu.active, #_flintdevtools .ViewMenu.active, #_flintdevtools .Menu > .active', '$item': '#_flintdevtools item.Menu, #_flintdevtools .Menu.item, #_flintdevtools .ViewMenu.item, #_flintdevtools .Menu > .item', '$first': '#_flintdevtools first.Menu, #_flintdevtools .Menu.first, #_flintdevtools .ViewMenu.first, #_flintdevtools .Menu > .first', '$last': '#_flintdevtools last.Menu, #_flintdevtools .Menu.last, #_flintdevtools .ViewMenu.last, #_flintdevtools .Menu > .last', '$hl': '#_flintdevtools hl.Menu, #_flintdevtools .Menu.hl, #_flintdevtools .ViewMenu.hl, #_flintdevtools .Menu > .hl', '$main': '#_flintdevtools main.Menu, #_flintdevtools .Menu.main, #_flintdevtools .ViewMenu.main, #_flintdevtools .Menu > .main' }, { '$menu': { ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096432, | ||
"error": null | ||
}, | ||
"modal.js": { | ||
"added": 1454397096375, | ||
"views": [ | ||
"FlintModal" | ||
], | ||
"meta": { | ||
"FlintModal": { | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 51, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/modal.js", | ||
"styles": { | ||
"": { | ||
"line": 24, | ||
"column": 2 | ||
}, | ||
"title": { | ||
"line": 41, | ||
"column": 2 | ||
}, | ||
"message": { | ||
"line": 48, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"Close1": { | ||
"line": 20, | ||
"column": 21 | ||
}, | ||
"title1": { | ||
"line": 21, | ||
"column": 20 | ||
}, | ||
"message1": { | ||
"line": 22, | ||
"column": 25 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [], | ||
"internals": [], | ||
"outsideSrc": "", | ||
"isInternal": false, | ||
"writtenAt": 1454397096474, | ||
"error": null | ||
}, | ||
"inspector/highlighter.js": { | ||
"added": 1454397096403, | ||
"views": [ | ||
"Highlighter" | ||
], | ||
"meta": { | ||
"Highlighter": { | ||
"location": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 13, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/highlighter.js", | ||
"styles": {}, | ||
"els": { | ||
"name1": { | ||
"line": 4, | ||
"column": 93 | ||
}, | ||
"span1": { | ||
"line": 7, | ||
"column": 34 | ||
}, | ||
"span2": { | ||
"line": 8, | ||
"column": 45 | ||
}, | ||
"highlight1": { | ||
"line": 9, | ||
"column": 33 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [ | ||
"babel-runtime/core-js/object/keys" | ||
], | ||
"internals": [], | ||
"outsideSrc": "var _Object$keys = require(\"babel-runtime/core-js/object/keys\").default;(function () {Flint.file(\"inspector/highlighter.js\", function (require) {var isEmpty = function isEmpty(obj) {return _Object$keys(object).length === 0;};Flint.view(\"Highlighter\", function (view, on, $) ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096599, | ||
"error": null | ||
}, | ||
"inspector/label.js": { | ||
"added": 1454397096434, | ||
"views": [ | ||
"Label" | ||
], | ||
"meta": { | ||
"Label": { | ||
"location": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 73, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/label.js", | ||
"styles": { | ||
"input": { | ||
"line": 54, | ||
"column": 2 | ||
}, | ||
"focus": { | ||
"line": 70, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"input1": { | ||
"line": 52, | ||
"column": 4 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [ | ||
"babel-runtime/helpers/extends", | ||
"lodash" | ||
], | ||
"internals": [], | ||
"outsideSrc": "var _extends = require('babel-runtime/helpers/extends').default;(function () {Flint.file('inspector/label.js', function (require) {var _lodash = require('lodash');Flint.staticStyles('Label', { '$input': '#_flintdevtools input.Label, #_flintdevtools .Label.input, #_flintdevtools .ViewLabel.input, #_flintdevtools .Label > .input', '$focus': '#_flintdevtools focus.Label, #_flintdevtools .Label.focus, #_flintdevtools .ViewLabel.focus, #_flintdevtools .Label > .focus' }, { '$input': { cursor: (0, _lodash.isBoolean)(val) ? 'pointer' : 'auto' };};});})})();", | ||
"isInternal": false, | ||
"writtenAt": 1454397096616, | ||
"error": null | ||
}, | ||
"inspector/leaf.js": { | ||
"added": 1454397096475, | ||
"views": [ | ||
"Leaf" | ||
], | ||
"meta": { | ||
"Leaf": { | ||
"location": { | ||
"start": { | ||
"line": 19, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 212, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/leaf.js", | ||
"styles": { | ||
"leaf": { | ||
"line": 155, | ||
"column": 2 | ||
}, | ||
"label": { | ||
"line": 164, | ||
"column": 2 | ||
}, | ||
"helper": { | ||
"line": 171, | ||
"column": 2 | ||
}, | ||
"boolean": { | ||
"line": 172, | ||
"column": 2 | ||
}, | ||
"number": { | ||
"line": 173, | ||
"column": 2 | ||
}, | ||
"string": { | ||
"line": 174, | ||
"column": 2 | ||
}, | ||
"key": { | ||
"line": 176, | ||
"column": 2 | ||
}, | ||
"function": { | ||
"line": 182, | ||
"column": 2 | ||
}, | ||
"colon": { | ||
"line": 184, | ||
"column": 2 | ||
}, | ||
"name": { | ||
"line": 189, | ||
"column": 2 | ||
}, | ||
"expand": { | ||
"line": 195, | ||
"column": 2 | ||
}, | ||
"value": { | ||
"line": 198, | ||
"column": 2 | ||
}, | ||
"children": { | ||
"line": 203, | ||
"column": 2 | ||
}, | ||
"type": { | ||
"line": 207, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"Highlighter1": { | ||
"line": 82, | ||
"column": 51 | ||
}, | ||
"Label1": { | ||
"line": 90, | ||
"column": 6 | ||
}, | ||
"leaf1": { | ||
"line": 106, | ||
"column": 25 | ||
}, | ||
"label1": { | ||
"line": 107, | ||
"column": 63 | ||
}, | ||
"key1": { | ||
"line": 108, | ||
"column": 11 | ||
}, | ||
"name1": { | ||
"line": 109, | ||
"column": 14 | ||
}, | ||
"colon1": { | ||
"line": 111, | ||
"column": 13 | ||
}, | ||
"value1": { | ||
"line": 112, | ||
"column": 13 | ||
}, | ||
"fn1": { | ||
"line": 113, | ||
"column": 46 | ||
}, | ||
"i1": { | ||
"line": 114, | ||
"column": 13 | ||
}, | ||
"array1": { | ||
"line": 116, | ||
"column": 29 | ||
}, | ||
"type1": { | ||
"line": 117, | ||
"column": 16 | ||
}, | ||
"obj1": { | ||
"line": 119, | ||
"column": 28 | ||
}, | ||
"type2": { | ||
"line": 120, | ||
"column": 16 | ||
}, | ||
"nested1": { | ||
"line": 122, | ||
"column": 58 | ||
}, | ||
"str1": { | ||
"line": 123, | ||
"column": 30 | ||
}, | ||
"else1": { | ||
"line": 126, | ||
"column": 46 | ||
}, | ||
"children1": { | ||
"line": 133, | ||
"column": 14 | ||
}, | ||
"child1": { | ||
"line": 136, | ||
"column": 26 | ||
}, | ||
"Leaf1": { | ||
"line": 150, | ||
"column": 10 | ||
} | ||
} | ||
} | ||
}, | ||
"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'); var PATH_PREFIX = '.root.'; var contains = function contains(string, substring) {return string.indexOf(substring) !== -1;}; var isPrimitive = function isPrimitive(v) {return (0, _libGetType2.default)(v) !== 'Object' && (0, _libGetType2.default)(v) !== 'Array';}; var noop = function noop() {}; var fnParams = function fnParams(fn) {return fn.toString(). replace(/((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/)|(\\s))/mg, ''). match(/^function\\s*[^\\(]*\\(\\s*([^\\)]*)\\)/m)[1]. split(/,/);};Flint.staticStyles('Leaf', { '$leaf': '#_flintdevtools .ViewLeaf', '$helper': '#_flintdevtools helper.Leaf, #_flintdevtools .Leaf.helper, #_flintdevtools .ViewLeaf.helper, #_flintdevtools .Leaf > .helper', '$boolean': '#_flintdevtools boolean.Leaf, #_flintdevtools .Leaf.boolean, #_flintdevtools .ViewLeaf.boolean, #_flintdevtools .Leaf > .boolean', '$number': '#_flintdevtools number.Leaf, #_flintdevtools .Leaf.number, #_flintdevtools .ViewLeaf.number, #_flintdevtools .Leaf > .number', '$string': '#_flintdevtools string.Leaf, #_flintdevtools .Leaf.string, #_flintdevtools .ViewLeaf.string, #_flintdevtools .Leaf > .string', '$function': '#_flintdevtools function.Leaf, #_flintdevtools .Leaf.function, #_flintdevtools .ViewLeaf.function, #_flintdevtools .Leaf > .function', '$colon': '#_flintdevtools colon.Leaf, #_flintdevtools .Leaf.colon, #_flintdevtools .ViewLeaf.colon, #_flintdevtools .Leaf > .colon', '$name': '#_flintdevtools name.Leaf, #_flintdevtools .Leaf.name, #_flintdevtools .ViewLeaf.name, #_flintdevtools .Leaf > .name', '$children': '#_flintdevtools children.Leaf, #_flintdevtools .Leaf.children, #_flintdevtools .ViewLeaf.children, #_flintdevtools .Leaf > .children', '$type': '#_flintdevtools type.Leaf, #_flintdevtools .Leaf.type, #_flintdevtools .ViewLeaf.type, #_flintdevtools .Leaf > .type' }, { '$leaf': { ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096690, | ||
"error": null | ||
}, | ||
"inspector/section.js": { | ||
"added": 1454397096601, | ||
"views": [ | ||
"Inspector.Section" | ||
], | ||
"meta": { | ||
"Inspector.Section": { | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 22, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/section.js", | ||
"styles": { | ||
"": { | ||
"line": 11, | ||
"column": 2 | ||
}, | ||
"body": { | ||
"line": 15, | ||
"column": 2 | ||
}, | ||
"inactive": { | ||
"line": 19, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"Inspector.Title1": { | ||
"line": 4, | ||
"column": 48 | ||
}, | ||
"body1": { | ||
"line": 7, | ||
"column": 8 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [], | ||
"internals": [], | ||
"outsideSrc": "", | ||
"isInternal": false, | ||
"writtenAt": 1454397096707, | ||
"error": null | ||
}, | ||
"inspector/statetests.js": { | ||
"added": 1454397096620, | ||
"views": [ | ||
"StateTests", | ||
"Tests.Boolean", | ||
"Tests.Props", | ||
"Test.PropsChild", | ||
"Tests.Counter", | ||
"Tests.Deep", | ||
"Tests.Name", | ||
"Tests.Circles", | ||
"Tests.Circle" | ||
], | ||
"meta": { | ||
"StateTests": { | ||
"location": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 9, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": {}, | ||
"els": { | ||
"Tests.Name1": { | ||
"line": 4, | ||
"column": 16 | ||
}, | ||
"Tests.Boolean1": { | ||
"line": 5, | ||
"column": 19 | ||
}, | ||
"Tests.Counter1": { | ||
"line": 6, | ||
"column": 19 | ||
}, | ||
"Tests.Props1": { | ||
"line": 7, | ||
"column": 17 | ||
}, | ||
"Tests.Circles1": { | ||
"line": 8, | ||
"column": 19 | ||
} | ||
} | ||
}, | ||
"Tests.Boolean": { | ||
"location": { | ||
"start": { | ||
"line": 11, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 15, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": {}, | ||
"els": { | ||
"h11": { | ||
"line": 13, | ||
"column": 6 | ||
}, | ||
"button1": { | ||
"line": 14, | ||
"column": 39 | ||
} | ||
} | ||
}, | ||
"Tests.Props": { | ||
"location": { | ||
"start": { | ||
"line": 17, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 24, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": { | ||
"": { | ||
"line": 23, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"input1": { | ||
"line": 20, | ||
"column": 23 | ||
}, | ||
"Test.PropsChild1": { | ||
"line": 21, | ||
"column": 33 | ||
} | ||
} | ||
}, | ||
"Test.PropsChild": { | ||
"location": { | ||
"start": { | ||
"line": 26, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 33, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": {}, | ||
"els": { | ||
"h11": { | ||
"line": 30, | ||
"column": 6 | ||
}, | ||
"h41": { | ||
"line": 31, | ||
"column": 6 | ||
}, | ||
"button1": { | ||
"line": 32, | ||
"column": 34 | ||
} | ||
} | ||
}, | ||
"Tests.Counter": { | ||
"location": { | ||
"start": { | ||
"line": 35, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 40, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": {}, | ||
"els": { | ||
"h11": { | ||
"line": 37, | ||
"column": 6 | ||
}, | ||
"button1": { | ||
"line": 38, | ||
"column": 34 | ||
}, | ||
"button2": { | ||
"line": 39, | ||
"column": 34 | ||
} | ||
} | ||
}, | ||
"Tests.Deep": { | ||
"location": { | ||
"start": { | ||
"line": 42, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 46, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": {}, | ||
"els": { | ||
"h11": { | ||
"line": 44, | ||
"column": 6 | ||
}, | ||
"h21": { | ||
"line": 45, | ||
"column": 6 | ||
} | ||
} | ||
}, | ||
"Tests.Name": { | ||
"location": { | ||
"start": { | ||
"line": 48, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 58, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": {}, | ||
"els": { | ||
"h21": { | ||
"line": 51, | ||
"column": 6 | ||
}, | ||
"input1": { | ||
"line": 52, | ||
"column": 24 | ||
}, | ||
"input2": { | ||
"line": 53, | ||
"column": 23 | ||
}, | ||
"button1": { | ||
"line": 57, | ||
"column": 5 | ||
} | ||
} | ||
}, | ||
"Tests.Circles": { | ||
"location": { | ||
"start": { | ||
"line": 60, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 77, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": { | ||
"circles": { | ||
"line": 76, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"circles1": { | ||
"line": 67, | ||
"column": 31 | ||
}, | ||
"Tests.Circle1": { | ||
"line": 73, | ||
"column": 6 | ||
} | ||
} | ||
}, | ||
"Tests.Circle": { | ||
"location": { | ||
"start": { | ||
"line": 79, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 93, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/statetests.js", | ||
"styles": {}, | ||
"els": { | ||
"circle1": { | ||
"line": 92, | ||
"column": 29 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [ | ||
"babel-runtime/helpers/extends", | ||
"babel-runtime/helpers/interop-require-default", | ||
"mouse-event-offset" | ||
], | ||
"internals": [], | ||
"outsideSrc": "var _extends = require('babel-runtime/helpers/extends').default;var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;(function () {Flint.file('inspector/statetests.js', function (require) {var _mouseEventOffset = require('mouse-event-offset');var _mouseEventOffset2 = _interopRequireDefault(_mouseEventOffset);Flint.view('StateTests', function (view, on, $) { var dead = view.dec('dead', false); view.render(function () {return view.el(['h1', 1], null, 'is tupac dead? ', dead.toString());}); view.render(function () {return view.el(['button', 1], { onClick: function () {return view.set('dead', dead = !dead);} }, 'toggle');});});Flint.staticStyles('Tests.Props', { '$': '#_flintdevtools .ViewTests-Props' }, { '$': { marginTop: 20 } });Flint.view('Tests.Props', function (view, on, $) {var name = view.dec('name', 'a string');view.render(function () {return view.el(['input', 1], { '__flintValue': name, '__flintOnChange': function (e) {view.setImmediate('name', name = e.target.value)} });});view.render(function () {return view.el(['Test.PropsChild', 1], { name: name });});});Flint.view('Test.PropsChild', function (view, on, $) { var name = view.prop('name', undefined);on.props(function () {name = view.getProp('name');}); var count = view.dec('count', 0); view.render(function () {return view.el(['h1', 1], null, 'count is ', count);}); view.render(function () {return view.el(['button', 1], { onClick: function () {return view.set('count', count++, count, true);} }, 'up');}); view.render(function () {return view.el(['button', 2], { onClick: function () {return view.set('count', count--, count, true);} }, 'down');});});Flint.view('Tests.Deep', function (view, on, $) { var person = view.dec('person', { name: 'nick', tools: ['js', 'juggling balls', 'coffee'] }); view.render(function () {return view.el(['h1', 1], null, 'deep');}); view.render(function () {return view.el(['h2', 1], null, JSON.stringify(person));});});Flint.view('Tests.Name', function (view, on, $) view.render(function () {return view.el(['button', 1], { onClick: function () { view.set('first', first = 'nate'); view.set('last', last = 'wienert');} }, 'nateify');});});Flint.staticStyles('Tests.Circles', { '$circles': '#_flintdevtools circles.Tests-Circles, #_flintdevtools .Tests-Circles.circles, #_flintdevtools .ViewTests-Circles.circles, #_flintdevtools .Tests-Circles > .circles' }, { '$circles': { var base = view.dec('base', { background: [c(), c(), c()], position: 'absolute', top: view.props.top, left: view.props.left, width: 118, height: 29, ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096729, | ||
"error": null | ||
}, | ||
"inspector/title.js": { | ||
"added": 1454397096691, | ||
"views": [ | ||
"Inspector.Title" | ||
], | ||
"meta": { | ||
"Inspector.Title": { | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 33, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/title.js", | ||
"styles": { | ||
"title": { | ||
"line": 14, | ||
"column": 2 | ||
}, | ||
"closed": { | ||
"line": 23, | ||
"column": 2 | ||
}, | ||
"inner": { | ||
"line": 28, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"title1": { | ||
"line": 10, | ||
"column": 26 | ||
}, | ||
"inner1": { | ||
"line": 11, | ||
"column": 11 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [], | ||
"internals": [], | ||
"outsideSrc": "", | ||
"isInternal": false, | ||
"writtenAt": 1454397096800, | ||
"error": null | ||
}, | ||
"inspector/tree.js": { | ||
"added": 1454397096708, | ||
"views": [ | ||
"Tree" | ||
], | ||
"meta": { | ||
"Tree": { | ||
"location": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 28, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/tree.js", | ||
"styles": { | ||
"": { | ||
"line": 24, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"Leaf1": { | ||
"line": 22, | ||
"column": 4 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [ | ||
"babel-runtime/helpers/interop-require-default" | ||
], | ||
"internals": [ | ||
"../lib/lens" | ||
], | ||
"outsideSrc": "var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default').default;(function () {Flint.file('inspector/tree.js', function (require) {var _libLens = require('../lib/lens');var _libLens2 = _interopRequireDefault(_libLens);Flint.staticStyles('Tree', { '$': '#_flintdevtools .ViewTree' }, { '$': { ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096834, | ||
"error": null | ||
}, | ||
"inspector/view.js": { | ||
"added": 1454397096730, | ||
"views": [ | ||
"Inspector.View" | ||
], | ||
"meta": { | ||
"Inspector.View": { | ||
"location": { | ||
"start": { | ||
"line": 13, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 161, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/inspector/view.js", | ||
"styles": { | ||
"view": { | ||
"line": 76, | ||
"column": 2 | ||
}, | ||
"top": { | ||
"line": 99, | ||
"column": 2 | ||
}, | ||
"active": { | ||
"line": 103, | ||
"column": 2 | ||
}, | ||
"highlight": { | ||
"line": 110, | ||
"column": 2 | ||
}, | ||
"Close": { | ||
"line": 114, | ||
"column": 2 | ||
}, | ||
"name": { | ||
"line": 120, | ||
"column": 2 | ||
}, | ||
"edit": { | ||
"line": 128, | ||
"column": 2 | ||
}, | ||
"expanded": { | ||
"line": 137, | ||
"column": 2 | ||
}, | ||
"input": { | ||
"line": 141, | ||
"column": 2 | ||
}, | ||
"title": { | ||
"line": 150, | ||
"column": 2 | ||
}, | ||
"section": { | ||
"line": 158, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"view1": { | ||
"line": 56, | ||
"column": 38 | ||
}, | ||
"Close1": { | ||
"line": 57, | ||
"column": 55 | ||
}, | ||
"top1": { | ||
"line": 58, | ||
"column": 9 | ||
}, | ||
"name1": { | ||
"line": 59, | ||
"column": 12 | ||
}, | ||
"edit1": { | ||
"line": 60, | ||
"column": 38 | ||
}, | ||
"Inspector.Section1": { | ||
"line": 63, | ||
"column": 71 | ||
}, | ||
"Tree1": { | ||
"line": 64, | ||
"column": 44 | ||
}, | ||
"Inspector.Section2": { | ||
"line": 67, | ||
"column": 57 | ||
}, | ||
"Tree2": { | ||
"line": 72, | ||
"column": 8 | ||
} | ||
} | ||
} | ||
}, | ||
"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) { var leaveOut = ['if', 'repeat', 'style', 'yield', '__flint']; return _lodash.omit.apply(null, [props].concat(leaveOut));}Flint.staticStyles('Inspector.View', { '$view': '#_flintdevtools view.Inspector-View, #_flintdevtools .Inspector-View.view, #_flintdevtools .ViewInspector-View.view, #_flintdevtools .Inspector-View > .view', '$top': '#_flintdevtools top.Inspector-View, #_flintdevtools .Inspector-View.top, #_flintdevtools .ViewInspector-View.top, #_flintdevtools .Inspector-View > .top', '$active': '#_flintdevtools active.Inspector-View, #_flintdevtools .Inspector-View.active, #_flintdevtools .ViewInspector-View.active, #_flintdevtools .Inspector-View > .active', '$highlight': '#_flintdevtools highlight.Inspector-View, #_flintdevtools .Inspector-View.highlight, #_flintdevtools .ViewInspector-View.highlight, #_flintdevtools .Inspector-View > .highlight', '$Close': '#_flintdevtools .ViewInspector-View .ViewClose', '$name': '#_flintdevtools name.Inspector-View, #_flintdevtools .Inspector-View.name, #_flintdevtools .ViewInspector-View.name, #_flintdevtools .Inspector-View > .name', '$edit': '#_flintdevtools edit.Inspector-View, #_flintdevtools .Inspector-View.edit, #_flintdevtools .ViewInspector-View.edit, #_flintdevtools .Inspector-View > .edit', '$expanded': '#_flintdevtools expanded.Inspector-View, #_flintdevtools .Inspector-View.expanded, #_flintdevtools .ViewInspector-View.expanded, #_flintdevtools .Inspector-View > .expanded', '$input': '#_flintdevtools input.Inspector-View, #_flintdevtools .Inspector-View.input, #_flintdevtools .ViewInspector-View.input, #_flintdevtools .Inspector-View > .input', '$title': '#_flintdevtools title.Inspector-View, #_flintdevtools .Inspector-View.title, #_flintdevtools .ViewInspector-View.title, #_flintdevtools .Inspector-View > .title', '$section': '#_flintdevtools section.Inspector-View, #_flintdevtools .Inspector-View.section, #_flintdevtools .ViewInspector-View.section, #_flintdevtools .Inspector-View > .section' }, { '$view': { ", | ||
"isInternal": false, | ||
"writtenAt": 1454397096842, | ||
"error": null | ||
}, | ||
"lib/createFilterer.js": { | ||
"added": 1454397096804, | ||
"views": [], | ||
"meta": {}, | ||
"externals": [ | ||
"babel-runtime/core-js/object/assign", | ||
"babel-runtime/core-js/object/keys" | ||
], | ||
"internals": [], | ||
"isInternal": true, | ||
"writtenAt": 1454397096871, | ||
"error": null | ||
}, | ||
"lib/getType.js": { | ||
"added": 1454397096835, | ||
"views": [], | ||
"meta": {}, | ||
"externals": [], | ||
"internals": [], | ||
"isInternal": true, | ||
"writtenAt": 1454397096881, | ||
"error": null | ||
}, | ||
"lib/inspecting.js": { | ||
"added": 1454397096845, | ||
"views": [], | ||
"meta": {}, | ||
"externals": [ | ||
"babel-runtime/core-js/object/keys" | ||
], | ||
"internals": [], | ||
"isInternal": true, | ||
"writtenAt": 1454397096893, | ||
"error": null | ||
}, | ||
"lib/lens.js": { | ||
"added": 1454397096872, | ||
"views": [], | ||
"meta": {}, | ||
"externals": [], | ||
"internals": [], | ||
"isInternal": true, | ||
"writtenAt": 1454397096943, | ||
"error": null | ||
}, | ||
"lib/uid.js": { | ||
"added": 1454397096885, | ||
"views": [], | ||
"meta": {}, | ||
"externals": [], | ||
"internals": [], | ||
"isInternal": true, | ||
"writtenAt": 1454397096945, | ||
"error": null | ||
}, | ||
"npm/installer.js": { | ||
"added": 1454397096893, | ||
"views": [ | ||
"Installer", | ||
"Versions" | ||
], | ||
"meta": { | ||
"Installer": { | ||
"location": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 68, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/npm/installer.js", | ||
"styles": {}, | ||
"els": { | ||
"Versions1": { | ||
"line": 55, | ||
"column": 78 | ||
}, | ||
"FlintModal1": { | ||
"line": 64, | ||
"column": 52 | ||
}, | ||
"InstallerLoading1": { | ||
"line": 65, | ||
"column": 48 | ||
} | ||
} | ||
}, | ||
"Versions": { | ||
"location": { | ||
"start": { | ||
"line": 70, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 101, | ||
"column": 1 | ||
} | ||
}, | ||
"file": "/Users/nw/flint/apps/tools/npm/installer.js", | ||
"styles": { | ||
"version": { | ||
"line": 79, | ||
"column": 2 | ||
}, | ||
"inner": { | ||
"line": 85, | ||
"column": 2 | ||
}, | ||
"v": { | ||
"line": 89, | ||
"column": 2 | ||
}, | ||
"info": { | ||
"line": 99, | ||
"column": 2 | ||
} | ||
}, | ||
"els": { | ||
"version1": { | ||
"line": 71, | ||
"column": 79 | ||
}, | ||
"inner1": { | ||
"line": 72, | ||
"column": 11 | ||
}, | ||
"v1": { | ||
"line": 73, | ||
"column": 28 | ||
}, | ||
"info1": { | ||
"line": 74, | ||
"column": 12 | ||
}, | ||
"a1": { | ||
"line": 75, | ||
"column": 43 | ||
} | ||
} | ||
} | ||
}, | ||
"externals": [], | ||
"internals": [], | ||
"outsideSrc": "(function () {Flint.file('npm/installer.js', function (require) {var tools = window._DT;Flint.view('Installer', function (view, on, $) textAlign: 'left', padding: [2, 4], borderRadius: 2 }, '$inner': { flexFlow: 'row' }, '$v': { flexGrow: 1, fontWeight: 'bold' }, '$info': {} });Flint.view('Versions', function (view, on, $) {;view.render(function () {return Flint.range(view.props.versions).map(function (_, _index) {return view.el(['version', 1, _, _index], { repeat: view.props.versions, onClick: function () {return view.props.onSelect(_);} }, view.el(['inner', 1, _, _index], null, view.el(['v', 1, _, _index], { key: 'v' + _index }, _.version), view.el(['info', 1, _, _index], null, _.description), view.el(['a', 1, _, _index], { href: _.homepage, target: '_blank' }, 'Info')));});});$[\"v\"] = function (_, _index) {return { ':hover': { background: '#fff', cursor: 'pointer' } };};});})})();", | ||
"isInternal": false, | ||
"writtenAt": 1454397096947, | ||
"error": null | ||
} | ||
}, | ||
"imports": [], | ||
"fileMeta": {} | ||
}, | ||
"installed": [ | ||
"keycode", | ||
"lodash", | ||
"md5-o-matic", | ||
"ellipsize", | ||
"mouse-event-offset" | ||
], | ||
"port": 4001, | ||
"wport": 6284 | ||
} |
@@ -1,2435 +0,3 @@ | ||
exports["flinttools"] = function(Flint,opts){(function(Flint){(function(){ | ||
Flint.file('close.js',function(require){ | ||
Flint.staticStyles('Close',{ | ||
'$':'#_flintdevtools .ViewClose'}, | ||
{ | ||
'$':{ | ||
position:'absolute', | ||
right:0, | ||
top:0, | ||
display:'flex', | ||
justifyContent:'center', | ||
alignItems:'center', | ||
lineHeight:1, | ||
opacity:0.15, | ||
cursor:'pointer', | ||
transition:'all ease-in 200ms'}}); | ||
Flint.viewRoots["Close"] = 'close'; | ||
Flint.view('Close',function(view,on,$){ | ||
;view.render(function(){ | ||
return view.el( | ||
['close',1], | ||
{onClick:view.props.onClick}, | ||
'x');}); | ||
$["$"] = function(_,_index){ | ||
return {fontSize:view.props.fontSize || 13, | ||
width:view.props.size || 50, | ||
height:view.props.size || 50,':hover':{ | ||
opacity:0.4}};};});});})(); | ||
//# sourceMappingURL=close.js.map | ||
(function(){ | ||
Flint.file("debounce.js",function(require){ | ||
// fancy debounce | ||
// detects if we are in autosave mode | ||
var sum=function sum(a,b){ | ||
return a + b;}; | ||
var Delay=300; | ||
var AutoDelay=800; | ||
var Avg=5000; | ||
var Clear=1000 * 10; | ||
var AutoDetectAvgDiff=1000; | ||
Flint.view("Debounce",function(view,on,$){ | ||
var showKey=undefined, | ||
timeout=undefined, | ||
lastTime=undefined, | ||
delay=undefined, | ||
curDelay=undefined, | ||
avgDiff=undefined; | ||
var isAutoSaving=false; | ||
var lastFew=[]; | ||
// dont update unless we want to | ||
view.pause(); | ||
on.props(function(){ | ||
// override | ||
if(view.props.force){ | ||
view.set("showKey",showKey = Math.random()); | ||
view.updateSoft(); | ||
return show();} | ||
if(view.props.showKey && view.props.showKey == showKey)return; | ||
view.set("showKey",showKey = view.props.showKey); | ||
view.set("delay",delay = view.props.delay || Delay); | ||
view.set("curDelay",curDelay = curDelay || delay); | ||
// find diff | ||
var now=Date.now(); | ||
var diff=lastTime?now - lastTime:Avg; // or init to 5s | ||
view.set("lastTime",lastTime = now); | ||
// update queue | ||
view.set("lastFew",lastFew.unshift(diff),lastFew,true); | ||
if(lastFew.length > 3)view.set("lastFew",lastFew.pop(),lastFew,true); | ||
// if its been a while, clear running avg | ||
if(diff > Clear){ | ||
view.set("lastFew",lastFew = []);} | ||
// otherwise update avg | ||
else { | ||
if(lastFew.length == 3){ | ||
// find avg of last few | ||
view.set("avgDiff",avgDiff = lastFew.reduce(sum,0) / lastFew.length); | ||
// set autosaving | ||
view.set("isAutoSaving",isAutoSaving = avgDiff < AutoDetectAvgDiff); | ||
view.set("curDelay",curDelay = isAutoSaving?AutoDelay:delay);}} | ||
function show(){ | ||
if(view.props.onUpdate)view.props.onUpdate(); | ||
view.update();} | ||
// debounce | ||
clearTimeout(timeout); | ||
view.set("timeout",timeout = setTimeout(show,curDelay)); | ||
view.updateSoft();});});});})(); | ||
//# sourceMappingURL=debounce.js.map | ||
(function(){ | ||
Flint.file('errors.js',function(require){ | ||
var browser=window._DT; | ||
var split=function split(s,i){ | ||
return [s.substring(0,i),s.substring(i,i + 1),s.substring(i + 1)];}; | ||
var isLive=function isLive(){ | ||
return browser.editor && browser.editor.live;}; | ||
// 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 runtimeError=null; | ||
var npmError=null; | ||
// only set error if there is an error, giving compile priority | ||
function setError(){ | ||
if(compileError)view.set('error',error = niceCompilerError(compileError));else if(runtimeError)view.set('error',error = niceRuntimeError(runtimeError));else { | ||
view.set('error',error = null);} | ||
CUR_ERROR = error; | ||
log('tools: view.update()'); | ||
view.updateSoft();} | ||
function close(){ | ||
view.set('error',error = null); | ||
view.set('compileError',compileError = null); | ||
view.set('runtimeError',runtimeError = null); | ||
view.set('npmError',npmError = null); | ||
view.updateSoft();} | ||
browser.on('compile:error',function(){ | ||
log('compile:error'); | ||
view.set('compileError',compileError = browser.data.error); | ||
setError(); | ||
view.updateSoft();}); | ||
browser.on('runtime:error',function(){ | ||
// if (runtimeError) return // prefer first error | ||
view.set('runtimeError',runtimeError = browser.data); | ||
log('runtime:error',runtimeError); | ||
setError(); | ||
view.updateSoft();}); | ||
browser.on('npm:error',function(){ | ||
view.set('npmError',npmError = niceNpmError(browser.data.error)); | ||
log('npm:error',npmError); | ||
view.updateSoft();}); | ||
browser.on('runtime:success',function(){ | ||
log('runtime:success'); | ||
view.set('runtimeError',runtimeError = null); | ||
view.set('npmError',npmError = null); | ||
setError(); | ||
view.updateSoft();}); | ||
browser.on('compile:success',function(){ | ||
log('compile:success'); | ||
view.set('compileError',compileError = null); | ||
view.set('npmError',npmError = null); | ||
setError(); | ||
view.updateSoft();}); | ||
view.render(function(){ | ||
return view.el(['ErrorMessage',1],{ | ||
error:error, | ||
npmError:npmError, | ||
close:close});});}); | ||
var flintAddedLines=0; | ||
var last=function last(arr){ | ||
return arr[arr.length - 1];}; | ||
var fileName=function fileName(url){ | ||
return url && url.replace(/[\?\)].*/,'');}; | ||
var getLine=function getLine(err){ | ||
return err && (err.line || err.loc && err.loc.line);}; | ||
Flint.staticStyles('ErrorMessage',{ | ||
'$bar':'#_flintdevtools bar.ErrorMessage, #_flintdevtools .ErrorMessage.bar, #_flintdevtools .ViewErrorMessage.bar, #_flintdevtools .ErrorMessage > .bar', | ||
'$inner':'#_flintdevtools inner.ErrorMessage, #_flintdevtools .ErrorMessage.inner, #_flintdevtools .ViewErrorMessage.inner, #_flintdevtools .ErrorMessage > .inner', | ||
'$top':'#_flintdevtools top.ErrorMessage, #_flintdevtools .ErrorMessage.top, #_flintdevtools .ViewErrorMessage.top, #_flintdevtools .ErrorMessage > .top', | ||
'$where':'#_flintdevtools where.ErrorMessage, #_flintdevtools .ErrorMessage.where, #_flintdevtools .ViewErrorMessage.where, #_flintdevtools .ErrorMessage > .where', | ||
'$line':'#_flintdevtools line.ErrorMessage, #_flintdevtools .ErrorMessage.line, #_flintdevtools .ViewErrorMessage.line, #_flintdevtools .ErrorMessage > .line', | ||
'$flint':'#_flintdevtools flint.ErrorMessage, #_flintdevtools .ErrorMessage.flint, #_flintdevtools .ViewErrorMessage.flint, #_flintdevtools .ErrorMessage > .flint', | ||
'$shortError':'#_flintdevtools shortError.ErrorMessage, #_flintdevtools .ErrorMessage.shortError, #_flintdevtools .ViewErrorMessage.shortError, #_flintdevtools .ErrorMessage > .shortError', | ||
'$cur':'#_flintdevtools cur.ErrorMessage, #_flintdevtools .ErrorMessage.cur, #_flintdevtools .ViewErrorMessage.cur, #_flintdevtools .ErrorMessage > .cur', | ||
'$errCol':'#_flintdevtools errCol.ErrorMessage, #_flintdevtools .ErrorMessage.errCol, #_flintdevtools .ViewErrorMessage.errCol, #_flintdevtools .ErrorMessage > .errCol', | ||
'$ln':'#_flintdevtools ln.ErrorMessage, #_flintdevtools .ErrorMessage.ln, #_flintdevtools .ViewErrorMessage.ln, #_flintdevtools .ErrorMessage > .ln', | ||
'$flintline':'#_flintdevtools flintline.ErrorMessage, #_flintdevtools .ErrorMessage.flintline, #_flintdevtools .ViewErrorMessage.flintline, #_flintdevtools .ErrorMessage > .flintline'}, | ||
{ | ||
'$bar':{ | ||
display:'block', | ||
position:'fixed', | ||
left:0, | ||
transition:'all 200ms ease-in', | ||
right:0, | ||
fontFamily:'-apple-system, "San Francisco", Roboto, "Segou UI", "Helvetica Neue", Helvetica, Arial, sans-serif', | ||
fontWeight:300, | ||
color:'#fff', | ||
fontSize:'14px', | ||
padding:2, | ||
pointerEvents:'all', | ||
overflow:'scroll', | ||
zIndex:2147483647, | ||
boxShadow:'0 -6px 12px rgba(0,0,0,0.06)'}, | ||
'$inner':{ | ||
display:'block', | ||
maxHeight:200, | ||
overflowY:'scroll'}, | ||
'$top':{ | ||
padding:8, | ||
display:'block'}, | ||
'$where':{ | ||
display:'inline-block', | ||
pointerEvents:'all', | ||
fontWeight:300, | ||
color:'rgba(255,255,255,0.8)'}, | ||
'$line':{ | ||
display:'inline-block', | ||
whiteSpace:'pre', | ||
pointerEvents:'all'}, | ||
'$flint':{ | ||
display:'inline', | ||
fontWeight:700, | ||
color:'#fff'}, | ||
'$shortError':{ | ||
display:'inline', | ||
color:'rgba(255,255,255,0.7)'}, | ||
'$cur':{ | ||
background:'#fff'}, | ||
'$errCol':{ | ||
display:'inline', | ||
borderBottom:'2px solid #f5d64c', | ||
margin:-3, | ||
padding:3, | ||
color:'#fff'}, | ||
'$ln':{ | ||
padding:[0,20]}, | ||
'$flintline':{ | ||
whiteSpace:'pre', | ||
pointerEvents:'all', | ||
fontWeight:'flint'}}); | ||
Flint.view('ErrorMessage',function(view,on,$){ | ||
var hasError=false; | ||
var error={}; | ||
var npmError=undefined, | ||
fullStack=undefined; | ||
var line=getLine(view.props.error); | ||
var clearDelay=undefined; | ||
on.props(function(){ | ||
clearDelay && clearDelay(); | ||
view.set('npmError',npmError = view.props.npmError); | ||
view.set('hasError',hasError = !!(view.props.error || view.props.npmError)); | ||
view.set('error',error = view.props.error || error); // keep old | ||
view.set('line',line = getLine(error)); | ||
view.set('fullStack',fullStack = null); | ||
// show full stack after a delay | ||
if(error){ | ||
view.set('clearDelay',clearDelay = on.delay(2500,function(){ | ||
if(hasError && error.fullStack){ | ||
view.set('fullStack',fullStack = error.fullStack);} | ||
view.updateSoft();}));} | ||
view.updateSoft();}); | ||
// update on editor state | ||
browser.emitter.on('editor:state',function(){ | ||
return setTimeout(view.update);}); | ||
view.render(function(){ | ||
return view.el( | ||
['Debounce',1], | ||
{ | ||
// delay more during live typing | ||
delay:isLive()?2000:1000, | ||
force:hasError === false, | ||
showKey:fullStack || error && error.message, | ||
onUpdate:showFlintErrorDiv}, | ||
view.el( | ||
['bar',1], | ||
null, | ||
view.el(['Close',1],{onClick:view.props.close,size:35}), | ||
Flint.iff(npmError) && view.el( | ||
['inner',1], | ||
{if:npmError}, | ||
view.el( | ||
['where',1], | ||
null, | ||
view.el( | ||
['flint',1], | ||
null, | ||
npmError.name)), | ||
' ', | ||
npmError.msg), | ||
view.el( | ||
['inner',2], | ||
null, | ||
view.el( | ||
['top',1], | ||
null, | ||
view.el( | ||
['where',2], | ||
null, | ||
view.el( | ||
['span',1], | ||
null, | ||
'In ', | ||
view.el( | ||
['flint',2], | ||
null, | ||
fileName(error.file))), | ||
view.el( | ||
['line',1], | ||
null, | ||
line?' line':'', | ||
' ', | ||
Flint.iff(line) && view.el( | ||
['flint',3], | ||
{if:line}, | ||
line - flintAddedLines))), | ||
' ', | ||
view.el( | ||
['shortError',1], | ||
null, | ||
(error.niceMessage || error.message || '').trim(), | ||
Flint.iff(error.niceStack) && view.el( | ||
['niceStack',1], | ||
{if:error.niceStack}, | ||
error.niceStack[0], | ||
view.el( | ||
['errCol',1], | ||
null, | ||
error.niceStack[1]), | ||
error.niceStack[2])), | ||
Flint.iff(error.help) && view.el( | ||
['help',1], | ||
{if:error.help}, | ||
error.help)), | ||
Flint.iff(fullStack) && view.el( | ||
['fullStack',1], | ||
{if:fullStack}, | ||
view.el( | ||
['ln',1], | ||
null, | ||
'' + fullStack[0]), | ||
view.el( | ||
['ln',2], | ||
{className:'cur'}, | ||
'' + fullStack[1]), | ||
view.el( | ||
['ln',3], | ||
null, | ||
'' + fullStack[2])))));}); | ||
var red='#cd423e'; | ||
$["bar"] = function(_,_index){ | ||
return {background:red,bottom:hasError?0:-100};}; | ||
var stack={ | ||
color:'rgba(255,255,255,0.85)', | ||
display:'inline', | ||
fontFamily:'Meslo, Menlo, Monaco, monospace', | ||
padding:[0,5]}; | ||
$["niceStack"] = function(_,_index){ | ||
return stack;}; | ||
$["fullStack"] = function(_,_index){ | ||
return [stack,{ | ||
maxHeight:fullStack?600:0, | ||
padding:fullStack?[10,0]:0, | ||
transition:'maxHeight ease-in 300ms', | ||
color:'rgba(0,0,0,0.85)', | ||
background:'rgba(255,255,255,0.9)', | ||
display:'block', | ||
whiteSpace:'pre', | ||
fontSize:14, | ||
borderRadius:3, | ||
margin:2}];};}); | ||
Flint.staticStyles('ErrorIcon',{ | ||
'$svg':'#_flintdevtools svg.ErrorIcon, #_flintdevtools .ErrorIcon.svg, #_flintdevtools .ViewErrorIcon.svg, #_flintdevtools .ErrorIcon > .svg'}, | ||
{ | ||
'$svg':{ | ||
width:19, | ||
fill:'red', | ||
margin:-4, | ||
marginLeft:3, | ||
marginRight:6, | ||
opacity:0.9}}); | ||
Flint.view('ErrorIcon',function(view,on,$){ | ||
;view.render(function(){ | ||
return view.el( | ||
['svg',1], | ||
{viewBox:'0 0 27.963 27.963'}, | ||
view.el(['path',1],{d:'M13.983,0C6.261,0,0.001,6.259,0.001,13.979c0,7.724,6.26,13.984,13.982,13.984s13.98-6.261,13.98-13.984 C27.963,6.259,21.705,0,13.983,0z M13.983,26.531c-6.933,0-12.55-5.62-12.55-12.553c0-6.93,5.617-12.548,12.55-12.548 c6.931,0,12.549,5.618,12.549,12.548C26.531,20.911,20.913,26.531,13.983,26.531z'}), | ||
view.el(['polygon',1],{points:'15.579,17.158 16.191,4.579 11.804,4.579 12.414,17.158'}), | ||
view.el(['path',2],{d:'M13.998,18.546c-1.471,0-2.5,1.029-2.5,2.526c0,1.443,0.999,2.528,2.444,2.528h0.056c1.499,0,2.469-1.085,2.469-2.528 C16.441,19.575,15.468,18.546,13.998,18.546z'}));});});});})(); | ||
//# sourceMappingURL=errors.js.map | ||
var _extends=require('babel-runtime/helpers/extends').default; | ||
var _toArray=require('babel-runtime/helpers/to-array').default; | ||
var _slicedToArray=require('babel-runtime/helpers/sliced-to-array').default; | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector.js',function(require){ | ||
var _keys=require('./keys'); | ||
var _libInspecting=require('./lib/inspecting'); | ||
var _libInspecting2=_interopRequireDefault(_libInspecting); | ||
var _lodash=require('lodash'); | ||
var removeHead=function removeHead(_ref){ | ||
var _ref2=_toArray(_ref); | ||
var l=_ref2[0]; | ||
var ls=_ref2.slice(1); | ||
return ls;}; | ||
var isAlt=function isAlt(cb){ | ||
return function(e){ | ||
return e.keyIdentifier === 'Alt' && cb();};}; | ||
var isEsc=function isEsc(cb){ | ||
return function(e){ | ||
return e.keyCode === 27 && cb();};}; | ||
var setLocal=function setLocal(k,v){ | ||
return localStorage.setItem('__flint.state.' + k,JSON.stringify(v));}; | ||
var getLocal=function getLocal(k,d){ | ||
return JSON.parse(localStorage.getItem('__flint.state.' + k)) || d;}; | ||
var round=Math.round; | ||
var highlighter=undefined; | ||
function positionHighlight(node){ | ||
var bounds=node.getBoundingClientRect(); | ||
var winW=window.innerWidth; | ||
var winH=window.innerHeight; | ||
var width=round(bounds.right - bounds.left); | ||
var height=round(bounds.bottom - bounds.top); | ||
var opacity=1; | ||
if(width >= winW && height >= winH)opacity = 0.2; | ||
highlighter.setAttribute('style','\n top: ' + round(bounds.top) + 'px;\n left: ' + round(bounds.left) + 'px;\n width: ' + width + 'px;\n height: ' + height + 'px;\n opacity: ' + opacity + ';\n ');} | ||
function hideHighlight(){ | ||
highlighter.setAttribute('style','');} | ||
function findPath(node){ | ||
if(!node || !node.getAttribute)return null; | ||
var flintid=node.__flintID; | ||
if(!flintid)return findPath(node.parentNode); | ||
positionHighlight(node); | ||
return flintid;} | ||
function tempActive(views){ | ||
return views.filter(function(v){ | ||
return !v.temp;}). | ||
length > 0;} | ||
function pathActive(views,path){ | ||
return views.filter(function(v){ | ||
return v.path == path;}). | ||
length > 0;} | ||
function removeTemp(views){ | ||
return views.filter(function(v){ | ||
return !v.temp;}). | ||
map(function(v){ | ||
return _extends({},v,{highlight:false});});} | ||
function addTemp(views,path){ | ||
return [{path:path,highlight:false,temp:true}].concat(views);} | ||
function setClosing(views,path){ | ||
return views.map(function(v){ | ||
if(v.path == path)v.closing = true; | ||
return v;});} | ||
function highlightPath(views,path){ | ||
return views.map(function(v){ | ||
if(v.path == path)v.highlight = true; | ||
return v;});} | ||
function toggleView(views,path){ | ||
if(pathActive(views,path)){ | ||
return views.map(function(v){ | ||
if(v.path == path)v.temp = true; | ||
return v;});}else | ||
{ | ||
var added={temp:false,highlight:false,closing:false,path:path}; | ||
return [].concat([added],views);}} | ||
function internal(){ | ||
return window._Flint;} | ||
function writeBack(path,writePath){ | ||
var Int=internal(); | ||
var cache=Int.getCache[path]; | ||
// update getCache | ||
writePath.reduce(function(acc,cur){ | ||
if(cur == 'root')return acc; | ||
if(!Array.isArray(cur))return acc[cur]; | ||
// is end of path: [key, val] | ||
var _cur=_slicedToArray(cur,2); | ||
var key=_cur[0]; | ||
var val=_cur[1]; | ||
var current=acc[key]; | ||
if(typeof current == 'number')val = +val; | ||
// write | ||
acc[key] = val;}, | ||
cache); | ||
Int.inspectorRefreshing = path; | ||
Int.getInitialStates[path](); | ||
Int.viewsAtPath[path].forceUpdate(); | ||
Int.inspectorRefreshing = null;} | ||
Flint.staticStyles('Inspector',{ | ||
'$':'#_flintdevtools .ViewInspector'}, | ||
{ | ||
'$':{ | ||
position:'fixed', | ||
top:0,right:0, | ||
padding:2}}); | ||
Flint.view('Inspector',function(view,on,$){ | ||
var clickOff=undefined, | ||
hoverOff=undefined, | ||
lastTarget=undefined; | ||
var hudActive=false; | ||
var views=[]; | ||
on.mount(function(){ | ||
view.set('hoverOff',hoverOff = on.mousemove(window,(0,_lodash.throttle)(mouseMove,40))); | ||
if(highlighter)return; | ||
highlighter = document.createElement('div'); | ||
highlighter.className = "_flintHighlighter"; | ||
document.body.appendChild(highlighter); | ||
view.updateSoft();}); | ||
// key events | ||
(0,_keys.onKeyDown)('esc',closeLast); | ||
var offAlt=undefined; | ||
var keysCorrect=function keysCorrect(_ref3){ | ||
var altKey=_ref3.altKey; | ||
var metaKey=_ref3.metaKey; | ||
return altKey && !metaKey;}; | ||
function checkInspect(e){ | ||
if(keysCorrect(e)){ | ||
// wait a little so were not toooo eager | ||
view.set('offAlt',offAlt = on.delay(180,function(){ | ||
if(keysCorrect(e)){ | ||
showInspect();}}));}else | ||
{ | ||
offAlt && offAlt(); | ||
hideInspect();} | ||
view.updateSoft();} | ||
on.keydown(window,checkInspect); | ||
on.keyup(window,checkInspect); | ||
function inspect(target){ | ||
internal().isInspecting = true; | ||
var path=findPath(target); | ||
if(path === null)return; | ||
view.set('views',views = removeTemp(views)); | ||
view.set('views',views = pathActive(views,path)?highlightPath(views,path):addTemp(views,path)); | ||
view.updateSoft();} | ||
function mouseMove(_ref4){ | ||
var target=_ref4.target; | ||
var inspector=ReactDOM.findDOMNode(view); | ||
if(lastTarget != target){ | ||
if(inspector.contains(target))return; | ||
view.set('lastTarget',lastTarget = target); | ||
_libInspecting2.default.set(target); | ||
if(hudActive)inspect(lastTarget);} | ||
view.updateSoft();} | ||
function closeLast(){ | ||
if(!views.length)return; | ||
view.set('views',views = removeHead(views)); | ||
view.updateSoft();} | ||
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(_ref5){ | ||
var target=_ref5.target; | ||
var inspector=ReactDOM.findDOMNode(view); | ||
if(inspector.contains(target))return; | ||
view.set('views',views = toggleView(removeTemp(views),findPath(target))); | ||
return false; | ||
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);}}));});});});});})(); | ||
//# sourceMappingURL=inspector.js.map | ||
var _Object$keys=require("babel-runtime/core-js/object/keys").default; | ||
(function(){ | ||
Flint.file("inspector/highlighter.js",function(require){ | ||
var isEmpty=function isEmpty(obj){ | ||
return _Object$keys(object).length === 0;}; | ||
Flint.view("Highlighter",function(view,on,$){ | ||
;view.render(function(){ | ||
return Flint.iff(!view.props.highlight || view.props.string.indexOf(view.props.highlight) === -1) && view.el( | ||
["name",1], | ||
{if:!view.props.highlight || view.props.string.indexOf(view.props.highlight) === -1}, | ||
view.props.string);}); | ||
view.render(function(){ | ||
return Flint.iff(view.props.highlight) && view.el( | ||
["span",1], | ||
{if:view.props.highlight}, | ||
Flint.range(view.props.string.split()).map(function(_,_index){ | ||
return view.el( | ||
["span",2,_,_index], | ||
{repeat:view.props.string.split()}, | ||
Flint.iff(_index > 0) && view.el( | ||
["highlight",1,_,_index], | ||
{if:_index > 0}, | ||
view.props.highlight), | ||
_);}));});});});})(); | ||
//# sourceMappingURL=highlighter.js.map | ||
var _extends=require('babel-runtime/helpers/extends').default; | ||
(function(){ | ||
Flint.file('inspector/label.js',function(require){ | ||
var _lodash=require('lodash'); | ||
Flint.staticStyles('Label',{ | ||
'$input':'#_flintdevtools input.Label, #_flintdevtools .Label.input, #_flintdevtools .ViewLabel.input, #_flintdevtools .Label > .input', | ||
'$focus':'#_flintdevtools focus.Label, #_flintdevtools .Label.focus, #_flintdevtools .ViewLabel.focus, #_flintdevtools .Label > .focus'}, | ||
{ | ||
'$input':{ | ||
position:'absolute', | ||
top:0, | ||
left:-1, | ||
right:0, | ||
color:'#333', | ||
padding:1, | ||
width:140, | ||
outline:'none', | ||
border:'none', | ||
opacity:0, | ||
boxShadow:'1px 1px 2px rgba(0,0,0,0.4)'}, | ||
'$focus':{ | ||
opacity:'1 !important'}}); | ||
Flint.view('Label',function(view,on,$){ | ||
var val=view.prop('val',undefined), | ||
editable=view.prop('editable',undefined), | ||
onSet=view.prop('onSet',undefined); | ||
on.props(function(){ | ||
val = view.getProp('val'); | ||
editable = view.getProp('editable'); | ||
onSet = view.getProp('onSet');}); | ||
var input=null; | ||
var focus=undefined, | ||
newVal=undefined; | ||
on.props(function(){ | ||
if(!focus)view.set('newVal',newVal = val); | ||
view.updateSoft();}); | ||
var onFocus=function onFocus(e){ | ||
if(!editable)return; | ||
if((0,_lodash.isBoolean)(val))return onSet(!val); | ||
view.set('focus',focus = true); | ||
e.stopPropagation(); | ||
view.updateSoft();}; | ||
var onBlur=function onBlur(e){ | ||
view.set('focus',focus = false); | ||
view.updateSoft();}; | ||
var onChange=function onChange(e){ | ||
view.set('newVal',newVal = e.target.value); | ||
view.update({immediate:true}); | ||
if((0,_lodash.isNumber)(val)){ | ||
// dont let them change from num to str | ||
if(newVal === '' || isNaN(newVal))return;} | ||
// todo: debate | ||
if(newVal === 'false')view.set('newVal',newVal = false); | ||
if(newVal === 'true')view.set('newVal',newVal = true); | ||
onSet(newVal); | ||
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'};};});});})(); | ||
//# sourceMappingURL=label.js.map | ||
var _Object$keys=require('babel-runtime/core-js/object/keys').default; | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector/leaf.js',function(require){ | ||
var _md5OMatic=require('md5-o-matic'); | ||
var _md5OMatic2=_interopRequireDefault(_md5OMatic); | ||
var _libGetType=require('../lib/getType'); | ||
var _libGetType2=_interopRequireDefault(_libGetType); | ||
var _ellipsize=require('ellipsize'); | ||
var _ellipsize2=_interopRequireDefault(_ellipsize); | ||
var PATH_PREFIX='.root.'; | ||
var noop=function noop(){}; | ||
var contains=function contains(string,substring){ | ||
return string.indexOf(substring) !== -1;}; | ||
var isPrimitive=function isPrimitive(v){ | ||
return (0,_libGetType2.default)(v) !== 'Object' && (0,_libGetType2.default)(v) !== 'Array';}; | ||
var getLeafKey=function getLeafKey(key,value){ | ||
return isPrimitive(value)?key + ':' + (0,_md5OMatic2.default)(String(key)):key + '[' + (0,_libGetType2.default)(value) + ']';}; | ||
var fnParams=function fnParams(fn){ | ||
return fn.toString().replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s))/mg,'').match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].split(/,/);}; | ||
Flint.staticStyles('Leaf',{ | ||
'$leaf':'#_flintdevtools .ViewLeaf', | ||
'$helper':'#_flintdevtools helper.Leaf, #_flintdevtools .Leaf.helper, #_flintdevtools .ViewLeaf.helper, #_flintdevtools .Leaf > .helper', | ||
'$boolean':'#_flintdevtools boolean.Leaf, #_flintdevtools .Leaf.boolean, #_flintdevtools .ViewLeaf.boolean, #_flintdevtools .Leaf > .boolean', | ||
'$number':'#_flintdevtools number.Leaf, #_flintdevtools .Leaf.number, #_flintdevtools .ViewLeaf.number, #_flintdevtools .Leaf > .number', | ||
'$string':'#_flintdevtools string.Leaf, #_flintdevtools .Leaf.string, #_flintdevtools .ViewLeaf.string, #_flintdevtools .Leaf > .string', | ||
'$function':'#_flintdevtools function.Leaf, #_flintdevtools .Leaf.function, #_flintdevtools .ViewLeaf.function, #_flintdevtools .Leaf > .function', | ||
'$colon':'#_flintdevtools colon.Leaf, #_flintdevtools .Leaf.colon, #_flintdevtools .ViewLeaf.colon, #_flintdevtools .Leaf > .colon', | ||
'$name':'#_flintdevtools name.Leaf, #_flintdevtools .Leaf.name, #_flintdevtools .ViewLeaf.name, #_flintdevtools .Leaf > .name', | ||
'$children':'#_flintdevtools children.Leaf, #_flintdevtools .Leaf.children, #_flintdevtools .ViewLeaf.children, #_flintdevtools .Leaf > .children', | ||
'$type':'#_flintdevtools type.Leaf, #_flintdevtools .Leaf.type, #_flintdevtools .ViewLeaf.type, #_flintdevtools .Leaf > .type'}, | ||
{ | ||
'$leaf':{ | ||
padding:[1,0], | ||
fontSize:13}, | ||
'$helper':{color:'#ffff05'}, | ||
'$boolean':{color:'#32a3cd',fontWeight:700}, | ||
'$number':{color:'#b92222',marginTop:2,fontWeight:500}, | ||
'$string':{color:'#698c17'}, | ||
'$function':{ | ||
marginLeft:10, | ||
marginTop:2, | ||
color:'#962eba'}, | ||
'$colon':{ | ||
opacity:0.3, | ||
color:'#000'}, | ||
'$name':{ | ||
color:"#ff2f2f", | ||
fontWeight:400, | ||
margin:['auto',0]}, | ||
'$children':{ | ||
paddingLeft:10}, | ||
'$type':{ | ||
margin:[1,0,0,8], | ||
opacity:0.7, | ||
flexFlow:'row'}}); | ||
Flint.viewRoots["Leaf"] = 'leaf'; | ||
Flint.view('Leaf',function(view,on,$){ | ||
view.pause(); | ||
var root=view.prop('root',undefined), | ||
isExpanded=view.prop('isExpanded',undefined), | ||
data=view.prop('data',undefined), | ||
prefix=view.prop('prefix',undefined), | ||
query=view.prop('query',undefined), | ||
label=view.prop('label',undefined), | ||
id=view.prop('id',undefined), | ||
editable=view.prop('editable',undefined); | ||
on.props(function(){ | ||
root = view.getProp('root'); | ||
isExpanded = view.getProp('isExpanded'); | ||
data = view.getProp('data'); | ||
prefix = view.getProp('prefix'); | ||
query = view.getProp('query'); | ||
label = view.getProp('label'); | ||
id = view.getProp('id'); | ||
editable = view.getProp('editable');}); | ||
var getOriginal=view.prop('getOriginal',noop); | ||
on.props(function(){ | ||
getOriginal = view.getProp('getOriginal');}); | ||
var onSet=view.prop('onSet',noop); | ||
on.props(function(){ | ||
onSet = view.getProp('onSet');}); | ||
var onClick=view.prop('onClick',noop); | ||
// state | ||
on.props(function(){ | ||
onClick = view.getProp('onClick');}); | ||
var rootPath=undefined, | ||
path=undefined, | ||
_data=undefined, | ||
type=undefined, | ||
key=undefined, | ||
original=undefined, | ||
expanded=undefined; | ||
var dataKeys=[]; | ||
var _query=''; | ||
// helpers | ||
var isInitiallyExpanded=function isInitiallyExpanded(){ | ||
return root || !_query && isExpanded(path,data) || !contains(path,_query);}; | ||
// lifecycle | ||
on.props(function(){ | ||
view.set('rootPath',rootPath = prefix + '.' + label); | ||
view.set('key',key = label.toString()); | ||
view.set('path',path = rootPath.substr(PATH_PREFIX.length)); | ||
view.set('_data',_data = data); // originally was stream of ||s, but 0 was turning into false | ||
// multiline strings | ||
if(typeof _data === 'string' && _data.indexOf('\n') > -1){ | ||
view.set('_data',_data = _data.split('\n'));} | ||
if(_data)view.set('dataKeys',dataKeys = _Object$keys(_data).sort()); | ||
if(_data === undefined)view.set('_data',_data = data); | ||
if(_data === undefined)view.set('_data',_data = {}); | ||
view.set('type',type = (0,_libGetType2.default)(_data)); | ||
view.set('_query',_query = query || ''); | ||
if(view.props.root)view.set('expanded',expanded = true);else if(_query)view.set('expanded',expanded = !contains(label,_query)); | ||
if(query && !_query)view.set('expanded',expanded = isInitiallyExpanded()); | ||
view.update(); | ||
view.updateSoft();}); | ||
var toggle=function toggle(e){ | ||
if(!root)view.set('expanded',expanded = !expanded); | ||
view.update(); | ||
onClick(_data); | ||
e.stopPropagation(); | ||
view.updateSoft();}; | ||
var format=function format(key){ | ||
return view.el(['Highlighter',1],{string:key,highlight:_query});}; | ||
var getLabel=function getLabel(type,val,sets,editable){ | ||
return view.el(['Label',1],{ | ||
val:val, | ||
editable:editable, | ||
onSet:function(_){ | ||
return onSet([sets,_]);}});}; | ||
view.render(function(){ | ||
return view.el( | ||
['leaf',1], | ||
{className:rootPath}, | ||
Flint.iff(!view.props.root) && view.el( | ||
['label',1], | ||
{if:!view.props.root,htmlFor:id,onClick:toggle}, | ||
view.el( | ||
['key',1], | ||
null, | ||
view.el( | ||
['name',1], | ||
null, | ||
format(key)), | ||
getLabel('key',key,key,false)), | ||
view.el( | ||
['colon',1], | ||
null, | ||
':'), | ||
Flint.iff(type == 'Function') && view.el( | ||
['expand',1], | ||
{className:'function',if:type == 'Function'}, | ||
view.el( | ||
['i',1], | ||
null, | ||
'fn (', | ||
fnParams(_data).join(', '), | ||
')')), | ||
Flint.iff(type == 'Array') && view.el( | ||
['expand',2], | ||
{if:type == 'Array'}, | ||
view.el( | ||
['type',1], | ||
null, | ||
'Array[', | ||
_data.length, | ||
']')), | ||
Flint.iff(type == 'Object') && view.el( | ||
['expand',3], | ||
{if:type == 'Object'}, | ||
view.el( | ||
['type',2], | ||
null, | ||
'{} ' + dataKeys.length + ' keys')), | ||
Flint.iff(['Array','Object','Function'].indexOf(type) == -1) && view.el( | ||
['value',1], | ||
{if:['Array','Object','Function'].indexOf(type) == -1,className:type.toLowerCase()}, | ||
Flint.iff(type.toLowerCase() == 'string') && view.el( | ||
['str',1], | ||
{if:type.toLowerCase() == 'string'}, | ||
format((0,_ellipsize2.default)(String(_data),25))), | ||
Flint.iff(type.toLowerCase() != 'string') && view.el( | ||
['else',1], | ||
{if:type.toLowerCase() != 'string'}, | ||
format(String(_data))), | ||
getLabel('val',_data,key,editable))), | ||
view.el( | ||
['children',1], | ||
null, | ||
Flint.iff(expanded && !isPrimitive(_data)) && Flint.range(dataKeys).map(function(_,_index){ | ||
return view.el( | ||
['child',1,_,_index], | ||
{ | ||
if:expanded && !isPrimitive(_data), | ||
repeat:dataKeys}, | ||
Flint.iff(_.indexOf('__') == -1) && view.el(['Leaf',1,_,_index],{ | ||
if:_.indexOf('__') == -1, | ||
key:getLeafKey(_,_data[_]), | ||
onSet:function(){ | ||
for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) { | ||
args[_key] = arguments[_key];} | ||
return onSet.apply(undefined,[key].concat(args));}, | ||
data:_data[_], | ||
editable:editable, | ||
label:_, | ||
prefix:rootPath, | ||
onClick:onClick, | ||
id:id, | ||
query:_query, | ||
getOriginal:original?null:getOriginal, | ||
isExpanded:isExpanded}));})));}); | ||
var row={ | ||
flexFlow:'row'}; | ||
$["label"] = function(_,_index){ | ||
return [row,{ | ||
position:'relative', | ||
color:'rgba(0,0,0,0.8)', | ||
opacity:1, | ||
alignItems:'baseline'}];}; | ||
$["key"] = function(_,_index){ | ||
return [row,{ | ||
color:'rgba(0,0,0,0.9)', | ||
margin:[0], | ||
fontWeight:'bold'}];}; | ||
$["expand"] = function(_,_index){ | ||
return [row];}; | ||
$["value"] = function(_,_index){ | ||
return [row,{ | ||
position:'relative', | ||
margin:[0,4,0]}];};});});})(); | ||
//# sourceMappingURL=leaf.js.map | ||
(function(){ | ||
Flint.file('inspector/section.js',function(require){ | ||
Flint.staticStyles('Inspector.Section',{ | ||
'$':'#_flintdevtools .ViewInspector-Section', | ||
'$body':'#_flintdevtools body.Inspector-Section, #_flintdevtools .Inspector-Section.body, #_flintdevtools .ViewInspector-Section.body, #_flintdevtools .Inspector-Section > .body', | ||
'$inactive':'#_flintdevtools inactive.Inspector-Section, #_flintdevtools .Inspector-Section.inactive, #_flintdevtools .ViewInspector-Section.inactive, #_flintdevtools .Inspector-Section > .inactive'}, | ||
{ | ||
'$':{ | ||
padding:[5,0]}, | ||
'$body':{ | ||
padding:[0,12]}, | ||
'$inactive':{ | ||
display:'none'}}); | ||
Flint.view('Inspector.Section',function(view,on,$){ | ||
var open=true;view.render(function(){ | ||
return view.el( | ||
['Inspector.Title',1], | ||
{onToggle:function(val){ | ||
view.set('open',open = val); | ||
view.updateSoft();}}, | ||
view.props.title);}); | ||
view.render(function(){ | ||
return view.el( | ||
['body',1], | ||
null, | ||
view.props.children);});});});})(); | ||
//# sourceMappingURL=section.js.map | ||
var _extends=require('babel-runtime/helpers/extends').default; | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector/statetests.js',function(require){ | ||
var _mouseEventOffset=require('mouse-event-offset'); | ||
var _mouseEventOffset2=_interopRequireDefault(_mouseEventOffset); | ||
Flint.view('StateTests',function(view,on,$){ | ||
;view.render(function(){ | ||
return view.el(['Tests.Name',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Boolean',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Counter',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Props',1],null);}); | ||
view.render(function(){ | ||
return view.el(['Tests.Circles',1],null);});}); | ||
Flint.view('Tests.Boolean',function(view,on,$){ | ||
var dead=false;view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'is tupac dead? ', | ||
dead.toString());}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',1], | ||
{onClick:function(){ | ||
view.set('dead',dead = !dead); | ||
view.updateSoft();}}, | ||
'toggle');});}); | ||
Flint.staticStyles('Tests.Props',{ | ||
'$':'#_flintdevtools .ViewTests-Props'}, | ||
{ | ||
'$':{marginTop:20}}); | ||
Flint.view('Tests.Props',function(view,on,$){ | ||
var name='a string';view.render(function(){ | ||
return view.el(['input',1],{ | ||
'__flintValue':name, | ||
'__flintOnChange':function(__flintval__){ | ||
view.set('name',name = __flintval__); | ||
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); | ||
on.props(function(){ | ||
name = view.getProp('name');}); | ||
var count=0;view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'my name is ', | ||
name);}); | ||
view.render(function(){ | ||
return view.el( | ||
['h4',1], | ||
null, | ||
'counter to test state ', | ||
count);}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',1], | ||
{onClick:function(){ | ||
view.set('count',count++,count,true); | ||
view.updateSoft();}}, | ||
'up');});}); | ||
Flint.view('Tests.Counter',function(view,on,$){ | ||
var count=0;view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'count is ', | ||
count);}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',1], | ||
{onClick:function(){ | ||
view.set('count',count++,count,true); | ||
view.updateSoft();}}, | ||
'up');}); | ||
view.render(function(){ | ||
return view.el( | ||
['button',2], | ||
{onClick:function(){ | ||
view.set('count',count--,count,true); | ||
view.updateSoft();}}, | ||
'down');});}); | ||
Flint.view('Tests.Deep',function(view,on,$){ | ||
var person={name:'nick',tools:['js','juggling balls','coffee']};view.render(function(){ | ||
return view.el( | ||
['h1',1], | ||
null, | ||
'deep');}); | ||
view.render(function(){ | ||
return view.el( | ||
['h2',1], | ||
null, | ||
JSON.stringify(person));});}); | ||
Flint.view('Tests.Name',function(view,on,$){ | ||
var first='nick'; | ||
var last='cammarata';view.render(function(){ | ||
return view.el( | ||
['h2',1], | ||
null, | ||
'name is ', | ||
first, | ||
' ', | ||
last);}); | ||
view.render(function(){ | ||
return view.el(['input',1],{ | ||
'__flintValue':first, | ||
'__flintOnChange':function(__flintval__){ | ||
view.set('first',first = __flintval__); | ||
view.updateSoft();}});}); | ||
view.render(function(){ | ||
return view.el(['input',2],{ | ||
'__flintValue':last, | ||
'__flintOnChange':function(__flintval__){ | ||
view.set('last',last = __flintval__); | ||
view.updateSoft();}});}); | ||
view.render(function(){ | ||
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)});});});});})(); | ||
//# sourceMappingURL=statetests.js.map | ||
(function(){ | ||
Flint.file('inspector/title.js',function(require){ | ||
Flint.staticStyles('Inspector.Title',{ | ||
'$title':'#_flintdevtools title.Inspector-Title, #_flintdevtools .Inspector-Title.title, #_flintdevtools .ViewInspector-Title.title, #_flintdevtools .Inspector-Title > .title', | ||
'$closed':'#_flintdevtools closed.Inspector-Title, #_flintdevtools .Inspector-Title.closed, #_flintdevtools .ViewInspector-Title.closed, #_flintdevtools .Inspector-Title > .closed', | ||
'$inner':'#_flintdevtools inner.Inspector-Title, #_flintdevtools .Inspector-Title.inner, #_flintdevtools .ViewInspector-Title.inner, #_flintdevtools .Inspector-Title > .inner'}, | ||
{ | ||
'$title':{ | ||
fontWeight:300, | ||
borderBottom:'1px solid #eee', | ||
height:10, | ||
margin:[5,5,8], | ||
color:'#999', | ||
flexFlow:'row'}, | ||
'$closed':{ | ||
marginTop:1}, | ||
'$inner':{ | ||
padding:[4,10], | ||
background:'#fff'}}); | ||
Flint.view('Inspector.Title',function(view,on,$){ | ||
var open=true; | ||
function toggle(){ | ||
if(!view.props.onToggle)return; | ||
view.set('open',open = !open); | ||
view.props.onToggle(open); | ||
view.updateSoft();} | ||
;view.render(function(){ | ||
return view.el( | ||
['title',1], | ||
{onClick:toggle}, | ||
view.el( | ||
['inner',1], | ||
null, | ||
view.props.children));}); | ||
$["closed"] = function(_,_index){ | ||
return { | ||
transform:{scale:0.8}};}; | ||
$["inner"] = function(_,_index){ | ||
return {margin:[-2,'auto']};};});});})(); | ||
//# sourceMappingURL=title.js.map | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('inspector/tree.js',function(require){ | ||
var _libLens=require('../lib/lens'); | ||
var _libLens2=_interopRequireDefault(_libLens); | ||
Flint.staticStyles('Tree',{ | ||
'$':'#_flintdevtools .ViewTree'}, | ||
{ | ||
'$':{ | ||
pointerEvents:'auto', | ||
marginLeft:-10}}); | ||
Flint.viewRoots["Tree"] = 'Leaf'; | ||
Flint.view('Tree',function(view,on,$){ | ||
var query=''; | ||
var search=function search(q){ | ||
return query === '' || view.props.validateQuery(query)?view.set('query',query = q):false;}; | ||
var getOriginal=function getOriginal(path){ | ||
return (0,_libLens2.default)(view.props.data,path);}; | ||
view.render(function(){ | ||
return view.el(['Leaf',1],{ | ||
data:view.props.data, | ||
onClick:view.props.onClick, | ||
id:view.props.id, | ||
getOriginal:getOriginal, | ||
query:query, | ||
label:'root', | ||
editable:view.props.editable, | ||
root:true, | ||
validateQuery:function(query){ | ||
return query.length >= 2;}, | ||
isExpanded:view.props.isExpanded || function(){ | ||
return false;}, | ||
interactiveLabel:view.props.interactiveLabel, | ||
onSet:function(){ | ||
for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) { | ||
args[_key] = arguments[_key];} | ||
return view.props.onSet(args);}});});});});})(); | ||
//# sourceMappingURL=tree.js.map | ||
var _Object$keys=require('babel-runtime/core-js/object/keys').default; | ||
(function(){ | ||
Flint.file('inspector/view.js',function(require){ | ||
var _lodash=require('lodash'); | ||
function pathToName(path){ | ||
var p=path.split(','); | ||
return p[p.length - 1].split('-')[0];} | ||
function filterProps(props){ | ||
var leaveOut=['if','repeat','style','yield','__flint']; | ||
return _lodash.omit.apply(null,[props].concat(leaveOut));} | ||
Flint.staticStyles('Inspector.View',{ | ||
'$view':'#_flintdevtools view.Inspector-View, #_flintdevtools .Inspector-View.view, #_flintdevtools .ViewInspector-View.view, #_flintdevtools .Inspector-View > .view', | ||
'$top':'#_flintdevtools top.Inspector-View, #_flintdevtools .Inspector-View.top, #_flintdevtools .ViewInspector-View.top, #_flintdevtools .Inspector-View > .top', | ||
'$active':'#_flintdevtools active.Inspector-View, #_flintdevtools .Inspector-View.active, #_flintdevtools .ViewInspector-View.active, #_flintdevtools .Inspector-View > .active', | ||
'$highlight':'#_flintdevtools highlight.Inspector-View, #_flintdevtools .Inspector-View.highlight, #_flintdevtools .ViewInspector-View.highlight, #_flintdevtools .Inspector-View > .highlight', | ||
'$Close':'#_flintdevtools .ViewInspector-View .ViewClose', | ||
'$name':'#_flintdevtools name.Inspector-View, #_flintdevtools .Inspector-View.name, #_flintdevtools .ViewInspector-View.name, #_flintdevtools .Inspector-View > .name', | ||
'$edit':'#_flintdevtools edit.Inspector-View, #_flintdevtools .Inspector-View.edit, #_flintdevtools .ViewInspector-View.edit, #_flintdevtools .Inspector-View > .edit', | ||
'$expanded':'#_flintdevtools expanded.Inspector-View, #_flintdevtools .Inspector-View.expanded, #_flintdevtools .ViewInspector-View.expanded, #_flintdevtools .Inspector-View > .expanded', | ||
'$input':'#_flintdevtools input.Inspector-View, #_flintdevtools .Inspector-View.input, #_flintdevtools .ViewInspector-View.input, #_flintdevtools .Inspector-View > .input', | ||
'$title':'#_flintdevtools title.Inspector-View, #_flintdevtools .Inspector-View.title, #_flintdevtools .ViewInspector-View.title, #_flintdevtools .Inspector-View > .title', | ||
'$section':'#_flintdevtools section.Inspector-View, #_flintdevtools .Inspector-View.section, #_flintdevtools .ViewInspector-View.section, #_flintdevtools .Inspector-View > .section'}, | ||
{ | ||
'$view':{ | ||
position:'relative', | ||
pointerEvents:'auto', | ||
margin:10, | ||
marginBottom:0, | ||
padding:[0,0,1], | ||
minWidth:220, | ||
minHeight:34, | ||
fontSize:12, | ||
userSelect:'none', | ||
cursor:'default', | ||
background:'#fff', | ||
boxShadow:'0px 2px 16px rgba(0,0,0,0.2)', | ||
border:'1px solid #ccc', | ||
borderRadius:5, | ||
color:'#333', | ||
transition:'all ease-in 60ms', | ||
opacity:0}, | ||
'$top':{ | ||
flexFlow:'row'}, | ||
'$active':{ | ||
opacity:1}, | ||
'$highlight':{ | ||
border:'2px solid #afb4e2'}, | ||
'$Close':{ | ||
top:-5, | ||
right:-5, | ||
fontSize:13}, | ||
'$name':{ | ||
fontWeight:400, | ||
color:'rgba(0,0,0,0.8)', | ||
padding:[8,8,0], | ||
fontSize:14}, | ||
'$edit':{ | ||
padding:[8,8,0], | ||
fontSize:14, | ||
marginLeft:4, | ||
fontWeight:400, | ||
color:'rgba(24, 101, 227, 0.8)'}, | ||
'$expanded':{}, | ||
'$input':{ | ||
borderRadius:100, | ||
border:'1px solid #ccc', | ||
width:'100%', | ||
padding:[2,12], | ||
color:'#333', | ||
fontSize:14}, | ||
'$title':{ | ||
display:'none', | ||
color:'#333', | ||
fontWeight:200, | ||
fontSize:12, | ||
margin:[3,0]}, | ||
'$section':{ | ||
background:[0,0,0,0.05]}}); | ||
Flint.view('Inspector.View',function(view,on,$){ | ||
var highlight=view.prop('highlight',undefined), | ||
closing=view.prop('closing',undefined), | ||
path=view.prop('path',undefined), | ||
onClose=view.prop('onClose',undefined); | ||
on.props(function(){ | ||
highlight = view.getProp('highlight'); | ||
closing = view.getProp('closing'); | ||
path = view.getProp('path'); | ||
onClose = view.getProp('onClose');}); | ||
var inspect=window.Flint.inspect; | ||
var name=undefined; | ||
var active=false; | ||
var state={}; | ||
var props=null; | ||
var writeBack=null; | ||
function onSet(write){ | ||
view.props.writeBack(path,write);} | ||
on.delay(60,function(){ | ||
view.set('active',active = true); | ||
view.updateSoft();}); | ||
on.unmount(function(){ | ||
delete window._Flint.inspector[path];}); | ||
on.props(function(){ | ||
if(closing === true)view.set('active',active = false); | ||
if(!path)return; | ||
view.set('name',name = pathToName(path)); | ||
// if not inspecting, inspect | ||
if(!_Flint.inspector[path]){ | ||
inspect(path,function(_props,_state,_wb){ | ||
view.set('props',props = filterProps(_props || {})); | ||
view.set('state',state = _state || {}); | ||
view.set('writeBack',writeBack = _wb); | ||
view.update(); | ||
view.updateSoft();});} | ||
view.updateSoft();}); | ||
var hasKeys=function hasKeys(o){ | ||
return o && _Object$keys(o).length > 0;}; | ||
var edit=function edit(){ | ||
return _DT.messageEditor({type:'focus:element',view:name});}; | ||
view.render(function(){ | ||
return view.el( | ||
['view',1], | ||
{className:{active:active,highlight:highlight}}, | ||
view.el(['Close',1],{onClick:onClose,fontSize:20,size:35}), | ||
view.el( | ||
['top',1], | ||
null, | ||
view.el( | ||
['name',1], | ||
null, | ||
name), | ||
Flint.iff(false) && view.el( | ||
['edit',1], | ||
{if:false,onClick:edit}, | ||
'edit')), | ||
Flint.iff(hasKeys(props)) && view.el( | ||
['Inspector.Section',1], | ||
{title:'Props',if:hasKeys(props),className:'props'}, | ||
view.el(['Tree',1],{editable:false,data:props})), | ||
Flint.iff(hasKeys(state)) && view.el( | ||
['Inspector.Section',2], | ||
{title:'State',if:hasKeys(state)}, | ||
view.el(['Tree',2],{ | ||
editable:true, | ||
onSet:onSet, | ||
data:state})));}); | ||
'68270699'; | ||
$["view"] = function(_,_index){ | ||
return {transform:{ | ||
x:20}};}; | ||
'c59a100e'; | ||
'14ed20fc'; | ||
$["active"] = function(_,_index){ | ||
return {transform:{ | ||
x:0}};}; | ||
'73fd2ce7'; | ||
'4c3860b8'; | ||
'6f330b54'; | ||
$["name"] = function(_,_index){ | ||
return {margin:[0,0,-6]};}; | ||
'748b11a6'; | ||
$["edit"] = function(_,_index){ | ||
return {margin:[0,0,-6]};}; | ||
$["expanded"] = function(_,_index){ | ||
return { | ||
transform:{y:0}};}; | ||
'a91c0042'; | ||
'22691102'; | ||
'1d45081d';});});})(); | ||
//# sourceMappingURL=view.js.map | ||
(function(){ | ||
Flint.file("main.js",function(require){ | ||
Flint.staticStyles("Main",{ | ||
"$":"#_flintdevtools .ViewMain"}, | ||
{ | ||
"$":{ | ||
position:'fixed', | ||
top:0,left:0, | ||
right:0,bottom:0, | ||
zIndex:2147483647}}); | ||
Flint.view("Main",function(view,on,$){ | ||
var internal=window.__isDevingDevTools; | ||
var showInspector=true;view.render(function(){ | ||
return view.el(["link",1],{rel:"stylesheet",property:"stylesheet",href:"/__/tools/static/tools.css"});}); | ||
view.render(function(){ | ||
return Flint.iff(!internal) && view.el(["link",2],{if:!internal,rel:"stylesheet",property:"stylesheet",href:"/__/tools/styles.css"});}); | ||
view.render(function(){ | ||
return view.el(["Errors",1],null);}); | ||
view.render(function(){ | ||
return view.el(["Installer",1],null);}); | ||
view.render(function(){ | ||
return Flint.iff(showInspector) && view.el(["Menu",1],{if:showInspector});}); | ||
view.render(function(){ | ||
return Flint.iff(showInspector) && view.el(["Inspector",1],{if:showInspector});}); | ||
view.render(function(){ | ||
return Flint.iff(internal) && view.el(["StateTests",1],{if:internal});}); | ||
$["$"] = function(_,_index){ | ||
return {pointerEvents:internal?'auto':'none'};};});});})(); | ||
//# sourceMappingURL=main.js.map | ||
var _interopRequireDefault=require('babel-runtime/helpers/interop-require-default').default; | ||
(function(){ | ||
Flint.file('menu.js',function(require){ | ||
var _keys=require('./keys'); | ||
var _libInspecting=require('./lib/inspecting'); | ||
var _libInspecting2=_interopRequireDefault(_libInspecting); | ||
var Tools=_DT; | ||
var toEditor=Tools.messageEditor; | ||
Flint.staticStyles('Menu',{ | ||
'$menu':'#_flintdevtools .ViewMenu', | ||
'$active':'#_flintdevtools active.Menu, #_flintdevtools .Menu.active, #_flintdevtools .ViewMenu.active, #_flintdevtools .Menu > .active', | ||
'$item':'#_flintdevtools item.Menu, #_flintdevtools .Menu.item, #_flintdevtools .ViewMenu.item, #_flintdevtools .Menu > .item', | ||
'$first':'#_flintdevtools first.Menu, #_flintdevtools .Menu.first, #_flintdevtools .ViewMenu.first, #_flintdevtools .Menu > .first', | ||
'$last':'#_flintdevtools last.Menu, #_flintdevtools .Menu.last, #_flintdevtools .ViewMenu.last, #_flintdevtools .Menu > .last', | ||
'$hl':'#_flintdevtools hl.Menu, #_flintdevtools .Menu.hl, #_flintdevtools .ViewMenu.hl, #_flintdevtools .Menu > .hl', | ||
'$main':'#_flintdevtools main.Menu, #_flintdevtools .Menu.main, #_flintdevtools .ViewMenu.main, #_flintdevtools .Menu > .main'}, | ||
{ | ||
'$menu':{ | ||
border:'1px solid #ddd', | ||
boxShadow:'0 0 10px rgba(0,0,0,0.2)', | ||
position:'absolute', | ||
background:'#fff', | ||
zIndex:2147483647, | ||
transition:'opacity ease-in 30ms, transform ease-in 30ms', | ||
opacity:0, | ||
pointerEvents:'none', | ||
padding:0}, | ||
'$active':{ | ||
pointerEvents:'auto', | ||
opacity:1}, | ||
'$item':{ | ||
minWidth:120, | ||
cursor:'pointer', | ||
flexFlow:'row'}, | ||
'$first':{ | ||
overflow:'hidden'}, | ||
'$last':{ | ||
overflow:'hidden'}, | ||
'$hl':{ | ||
padding:[4,8]}, | ||
'$main':{ | ||
flexGrow:1}}); | ||
Flint.viewRoots["Menu"] = 'menu'; | ||
Flint.view('Menu',function(view,on,$){ | ||
var active=false; | ||
var top=undefined, | ||
left=undefined; | ||
var elements=[]; | ||
// prevent select and show custom cursor when ready for context | ||
var focused=undefined; | ||
on.keydown(function(){ | ||
if(_keys.keys.alt && _keys.keys.command){ | ||
document.body.classList.add('__flintfocus'); | ||
view.set('focused',focused = true);} | ||
view.updateSoft();}); | ||
on.keyup(function(){ | ||
if(focused){ | ||
document.body.classList.remove('__flintfocus'); | ||
view.set('focused',focused = false);} | ||
view.updateSoft();}); | ||
on.click(window,function(e){ | ||
if(active){ | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
view.set('active',active = false); | ||
view.updateSoft(); | ||
return;} | ||
var mode=_keys.keys.alt && _keys.keys.command; | ||
if(!mode)return; | ||
e.preventDefault(); | ||
var clientX=e.clientX; | ||
var clientY=e.clientY; | ||
view.set('left',left = clientX); | ||
view.set('top',top = clientY); | ||
view.set('active',active = true); | ||
view.set('elements',elements = _libInspecting2.default.all()); | ||
view.updateSoft();}); | ||
function focusElement(el){ | ||
return function(){ | ||
toEditor({type:'focus:element',key:el.key,view:el.view});};} | ||
function focusStyle(el){ | ||
return function(){ | ||
toEditor({type:'focus:style',el:el.el,view:el.view});};} | ||
;view.render(function(){ | ||
return view.el( | ||
['menu',1], | ||
{className:{internal:true,active:active}}, | ||
Flint.range(elements.filter(function(i){ | ||
return !!i.view;})). | ||
map(function(_,_index){ | ||
return view.el( | ||
['item',1,_,_index], | ||
{ | ||
repeat:elements.filter(function(i){ | ||
return !!i.view;}), | ||
className:{ | ||
first:_index == 0, | ||
last:_index == elements.length - 1}}, | ||
view.el( | ||
['main',1,_,_index], | ||
{className:'hl',onClick:focusElement(_)}, | ||
_.view), | ||
view.el( | ||
['sub',1,_,_index], | ||
{className:'hl',onClick:focusStyle(_)}, | ||
'$'));}));}); | ||
var rad=5; | ||
$["menu"] = function(_,_index){ | ||
return { | ||
borderRadius:rad,top:top, | ||
left:left,transform:{y:-10}};}; | ||
$["active"] = function(_,_index){ | ||
return {transform:{y:0}};}; | ||
$["first"] = function(_,_index){ | ||
return { | ||
borderTopLeftRadius:rad, | ||
borderTopRightRadius:rad};}; | ||
$["last"] = function(_,_index){ | ||
return { | ||
borderBottomLeftRadius:rad, | ||
borderBottomRightRadius:rad};}; | ||
$["hl"] = function(_,_index){ | ||
return {hover:{ | ||
background:[0,0,0,0.1]}};};});});})(); | ||
//# sourceMappingURL=menu.js.map | ||
(function(){ | ||
Flint.file('modal.js',function(require){ | ||
Flint.staticStyles('FlintModal',{ | ||
'$':'#_flintdevtools .ViewFlintModal', | ||
'$title':'#_flintdevtools title.FlintModal, #_flintdevtools .FlintModal.title, #_flintdevtools .ViewFlintModal.title, #_flintdevtools .FlintModal > .title', | ||
'$message':'#_flintdevtools message.FlintModal, #_flintdevtools .FlintModal.message, #_flintdevtools .ViewFlintModal.message, #_flintdevtools .FlintModal > .message'}, | ||
{ | ||
'$':{ | ||
position:'fixed', | ||
right:0, | ||
minWidth:80, | ||
padding:[7,5], | ||
margin:20, | ||
background:'#fff', | ||
boxShadow:'0 5px 26px rgba(0,0,0,0.13)', | ||
border:'1px solid #dadada', | ||
fontSize:14, | ||
transition:'all ease-in 200ms', | ||
textAlign:'center', | ||
borderRadius:6, | ||
pointerEvents:'auto'}, | ||
'$title':{ | ||
fontWeight:500, | ||
fontSize:15, | ||
margin:[0,20]}, | ||
'$message':{ | ||
fontFamily:"-apple-system, 'Helvetica Nueue', Helvetica, Arial, sans-serif"}}); | ||
Flint.view('FlintModal',function(view,on,$){ | ||
var open=view.prop('open',undefined), | ||
title=view.prop('title',undefined), | ||
children=view.prop('children',undefined); | ||
on.props(function(){ | ||
open = view.getProp('open'); | ||
title = view.getProp('title'); | ||
children = view.getProp('children');}); | ||
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'};};});});})(); | ||
//# sourceMappingURL=modal.js.map | ||
(function(){ | ||
Flint.file('npm/installer.js',function(require){ | ||
var tools=window._DT; | ||
Flint.view('Installer',function(view,on,$){ | ||
var version=''; | ||
var versions=[]; | ||
var name=''; | ||
var error=''; | ||
var state=0; | ||
tools.on('package:install',function(){ | ||
view.set('state',state = 1); | ||
view.set('name',name = tools.data.name); | ||
view.updateSoft();}); | ||
tools.on('package:installed',function(){ | ||
view.set('state',state = 2); | ||
setTimeout(function(){ | ||
view.set('state',state = 0); | ||
view.updateSoft();}, | ||
2000); | ||
view.updateSoft();}); | ||
tools.on('package:error',function(){ | ||
view.set('state',state = 3); | ||
view.set('name',name = tools.data.name); | ||
view.set('error',error = tools.data.error); | ||
setTimeout(function(){ | ||
view.set('state',state = 0); | ||
view.updateSoft();}, | ||
2000); | ||
view.updateSoft();}); | ||
tools.on('package:select',function(){ | ||
view.set('state',state = 4); | ||
view.set('versions',versions = tools.data.versions); | ||
view.updateSoft();}); | ||
var selectVersion=function selectVersion(v){ | ||
view.set('version',version = v); | ||
tools.data.version = v; | ||
tools.emitter.emit('package:select'); | ||
view.set('state',state = 1); | ||
view.updateSoft();}; | ||
var closeModal=function closeModal(){ | ||
view.set('state',state = 0); | ||
view.updateSoft();}; | ||
var title=function title(state){ | ||
switch(state){ | ||
case 1: | ||
return 'Installing ' + name + (version?' ' + version:'') + '...'; | ||
case 2: | ||
return 'Installed ' + name + '!'; | ||
case 3: | ||
return 'Error: ' + name; | ||
case 4: | ||
return 'Select version';}}; | ||
var body=function body(state){ | ||
switch(state){ | ||
case 1: | ||
return null; | ||
case 2: | ||
return null; | ||
case 3: | ||
return error; | ||
case 4: | ||
return view.el(['Versions',1],{versions:versions,onSelect:selectVersion});}} | ||
// was <modal but collided with bootstrap | ||
;view.render(function(){ | ||
return view.el( | ||
['FlintModal',1], | ||
{ | ||
open:state > 0, | ||
onClose:closeModal, | ||
title:title(state), | ||
titleColor:state == 3?"#8c1919":"#0f8c3c"}, | ||
Flint.iff(false && state < 2) && view.el(['InstallerLoading',1],{if:false && state < 2}), | ||
body(state));});}); | ||
Flint.staticStyles('Versions',{ | ||
'$version':'#_flintdevtools version.Versions, #_flintdevtools .Versions.version, #_flintdevtools .ViewVersions.version, #_flintdevtools .Versions > .version', | ||
'$inner':'#_flintdevtools inner.Versions, #_flintdevtools .Versions.inner, #_flintdevtools .ViewVersions.inner, #_flintdevtools .Versions > .inner', | ||
'$v':'#_flintdevtools v.Versions, #_flintdevtools .Versions.v, #_flintdevtools .ViewVersions.v, #_flintdevtools .Versions > .v', | ||
'$info':'#_flintdevtools info.Versions, #_flintdevtools .Versions.info, #_flintdevtools .ViewVersions.info, #_flintdevtools .Versions > .info'}, | ||
{ | ||
'$version':{ | ||
textAlign:'left', | ||
padding:[2,4], | ||
borderRadius:2}, | ||
'$inner':{ | ||
flexFlow:'row'}, | ||
'$v':{ | ||
flexGrow:1, | ||
fontWeight:'bold'}, | ||
'$info':{}}); | ||
Flint.view('Versions',function(view,on,$){ | ||
;view.render(function(){ | ||
return Flint.range(view.props.versions).map(function(_,_index){ | ||
return view.el( | ||
['version',1,_,_index], | ||
{repeat:view.props.versions,onClick:function(){ | ||
return view.props.onSelect(_);}}, | ||
view.el( | ||
['inner',1,_,_index], | ||
null, | ||
view.el( | ||
['v',1,_,_index], | ||
{key:'v' + _index}, | ||
_.version), | ||
view.el( | ||
['info',1,_,_index], | ||
null, | ||
_.description), | ||
view.el( | ||
['a',1,_,_index], | ||
{href:_.homepage,target:'_blank'}, | ||
'Info')));});}); | ||
$["v"] = function(_,_index){ | ||
return {':hover':{ | ||
background:'#fff', | ||
cursor:'pointer'}};};});});})(); | ||
//# sourceMappingURL=installer.js.map | ||
Flint.start();})(Flint)}; | ||
exports.flinttools=function(e,t){!function(e){var t=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("main.js",function(n){function o(e){l(e)?s=on.delay(180,function(){l(e)&&on.event("hud:show")}):(s&&s(),on.event("hud:hide"))}var i=n("keycode"),r=t(i);window.___keycode=r["default"];var l=function(e){var t=e.altKey,n=e.metaKey;return t&&!n},s=null;on.keydown(window,o),on.keyup(window,o),e.staticStyles("Main",{$:"#_flintdevtools .ViewMain"},{$:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2147483647}}),e.view("Main",function(t,n,o){var i=window.__isDevingDevTools,r=!0;t.render(function(){return t.el(["link",1],{rel:"stylesheet",property:"stylesheet",href:"/__/tools/static/tools.css"})}),t.render(function(){return e.iff(!i)&&t.el(["link",2],{"if":!i,rel:"stylesheet",property:"stylesheet",href:"/__/tools/styles.css"})}),t.render(function(){return t.el(["Errors",1],null)}),t.render(function(){return t.el(["Installer",1],null)}),t.render(function(){return t.el(["DevBar",1],null)}),t.render(function(){return e.iff(r)&&t.el(["Menu",1],{"if":r})}),t.render(function(){return e.iff(r)&&t.el(["Inspector",1],{"if":r})}),t.render(function(){return e.iff(i)&&t.el(["StateTests",1],{"if":i})}),o.$=function(e,t){return{pointerEvents:i?"auto":"none"}}})})}(),function(){e.file("close.js",function(t){e.staticStyles("Close",{$:"#_flintdevtools .ViewClose"},{$:{position:"absolute",right:0,top:0,display:"flex",justifyContent:"center",alignItems:"center",lineHeight:1,opacity:.15,cursor:"pointer",transition:"all ease-in 200ms"}}),e.viewRoots.Close="close",e.view("Close",function(e,t,n){e.render(function(){return e.el(["close",1],{onClick:e.props.onClick},"x")}),n.$=function(t,n){return{fontSize:e.props.fontSize||13,width:e.props.size||50,height:e.props.size||50,":hover":{opacity:.4}}}})})}(),function(){e.file("debounce.js",function(t){var n=function(e,t){return e+t},o=300,i=800,r=5e3,l=1e4,s=1e3;e.view("Debounce",function(e,t,a){var f=void 0,u=void 0,c=void 0,d=void 0,p=void 0,v=void 0,g=!1,h=[];e.pause(),t.props(function(){function t(){e.props.onUpdate&&e.props.onUpdate(),e.update()}if(e.props.force)return e.set("showKey",f=Math.random()),t();if(!e.props.showKey||e.props.showKey!=f){e.set("showKey",f=e.props.showKey),e.set("delay",d=e.props.delay||o),e.set("curDelay",p=p||d);var a=Date.now(),m=c?a-c:r;e.set("lastTime",c=a),e.set("lastFew",h.unshift(m),h,!0),h.length>3&&e.set("lastFew",h.pop(),h,!0),m>l?e.set("lastFew",h=[]):3==h.length&&(e.set("avgDiff",v=h.reduce(n,0)/h.length),e.set("isAutoSaving",g=s>v),e.set("curDelay",p=g?i:d)),clearTimeout(u),e.set("timeout",u=setTimeout(t,p))}})})})}(),function(){e.file("devbar.js",function(t){var n=function(e){var t=0;if(0===e.length)return 0;for(var n=0;n<e.length;n++)t+=parseInt(e[n],10);return t/e.length};e.staticStyles("DevBar",{$bar:"#_flintdevtools bar.DevBar, #_flintdevtools .DevBar.bar, #_flintdevtools .ViewDevBar.bar, #_flintdevtools .DevBar > .bar",$pin:"#_flintdevtools pin.DevBar, #_flintdevtools .DevBar.pin, #_flintdevtools .ViewDevBar.pin, #_flintdevtools .DevBar > .pin",$label:"#_flintdevtools label.DevBar, #_flintdevtools .DevBar.label, #_flintdevtools .ViewDevBar.label, #_flintdevtools .DevBar > .label",$fps:"#_flintdevtools fps.DevBar, #_flintdevtools .DevBar.fps, #_flintdevtools .ViewDevBar.fps, #_flintdevtools .DevBar > .fps",$button:"#_flintdevtools button.DevBar, #_flintdevtools .DevBar.button, #_flintdevtools .ViewDevBar.button, #_flintdevtools .DevBar > .button"},{$bar:{flexFlow:"row",position:"fixed",bottom:0,left:0,right:0,background:"white",height:50,border:[1,"solid","#ccc"],padding:[10,15],pointerEvents:"all"},$pin:{position:"abosulte",right:10,top:3},$label:{flexFlow:"row",fontSize:15,marginTop:1,fontWeight:"bold"},$fps:{flexFlow:"row"},$button:{marginLeft:20}}),e.view("DevBar",function(t,o,i){var r=0,l=!1,s=[],a=0,f="true"===localStorage.getItem("devbar"),u=function(){console.log("times are",s,"avg is",n(s)),t.set("avgTime",a=n(s)),t.set("fps",r=0===a?0:1e3/a)};o.event("hot:finished",function(e){var n=e.time;f&&(t.set("times",s.push(n),s,!0),u())});t.render(function(){return e.iff(l||f)&&t.el(["bar",1],{"if":l||f},t.el(["fps",1],null,t.el(["label",1],null,"Live: ",(""+r).substr(0,6)," FPS"),t.el(["button",1],{onClick:function(){t.set("times",s=[]),u()}},"reset")))})})})}(),function(){e.file("errors.js",function(t){function n(){setTimeout(function(){var e=document.querySelectorAll(".__flintError");e.length&&[].forEach.call(e,function(e){-1==e.className.indexOf("active")&&(e.className+=" active")})},s()?1e3:0)}function o(e){if(e.file&&(e.file=e.file.replace(new RegExp(".*"+window.location.origin+"(/[_]+/)?"),"")),e.file&&e.file.indexOf("internals.js")>=0)if(e.message&&0==e.message.indexOf("Cannot find module")){var t=e.message.match(/(fs|path)/);t&&t.length&&(e.file="imported module:",e.message="Cannot import node-only module: "+t[0])}else e.message="Error in a locally required file. "+e.message;return e.message&&(e.niceMessage=e.message.replace(/Uncaught .*Error:\s*/,"")),e}function i(e){var t=e.msg,n=e.name;return t&&(t=t.replace(/(npm WARN.*\n|ERR\!)/g,"").replace(/npm argv.*\n/g,"").replace(/npm node v.*\n/g,"").replace(/npm npm.*\n/g,"").replace(/npm code.*\n/g,"").replace(/npm peerinvalid /g,"").replace(/npm 404 /g,"")),{msg:t,name:n}}var r=window._DT,l=function(e,t){return[e.substring(0,t),e.substring(t,t+1),e.substring(t+1)]},s=function(){return r.editor&&r.editor.live},a=function(e){return u(p(v(e)))},f=function(e){return e?e.replace(/.*\.js\:/,"").replace(/\([0-9]+\:[0-9]+\)/,"").replace(/Line [0-9]+\:\s*/,""):""},u=function(e){return e.niceMessage=f(e.message,e.fileName),e},c=/\>?\s*([0-9]*)\s*\|(.*)/g,d=/\s*\|\s*\^\s*$/g,p=function(e){return e?(e.stack&&!function(){e.fullStack=["","",""];var t=0;e.stack.split("\n").forEach(function(n){if(!d.test(n)&&c.test(n)){var o=">"===n[0];o&&(t=1),o||1!==t||(t=2);var i=n.replace(c,"$1$2").replace(/^(\s*[0-9]+\s*)[;]/,"$1 ");e.fullStack[t]+=i+"\n"}})}(),e):void 0},v=function(e){return e?(e.stack&&e.stack.split("\n").map(function(t){if(">"===t[0]){var n=t;if(!n)return;n=n.replace(/\>\s*[0-9]+\s*\|\s*/,""),n=f(n);var o=e.loc.column-4;e.niceStack=l(n,o)}}),e):void 0},g=function(){};e.view("Errors",function(e,t,n){function l(){u?e.set("error",f=a(u)):c?e.set("error",f=o(c)):e.set("error",f=null),g("tools: view.update()"),e.update()}function s(){e.set("error",f=null),e.set("compileError",u=null),e.set("runtimeError",c=null),e.set("npmError",d=null),e.update()}e.pause();var f=null,u=null,c=null,d=null;r.on("compile:error",function(){g("compile:error"),e.set("compileError",u=r.data.error),l()}),r.on("runtime:error",function(){e.set("runtimeError",c=r.data),g("runtime:error",c),l()}),r.on("npm:error",function(){e.set("npmError",d=i(r.data.error)),g("npm:error",d),e.update()}),r.on("runtime:success",function(){g("runtime:success"),e.set("runtimeError",c=null),e.set("npmError",d=null),l()}),r.on("compile:success",function(){g("compile:success"),e.set("compileError",u=null),e.set("npmError",d=null),l()}),e.render(function(){return e.el(["ErrorMessage",1],{error:f,npmError:d,close:s})})});var h=0,m=function(e){return e&&e.replace(/[\?\)].*/,"")},_=function(e){return e&&(e.line||e.loc&&e.loc.line)};e.staticStyles("ErrorMessage",{$bar:"#_flintdevtools bar.ErrorMessage, #_flintdevtools .ErrorMessage.bar, #_flintdevtools .ViewErrorMessage.bar, #_flintdevtools .ErrorMessage > .bar",$inner:"#_flintdevtools inner.ErrorMessage, #_flintdevtools .ErrorMessage.inner, #_flintdevtools .ViewErrorMessage.inner, #_flintdevtools .ErrorMessage > .inner",$top:"#_flintdevtools top.ErrorMessage, #_flintdevtools .ErrorMessage.top, #_flintdevtools .ViewErrorMessage.top, #_flintdevtools .ErrorMessage > .top",$where:"#_flintdevtools where.ErrorMessage, #_flintdevtools .ErrorMessage.where, #_flintdevtools .ViewErrorMessage.where, #_flintdevtools .ErrorMessage > .where",$line:"#_flintdevtools line.ErrorMessage, #_flintdevtools .ErrorMessage.line, #_flintdevtools .ViewErrorMessage.line, #_flintdevtools .ErrorMessage > .line",$flint:"#_flintdevtools flint.ErrorMessage, #_flintdevtools .ErrorMessage.flint, #_flintdevtools .ViewErrorMessage.flint, #_flintdevtools .ErrorMessage > .flint",$shortError:"#_flintdevtools shortError.ErrorMessage, #_flintdevtools .ErrorMessage.shortError, #_flintdevtools .ViewErrorMessage.shortError, #_flintdevtools .ErrorMessage > .shortError",$cur:"#_flintdevtools cur.ErrorMessage, #_flintdevtools .ErrorMessage.cur, #_flintdevtools .ViewErrorMessage.cur, #_flintdevtools .ErrorMessage > .cur",$errCol:"#_flintdevtools errCol.ErrorMessage, #_flintdevtools .ErrorMessage.errCol, #_flintdevtools .ViewErrorMessage.errCol, #_flintdevtools .ErrorMessage > .errCol",$ln:"#_flintdevtools ln.ErrorMessage, #_flintdevtools .ErrorMessage.ln, #_flintdevtools .ViewErrorMessage.ln, #_flintdevtools .ErrorMessage > .ln",$flintline:"#_flintdevtools flintline.ErrorMessage, #_flintdevtools .ErrorMessage.flintline, #_flintdevtools .ViewErrorMessage.flintline, #_flintdevtools .ErrorMessage > .flintline"},{$bar:{display:"block",position:"fixed",left:0,transition:"all 200ms ease-in",right:0,fontFamily:'-apple-system, "San Francisco", Roboto, "Segou UI", "Helvetica Neue", Helvetica, Arial, sans-serif',fontWeight:300,color:"#fff",fontSize:"14px",padding:2,pointerEvents:"all",overflow:"scroll",zIndex:2147483647,boxShadow:"0 -6px 12px rgba(0,0,0,0.06)"},$inner:{display:"block",maxHeight:200,overflowY:"scroll"},$top:{padding:8,display:"block"},$where:{display:"inline-block",pointerEvents:"all",fontWeight:300,color:"rgba(255,255,255,0.8)"},$line:{display:"inline-block",whiteSpace:"pre",pointerEvents:"all"},$flint:{display:"inline",fontWeight:700,color:"#fff"},$shortError:{display:"inline",color:"rgba(255,255,255,0.7)"},$cur:{background:"#fff"},$errCol:{display:"inline",borderBottom:"2px solid #f5d64c",margin:-3,padding:3,color:"#fff"},$ln:{padding:[0,20]},$flintline:{whiteSpace:"pre",pointerEvents:"all",fontWeight:"flint"}}),e.view("ErrorMessage",function(t,o,i){t.pause();var l=!1,a={},f=void 0,u=void 0,c=_(t.props.error),d=void 0;o.props(function(){d&&d(),t.set("npmError",f=t.props.npmError),t.set("hasError",l=!(!t.props.error&&!t.props.npmError)),t.set("error",a=t.props.error||a),t.set("line",c=_(a)),t.set("fullStack",u=null),t.update(),a&&t.set("clearDelay",d=o.delay(2500,function(){l&&a.fullStack&&(t.set("fullStack",u=a.fullStack),t.update())}))}),r.emitter.on("editor:state",function(){return setTimeout(t.update)}),t.render(function(){return t.el(["Debounce",1],{delay:s()?2e3:1e3,force:l===!1,showKey:u||a&&a.message,onUpdate:n},t.el(["bar",1],null,t.el(["Close",1],{onClick:t.props.close,size:35}),e.iff(f)&&t.el(["inner",1],{"if":f},t.el(["where",1],null,t.el(["flint",1],null,f.name))," ",f.msg),t.el(["inner",2],null,t.el(["top",1],null,t.el(["where",2],null,t.el(["span",1],null,"In ",t.el(["flint",2],null,m(a.file))),t.el(["line",1],null,c?" line":""," ",e.iff(c)&&t.el(["flint",3],{"if":c},c-h)))," ",t.el(["shortError",1],null,(a.niceMessage||a.message||"").trim(),e.iff(a.niceStack)&&t.el(["niceStack",1],{"if":a.niceStack},a.niceStack[0],t.el(["errCol",1],null,a.niceStack[1]),a.niceStack[2])),e.iff(a.help)&&t.el(["help",1],{"if":a.help},a.help)),e.iff(u)&&t.el(["fullStack",1],{"if":u},t.el(["ln",1],null,""+u[0]),t.el(["ln",2],{className:"cur"},""+u[1]),t.el(["ln",3],null,""+u[2])))))});var p="#cd423e";i.bar=function(e,t){return{background:p,bottom:l?0:-100}};var v={color:"rgba(255,255,255,0.85)",display:"inline",fontFamily:"Meslo, Menlo, Monaco, monospace",padding:[0,5]};i.niceStack=function(e,t){return v},i.fullStack=function(e,t){return[v,{maxHeight:u?600:0,padding:u?[10,0]:0,transition:"maxHeight ease-in 300ms",color:"rgba(0,0,0,0.85)",background:"rgba(255,255,255,0.9)",display:"block",whiteSpace:"pre",fontSize:14,borderRadius:3,margin:2}]}}),e.staticStyles("ErrorIcon",{$svg:"#_flintdevtools svg.ErrorIcon, #_flintdevtools .ErrorIcon.svg, #_flintdevtools .ViewErrorIcon.svg, #_flintdevtools .ErrorIcon > .svg"},{$svg:{width:19,fill:"red",margin:-4,marginLeft:3,marginRight:6,opacity:.9}}),e.view("ErrorIcon",function(e,t,n){e.render(function(){return e.el(["svg",1],{viewBox:"0 0 27.963 27.963"},e.el(["path",1],{d:"M13.983,0C6.261,0,0.001,6.259,0.001,13.979c0,7.724,6.26,13.984,13.982,13.984s13.98-6.261,13.98-13.984 C27.963,6.259,21.705,0,13.983,0z M13.983,26.531c-6.933,0-12.55-5.62-12.55-12.553c0-6.93,5.617-12.548,12.55-12.548 c6.931,0,12.549,5.618,12.549,12.548C26.531,20.911,20.913,26.531,13.983,26.531z"}),e.el(["polygon",1],{points:"15.579,17.158 16.191,4.579 11.804,4.579 12.414,17.158"}),e.el(["path",2],{d:"M13.998,18.546c-1.471,0-2.5,1.029-2.5,2.526c0,1.443,0.999,2.528,2.444,2.528h0.056c1.499,0,2.469-1.085,2.469-2.528 C16.441,19.575,15.468,18.546,13.998,18.546z"}))})})})}();var n=require("babel-runtime/helpers/extends")["default"],o=require("babel-runtime/helpers/to-array")["default"],i=require("babel-runtime/helpers/sliced-to-array")["default"],t=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector.js",function(r){function l(e){var t=e.getBoundingClientRect(),n=window.innerWidth,o=window.innerHeight,i=$(t.right-t.left),r=$(t.bottom-t.top),l=1;i>=n&&r>=o&&(l=.2),V.setAttribute("style","\n top: "+$(t.top)+"px;\n left: "+$(t.left)+"px;\n width: "+i+"px;\n height: "+r+"px;\n opacity: "+l+";\n ")}function s(){V.setAttribute("style","")}function a(e){if(!e||!e.getAttribute)return null;var t=e.__flintID;return t?(l(e),t):a(e.parentNode)}function f(e,t){return e.filter(function(e){return e.path==t}).length>0}function u(e){return e.filter(function(e){return!e.temp}).map(function(e){return n({},e,{highlight:!1})})}function c(e,t){return[{path:t,highlight:!1,temp:!0}].concat(e)}function d(e,t){return e.map(function(e){return e.path==t&&(e.closing=!0),e})}function p(e,t){return e.map(function(e){return e.path==t&&(e.highlight=!0),e})}function v(e,t){if(f(e,t))return e.map(function(e){return e.path==t&&(e.temp=!0),e});var n={temp:!1,highlight:!1,closing:!1,path:t};return[].concat([n],e)}function g(){return window._Flint}function h(e,t){var n=g(),o=n.getCache[e];t.reduce(function(e,t){if("root"==t)return e;if(!Array.isArray(t))return e[t];var n=i(t,2),o=n[0],r=n[1],l=e[o];"number"==typeof l&&(r=+r),e[o]=r},o),n.inspectorRefreshing=e,n.getInitialStates[e](),n.viewsAtPath[e].forceUpdate(),n.inspectorRefreshing=null}var m=r("./lib/inspecting"),_=t(m),w=r("./keys"),b=r("lodash"),y=function(e){var t=o(e),n=(t[0],t.slice(1));return n},$=Math.round,V=void 0;e.staticStyles("Inspector",{$:"#_flintdevtools .ViewInspector"},{$:{position:"fixed",top:0,right:0,padding:2}}),e.view("Inspector",function(t,o,i){function r(e){g().isInspecting=!0;var n=a(e);null!==n&&(t.set("views",T=u(T)),t.set("views",T=f(T,n)?p(T,n):c(T,n)))}function l(e){var n=e.target,o=ReactDOM.findDOMNode(t);if(C!=n){if(o.contains(n))return;t.set("lastTarget",C=n),_["default"].set(n),L&&r(C)}}function m(){T.length&&t.set("views",T=y(T))}function $(e,n){n&&n.stopPropagation(),t.set("views",T=d(T,e)),o.delay(200,function(){t.set("views",T=T.filter(function(t){return e!=t.path}))})}function M(e){var n=e.target,o=ReactDOM.findDOMNode(t);return o.contains(n)?void 0:(t.set("views",T=v(u(T),a(n))),!1)}function E(){r(C),t.set("hudActive",L=!0),t.set("clickOff",S=o.click(window,M))}function I(){g().isInspecting=!1,t.set("hudActive",L=!1),s(),S&&S(),t.set("views",T=u(T))}function k(e,n){h(e,n),t.update()}var S=void 0,x=void 0,C=void 0,L=!1,T=[];o.mount(function(){t.set("hoverOff",x=o.mousemove(window,(0,b.throttle)(l,40))),V||(V=document.createElement("div"),V.className="_flintHighlighter",document.body.appendChild(V))}),o.event("hud:show",E),o.event("hud:hide",I),(0,w.onKeyDown)("esc",m),t.render(function(){return e.range(T).map(function(e,o){return t.el(["Inspector.View",1,e,o],n({repeat:T,key:e.path},e,{writeBack:k,onClose:function(t){return $(e.path,t)}}))})})})})}();var t=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("menu.js",function(n){var o=n("./keys"),i=n("./lib/inspecting"),r=t(i),l=_DT,s=l.messageEditor;e.staticStyles("Menu",{$menu:"#_flintdevtools .ViewMenu",$active:"#_flintdevtools active.Menu, #_flintdevtools .Menu.active, #_flintdevtools .ViewMenu.active, #_flintdevtools .Menu > .active",$item:"#_flintdevtools item.Menu, #_flintdevtools .Menu.item, #_flintdevtools .ViewMenu.item, #_flintdevtools .Menu > .item",$first:"#_flintdevtools first.Menu, #_flintdevtools .Menu.first, #_flintdevtools .ViewMenu.first, #_flintdevtools .Menu > .first",$last:"#_flintdevtools last.Menu, #_flintdevtools .Menu.last, #_flintdevtools .ViewMenu.last, #_flintdevtools .Menu > .last",$hl:"#_flintdevtools hl.Menu, #_flintdevtools .Menu.hl, #_flintdevtools .ViewMenu.hl, #_flintdevtools .Menu > .hl",$main:"#_flintdevtools main.Menu, #_flintdevtools .Menu.main, #_flintdevtools .ViewMenu.main, #_flintdevtools .Menu > .main"},{$menu:{border:"1px solid #ddd",boxShadow:"0 0 10px rgba(0,0,0,0.2)",position:"absolute",background:"#fff",zIndex:2147483647,transition:"opacity ease-in 30ms, transform ease-in 30ms",opacity:0,pointerEvents:"none",padding:0},$active:{pointerEvents:"auto",opacity:1},$item:{minWidth:120,cursor:"pointer",flexFlow:"row"},$first:{overflow:"hidden"},$last:{overflow:"hidden"},$hl:{padding:[4,8]},$main:{flexGrow:1}}),e.viewRoots.Menu="menu",e.view("Menu",function(t,n,i){function l(e){return function(){s({type:"focus:element",key:e.key,view:e.view})}}function a(e){return function(){s({type:"focus:style",el:e.el,view:e.view})}}var f=!1,u=void 0,c=void 0,d=[],p=void 0;n.keydown(function(){o.keys.alt&&o.keys.command&&(document.body.classList.add("__flintfocus"),t.set("focused",p=!0))}),n.keyup(function(){p&&(document.body.classList.remove("__flintfocus"),t.set("focused",p=!1))}),n.click(window,function(e){if(f)return e.stopPropagation(),e.preventDefault(),void t.set("active",f=!1);var n=o.keys.alt&&o.keys.command;if(n){e.preventDefault();var i=e.clientX,l=e.clientY;t.set("left",c=i),t.set("top",u=l),t.set("active",f=!0),t.set("elements",d=r["default"].all())}}),t.render(function(){return t.el(["menu",1],{className:{internal:!0,active:f}},e.range(d.filter(function(e){return!!e.view})).map(function(e,n){return t.el(["item",1,e,n],{repeat:d.filter(function(e){return!!e.view}),className:{first:0==n,last:n==d.length-1}},t.el(["main",1,e,n],{className:"hl",onClick:l(e)},e.view),t.el(["sub",1,e,n],{className:"hl",onClick:a(e)},"$"))}))});var v=5;i.menu=function(e,t){return{borderRadius:v,top:u,left:c,transform:{y:-10}}},i.active=function(e,t){return{transform:{y:0}}},i.first=function(e,t){return{borderTopLeftRadius:v,borderTopRightRadius:v}},i.last=function(e,t){return{borderBottomLeftRadius:v,borderBottomRightRadius:v}},i.hl=function(e,t){return{hover:{background:[0,0,0,.1]}}}})})}(),function(){e.file("modal.js",function(t){e.staticStyles("FlintModal",{$:"#_flintdevtools .ViewFlintModal",$title:"#_flintdevtools title.FlintModal, #_flintdevtools .FlintModal.title, #_flintdevtools .ViewFlintModal.title, #_flintdevtools .FlintModal > .title",$message:"#_flintdevtools message.FlintModal, #_flintdevtools .FlintModal.message, #_flintdevtools .ViewFlintModal.message, #_flintdevtools .FlintModal > .message"},{$:{position:"fixed",right:0,minWidth:80,padding:[7,5],margin:20,background:"#fff",boxShadow:"0 5px 26px rgba(0,0,0,0.13)",border:"1px solid #dadada",fontSize:14,transition:"all ease-in 200ms",textAlign:"center",borderRadius:6,pointerEvents:"auto"},$title:{fontWeight:500,fontSize:15,margin:[0,20]},$message:{fontFamily:"-apple-system, 'Helvetica Nueue', Helvetica, Arial, sans-serif"}}),e.view("FlintModal",function(t,n,o){function i(){return t.set("open",s=t.props.open),l&&!t.props.title?t.update():(t.set("title",l=t.props.title),t.set("children",r=t.props.children),void t.update())}t.pause();var r=void 0,l=void 0,s=void 0;n.props(i),t.render(function(){return t.el(["Close",1],{size:25})}),t.render(function(){return e.iff(l)&&t.el(["title",1],{"if":l},l)}),t.render(function(){return e.iff(r)&&t.el(["message",1],{"if":r},r)}),o.$=function(e,t){return{top:s?0:-140}},o.title=function(e,n){return{color:t.props.titleColor||"#222"}}})})}();var r=require("babel-runtime/core-js/object/keys")["default"];!function(){e.file("inspector/highlighter.js",function(t){e.view("Highlighter",function(t,n,o){t.render(function(){return e.iff(!t.props.highlight||-1===t.props.string.indexOf(t.props.highlight))&&t.el(["name",1],{"if":!t.props.highlight||-1===t.props.string.indexOf(t.props.highlight)},t.props.string)}),t.render(function(){return e.iff(t.props.highlight)&&t.el(["span",1],{"if":t.props.highlight},e.range(t.props.string.split()).map(function(n,o){return t.el(["span",2,n,o],{repeat:t.props.string.split()},e.iff(o>0)&&t.el(["highlight",1,n,o],{"if":o>0},t.props.highlight),n)}))})})})}();var n=require("babel-runtime/helpers/extends")["default"];!function(){e.file("inspector/label.js",function(t){var o=t("lodash");e.staticStyles("Label",{$input:"#_flintdevtools input.Label, #_flintdevtools .Label.input, #_flintdevtools .ViewLabel.input, #_flintdevtools .Label > .input",$focus:"#_flintdevtools focus.Label, #_flintdevtools .Label.focus, #_flintdevtools .ViewLabel.focus, #_flintdevtools .Label > .focus"},{$input:{position:"absolute",top:0,left:-1,right:0,color:"#333",padding:1,width:140,outline:"none",border:"none",opacity:0,boxShadow:"1px 1px 2px rgba(0,0,0,0.4)"},$focus:{opacity:"1 !important"}}),e.view("Label",function(e,t,i){var r=e.prop("val",void 0),l=e.prop("editable",void 0),s=e.prop("onSet",void 0);t.props(function(){r=e.getProp("val"),l=e.getProp("editable"),s=e.getProp("onSet")});var a=void 0,f=void 0;t.props(function(){a||e.set("newVal",f=r)});var u=function(t){if(l){if((0,o.isBoolean)(r))return s(!r);e.set("focus",a=!0),t.stopPropagation()}},c=function(t){e.set("focus",a=!1)},d=function(t){e.set("newVal",f=t.target.value),e.update({immediate:!0}),(!(0,o.isNumber)(r)||""!==f&&!isNaN(f))&&("false"===f&&e.set("newVal",f=!1),"true"===f&&e.set("newVal",f=!0),s(f))},p=function(e){return e?{}:{tabIndex:5e3,disabled:!0}};e.render(function(){return e.el(["input",1],n({defaultValue:r.toString(),value:f,className:{focus:a},size:Math.max(4,r&&r.length||0),spellCheck:!1,onMouseDown:u,onFocus:u,onEnter:c},p(l),{onFocus:u,onBlur:c,onChange:d}))}),i.input=function(e,t){return{cursor:(0,o.isBoolean)(r)?"pointer":"auto"}}})})}();var r=require("babel-runtime/core-js/object/keys")["default"],t=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector/leaf.js",function(n){var o=n("md5-o-matic"),i=t(o),l=n("../lib/getType"),s=t(l),a=n("ellipsize"),f=t(a),u=n("lodash"),c=".root.",d=function(e,t){return-1!==e.indexOf(t)},p=function(e){return"Object"!==(0,s["default"])(e)&&"Array"!==(0,s["default"])(e)},v=function(){},g=function(e){return e.toString().replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s))/gm,"").match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].split(/,/)};e.staticStyles("Leaf",{$leaf:"#_flintdevtools .ViewLeaf",$helper:"#_flintdevtools helper.Leaf, #_flintdevtools .Leaf.helper, #_flintdevtools .ViewLeaf.helper, #_flintdevtools .Leaf > .helper",$boolean:"#_flintdevtools boolean.Leaf, #_flintdevtools .Leaf.boolean, #_flintdevtools .ViewLeaf.boolean, #_flintdevtools .Leaf > .boolean",$number:"#_flintdevtools number.Leaf, #_flintdevtools .Leaf.number, #_flintdevtools .ViewLeaf.number, #_flintdevtools .Leaf > .number",$string:"#_flintdevtools string.Leaf, #_flintdevtools .Leaf.string, #_flintdevtools .ViewLeaf.string, #_flintdevtools .Leaf > .string",$function:"#_flintdevtools function.Leaf, #_flintdevtools .Leaf.function, #_flintdevtools .ViewLeaf.function, #_flintdevtools .Leaf > .function",$colon:"#_flintdevtools colon.Leaf, #_flintdevtools .Leaf.colon, #_flintdevtools .ViewLeaf.colon, #_flintdevtools .Leaf > .colon",$name:"#_flintdevtools name.Leaf, #_flintdevtools .Leaf.name, #_flintdevtools .ViewLeaf.name, #_flintdevtools .Leaf > .name",$children:"#_flintdevtools children.Leaf, #_flintdevtools .Leaf.children, #_flintdevtools .ViewLeaf.children, #_flintdevtools .Leaf > .children",$type:"#_flintdevtools type.Leaf, #_flintdevtools .Leaf.type, #_flintdevtools .ViewLeaf.type, #_flintdevtools .Leaf > .type"},{$leaf:{padding:[1,0],fontSize:13},$helper:{color:"#ffff05"},$boolean:{color:"#32a3cd",fontWeight:700},$number:{color:"#b92222",marginTop:2,fontWeight:500},$string:{color:"#698c17"},$function:{marginLeft:10,marginTop:2,color:"#962eba"},$colon:{opacity:.3,color:"#000"},$name:{color:"#ff2f2f",fontWeight:400,margin:["auto",0]},$children:{paddingLeft:10},$type:{margin:[1,0,0,8],opacity:.7,flexFlow:"row"}}),e.viewRoots.Leaf="leaf",e.view("Leaf",function(t,n,o){function l(e){t.props.root||t.set("expanded",C=!C),t.update(),M(k),e.stopPropagation()}var a=t.prop("isExpanded",void 0),h=t.prop("data",void 0),m=t.prop("prefix",void 0),_=t.prop("query",void 0),w=t.prop("label",void 0),b=t.prop("id",void 0),y=t.prop("editable",void 0);n.props(function(){a=t.getProp("isExpanded"),h=t.getProp("data"),m=t.getProp("prefix"),_=t.getProp("query"),w=t.getProp("label"),b=t.getProp("id"),y=t.getProp("editable")});var $=t.prop("getOriginal",v),V=t.prop("onSet",v),M=t.prop("onClick",v);n.props(function(){$=t.getProp("getOriginal"),V=t.getProp("onSet"),M=t.getProp("onClick")}),t.pause();var E=void 0,I=void 0,k=void 0,S=void 0,x=void 0,C=void 0,L=[],T="",D=function(){return t.props.root||!T&&a(I,h)||!d(I,T)&&"function"==typeof $};n.props(function(){t.set("rootPath",E=m+"."+w),t.set("key",S=w.toString()),t.set("path",I=E.substr(c.length)),t.set("_data",k=h),"string"==typeof k&&k.indexOf("\n")>-1&&t.set("_data",k=k.split("\n")),k&&t.set("dataKeys",L=r(k).sort()),void 0===k&&t.set("_data",k=h),void 0===k&&t.set("_data",k={}),t.set("_query",T=_||""),t.props.root?t.set("expanded",C=!0):T&&t.set("expanded",C=!d(w,T)),_&&!T&&t.set("expanded",C=D()),t.update()});var B=function(e,t){return p(t)?e+":"+(0,i["default"])(String(e)):e+"["+(0,s["default"])(t)+"]"},F=function(e){return t.el(["Highlighter",1],{string:e,highlight:T})},j=function(e,n,o,i){return t.el(["Label",1],{val:n,editable:i,onSet:function(e){return V([o,e])}})},P={},z=void 0;n.change(function(){t.set("is",P["function"]=(0,u.isFunction)(k),P,!0),t.set("is",P.array=(0,u.isArray)(k),P,!0),t.set("is",P.object=(0,u.isObject)(k),P,!0),t.set("is",P.string=(0,u.isString)(k),P,!0),t.set("is",P.number=(0,u.isNumber)(k),P,!0),t.set("is",P.nested=P["function"]||P.object||P.array,P,!0),t.set("is",P.literal=!P.nested,P,!0),t.set("type",z=typeof k)}),t.render(function(){return t.el(["leaf",1],{className:E},e.iff(!t.props.root)&&t.el(["label",1],{"if":!t.props.root,htmlFor:b,onClick:l},t.el(["key",1],null,t.el(["name",1],null,F(S))),t.el(["colon",1],null,":"),t.el(["value",1],null,e.iff(P["function"])&&t.el(["fn",1],{className:"function","if":P["function"]},t.el(["i",1],null,"fn (",g(k).join(", "),")")),e.iff(P.array)&&t.el(["array",1],{"if":P.array},t.el(["type",1],null,"Array[",k.length,"]")),e.iff(P.object)&&t.el(["obj",1],{"if":P.object},t.el(["type",2],null,"{} "+L.length+" keys")),e.iff(P.nested)&&t.el(["nested",1],{"if":P.nested,className:z.toLowerCase()},e.iff(P.string)&&t.el(["str",1],{"if":P.string},F((0,f["default"])(String(k),25))),e.iff(!P.string&&P.literal)&&t.el(["else",1],{"if":!P.string&&P.literal},F(String(k))),j("val",k,S,y)))),t.el(["children",1],null,e.iff(C&&!p(k))&&e.range(L).map(function(n,o){return t.el(["child",1,n,o],{"if":C&&!p(k),repeat:L},e.iff(-1==n.indexOf("__"))&&t.el(["Leaf",1,n,o],{"if":-1==n.indexOf("__"),key:B(n,k[n]),onSet:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return V.apply(void 0,[S].concat(t))},data:k[n],editable:y,label:n,prefix:E,onClick:M,id:b,query:T,getOriginal:x?null:$,isExpanded:a}))})))});var N={flexFlow:"row"};o.label=function(e,t){return[N,{position:"relative",color:"rgba(0,0,0,0.8)",opacity:1,alignItems:"baseline"}]},o.key=function(e,t){return[N,{color:"rgba(0,0,0,0.9)",margin:[0],fontWeight:"bold"}]},o.expand=function(e,t){return[N,{}]},o.value=function(e,t){return[N,{position:"relative",margin:[0,4,0]}]}})})}(),function(){e.file("inspector/section.js",function(t){e.staticStyles("Inspector.Section",{$:"#_flintdevtools .ViewInspector-Section",$body:"#_flintdevtools body.Inspector-Section, #_flintdevtools .Inspector-Section.body, #_flintdevtools .ViewInspector-Section.body, #_flintdevtools .Inspector-Section > .body",$inactive:"#_flintdevtools inactive.Inspector-Section, #_flintdevtools .Inspector-Section.inactive, #_flintdevtools .ViewInspector-Section.inactive, #_flintdevtools .Inspector-Section > .inactive"},{$:{padding:[5,0]},$body:{padding:[0,12]},$inactive:{display:"none"}}),e.view("Inspector.Section",function(e,t,n){var o=!0;e.render(function(){return e.el(["Inspector.Title",1],{onToggle:function(t){return e.set("open",o=t)}},e.props.title)}),e.render(function(){return e.el(["body",1],null,e.props.children)})})})}();var n=require("babel-runtime/helpers/extends")["default"],t=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector/statetests.js",function(o){var i=o("mouse-event-offset"),r=t(i);e.view("StateTests",function(e,t,n){e.render(function(){return e.el(["Tests.Name",1],null)}),e.render(function(){return e.el(["Tests.Boolean",1],null)}),e.render(function(){return e.el(["Tests.Counter",1],null)}),e.render(function(){return e.el(["Tests.Props",1],null)}),e.render(function(){return e.el(["Tests.Circles",1],null)})}),e.view("Tests.Boolean",function(e,t,n){var o=!1;e.render(function(){return e.el(["h1",1],null,"is tupac dead? ",o.toString())}),e.render(function(){return e.el(["button",1],{onClick:function(){return e.set("dead",o=!o)}},"toggle")})}),e.staticStyles("Tests.Props",{$:"#_flintdevtools .ViewTests-Props"},{$:{marginTop:20}}),e.view("Tests.Props",function(e,t,n){var o="a string";e.render(function(){return e.el(["input",1],{__flintValue:o,__flintOnChange:function(t){e.setImmediate("name",o=t.target.value)}})}),e.render(function(){return e.el(["Test.PropsChild",1],{name:o})})}),e.view("Test.PropsChild",function(e,t,n){var o=e.prop("name",void 0);t.props(function(){o=e.getProp("name")});var i=0;e.render(function(){return e.el(["h1",1],null,"my name is ",o)}),e.render(function(){return e.el(["h4",1],null,"counter to test state ",i)}),e.render(function(){return e.el(["button",1],{onClick:function(){return e.set("count",i++,i,!0)}},"up")})}),e.view("Tests.Counter",function(e,t,n){var o=0;e.render(function(){return e.el(["h1",1],null,"count is ",o)}),e.render(function(){return e.el(["button",1],{onClick:function(){return e.set("count",o++,o,!0)}},"up")}),e.render(function(){return e.el(["button",2],{onClick:function(){return e.set("count",o--,o,!0)}},"down")})}),e.view("Tests.Deep",function(e,t,n){var o={name:"nick",tools:["js","juggling balls","coffee"]};e.render(function(){return e.el(["h1",1],null,"deep")}),e.render(function(){return e.el(["h2",1],null,JSON.stringify(o))})}),e.view("Tests.Name",function(e,t,n){var o="nick",i="cammarata";e.render(function(){return e.el(["h2",1],null,"name is ",o," ",i)}),e.render(function(){return e.el(["input",1],{__flintValue:o,__flintOnChange:function(t){e.setImmediate("first",o=t.target.value)}})}),e.render(function(){return e.el(["input",2],{__flintValue:i,__flintOnChange:function(t){e.setImmediate("last",i=t.target.value)}})}),e.render(function(){return e.el(["button",1],{onClick:function(){e.set("first",o="nate"),e.set("last",i="wienert")}},"nateify")})}),e.staticStyles("Tests.Circles",{$circles:"#_flintdevtools circles.Tests-Circles, #_flintdevtools .Tests-Circles.circles, #_flintdevtools .ViewTests-Circles.circles, #_flintdevtools .Tests-Circles > .circles"},{$circles:{position:"relative",background:"#eee",height:400,width:400}}),e.view("Tests.Circles",function(t,n,o){function i(e){t.set("coords",l.push((0,r["default"])(e)),l,!0)}var l=[[200,200]]; | ||
t.render(function(){return t.el(["circles",1],{onClick:i},e.range(l).map(function(e,n){return t.el(["Tests.Circle",1,e,n],{repeat:l,key:""+e[0]+e[1],left:e[0],top:e[1]})}))})}),e.view("Tests.Circle",function(e,t,o){var i=function(){return Math.round(255*Math.random())},r={background:[i(),i(),i()],position:"absolute",top:e.props.top,left:e.props.left,width:118,height:29,borderRadius:27},l=function(e){return n({},r,{transform:{scale:e}})};e.render(function(){return e.el(["circle",1],{style:l(1)})})})})}(),function(){e.file("inspector/title.js",function(t){e.staticStyles("Inspector.Title",{$title:"#_flintdevtools title.Inspector-Title, #_flintdevtools .Inspector-Title.title, #_flintdevtools .ViewInspector-Title.title, #_flintdevtools .Inspector-Title > .title",$closed:"#_flintdevtools closed.Inspector-Title, #_flintdevtools .Inspector-Title.closed, #_flintdevtools .ViewInspector-Title.closed, #_flintdevtools .Inspector-Title > .closed",$inner:"#_flintdevtools inner.Inspector-Title, #_flintdevtools .Inspector-Title.inner, #_flintdevtools .ViewInspector-Title.inner, #_flintdevtools .Inspector-Title > .inner"},{$title:{fontWeight:300,borderBottom:"1px solid #eee",height:10,margin:[5,5,8],color:"#999",flexFlow:"row"},$closed:{marginTop:1},$inner:{padding:[4,10],background:"#fff"}}),e.view("Inspector.Title",function(e,t,n){function o(){e.props.onToggle&&(e.set("open",i=!i),e.props.onToggle(i))}var i=!0;e.render(function(){return e.el(["title",1],{onClick:o},e.el(["inner",1],null,e.props.children))}),n.closed=function(e,t){return{transform:{scale:.8}}},n.inner=function(e,t){return{margin:[-2,"auto"]}}})})}();var t=require("babel-runtime/helpers/interop-require-default")["default"];!function(){e.file("inspector/tree.js",function(n){var o=n("../lib/lens"),i=t(o);e.staticStyles("Tree",{$:"#_flintdevtools .ViewTree"},{$:{pointerEvents:"auto",marginLeft:-10}}),e.viewRoots.Tree="Leaf",e.view("Tree",function(e,t,n){var o="",r=function(t){return(0,i["default"])(e.props.data,t)};e.render(function(){return e.el(["Leaf",1],{data:e.props.data,onClick:e.props.onClick,id:e.props.id,getOriginal:r,query:o,label:"root",editable:e.props.editable,root:!0,validateQuery:function(e){return e.length>=2},isExpanded:e.props.isExpanded||function(){return!1},interactiveLabel:e.props.interactiveLabel,onSet:function(){for(var t=arguments.length,n=Array(t),o=0;t>o;o++)n[o]=arguments[o];return e.props.onSet(n)}})})})})}();var r=require("babel-runtime/core-js/object/keys")["default"];!function(){e.file("inspector/view.js",function(t){function n(e){var t=e.split(",");return t[t.length-1].split("-")[0]}function o(e){var t=["if","repeat","style","yield","__flint"];return i.omit.apply(null,[e].concat(t))}var i=t("lodash");e.staticStyles("Inspector.View",{$view:"#_flintdevtools view.Inspector-View, #_flintdevtools .Inspector-View.view, #_flintdevtools .ViewInspector-View.view, #_flintdevtools .Inspector-View > .view",$top:"#_flintdevtools top.Inspector-View, #_flintdevtools .Inspector-View.top, #_flintdevtools .ViewInspector-View.top, #_flintdevtools .Inspector-View > .top",$active:"#_flintdevtools active.Inspector-View, #_flintdevtools .Inspector-View.active, #_flintdevtools .ViewInspector-View.active, #_flintdevtools .Inspector-View > .active",$highlight:"#_flintdevtools highlight.Inspector-View, #_flintdevtools .Inspector-View.highlight, #_flintdevtools .ViewInspector-View.highlight, #_flintdevtools .Inspector-View > .highlight",$Close:"#_flintdevtools .ViewInspector-View .ViewClose",$name:"#_flintdevtools name.Inspector-View, #_flintdevtools .Inspector-View.name, #_flintdevtools .ViewInspector-View.name, #_flintdevtools .Inspector-View > .name",$edit:"#_flintdevtools edit.Inspector-View, #_flintdevtools .Inspector-View.edit, #_flintdevtools .ViewInspector-View.edit, #_flintdevtools .Inspector-View > .edit",$expanded:"#_flintdevtools expanded.Inspector-View, #_flintdevtools .Inspector-View.expanded, #_flintdevtools .ViewInspector-View.expanded, #_flintdevtools .Inspector-View > .expanded",$input:"#_flintdevtools input.Inspector-View, #_flintdevtools .Inspector-View.input, #_flintdevtools .ViewInspector-View.input, #_flintdevtools .Inspector-View > .input",$title:"#_flintdevtools title.Inspector-View, #_flintdevtools .Inspector-View.title, #_flintdevtools .ViewInspector-View.title, #_flintdevtools .Inspector-View > .title",$section:"#_flintdevtools section.Inspector-View, #_flintdevtools .Inspector-View.section, #_flintdevtools .ViewInspector-View.section, #_flintdevtools .Inspector-View > .section"},{$view:{position:"relative",pointerEvents:"auto",margin:10,marginBottom:0,padding:[0,0,1],minWidth:220,minHeight:34,fontSize:12,userSelect:"none",cursor:"default",background:"#fff",boxShadow:"0px 2px 16px rgba(0,0,0,0.2)",border:"1px solid #ccc",borderRadius:5,color:"#333",transition:"all ease-in 60ms",opacity:0},$top:{flexFlow:"row"},$active:{opacity:1},$highlight:{border:"2px solid #afb4e2"},$Close:{top:-5,right:-5,fontSize:13},$name:{fontWeight:400,color:"rgba(0,0,0,0.8)",padding:[8,8,0],fontSize:14},$edit:{padding:[8,8,0],fontSize:14,marginLeft:4,fontWeight:400,color:"rgba(24, 101, 227, 0.8)"},$expanded:{},$input:{borderRadius:100,border:"1px solid #ccc",width:"100%",padding:[2,12],color:"#333",fontSize:14},$title:{display:"none",color:"#333",fontWeight:200,fontSize:12,margin:[3,0]},$section:{background:[0,0,0,.05]}}),e.view("Inspector.View",function(t,i,l){function s(e){t.props.writeBack(u,e)}var a=t.prop("highlight",void 0),f=t.prop("closing",void 0),u=t.prop("path",void 0),c=t.prop("onClose",void 0);i.props(function(){a=t.getProp("highlight"),f=t.getProp("closing"),u=t.getProp("path"),c=t.getProp("onClose")});var d=window.Flint.inspect,p=void 0,v=!1,g={},h=null,m=null;i.delay(60,function(){t.set("active",v=!0)}),i.unmount(function(){delete window._Flint.inspector[u]}),i.props(function(){f===!0&&t.set("active",v=!1),u&&(t.set("name",p=n(u)),_Flint.inspector[u]||d(u,function(e,n,i){console.log("props are",e),t.set("props",h=o(e||{})),t.set("state",g=n||{}),t.set("writeBack",m=i),t.update()}))});var _=function(e){return e&&r(e).length>0},w=function(){return _DT.messageEditor({type:"focus:element",view:p})};t.render(function(){return t.el(["view",1],{className:{active:v,highlight:a}},t.el(["Close",1],{onClick:c,fontSize:20,size:35}),t.el(["top",1],null,t.el(["name",1],null,p),e.iff(!1)&&t.el(["edit",1],{"if":!1,onClick:w},"edit")),e.iff(_(h))&&t.el(["Inspector.Section",1],{title:"Props","if":_(h),className:"props"},t.el(["Tree",1],{editable:!1,data:h})),e.iff(_(g))&&t.el(["Inspector.Section",2],{title:"State","if":_(g)},t.el(["Tree",2],{editable:!0,onSet:s,data:g})))}),l.view=function(e,t){return{transform:{x:20}}},l.active=function(e,t){return{transform:{x:0}}},l.name=function(e,t){return{margin:[0,0,-6]}},l.edit=function(e,t){return{margin:[0,0,-6]}},l.expanded=function(e,t){return{transform:{y:0}}}})})}(),function(){e.file("npm/installer.js",function(t){var n=window._DT;e.view("Installer",function(t,o,i){var r="",l=[],s="",a="",f=0;n.on("package:install",function(){t.set("state",f=1),t.set("name",s=n.data.name)}),n.on("package:installed",function(){t.set("state",f=2),setTimeout(function(){return t.set("state",f=0)},2e3)}),n.on("package:error",function(){t.set("state",f=3),t.set("name",s=n.data.name),t.set("error",a=n.data.error),setTimeout(function(){return t.set("state",f=0)},2e3)}),n.on("package:select",function(){t.set("state",f=4),t.set("versions",l=n.data.versions)});var u=function(e){t.set("version",r=e),n.data.version=e,n.emitter.emit("package:select"),t.set("state",f=1)},c=function(){return t.set("state",f=0)},d=function(e){switch(e){case 1:return"Installing "+s+(r?" "+r:"")+"...";case 2:return"Installed "+s+"!";case 3:return"Error: "+s;case 4:return"Select version"}},p=function(e){switch(e){case 1:return null;case 2:return null;case 3:return a;case 4:return t.el(["Versions",1],{versions:l,onSelect:u})}};t.render(function(){return t.el(["FlintModal",1],{open:f>0,onClose:c,title:d(f),titleColor:3==f?"#8c1919":"#0f8c3c"},e.iff(!1)&&t.el(["InstallerLoading",1],{"if":!1}),p(f))})}),e.staticStyles("Versions",{$version:"#_flintdevtools version.Versions, #_flintdevtools .Versions.version, #_flintdevtools .ViewVersions.version, #_flintdevtools .Versions > .version",$inner:"#_flintdevtools inner.Versions, #_flintdevtools .Versions.inner, #_flintdevtools .ViewVersions.inner, #_flintdevtools .Versions > .inner",$v:"#_flintdevtools v.Versions, #_flintdevtools .Versions.v, #_flintdevtools .ViewVersions.v, #_flintdevtools .Versions > .v",$info:"#_flintdevtools info.Versions, #_flintdevtools .Versions.info, #_flintdevtools .ViewVersions.info, #_flintdevtools .Versions > .info"},{$version:{textAlign:"left",padding:[2,4],borderRadius:2},$inner:{flexFlow:"row"},$v:{flexGrow:1,fontWeight:"bold"},$info:{}}),e.view("Versions",function(t,n,o){t.render(function(){return e.range(t.props.versions).map(function(e,n){return t.el(["version",1,e,n],{repeat:t.props.versions,onClick:function(){return t.props.onSelect(e)}},t.el(["inner",1,e,n],null,t.el(["v",1,e,n],{key:"v"+n},e.version),t.el(["info",1,e,n],null,e.description),t.el(["a",1,e,n],{href:e.homepage,target:"_blank"},"Info")))})}),o.v=function(e,t){return{":hover":{background:"#fff",cursor:"pointer"}}}})})}(),e.start()}(e)}; | ||
//# sourceMappingURL=flinttools.js.map |
@@ -1,394 +0,2 @@ | ||
exports["flinttools-internals"] = | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var packages = {} | ||
packages["keys"] = __webpack_require__(1); | ||
packages["lib/createFilterer"] = __webpack_require__(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); | ||
window.require.setApp("flinttools") | ||
module.exports = packages | ||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _interopRequireDefault = __webpack_require__(2).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _keycode = __webpack_require__(3); | ||
var _keycode2 = _interopRequireDefault(_keycode); | ||
var keys = {}; | ||
exports.keys = keys; | ||
var listeners = {}; | ||
var pressListeners = {}; | ||
on.keydown(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
keys[code] = true; | ||
keyDown(code); | ||
}); | ||
on.keyup(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
keys[code] = false; | ||
keyUp(code); | ||
}); | ||
on.keypress(window, function (e) { | ||
var code = (0, _keycode2.default)(e.keyCode); | ||
var queue = pressListeners[code]; | ||
queue && queue.forEach(function (listener) { | ||
return listener(); | ||
}); | ||
}); | ||
function keyDown(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(true); | ||
}); | ||
} | ||
function keyUp(code) { | ||
if (!listeners[code]) return; | ||
listeners[code].forEach(function (listener) { | ||
return listener(false); | ||
}); | ||
} | ||
function onKey(code, fn) { | ||
listeners[code] = listeners[code] || []; | ||
listeners[code].push(fn); | ||
} | ||
exports.onKey = onKey; | ||
function onKeyPress(code, fn) { | ||
pressListeners[code] = pressListeners[code] || []; | ||
pressListeners[code].push(fn); | ||
} | ||
exports.onKeyPress = onKeyPress; | ||
function onKeyDown(code, fn) { | ||
onKey(code, function (val) { | ||
return val && fn(); | ||
}); | ||
} | ||
exports.onKeyDown = onKeyDown; | ||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("babel-runtime/helpers/interop-require-default"); | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("keycode"); | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$assign = __webpack_require__(5).default; | ||
var _Object$keys = __webpack_require__(6).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var assign = _Object$assign; | ||
var keys = _Object$keys; | ||
function createFilterer(data, options) { | ||
options || (options = {}); | ||
var cache = {}; | ||
return function (query) { | ||
var subquery; | ||
if (!cache[query]) { | ||
for (var i = query.length - 1; i > 0; i -= 1) { | ||
subquery = query.substr(0, i); | ||
if (cache[subquery]) { | ||
cache[query] = find(cache[subquery], query, options); | ||
break; | ||
} | ||
} | ||
} | ||
if (!cache[query]) { | ||
cache[query] = find(data, query, options); | ||
} | ||
return cache[query]; | ||
}; | ||
} | ||
exports.default = createFilterer; | ||
; | ||
function find(data, query, options) { | ||
return keys(data).reduce(function (acc, key) { | ||
var value = data[key]; | ||
var matches; | ||
if (isPrimitive(value)) { | ||
if (contains(query, key, options) || contains(query, value, options)) { | ||
acc[key] = value; | ||
} | ||
} else { | ||
if (contains(query, key, options)) { | ||
acc[key] = value; | ||
} else { | ||
matches = find(value, query, options); | ||
if (!isEmpty(matches)) { | ||
assign(acc, pair(key, matches)); | ||
} | ||
} | ||
} | ||
return acc; | ||
}, {}); | ||
} | ||
function contains(query, string, options) { | ||
if (options.ignoreCase) { | ||
query = String(query).toLowerCase(); | ||
return string && String(string).toLowerCase().indexOf(query) !== -1; | ||
} else { | ||
return string && String(string).indexOf(query) !== -1; | ||
} | ||
} | ||
function isPrimitive(value) { | ||
var t = getType(value); | ||
return t !== 'Object' && t !== 'Array'; | ||
} | ||
function pair(key, value) { | ||
var p = {}; | ||
p[key] = value; | ||
return p; | ||
} | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("babel-runtime/core-js/object/assign"); | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports) { | ||
module.exports = require("babel-runtime/core-js/object/keys"); | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function getType(value) { | ||
return Object.prototype.toString.call(value).slice(8, -1); | ||
} | ||
exports.default = getType; | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 8 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var _Object$keys = __webpack_require__(6).default; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var el = undefined; | ||
var reactKey = null; | ||
var getReactKey = function getReactKey(el) { | ||
return _Object$keys(el).filter(function (k) { | ||
return k.indexOf('__reactInternalInst') == 0; | ||
})[0]; | ||
}; | ||
function getReactId(el) { | ||
if (!reactKey) reactKey = getReactKey(el); | ||
if (!el[reactKey]) return; | ||
var current = el[reactKey]._currentElement; | ||
if (!current || !current.key) return null; | ||
var key = current.key; | ||
var split = key.split('$'); | ||
return split[split.length - 1]; | ||
} | ||
var Inspecting = { | ||
set: function set(_) { | ||
el = _; | ||
}, | ||
get: function get() { | ||
return el; | ||
}, | ||
props: function props(el) { | ||
return { | ||
key: getReactId(el), | ||
el: el.tagName.toLowerCase(), | ||
view: el.className.split(' ').filter(function (s) { | ||
return s.substr(0, 4) != 'View'; | ||
}).filter(function (s) { | ||
return s.charAt(0).toUpperCase() == s.charAt(0); | ||
})[0] | ||
}; | ||
}, | ||
all: function all() { | ||
var cur = el; | ||
var parents = [this.props(cur)]; | ||
// walk upwards, find unique views | ||
while (cur.parentNode && cur.parentNode.tagName) { | ||
var _parent = cur.parentNode; | ||
var last = parents[parents.length - 1]; | ||
var next = this.props(_parent); | ||
if (next.view && next.view != last.view) { | ||
// filter __flintfocus | ||
if (next.view[0] != '_') { | ||
parents.push(next); | ||
} | ||
} | ||
cur = _parent; | ||
} | ||
return parents; | ||
} | ||
}; | ||
exports.default = Inspecting; | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 9 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var PATH_DELIMITER = '.'; | ||
function lens(data, path) { | ||
var p = path.split(PATH_DELIMITER); | ||
var segment = p.shift(); | ||
if (!segment) { | ||
return data; | ||
} | ||
var t = getType(data); | ||
if (t === 'Array' && data[integer(segment)]) { | ||
return lens(data[integer(segment)], p.join(PATH_DELIMITER)); | ||
} else if (t === 'Object' && data[segment]) { | ||
return lens(data[segment], p.join(PATH_DELIMITER)); | ||
} | ||
} | ||
exports.default = lens; | ||
function integer(string) { | ||
return parseInt(string, 10); | ||
} | ||
module.exports = exports.default; | ||
/***/ }, | ||
/* 10 */ | ||
/***/ function(module, exports) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var id = Math.ceil(Math.random() * 10); | ||
function uid() { | ||
return id++; | ||
} | ||
exports.default = uid; | ||
module.exports = exports.default; | ||
/***/ } | ||
/******/ ]); | ||
exports["flinttools-internals"]=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r={};r.keys=n(1),r["lib/createFilterer"]=n(2),r["lib/getType"]=n(5),r["lib/inspecting"]=n(6),r["lib/lens"]=n(7),r["lib/uid"]=n(8),window.require.setApp("flinttools"),e.exports=r},function(e,t){function n(e){f[e]&&f[e].forEach(function(e){return e(!0)})}function r(e){f[e]&&f[e].forEach(function(e){return e(!1)})}function o(e,t){f[e]=f[e]||[],f[e].push(t)}function u(e,t){c[e]=c[e]||[],c[e].push(t)}function i(e,t){o(e,function(e){return e&&t()})}Object.defineProperty(t,"__esModule",{value:!0});var a={};t.keys=a;var f={},c={};on.keydown(window,function(e){var t=___keycode(e.keyCode);a[t]=!0,n(t)}),on.keyup(window,function(e){var t=___keycode(e.keyCode);a[t]=!1,r(t)}),on.keypress(window,function(e){var t=___keycode(e.keyCode),n=c[t];n&&n.forEach(function(e){return e()})}),t.onKey=o,t.onKeyPress=u,t.onKeyDown=i},function(e,t,n){function r(e,t){t||(t={});var n={};return function(r){var u;if(!n[r])for(var i=r.length-1;i>0;i-=1)if(u=r.substr(0,i),n[u]){n[r]=o(n[u],r,t);break}return n[r]||(n[r]=o(e,r,t)),n[r]}}function o(e,t,n){return s(e).reduce(function(r,f){var c,s=e[f];return i(s)?(u(t,f,n)||u(t,s,n))&&(r[f]=s):u(t,f,n)?r[f]=s:(c=o(s,t,n),isEmpty(c)||l(r,a(f,c))),r},{})}function u(e,t,n){return n.ignoreCase?(e=String(e).toLowerCase(),t&&-1!==String(t).toLowerCase().indexOf(e)):t&&-1!==String(t).indexOf(e)}function i(e){var t=getType(e);return"Object"!==t&&"Array"!==t}function a(e,t){var n={};return n[e]=t,n}var f=n(3)["default"],c=n(4)["default"];Object.defineProperty(t,"__esModule",{value:!0});var l=f,s=c;t["default"]=r,e.exports=t["default"]},function(e,t){e.exports=require("babel-runtime/core-js/object/assign")},function(e,t){e.exports=require("babel-runtime/core-js/object/keys")},function(e,t){function n(e){return Object.prototype.toString.call(e).slice(8,-1)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(e){if(i||(i=a(e)),e[i]){var t=e[i]._currentElement;if(!t||!t.key)return null;var n=t.key,r=n.split("$");return r[r.length-1]}}var o=n(4)["default"];Object.defineProperty(t,"__esModule",{value:!0});var u=void 0,i=null,a=function(e){return o(e).filter(function(e){return 0==e.indexOf("__reactInternalInst")})[0]},f={set:function(e){u=e},get:function(){return u},props:function(e){return{key:r(e),el:e.tagName.toLowerCase(),view:e.className.split(" ").filter(function(e){return"View"!=e.substr(0,4)}).filter(function(e){return e.charAt(0).toUpperCase()==e.charAt(0)})[0]}},all:function(){for(var e=u,t=[this.props(e)];e.parentNode&&e.parentNode.tagName;){var n=e.parentNode,r=t[t.length-1],o=this.props(n);o.view&&o.view!=r.view&&"_"!=o.view[0]&&t.push(o),e=n}return t}};t["default"]=f,e.exports=t["default"]},function(e,t){function n(e,t){var u=t.split(o),i=u.shift();if(!i)return e;var a=getType(e);return"Array"===a&&e[r(i)]?n(e[r(i)],u.join(o)):"Object"===a&&e[i]?n(e[i],u.join(o)):void 0}function r(e){return parseInt(e,10)}Object.defineProperty(t,"__esModule",{value:!0});var o=".";t["default"]=n,e.exports=t["default"]},function(e,t){function n(){return r++}Object.defineProperty(t,"__esModule",{value:!0});var r=Math.ceil(10*Math.random());t["default"]=n,e.exports=t["default"]}]); | ||
//# sourceMappingURL=internals.js.map | ||
//# sourceMappingURL=internals.js.map |
{ | ||
"name": "flint-tools", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"dependencies": { | ||
"clone": { | ||
"version": "1.0.2", | ||
"from": "clone@>=1.0.2 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz" | ||
}, | ||
"ellipsize": { | ||
@@ -17,3 +12,3 @@ "version": "0.0.2", | ||
"version": "2.1.0", | ||
"from": "keycode@latest", | ||
"from": "keycode@>=2.1.0 <3.0.0", | ||
"resolved": "https://registry.npmjs.org/keycode/-/keycode-2.1.0.tgz" | ||
@@ -23,3 +18,3 @@ }, | ||
"version": "4.1.0", | ||
"from": "lodash@>=4.0.1 <5.0.0", | ||
"from": "lodash@>=4.1.0 <5.0.0", | ||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.1.0.tgz" | ||
@@ -26,0 +21,0 @@ }, |
@@ -6,7 +6,6 @@ { | ||
"description": "tools", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"dependencies": { | ||
"clone": "^1.0.2", | ||
"ellipsize": "0.0.2", | ||
@@ -13,0 +12,0 @@ "keycode": "^2.1.0", |
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 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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
5251963
19709
3
- Removedclone@^1.0.2
- Removedclone@1.0.4(transitive)