fear(tasks): add build for graph example
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
|
||||||
.cache
|
.cache
|
||||||
|
node_modules
|
||||||
|
example/build
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
.react-graph {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__renderer {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__zoompane {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__selectionpane {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__selection {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
background: rgba(0, 89, 220, 0.08);
|
|
||||||
border: 1px dotted rgba(0, 89, 220, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edges {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edge {
|
|
||||||
fill: none;
|
|
||||||
stroke: #333;
|
|
||||||
stroke-width: 2;
|
|
||||||
pointer-events: all;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edge.selected {
|
|
||||||
stroke: #ff5050;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__nodes {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 3;
|
|
||||||
pointer-events: none;
|
|
||||||
transform-origin: 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__node {
|
|
||||||
position: absolute;
|
|
||||||
color: #222;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: center;
|
|
||||||
cursor: -webkit-grab;
|
|
||||||
cursor: grab;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
pointer-events: all;
|
|
||||||
transform-origin: 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__node:hover > * {
|
|
||||||
box-shadow: 0 1px 5px 2px rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__node.selected > * {
|
|
||||||
box-shadow: 0 0 0 2px #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__handle {
|
|
||||||
position: absolute;
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
background: #222;
|
|
||||||
left: 50%;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__nodesselection {
|
|
||||||
z-index: 3;
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
transform-origin: left top;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__nodesselection-rect {
|
|
||||||
position: absolute;
|
|
||||||
background: rgba(0, 89, 220, 0.08);
|
|
||||||
border: 1px dotted rgba(0, 89, 220, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*# sourceMappingURL=/ReactGraph.ba0da17b.css.map */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["../dist/ReactGraph.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"ReactGraph.ba0da17b.css","sourceRoot":"..","sourcesContent":[".react-graph {\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.react-graph__renderer {\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\n.react-graph__zoompane {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n}\n\n.react-graph__selectionpane {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n}\n\n.react-graph__selection {\n position: absolute;\n top: 0;\n left: 0;\n background: rgba(0, 89, 220, 0.08);\n border: 1px dotted rgba(0, 89, 220, 0.8);\n}\n\n.react-graph__edges {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n z-index: 2;\n}\n\n.react-graph__edge {\n fill: none;\n stroke: #333;\n stroke-width: 2;\n pointer-events: all;\n}\n\n.react-graph__edge.selected {\n stroke: #ff5050;\n }\n\n.react-graph__nodes {\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 3;\n pointer-events: none;\n transform-origin: 0 0;\n}\n\n.react-graph__node {\n position: absolute;\n color: #222;\n font-family: sans-serif;\n font-size: 12px;\n text-align: center;\n cursor: -webkit-grab;\n cursor: grab;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n pointer-events: all;\n transform-origin: 0 0;\n}\n\n.react-graph__node:hover > * {\n box-shadow: 0 1px 5px 2px rgba(0, 0, 0, 0.08);\n }\n\n.react-graph__node.selected > * {\n box-shadow: 0 0 0 2px #000;\n }\n\n.react-graph__handle {\n position: absolute;\n width: 12px;\n height: 12px;\n transform: translate(-50%, -50%);\n background: #222;\n left: 50%;\n border-radius: 50%;\n}\n\n.react-graph__nodesselection {\n z-index: 3;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n transform-origin: left top;\n pointer-events: none;\n}\n\n.react-graph__nodesselection-rect {\n position: absolute;\n background: rgba(0, 89, 220, 0.08);\n border: 1px dotted rgba(0, 89, 220, 0.8);\n }"]}
|
|
||||||
@@ -1,396 +0,0 @@
|
|||||||
// modules are defined as an array
|
|
||||||
// [ module function, map of requires ]
|
|
||||||
//
|
|
||||||
// map of requires is short require name -> numeric require
|
|
||||||
//
|
|
||||||
// anything defined in a previous bundle is accessed via the
|
|
||||||
// orig method which is the require for previous bundles
|
|
||||||
parcelRequire = (function (modules, cache, entry, globalName) {
|
|
||||||
// Save the require from previous bundle to this closure if any
|
|
||||||
var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
|
|
||||||
var nodeRequire = typeof require === 'function' && require;
|
|
||||||
|
|
||||||
function newRequire(name, jumped) {
|
|
||||||
if (!cache[name]) {
|
|
||||||
if (!modules[name]) {
|
|
||||||
// if we cannot find the module within our internal map or
|
|
||||||
// cache jump to the current global require ie. the last bundle
|
|
||||||
// that was added to the page.
|
|
||||||
var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
|
|
||||||
if (!jumped && currentRequire) {
|
|
||||||
return currentRequire(name, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there are other bundles on this page the require from the
|
|
||||||
// previous one is saved to 'previousRequire'. Repeat this as
|
|
||||||
// many times as there are bundles until the module is found or
|
|
||||||
// we exhaust the require chain.
|
|
||||||
if (previousRequire) {
|
|
||||||
return previousRequire(name, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try the node require function if it exists.
|
|
||||||
if (nodeRequire && typeof name === 'string') {
|
|
||||||
return nodeRequire(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
var err = new Error('Cannot find module \'' + name + '\'');
|
|
||||||
err.code = 'MODULE_NOT_FOUND';
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
|
|
||||||
localRequire.resolve = resolve;
|
|
||||||
localRequire.cache = {};
|
|
||||||
|
|
||||||
var module = cache[name] = new newRequire.Module(name);
|
|
||||||
|
|
||||||
modules[name][0].call(module.exports, localRequire, module, module.exports, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cache[name].exports;
|
|
||||||
|
|
||||||
function localRequire(x){
|
|
||||||
return newRequire(localRequire.resolve(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolve(x){
|
|
||||||
return modules[name][1][x] || x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Module(moduleName) {
|
|
||||||
this.id = moduleName;
|
|
||||||
this.bundle = newRequire;
|
|
||||||
this.exports = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
newRequire.isParcelRequire = true;
|
|
||||||
newRequire.Module = Module;
|
|
||||||
newRequire.modules = modules;
|
|
||||||
newRequire.cache = cache;
|
|
||||||
newRequire.parent = previousRequire;
|
|
||||||
newRequire.register = function (id, exports) {
|
|
||||||
modules[id] = [function (require, module) {
|
|
||||||
module.exports = exports;
|
|
||||||
}, {}];
|
|
||||||
};
|
|
||||||
|
|
||||||
var error;
|
|
||||||
for (var i = 0; i < entry.length; i++) {
|
|
||||||
try {
|
|
||||||
newRequire(entry[i]);
|
|
||||||
} catch (e) {
|
|
||||||
// Save first error but execute all entries
|
|
||||||
if (!error) {
|
|
||||||
error = e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entry.length) {
|
|
||||||
// Expose entry point to Node, AMD or browser globals
|
|
||||||
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
|
|
||||||
var mainExports = newRequire(entry[entry.length - 1]);
|
|
||||||
|
|
||||||
// CommonJS
|
|
||||||
if (typeof exports === "object" && typeof module !== "undefined") {
|
|
||||||
module.exports = mainExports;
|
|
||||||
|
|
||||||
// RequireJS
|
|
||||||
} else if (typeof define === "function" && define.amd) {
|
|
||||||
define(function () {
|
|
||||||
return mainExports;
|
|
||||||
});
|
|
||||||
|
|
||||||
// <script>
|
|
||||||
} else if (globalName) {
|
|
||||||
this[globalName] = mainExports;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override the current require with this new one
|
|
||||||
parcelRequire = newRequire;
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
// throw error from earlier, _after updating parcelRequire_
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return newRequire;
|
|
||||||
})({"../node_modules/parcel-bundler/src/builtins/bundle-url.js":[function(require,module,exports) {
|
|
||||||
var bundleURL = null;
|
|
||||||
|
|
||||||
function getBundleURLCached() {
|
|
||||||
if (!bundleURL) {
|
|
||||||
bundleURL = getBundleURL();
|
|
||||||
}
|
|
||||||
|
|
||||||
return bundleURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getBundleURL() {
|
|
||||||
// Attempt to find the URL of the current script and use that as the base URL
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
} catch (err) {
|
|
||||||
var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);
|
|
||||||
|
|
||||||
if (matches) {
|
|
||||||
return getBaseURL(matches[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
function getBaseURL(url) {
|
|
||||||
return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^/]+$/, '$1') + '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.getBundleURL = getBundleURLCached;
|
|
||||||
exports.getBaseURL = getBaseURL;
|
|
||||||
},{}],"../node_modules/parcel-bundler/src/builtins/css-loader.js":[function(require,module,exports) {
|
|
||||||
var bundle = require('./bundle-url');
|
|
||||||
|
|
||||||
function updateLink(link) {
|
|
||||||
var newLink = link.cloneNode();
|
|
||||||
|
|
||||||
newLink.onload = function () {
|
|
||||||
link.remove();
|
|
||||||
};
|
|
||||||
|
|
||||||
newLink.href = link.href.split('?')[0] + '?' + Date.now();
|
|
||||||
link.parentNode.insertBefore(newLink, link.nextSibling);
|
|
||||||
}
|
|
||||||
|
|
||||||
var cssTimeout = null;
|
|
||||||
|
|
||||||
function reloadCSS() {
|
|
||||||
if (cssTimeout) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cssTimeout = setTimeout(function () {
|
|
||||||
var links = document.querySelectorAll('link[rel="stylesheet"]');
|
|
||||||
|
|
||||||
for (var i = 0; i < links.length; i++) {
|
|
||||||
if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {
|
|
||||||
updateLink(links[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cssTimeout = null;
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = reloadCSS;
|
|
||||||
},{"./bundle-url":"../node_modules/parcel-bundler/src/builtins/bundle-url.js"}],"../dist/ReactGraph.css":[function(require,module,exports) {
|
|
||||||
var reloadCSS = require('_css_loader');
|
|
||||||
|
|
||||||
module.hot.dispose(reloadCSS);
|
|
||||||
module.hot.accept(reloadCSS);
|
|
||||||
},{"_css_loader":"../node_modules/parcel-bundler/src/builtins/css-loader.js"}],"../node_modules/parcel-bundler/src/builtins/hmr-runtime.js":[function(require,module,exports) {
|
|
||||||
var global = arguments[3];
|
|
||||||
var OVERLAY_ID = '__parcel__error__overlay__';
|
|
||||||
var OldModule = module.bundle.Module;
|
|
||||||
|
|
||||||
function Module(moduleName) {
|
|
||||||
OldModule.call(this, moduleName);
|
|
||||||
this.hot = {
|
|
||||||
data: module.bundle.hotData,
|
|
||||||
_acceptCallbacks: [],
|
|
||||||
_disposeCallbacks: [],
|
|
||||||
accept: function (fn) {
|
|
||||||
this._acceptCallbacks.push(fn || function () {});
|
|
||||||
},
|
|
||||||
dispose: function (fn) {
|
|
||||||
this._disposeCallbacks.push(fn);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
module.bundle.hotData = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.bundle.Module = Module;
|
|
||||||
var checkedAssets, assetsToAccept;
|
|
||||||
var parent = module.bundle.parent;
|
|
||||||
|
|
||||||
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
||||||
var hostname = "" || location.hostname;
|
|
||||||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
||||||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "65126" + '/');
|
|
||||||
|
|
||||||
ws.onmessage = function (event) {
|
|
||||||
checkedAssets = {};
|
|
||||||
assetsToAccept = [];
|
|
||||||
var data = JSON.parse(event.data);
|
|
||||||
|
|
||||||
if (data.type === 'update') {
|
|
||||||
var handled = false;
|
|
||||||
data.assets.forEach(function (asset) {
|
|
||||||
if (!asset.isNew) {
|
|
||||||
var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);
|
|
||||||
|
|
||||||
if (didAccept) {
|
|
||||||
handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}); // Enable HMR for CSS by default.
|
|
||||||
|
|
||||||
handled = handled || data.assets.every(function (asset) {
|
|
||||||
return asset.type === 'css' && asset.generated.js;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (handled) {
|
|
||||||
console.clear();
|
|
||||||
data.assets.forEach(function (asset) {
|
|
||||||
hmrApply(global.parcelRequire, asset);
|
|
||||||
});
|
|
||||||
assetsToAccept.forEach(function (v) {
|
|
||||||
hmrAcceptRun(v[0], v[1]);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.type === 'reload') {
|
|
||||||
ws.close();
|
|
||||||
|
|
||||||
ws.onclose = function () {
|
|
||||||
location.reload();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.type === 'error-resolved') {
|
|
||||||
console.log('[parcel] ✨ Error resolved');
|
|
||||||
removeErrorOverlay();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.type === 'error') {
|
|
||||||
console.error('[parcel] 🚨 ' + data.error.message + '\n' + data.error.stack);
|
|
||||||
removeErrorOverlay();
|
|
||||||
var overlay = createErrorOverlay(data);
|
|
||||||
document.body.appendChild(overlay);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeErrorOverlay() {
|
|
||||||
var overlay = document.getElementById(OVERLAY_ID);
|
|
||||||
|
|
||||||
if (overlay) {
|
|
||||||
overlay.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createErrorOverlay(data) {
|
|
||||||
var overlay = document.createElement('div');
|
|
||||||
overlay.id = OVERLAY_ID; // html encode message and stack trace
|
|
||||||
|
|
||||||
var message = document.createElement('div');
|
|
||||||
var stackTrace = document.createElement('pre');
|
|
||||||
message.innerText = data.error.message;
|
|
||||||
stackTrace.innerText = data.error.stack;
|
|
||||||
overlay.innerHTML = '<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;">' + '<span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span>' + '<span style="top: 2px; margin-left: 5px; position: relative;">🚨</span>' + '<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">' + message.innerHTML + '</div>' + '<pre>' + stackTrace.innerHTML + '</pre>' + '</div>';
|
|
||||||
return overlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getParents(bundle, id) {
|
|
||||||
var modules = bundle.modules;
|
|
||||||
|
|
||||||
if (!modules) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
var parents = [];
|
|
||||||
var k, d, dep;
|
|
||||||
|
|
||||||
for (k in modules) {
|
|
||||||
for (d in modules[k][1]) {
|
|
||||||
dep = modules[k][1][d];
|
|
||||||
|
|
||||||
if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {
|
|
||||||
parents.push(k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bundle.parent) {
|
|
||||||
parents = parents.concat(getParents(bundle.parent, id));
|
|
||||||
}
|
|
||||||
|
|
||||||
return parents;
|
|
||||||
}
|
|
||||||
|
|
||||||
function hmrApply(bundle, asset) {
|
|
||||||
var modules = bundle.modules;
|
|
||||||
|
|
||||||
if (!modules) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (modules[asset.id] || !bundle.parent) {
|
|
||||||
var fn = new Function('require', 'module', 'exports', asset.generated.js);
|
|
||||||
asset.isNew = !modules[asset.id];
|
|
||||||
modules[asset.id] = [fn, asset.deps];
|
|
||||||
} else if (bundle.parent) {
|
|
||||||
hmrApply(bundle.parent, asset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hmrAcceptCheck(bundle, id) {
|
|
||||||
var modules = bundle.modules;
|
|
||||||
|
|
||||||
if (!modules) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!modules[id] && bundle.parent) {
|
|
||||||
return hmrAcceptCheck(bundle.parent, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkedAssets[id]) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
checkedAssets[id] = true;
|
|
||||||
var cached = bundle.cache[id];
|
|
||||||
assetsToAccept.push([bundle, id]);
|
|
||||||
|
|
||||||
if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getParents(global.parcelRequire, id).some(function (id) {
|
|
||||||
return hmrAcceptCheck(global.parcelRequire, id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function hmrAcceptRun(bundle, id) {
|
|
||||||
var cached = bundle.cache[id];
|
|
||||||
bundle.hotData = {};
|
|
||||||
|
|
||||||
if (cached) {
|
|
||||||
cached.hot.data = bundle.hotData;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cached && cached.hot && cached.hot._disposeCallbacks.length) {
|
|
||||||
cached.hot._disposeCallbacks.forEach(function (cb) {
|
|
||||||
cb(bundle.hotData);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
delete bundle.cache[id];
|
|
||||||
bundle(id);
|
|
||||||
cached = bundle.cache[id];
|
|
||||||
|
|
||||||
if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
|
|
||||||
cached.hot._acceptCallbacks.forEach(function (cb) {
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},{}]},{},["../node_modules/parcel-bundler/src/builtins/hmr-runtime.js"], null)
|
|
||||||
//# sourceMappingURL=/ReactGraph.ba0da17b.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["../node_modules/parcel-bundler/src/builtins/bundle-url.js","../node_modules/parcel-bundler/src/builtins/css-loader.js"],"names":["bundleURL","getBundleURLCached","getBundleURL","Error","err","matches","stack","match","getBaseURL","url","replace","exports","bundle","require","updateLink","link","newLink","cloneNode","onload","remove","href","split","Date","now","parentNode","insertBefore","nextSibling","cssTimeout","reloadCSS","setTimeout","links","document","querySelectorAll","i","length","module"],"mappings":"AAAA,ACAA,IDAIA,ACAAY,MAAM,GDAG,ACAAC,GDAG,IAAhB,ACAoB,CAAC,cAAD,CAApB;;ADCA,ACCA,SDDSZ,ACCAa,UAAT,CAAoBC,IAApB,EAA0B,CDD1B,GAA8B;AAC5B,ACCA,MDDI,ACCAC,CDDChB,MCCM,GDDX,ACCce,EDDE,ECCE,CAACE,SAAL,EAAd;ADAEjB,IAAAA,SAAS,GAAGE,YAAY,EAAxB;AACD,ACADc,EAAAA,OAAO,CAACE,MAAR,GAAiB,YAAY;AAC3BH,IAAAA,IAAI,CAACI,MAAL;ADCF,ACAC,GAFD,MDEOnB,SAAP;AACD;ACACgB,EAAAA,OAAO,CAACI,IAAR,GAAeL,IAAI,CAACK,IAAL,CAAUC,KAAV,CAAgB,GAAhB,EAAqB,CAArB,IAA0B,GAA1B,GAAgCC,IAAI,CAACC,GAAL,EAA/C;ADEF,ACDER,EAAAA,IAAI,CAACS,EDCEtB,QCDP,CAAgBuB,GDClB,GAAwB,MCDtB,CAA6BT,OAA7B,EAAsCD,IAAI,CAACW,WAA3C;ADEA,ACDD;ADEC,MAAI;AACF,ACDJ,IAAIC,MDCM,IAAIxB,ACDA,GAAG,EDCP,EAAN,ACDJ;ADEG,GAFD,CAEE,OAAOC,GAAP,EAAY;AACZ,ACFJ,QDEQC,CCFCuB,MDEM,GAAG,ACFlB,CDEmB,ECFE,GDEGxB,GAAG,CAACE,KAAV,EAAiBC,KAAjB,CAAuB,+DAAvB,CAAd;ACDF,MAAIoB,UAAJ,EAAgB;ADEd,ACDA,QDCItB,OAAJ,EAAa;AACX,ACDH,aDCUG,UAAU,CAACH,OAAO,CAAC,CAAD,CAAR,CAAjB;AACD;AACF,ACDDsB,EAAAA,UAAU,GAAGE,UAAU,CAAC,YAAY;AAClC,QAAIC,KAAK,GAAGC,QAAQ,CAACC,gBAAT,CAA0B,wBAA1B,CAAZ;ADEF,SAAO,GAAP;AACD,ACFG,SAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,KAAK,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAuC;AACrC,UAAIrB,MAAM,CAACJ,UAAP,CAAkBsB,KAAK,CAACG,CAAD,CAAL,CAASb,IAA3B,MAAqCR,MAAM,CAACV,YAAP,EAAzC,EAAgE;ADGtE,ACFQY,QAAAA,CDECN,SCFS,CDElB,ACFmBsB,CDECrB,GAApB,CCFwB,CDEC,ACFAwB,CAAD,CAAN,CAAV;ADGN,ACFK,SDEE,CAAC,KAAKxB,GAAN,EAAWC,OAAX,CAAmB,sEAAnB,EAA2F,IAA3F,IAAmG,GAA1G;AACD,ACFI;;ADILC,ACFIgB,IAAAA,GDEG,CAACzB,MCFM,GAAG,GDEjB,CCFI,EDEmBD,kBAAvB;AACAU,ACFG,GATsB,EASpB,EDEE,ACXkB,CDWjBH,ACXN,UDWF,GAAqBA,UAArB;ACDC;;AAED2B,MAAM,CAACxB,OAAP,GAAiBiB,SAAjB","file":"ReactGraph.ba0da17b.js","sourceRoot":"..","sourcesContent":["var bundleURL = null;\nfunction getBundleURLCached() {\n if (!bundleURL) {\n bundleURL = getBundleURL();\n }\n\n return bundleURL;\n}\n\nfunction getBundleURL() {\n // Attempt to find the URL of the current script and use that as the base URL\n try {\n throw new Error;\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n return getBaseURL(matches[0]);\n }\n }\n\n return '/';\n}\n\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\n","var bundle = require('./bundle-url');\n\nfunction updateLink(link) {\n var newLink = link.cloneNode();\n newLink.onload = function () {\n link.remove();\n };\n newLink.href = link.href.split('?')[0] + '?' + Date.now();\n link.parentNode.insertBefore(newLink, link.nextSibling);\n}\n\nvar cssTimeout = null;\nfunction reloadCSS() {\n if (cssTimeout) {\n return;\n }\n\n cssTimeout = setTimeout(function () {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n for (var i = 0; i < links.length; i++) {\n if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {\n updateLink(links[i]);\n }\n }\n\n cssTimeout = null;\n }, 50);\n}\n\nmodule.exports = reloadCSS;\n"]}
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
.react-graph {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__renderer {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__zoompane {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__selectionpane {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__selection {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
background: rgba(0, 89, 220, 0.08);
|
|
||||||
border: 1px dotted rgba(0, 89, 220, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edges {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edge {
|
|
||||||
fill: none;
|
|
||||||
stroke: #bbb;
|
|
||||||
stroke-width: 2;
|
|
||||||
pointer-events: all;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edge.selected {
|
|
||||||
stroke: #555;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edge.animated {
|
|
||||||
stroke-dasharray: 5;
|
|
||||||
-webkit-animation: dashdraw 0.5s linear infinite;
|
|
||||||
animation: dashdraw 0.5s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__edge.connection {
|
|
||||||
stroke: '#ddd';
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes dashdraw {
|
|
||||||
from {stroke-dashoffset: 10}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes dashdraw {
|
|
||||||
from {stroke-dashoffset: 10}
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__nodes {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 3;
|
|
||||||
pointer-events: none;
|
|
||||||
transform-origin: 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__node {
|
|
||||||
position: absolute;
|
|
||||||
color: #222;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: center;
|
|
||||||
cursor: -webkit-grab;
|
|
||||||
cursor: grab;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
pointer-events: all;
|
|
||||||
transform-origin: 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__node:hover > * {
|
|
||||||
box-shadow: 0 1px 5px 2px rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__node.selected > * {
|
|
||||||
box-shadow: 0 0 0 2px #555;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__handle {
|
|
||||||
position: absolute;
|
|
||||||
width: 10px;
|
|
||||||
height: 8px;
|
|
||||||
background: rgba(255, 255, 255, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__handle.source {
|
|
||||||
top: auto;
|
|
||||||
left: 50%;
|
|
||||||
bottom: 0;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
cursor: crosshair;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__handle.target {
|
|
||||||
left: 50%;
|
|
||||||
top: 0;
|
|
||||||
cursor: crosshair;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__nodesselection {
|
|
||||||
z-index: 3;
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
transform-origin: left top;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-graph__nodesselection-rect {
|
|
||||||
position: absolute;
|
|
||||||
background: rgba(0, 89, 220, 0.08);
|
|
||||||
border: 1px dotted rgba(0, 89, 220, 0.8);
|
|
||||||
pointer-events: all;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*# sourceMappingURL=/example.e31bb0bc.css.map */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["style.css"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,gBAAgB;AAClB;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,UAAU;AACZ;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,UAAU;AACZ;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,kCAAkC;EAClC,wCAAwC;AAC1C;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,oBAAoB;EACpB,UAAU;AACZ;;AAEA;EACE,UAAU;EACV,YAAY;EACZ,eAAe;EACf,mBAAmB;AAerB;;AAbE;IACE,YAAY;EACd;;AAEA;IACE,mBAAmB;IACnB,gDAAwC;YAAxC,wCAAwC;EAC1C;;AAEA;IACE,cAAc;IACd,oBAAoB;EACtB;;AAGF;EACE,MAAM,qBAAqB;AAC7B;;AAFA;EACE,MAAM,qBAAqB;AAC7B;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,UAAU;EACV,oBAAoB;EACpB,qBAAqB;AACvB;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,uBAAuB;EACvB,eAAe;EACf,kBAAkB;EAClB,oBAAY;EAAZ,YAAY;EACZ,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;EACjB,mBAAmB;EACnB,qBAAqB;AASvB;;AAPE;IACE,6CAA6C;EAC/C;;AAEA;IACE,0BAA0B;EAC5B;;AAGF;EACE,kBAAkB;EAClB,WAAW;EACX,WAAW;EACX,oCAAoC;AAgBtC;;AAdE;IACE,SAAS;IACT,SAAS;IACT,SAAS;IACT,6BAA6B;IAC7B,iBAAiB;EACnB;;AAEA;IACE,SAAS;IACT,MAAM;IACN,iBAAiB;IACjB,6BAA6B;EAC/B;;AAGF;EACE,UAAU;EACV,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,MAAM;EACN,OAAO;EACP,0BAA0B;EAC1B,oBAAoB;AAQtB;;AANE;IACE,kBAAkB;IAClB,kCAAkC;IAClC,wCAAwC;IACxC,mBAAmB;EACrB","file":"example.e31bb0bc.css","sourceRoot":"..","sourcesContent":[".react-graph {\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.react-graph__renderer {\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\n.react-graph__zoompane {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n}\n\n.react-graph__selectionpane {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n}\n\n.react-graph__selection {\n position: absolute;\n top: 0;\n left: 0;\n background: rgba(0, 89, 220, 0.08);\n border: 1px dotted rgba(0, 89, 220, 0.8);\n}\n\n.react-graph__edges {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n z-index: 2;\n}\n\n.react-graph__edge {\n fill: none;\n stroke: #bbb;\n stroke-width: 2;\n pointer-events: all;\n\n &.selected {\n stroke: #555;\n }\n\n &.animated {\n stroke-dasharray: 5;\n animation: dashdraw 0.5s linear infinite;\n }\n\n &.connection {\n stroke: '#ddd';\n pointer-events: none;\n }\n}\n\n@keyframes dashdraw {\n from {stroke-dashoffset: 10}\n}\n\n.react-graph__nodes {\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 3;\n pointer-events: none;\n transform-origin: 0 0;\n}\n\n.react-graph__node {\n position: absolute;\n color: #222;\n font-family: sans-serif;\n font-size: 12px;\n text-align: center;\n cursor: grab;\n user-select: none;\n pointer-events: all;\n transform-origin: 0 0;\n\n &:hover > * {\n box-shadow: 0 1px 5px 2px rgba(0, 0, 0, 0.08);\n }\n\n &.selected > * {\n box-shadow: 0 0 0 2px #555;\n }\n}\n\n.react-graph__handle {\n position: absolute;\n width: 10px;\n height: 8px;\n background: rgba(255, 255, 255, 0.4);\n\n &.source {\n top: auto;\n left: 50%;\n bottom: 0;\n transform: translate(-50%, 0);\n cursor: crosshair;\n }\n\n &.target {\n left: 50%;\n top: 0;\n cursor: crosshair;\n transform: translate(-50%, 0);\n }\n}\n\n.react-graph__nodesselection {\n z-index: 3;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n transform-origin: left top;\n pointer-events: none;\n\n &-rect {\n position: absolute;\n background: rgba(0, 89, 220, 0.08);\n border: 1px dotted rgba(0, 89, 220, 0.8);\n pointer-events: all;\n }\n}"]}
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,26 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<!--<link rel="stylesheet" type="text/css" href="../dist/ReactGraph.css">-->
|
|
||||||
<title>Document</title>
|
|
||||||
<style>html, body {
|
|
||||||
margin: 0
|
|
||||||
}
|
|
||||||
html, body, #root {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.controls {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
left: 10px;
|
|
||||||
z-index: 4;
|
|
||||||
}</style>
|
|
||||||
<link rel="stylesheet" href="/example.e31bb0bc.css"></head>
|
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
|
||||||
<script src="/example.e31bb0bc.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,391 +0,0 @@
|
|||||||
// modules are defined as an array
|
|
||||||
// [ module function, map of requires ]
|
|
||||||
//
|
|
||||||
// map of requires is short require name -> numeric require
|
|
||||||
//
|
|
||||||
// anything defined in a previous bundle is accessed via the
|
|
||||||
// orig method which is the require for previous bundles
|
|
||||||
parcelRequire = (function (modules, cache, entry, globalName) {
|
|
||||||
// Save the require from previous bundle to this closure if any
|
|
||||||
var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
|
|
||||||
var nodeRequire = typeof require === 'function' && require;
|
|
||||||
|
|
||||||
function newRequire(name, jumped) {
|
|
||||||
if (!cache[name]) {
|
|
||||||
if (!modules[name]) {
|
|
||||||
// if we cannot find the module within our internal map or
|
|
||||||
// cache jump to the current global require ie. the last bundle
|
|
||||||
// that was added to the page.
|
|
||||||
var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
|
|
||||||
if (!jumped && currentRequire) {
|
|
||||||
return currentRequire(name, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there are other bundles on this page the require from the
|
|
||||||
// previous one is saved to 'previousRequire'. Repeat this as
|
|
||||||
// many times as there are bundles until the module is found or
|
|
||||||
// we exhaust the require chain.
|
|
||||||
if (previousRequire) {
|
|
||||||
return previousRequire(name, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try the node require function if it exists.
|
|
||||||
if (nodeRequire && typeof name === 'string') {
|
|
||||||
return nodeRequire(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
var err = new Error('Cannot find module \'' + name + '\'');
|
|
||||||
err.code = 'MODULE_NOT_FOUND';
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
|
|
||||||
localRequire.resolve = resolve;
|
|
||||||
localRequire.cache = {};
|
|
||||||
|
|
||||||
var module = cache[name] = new newRequire.Module(name);
|
|
||||||
|
|
||||||
modules[name][0].call(module.exports, localRequire, module, module.exports, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cache[name].exports;
|
|
||||||
|
|
||||||
function localRequire(x){
|
|
||||||
return newRequire(localRequire.resolve(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolve(x){
|
|
||||||
return modules[name][1][x] || x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Module(moduleName) {
|
|
||||||
this.id = moduleName;
|
|
||||||
this.bundle = newRequire;
|
|
||||||
this.exports = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
newRequire.isParcelRequire = true;
|
|
||||||
newRequire.Module = Module;
|
|
||||||
newRequire.modules = modules;
|
|
||||||
newRequire.cache = cache;
|
|
||||||
newRequire.parent = previousRequire;
|
|
||||||
newRequire.register = function (id, exports) {
|
|
||||||
modules[id] = [function (require, module) {
|
|
||||||
module.exports = exports;
|
|
||||||
}, {}];
|
|
||||||
};
|
|
||||||
|
|
||||||
var error;
|
|
||||||
for (var i = 0; i < entry.length; i++) {
|
|
||||||
try {
|
|
||||||
newRequire(entry[i]);
|
|
||||||
} catch (e) {
|
|
||||||
// Save first error but execute all entries
|
|
||||||
if (!error) {
|
|
||||||
error = e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entry.length) {
|
|
||||||
// Expose entry point to Node, AMD or browser globals
|
|
||||||
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
|
|
||||||
var mainExports = newRequire(entry[entry.length - 1]);
|
|
||||||
|
|
||||||
// CommonJS
|
|
||||||
if (typeof exports === "object" && typeof module !== "undefined") {
|
|
||||||
module.exports = mainExports;
|
|
||||||
|
|
||||||
// RequireJS
|
|
||||||
} else if (typeof define === "function" && define.amd) {
|
|
||||||
define(function () {
|
|
||||||
return mainExports;
|
|
||||||
});
|
|
||||||
|
|
||||||
// <script>
|
|
||||||
} else if (globalName) {
|
|
||||||
this[globalName] = mainExports;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override the current require with this new one
|
|
||||||
parcelRequire = newRequire;
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
// throw error from earlier, _after updating parcelRequire_
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return newRequire;
|
|
||||||
})({"../node_modules/parcel-bundler/src/builtins/bundle-url.js":[function(require,module,exports) {
|
|
||||||
var bundleURL = null;
|
|
||||||
|
|
||||||
function getBundleURLCached() {
|
|
||||||
if (!bundleURL) {
|
|
||||||
bundleURL = getBundleURL();
|
|
||||||
}
|
|
||||||
|
|
||||||
return bundleURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getBundleURL() {
|
|
||||||
// Attempt to find the URL of the current script and use that as the base URL
|
|
||||||
try {
|
|
||||||
throw new Error();
|
|
||||||
} catch (err) {
|
|
||||||
var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);
|
|
||||||
|
|
||||||
if (matches) {
|
|
||||||
return getBaseURL(matches[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
function getBaseURL(url) {
|
|
||||||
return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^/]+$/, '$1') + '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.getBundleURL = getBundleURLCached;
|
|
||||||
exports.getBaseURL = getBaseURL;
|
|
||||||
},{}],"../node_modules/parcel-bundler/src/builtins/css-loader.js":[function(require,module,exports) {
|
|
||||||
var bundle = require('./bundle-url');
|
|
||||||
|
|
||||||
function updateLink(link) {
|
|
||||||
var newLink = link.cloneNode();
|
|
||||||
|
|
||||||
newLink.onload = function () {
|
|
||||||
link.remove();
|
|
||||||
};
|
|
||||||
|
|
||||||
newLink.href = link.href.split('?')[0] + '?' + Date.now();
|
|
||||||
link.parentNode.insertBefore(newLink, link.nextSibling);
|
|
||||||
}
|
|
||||||
|
|
||||||
var cssTimeout = null;
|
|
||||||
|
|
||||||
function reloadCSS() {
|
|
||||||
if (cssTimeout) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cssTimeout = setTimeout(function () {
|
|
||||||
var links = document.querySelectorAll('link[rel="stylesheet"]');
|
|
||||||
|
|
||||||
for (var i = 0; i < links.length; i++) {
|
|
||||||
if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {
|
|
||||||
updateLink(links[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cssTimeout = null;
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = reloadCSS;
|
|
||||||
},{"./bundle-url":"../node_modules/parcel-bundler/src/builtins/bundle-url.js"}],"../node_modules/parcel-bundler/src/builtins/hmr-runtime.js":[function(require,module,exports) {
|
|
||||||
var global = arguments[3];
|
|
||||||
var OVERLAY_ID = '__parcel__error__overlay__';
|
|
||||||
var OldModule = module.bundle.Module;
|
|
||||||
|
|
||||||
function Module(moduleName) {
|
|
||||||
OldModule.call(this, moduleName);
|
|
||||||
this.hot = {
|
|
||||||
data: module.bundle.hotData,
|
|
||||||
_acceptCallbacks: [],
|
|
||||||
_disposeCallbacks: [],
|
|
||||||
accept: function (fn) {
|
|
||||||
this._acceptCallbacks.push(fn || function () {});
|
|
||||||
},
|
|
||||||
dispose: function (fn) {
|
|
||||||
this._disposeCallbacks.push(fn);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
module.bundle.hotData = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.bundle.Module = Module;
|
|
||||||
var checkedAssets, assetsToAccept;
|
|
||||||
var parent = module.bundle.parent;
|
|
||||||
|
|
||||||
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
||||||
var hostname = "" || location.hostname;
|
|
||||||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
||||||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "65263" + '/');
|
|
||||||
|
|
||||||
ws.onmessage = function (event) {
|
|
||||||
checkedAssets = {};
|
|
||||||
assetsToAccept = [];
|
|
||||||
var data = JSON.parse(event.data);
|
|
||||||
|
|
||||||
if (data.type === 'update') {
|
|
||||||
var handled = false;
|
|
||||||
data.assets.forEach(function (asset) {
|
|
||||||
if (!asset.isNew) {
|
|
||||||
var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);
|
|
||||||
|
|
||||||
if (didAccept) {
|
|
||||||
handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}); // Enable HMR for CSS by default.
|
|
||||||
|
|
||||||
handled = handled || data.assets.every(function (asset) {
|
|
||||||
return asset.type === 'css' && asset.generated.js;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (handled) {
|
|
||||||
console.clear();
|
|
||||||
data.assets.forEach(function (asset) {
|
|
||||||
hmrApply(global.parcelRequire, asset);
|
|
||||||
});
|
|
||||||
assetsToAccept.forEach(function (v) {
|
|
||||||
hmrAcceptRun(v[0], v[1]);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.type === 'reload') {
|
|
||||||
ws.close();
|
|
||||||
|
|
||||||
ws.onclose = function () {
|
|
||||||
location.reload();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.type === 'error-resolved') {
|
|
||||||
console.log('[parcel] ✨ Error resolved');
|
|
||||||
removeErrorOverlay();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.type === 'error') {
|
|
||||||
console.error('[parcel] 🚨 ' + data.error.message + '\n' + data.error.stack);
|
|
||||||
removeErrorOverlay();
|
|
||||||
var overlay = createErrorOverlay(data);
|
|
||||||
document.body.appendChild(overlay);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeErrorOverlay() {
|
|
||||||
var overlay = document.getElementById(OVERLAY_ID);
|
|
||||||
|
|
||||||
if (overlay) {
|
|
||||||
overlay.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createErrorOverlay(data) {
|
|
||||||
var overlay = document.createElement('div');
|
|
||||||
overlay.id = OVERLAY_ID; // html encode message and stack trace
|
|
||||||
|
|
||||||
var message = document.createElement('div');
|
|
||||||
var stackTrace = document.createElement('pre');
|
|
||||||
message.innerText = data.error.message;
|
|
||||||
stackTrace.innerText = data.error.stack;
|
|
||||||
overlay.innerHTML = '<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;">' + '<span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span>' + '<span style="top: 2px; margin-left: 5px; position: relative;">🚨</span>' + '<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">' + message.innerHTML + '</div>' + '<pre>' + stackTrace.innerHTML + '</pre>' + '</div>';
|
|
||||||
return overlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getParents(bundle, id) {
|
|
||||||
var modules = bundle.modules;
|
|
||||||
|
|
||||||
if (!modules) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
var parents = [];
|
|
||||||
var k, d, dep;
|
|
||||||
|
|
||||||
for (k in modules) {
|
|
||||||
for (d in modules[k][1]) {
|
|
||||||
dep = modules[k][1][d];
|
|
||||||
|
|
||||||
if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {
|
|
||||||
parents.push(k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bundle.parent) {
|
|
||||||
parents = parents.concat(getParents(bundle.parent, id));
|
|
||||||
}
|
|
||||||
|
|
||||||
return parents;
|
|
||||||
}
|
|
||||||
|
|
||||||
function hmrApply(bundle, asset) {
|
|
||||||
var modules = bundle.modules;
|
|
||||||
|
|
||||||
if (!modules) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (modules[asset.id] || !bundle.parent) {
|
|
||||||
var fn = new Function('require', 'module', 'exports', asset.generated.js);
|
|
||||||
asset.isNew = !modules[asset.id];
|
|
||||||
modules[asset.id] = [fn, asset.deps];
|
|
||||||
} else if (bundle.parent) {
|
|
||||||
hmrApply(bundle.parent, asset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hmrAcceptCheck(bundle, id) {
|
|
||||||
var modules = bundle.modules;
|
|
||||||
|
|
||||||
if (!modules) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!modules[id] && bundle.parent) {
|
|
||||||
return hmrAcceptCheck(bundle.parent, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkedAssets[id]) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
checkedAssets[id] = true;
|
|
||||||
var cached = bundle.cache[id];
|
|
||||||
assetsToAccept.push([bundle, id]);
|
|
||||||
|
|
||||||
if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getParents(global.parcelRequire, id).some(function (id) {
|
|
||||||
return hmrAcceptCheck(global.parcelRequire, id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function hmrAcceptRun(bundle, id) {
|
|
||||||
var cached = bundle.cache[id];
|
|
||||||
bundle.hotData = {};
|
|
||||||
|
|
||||||
if (cached) {
|
|
||||||
cached.hot.data = bundle.hotData;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cached && cached.hot && cached.hot._disposeCallbacks.length) {
|
|
||||||
cached.hot._disposeCallbacks.forEach(function (cb) {
|
|
||||||
cb(bundle.hotData);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
delete bundle.cache[id];
|
|
||||||
bundle(id);
|
|
||||||
cached = bundle.cache[id];
|
|
||||||
|
|
||||||
if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
|
|
||||||
cached.hot._acceptCallbacks.forEach(function (cb) {
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},{}]},{},["../node_modules/parcel-bundler/src/builtins/hmr-runtime.js"], null)
|
|
||||||
//# sourceMappingURL=/index.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"sources":["../node_modules/parcel-bundler/src/builtins/bundle-url.js","../node_modules/parcel-bundler/src/builtins/css-loader.js"],"names":["bundleURL","getBundleURLCached","getBundleURL","Error","err","matches","stack","match","getBaseURL","url","replace","exports","bundle","require","updateLink","link","newLink","cloneNode","onload","remove","href","split","Date","now","parentNode","insertBefore","nextSibling","cssTimeout","reloadCSS","setTimeout","links","document","querySelectorAll","i","length","module"],"mappings":"AAAA,ACAA,IDAIA,ACAAY,MAAM,GDAG,ACAAC,GDAG,IAAhB,ACAoB,CAAC,cAAD,CAApB;;ADCA,ACCA,SDDSZ,ACCAa,UAAT,CAAoBC,IAApB,EAA0B,CDD1B,GAA8B;AAC5B,ACCA,MDDI,ACCAC,CDDChB,MCCM,GDDX,ACCce,EDDE,ECCE,CAACE,SAAL,EAAd;ADAEjB,IAAAA,SAAS,GAAGE,YAAY,EAAxB;AACD,ACADc,EAAAA,OAAO,CAACE,MAAR,GAAiB,YAAY;AAC3BH,IAAAA,IAAI,CAACI,MAAL;ADCF,ACAC,GAFD,MDEOnB,SAAP;AACD;ACACgB,EAAAA,OAAO,CAACI,IAAR,GAAeL,IAAI,CAACK,IAAL,CAAUC,KAAV,CAAgB,GAAhB,EAAqB,CAArB,IAA0B,GAA1B,GAAgCC,IAAI,CAACC,GAAL,EAA/C;ADEF,ACDER,EAAAA,IAAI,CAACS,EDCEtB,QCDP,CAAgBuB,GDClB,GAAwB,MCDtB,CAA6BT,OAA7B,EAAsCD,IAAI,CAACW,WAA3C;ADEA,ACDD;ADEC,MAAI;AACF,ACDJ,IAAIC,MDCM,IAAIxB,ACDA,GAAG,EDCP,EAAN,ACDJ;ADEG,GAFD,CAEE,OAAOC,GAAP,EAAY;AACZ,ACFJ,QDEQC,CCFCuB,MDEM,GAAG,ACFlB,CDEmB,ECFE,GDEGxB,GAAG,CAACE,KAAV,EAAiBC,KAAjB,CAAuB,+DAAvB,CAAd;ACDF,MAAIoB,UAAJ,EAAgB;ADEd,ACDA,QDCItB,OAAJ,EAAa;AACX,ACDH,aDCUG,UAAU,CAACH,OAAO,CAAC,CAAD,CAAR,CAAjB;AACD;AACF,ACDDsB,EAAAA,UAAU,GAAGE,UAAU,CAAC,YAAY;AAClC,QAAIC,KAAK,GAAGC,QAAQ,CAACC,gBAAT,CAA0B,wBAA1B,CAAZ;ADEF,SAAO,GAAP;AACD,ACFG,SAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,KAAK,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAuC;AACrC,UAAIrB,MAAM,CAACJ,UAAP,CAAkBsB,KAAK,CAACG,CAAD,CAAL,CAASb,IAA3B,MAAqCR,MAAM,CAACV,YAAP,EAAzC,EAAgE;ADGtE,ACFQY,QAAAA,CDECN,SCFS,CDElB,ACFmBsB,CDECrB,GAApB,CCFwB,CDEC,ACFAwB,CAAD,CAAN,CAAV;ADGN,ACFK,SDEE,CAAC,KAAKxB,GAAN,EAAWC,OAAX,CAAmB,sEAAnB,EAA2F,IAA3F,IAAmG,GAA1G;AACD,ACFI;;ADILC,ACFIgB,IAAAA,GDEG,CAACzB,MCFM,GAAG,GDEjB,CCFI,EDEmBD,kBAAvB;AACAU,ACFG,GATsB,EASpB,EDEE,ACXkB,CDWjBH,ACXN,UDWF,GAAqBA,UAArB;ACDC;;AAED2B,MAAM,CAACxB,OAAP,GAAiBiB,SAAjB","file":"index.js","sourceRoot":"..","sourcesContent":["var bundleURL = null;\nfunction getBundleURLCached() {\n if (!bundleURL) {\n bundleURL = getBundleURL();\n }\n\n return bundleURL;\n}\n\nfunction getBundleURL() {\n // Attempt to find the URL of the current script and use that as the base URL\n try {\n throw new Error;\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n return getBaseURL(matches[0]);\n }\n }\n\n return '/';\n}\n\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\n","var bundle = require('./bundle-url');\n\nfunction updateLink(link) {\n var newLink = link.cloneNode();\n newLink.onload = function () {\n link.remove();\n };\n newLink.href = link.href.split('?')[0] + '?' + Date.now();\n link.parentNode.insertBefore(newLink, link.nextSibling);\n}\n\nvar cssTimeout = null;\nfunction reloadCSS() {\n if (cssTimeout) {\n return;\n }\n\n cssTimeout = setTimeout(function () {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n for (var i = 0; i < links.length; i++) {\n if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {\n updateLink(links[i]);\n }\n }\n\n cssTimeout = null;\n }, 50);\n}\n\nmodule.exports = reloadCSS;\n"]}
|
|
||||||
+2
-1
@@ -43,7 +43,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"watch": "rollup -w -c",
|
"watch": "rollup -w -c",
|
||||||
"dev": "parcel example/index.html -d example/build"
|
"dev": "parcel example/index.html -d example/build",
|
||||||
|
"build:example": "parcel build example/index.html -d example/build"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {}
|
"hooks": {}
|
||||||
|
|||||||
Reference in New Issue
Block a user