From 975056b3854dc065a275928c91d1d7869916d918 Mon Sep 17 00:00:00 2001 From: Kirit1592 Date: Fri, 10 Jul 2020 14:46:28 +0530 Subject: [PATCH 1/5] added babel --- .babelrc | 6 + .gitignore | 2 + demo/index.html | 3 +- lib/flowy.js | 1229 +++++++++++++++++++ package-lock.json | 2898 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 25 + 6 files changed, 4162 insertions(+), 1 deletion(-) create mode 100644 .babelrc create mode 100644 .gitignore create mode 100644 lib/flowy.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..99832fc --- /dev/null +++ b/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": ["@babel/preset-env"], + "plugins": [ + ["@babel/plugin-transform-arrow-functions", { "spec": true }] + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f9d799 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/* +dist/* \ No newline at end of file diff --git a/demo/index.html b/demo/index.html index e3a81a8..b6ef8bd 100644 --- a/demo/index.html +++ b/demo/index.html @@ -24,7 +24,8 @@ - + + diff --git a/lib/flowy.js b/lib/flowy.js new file mode 100644 index 0000000..9792f08 --- /dev/null +++ b/lib/flowy.js @@ -0,0 +1,1229 @@ +"use strict"; + +function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } + +var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x, spacing_y) { + if (!grab) { + grab = function grab() {}; + } + + if (!release) { + release = function release() {}; + } + + if (!snapping) { + snapping = function snapping() { + return true; + }; + } + + if (!rearrange) { + rearrange = function rearrange() { + return false; + }; + } + + if (!spacing_x) { + spacing_x = 20; + } + + if (!spacing_y) { + spacing_y = 80; + } + + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + } + + if (!Element.prototype.closest) { + Element.prototype.closest = function (s) { + var el = this; + + do { + if (Element.prototype.matches.call(el, s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + + return null; + }; + } + + var loaded = false; + + flowy.load = function () { + if (!loaded) loaded = true;else return; + var blocks = []; + var blockstemp = []; + var canvas_div = canvas; + var active = false; + var paddingx = spacing_x; + var paddingy = spacing_y; + var offsetleft = 0; + var offsetleftold = 0; + var rearrange = false; + var lastevent = false; + var drag, dragx, dragy, original; + var mouse_x, mouse_y; + var dragblock = false; + var prevblock = 0; + var el = document.createElement("DIV"); + el.classList.add('indicator'); + el.classList.add('invisible'); + canvas_div.appendChild(el); + + flowy["import"] = function (output) { + canvas_div.innerHTML = output.html; + + for (var a = 0; a < output.blockarr.length; a++) { + var block = { + childwidth: parseFloat(output.blockarr[a].childwidth), + parent: parseFloat(output.blockarr[a].parent), + id: parseFloat(output.blockarr[a].id), + x: parseFloat(output.blockarr[a].x), + y: parseFloat(output.blockarr[a].y), + width: parseFloat(output.blockarr[a].width), + height: parseFloat(output.blockarr[a].height) + }; + blocks.push(block); + } + + if (blocks.length > 1) { + rearrangeMe(); + } + }; + + flowy.output = function () { + var html_ser = canvas_div.innerHTML; + var json_data = { + html: html_ser, + blockarr: blocks, + blocks: [] + }; + + if (blocks.length > 0) { + for (var i = 0; i < blocks.length; i++) { + json_data.blocks.push({ + id: blocks[i].id, + parent: blocks[i].parent, + data: [], + attr: [] + }); + var blockParent = document.querySelector(".blockid[value='" + blocks[i].id + "']").parentNode; + blockParent.querySelectorAll("input").forEach(function (block) { + var json_name = block.getAttribute("name"); + var json_value = block.value; + json_data.blocks[i].data.push({ + name: json_name, + value: json_value + }); + }); + Array.prototype.slice.call(blockParent.attributes).forEach(function (attribute) { + var jsonobj = {}; + jsonobj[attribute.name] = attribute.value; + json_data.blocks[i].attr.push(jsonobj); + }); + } + + return json_data; + } + }; + + flowy.deleteBlocks = function () { + blocks = []; + canvas_div.innerHTML = ""; + }; + + flowy.beginDrag = function (event) { + var _this = this; + + if (event.targetTouches) { + mouse_x = event.changedTouches[0].clientX; + mouse_y = event.changedTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + + if (event.which != 3 && event.target.closest(".create-flowy")) { + original = event.target.closest(".create-flowy"); + var newNode = event.target.closest(".create-flowy").cloneNode(true); + event.target.closest(".create-flowy").classList.add("dragnow"); + newNode.classList.add("block"); + newNode.classList.remove("create-flowy"); + + if (blocks.length === 0) { + newNode.innerHTML += ""; + document.body.appendChild(newNode); + drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; + } else { + newNode.innerHTML += ""; + document.body.appendChild(newNode); + drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(function (a) { + _newArrowCheck(this, _this); + + return a.id; + }.bind(this)))) + 1) + "']").parentNode; + } + + blockGrabbed(event.target.closest(".create-flowy")); + drag.classList.add("dragging"); + active = true; + dragx = mouse_x - event.target.closest(".create-flowy").getBoundingClientRect().left; + dragy = mouse_y - event.target.closest(".create-flowy").getBoundingClientRect().top; + drag.style.left = mouse_x - dragx + "px"; + drag.style.top = mouse_y - dragy + "px"; + } + }; + + document.addEventListener("mousedown", touchblock, false); + document.addEventListener("touchstart", touchblock, false); + document.addEventListener("mouseup", touchblock, false); + + flowy.touchDone = function () { + dragblock = false; + }; + + document.addEventListener('mousedown', flowy.beginDrag); + document.addEventListener('touchstart', flowy.beginDrag); + + flowy.endDrag = function (event) { + var _this2 = this; + + if (event.which != 3 && (active || rearrange)) { + dragblock = false; + blockReleased(); + + if (!document.querySelector(".indicator").classList.contains("invisible")) { + document.querySelector(".indicator").classList.add("invisible"); + } + + if (active) { + original.classList.remove("dragnow"); + drag.classList.remove("dragging"); + } + + if (parseInt(drag.querySelector(".blockid").value) === 0 && rearrange) { + drag.classList.remove("dragging"); + rearrange = false; + + for (var w = 0; w < blockstemp.length; w++) { + if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { + var blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; + var arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop - 1 + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + canvas_div.scrollTop) - 1 + "px"; + canvas_div.appendChild(blockParent); + canvas_div.appendChild(arrowParent); + blockstemp[w].x = blockParent.getBoundingClientRect().left + window.scrollX + parseInt(blockParent.offsetWidth) / 2 + canvas_div.scrollLeft - 1; + blockstemp[w].y = blockParent.getBoundingClientRect().top + window.scrollY + parseInt(blockParent.offsetHeight) / 2 + canvas_div.scrollTop - 1; + } + } + + blockstemp.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == 0; + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == 0; + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2; + blocks = blocks.concat(blockstemp); + blockstemp = []; + } else if (active && blocks.length == 0 && drag.getBoundingClientRect().top + window.scrollY > canvas_div.getBoundingClientRect().top + window.scrollY && drag.getBoundingClientRect().left + window.scrollX > canvas_div.getBoundingClientRect().left + window.scrollX) { + blockSnap(drag, true, undefined); + active = false; + drag.style.top = drag.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + drag.style.left = drag.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + canvas_div.appendChild(drag); + blocks.push({ + parent: -1, + childwidth: 0, + id: parseInt(drag.querySelector(".blockid").value), + x: drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, + y: drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, + width: parseInt(window.getComputedStyle(drag).width), + height: parseInt(window.getComputedStyle(drag).height) + }); + } else if (active && blocks.length == 0) { + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } else if (active) { + var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this2); + + return a.id; + }.bind(this)); + + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height) { + active = false; + + if (blockSnap(drag, false, document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode)) { + snap(drag, i, blocko); + } else { + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } + + break; + } else if (i == blocks.length - 1) { + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } + } + } else if (rearrange) { + var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this2); + + return a.id; + }.bind(this)); + + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height) { + active = false; + drag.classList.remove("dragging"); + snap(drag, i, blocko); + break; + } else if (i == blocks.length - 1) { + if (beforeDelete(drag, blocks.filter(function (id) { + _newArrowCheck(this, _this2); + + return id.id == blocko[i]; + }.bind(this))[0])) { + active = false; + drag.classList.remove("dragging"); + snap(drag, blocko.indexOf(prevblock), blocko); + break; + } else { + rearrange = false; + blockstemp = []; + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + break; + } + } + } + } + } + }; + + document.addEventListener("mouseup", flowy.endDrag, false); + document.addEventListener("touchend", flowy.endDrag, false); + + function snap(drag, i, blocko) { + var _this3 = this; + + if (!rearrange) { + canvas_div.appendChild(drag); + } + + var totalwidth = 0; + var totalremove = 0; + var maxheight = 0; + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[w]; + + if (children.childwidth > children.width) { + totalwidth += children.childwidth + paddingx; + } else { + totalwidth += children.width + paddingx; + } + } + + totalwidth += parseInt(window.getComputedStyle(drag).width); + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[w]; + + if (children.childwidth > children.width) { + document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; + children.x = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; + totalremove += children.childwidth + paddingx; + } else { + document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + "px"; + children.x = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.width / 2; + totalremove += children.width + paddingx; + } + } + + drag.style.left = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == blocko[i]; + }.bind(this))[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + + if (rearrange) { + blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == drag.querySelector(".blockid").value; + }.bind(this))[0].parent = blocko[i]; + + for (var w = 0; w < blockstemp.length; w++) { + if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { + var blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; + var arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + 20 + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + canvas_div.appendChild(blockParent); + canvas_div.appendChild(arrowParent); + blockstemp[w].x = blockParent.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(blockParent).width) / 2 + canvas_div.scrollLeft; + blockstemp[w].y = blockParent.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(blockParent).height) / 2 + canvas_div.scrollTop; + } + } + + blocks = blocks.concat(blockstemp); + blockstemp = []; + } else { + blocks.push({ + childwidth: 0, + parent: blocko[i], + id: parseInt(drag.querySelector(".blockid").value), + x: drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, + y: drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, + width: parseInt(window.getComputedStyle(drag).width), + height: parseInt(window.getComputedStyle(drag).height) + }); + } + + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x + 20; + var arrowy = parseFloat(arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].height / 2) + canvas_div.scrollTop); + + if (arrowx < 0) { + canvas_div.innerHTML += '
'; + document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + } else { + canvas_div.innerHTML += '
'; + document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + } + + document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 + "px"; + + if (blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].parent != -1) { + var flag = false; + var idval = blocko[i]; + + while (!flag) { + if (blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == idval; + }.bind(this))[0].parent == -1) { + flag = true; + } else { + var zwidth = 0; + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this))[w]; + + if (children.childwidth > children.width) { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this)).length - 1) { + zwidth += children.childwidth; + } else { + zwidth += children.childwidth + paddingx; + } + } else { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this)).length - 1) { + zwidth += children.width; + } else { + zwidth += children.width + paddingx; + } + } + } + + blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == idval; + }.bind(this))[0].childwidth = zwidth; + idval = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == idval; + }.bind(this))[0].parent; + } + } + + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == idval; + }.bind(this))[0].childwidth = totalwidth; + } + + if (rearrange) { + rearrange = false; + drag.classList.remove("dragging"); + } + + rearrangeMe(); + checkOffset(); + } + + function touchblock(event) { + dragblock = false; + + if (hasParentClass(event.target, "block")) { + var theblock = event.target.closest(".block"); + + if (event.targetTouches) { + mouse_x = event.targetTouches[0].clientX; + mouse_y = event.targetTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + + if (event.type !== "mouseup" && hasParentClass(event.target, "block")) { + if (event.which != 3) { + if (!active && !rearrange) { + dragblock = true; + drag = theblock; + dragx = mouse_x - (drag.getBoundingClientRect().left + window.scrollX); + dragy = mouse_y - (drag.getBoundingClientRect().top + window.scrollY); + } + } + } + } + } + + function hasParentClass(element, classname) { + if (element.className) { + if (element.className.split(' ').indexOf(classname) >= 0) return true; + } + + return element.parentNode && hasParentClass(element.parentNode, classname); + } + + flowy.moveBlock = function (event) { + var _this4 = this; + + if (event.targetTouches) { + mouse_x = event.targetTouches[0].clientX; + mouse_y = event.targetTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + + if (dragblock) { + rearrange = true; + drag.classList.add("dragging"); + var blockid = parseInt(drag.querySelector(".blockid").value); + prevblock = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blockid; + }.bind(this))[0].parent; + blockstemp.push(blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blockid; + }.bind(this))[0]); + blocks = blocks.filter(function (e) { + return e.id != blockid; + }); + + if (blockid != 0) { + document.querySelector(".arrowid[value='" + blockid + "']").parentNode.remove(); + } + + var layer = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.parent == blockid; + }.bind(this)); + var flag = false; + var foundids = []; + var allids = []; + + while (!flag) { + for (var i = 0; i < layer.length; i++) { + if (layer[i] != blockid) { + blockstemp.push(blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == layer[i].id; + }.bind(this))[0]); + var blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; + var arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (drag.getBoundingClientRect().left + window.scrollX) + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (drag.getBoundingClientRect().left + window.scrollX) + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + drag.appendChild(blockParent); + drag.appendChild(arrowParent); + foundids.push(layer[i].id); + allids.push(layer[i].id); + } + } + + if (foundids.length == 0) { + flag = true; + } else { + layer = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return foundids.includes(a.parent); + }.bind(this)); + foundids = []; + } + } + + for (var i = 0; i < blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.parent == blockid; + }.bind(this)).length; i++) { + var blocknumber = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.parent == blockid; + }.bind(this))[i]; + blocks = blocks.filter(function (e) { + return e.id != blocknumber; + }); + } + + for (var i = 0; i < allids.length; i++) { + var blocknumber = allids[i]; + blocks = blocks.filter(function (e) { + return e.id != blocknumber; + }); + } + + if (blocks.length > 1) { + rearrangeMe(); + } + + if (lastevent) { + fixOffset(); + } + + dragblock = false; + } + + if (active) { + drag.style.left = mouse_x - dragx + "px"; + drag.style.top = mouse_y - dragy + "px"; + } else if (rearrange) { + drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this)).x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this)).y = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + } + + if (active || rearrange) { + var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this4); + + return a.id; + }.bind(this)); + + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].height) { + document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode.appendChild(document.querySelector(".indicator")); + document.querySelector(".indicator").style.left = parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).width) / 2 - 5 + "px"; + document.querySelector(".indicator").style.top = window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).height + "px"; + document.querySelector(".indicator").classList.remove("invisible"); + break; + } else if (i == blocks.length - 1) { + if (!document.querySelector(".indicator").classList.contains("invisible")) { + document.querySelector(".indicator").classList.add("invisible"); + } + } + } + } + }; + + document.addEventListener("mousemove", flowy.moveBlock, false); + document.addEventListener("touchmove", flowy.moveBlock, false); + + function checkOffset() { + var _this5 = this; + + offsetleft = blocks.map(function (a) { + _newArrowCheck(this, _this5); + + return a.x; + }.bind(this)); + var widths = blocks.map(function (a) { + _newArrowCheck(this, _this5); + + return a.width; + }.bind(this)); + var mathmin = offsetleft.map(function (item, index) { + return item - widths[index] / 2; + }); + offsetleft = Math.min.apply(Math, mathmin); + + if (offsetleft < canvas_div.getBoundingClientRect().left + window.scrollX) { + lastevent = true; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this5); + + return a.id; + }.bind(this)); + + for (var w = 0; w < blocks.length; w++) { + document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].width / 2 - offsetleft + 20 + "px"; + + if (blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].parent != -1) { + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + var _this6 = this; + + _newArrowCheck(this, _this5); + + return a.id == blocks.filter(function (a) { + _newArrowCheck(this, _this6); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x; + + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - offsetleft + 20 - 5 + "px"; + } else { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { + var _this7 = this; + + _newArrowCheck(this, _this5); + + return id.id == blocks.filter(function (a) { + _newArrowCheck(this, _this7); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x - 20 - offsetleft + 20 + "px"; + } + } + } + + for (var w = 0; w < blocks.length; w++) { + blocks[w].x = document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + (canvas_div.getBoundingClientRect().left + canvas_div.scrollLeft) - parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode).width) / 2 - 40; + } + + offsetleftold = offsetleft; + } + } + + function fixOffset() { + var _this8 = this; + + if (offsetleftold < canvas_div.getBoundingClientRect().left + window.scrollX) { + lastevent = false; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this8); + + return a.id; + }.bind(this)); + + for (var w = 0; w < blocks.length; w++) { + document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].width / 2 - offsetleftold - 20 + "px"; + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].width / 2; + + if (blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].parent != -1) { + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + var _this9 = this; + + _newArrowCheck(this, _this8); + + return a.id == blocks.filter(function (a) { + _newArrowCheck(this, _this9); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x; + + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + } else { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { + var _this10 = this; + + _newArrowCheck(this, _this8); + + return id.id == blocks.filter(function (a) { + _newArrowCheck(this, _this10); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + } + } + } + + offsetleftold = 0; + } + } + + function rearrangeMe() { + var _this11 = this; + + var result = blocks.map(function (a) { + _newArrowCheck(this, _this11); + + return a.parent; + }.bind(this)); + + for (var z = 0; z < result.length; z++) { + if (result[z] == -1) { + z++; + } + + var totalwidth = 0; + var totalremove = 0; + var maxheight = 0; + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this))[w]; + + if (blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == children.id; + }.bind(this)).length == 0) { + children.childwidth = 0; + } + + if (children.childwidth > children.width) { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length - 1) { + totalwidth += children.childwidth; + } else { + totalwidth += children.childwidth + paddingx; + } + } else { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length - 1) { + totalwidth += children.width; + } else { + totalwidth += children.width + paddingx; + } + } + } + + if (result[z] != -1) { + blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == result[z]; + }.bind(this))[0].childwidth = totalwidth; + } + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this))[w]; + var r_block = document.querySelector(".blockid[value='" + children.id + "']").parentNode; + var r_array = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == result[z]; + }.bind(this)); + r_block.style.top = r_array.y + paddingy + "px"; + r_array.y = r_array.y + paddingy; + + if (children.childwidth > children.width) { + r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + children.x = r_array[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; + totalremove += children.childwidth + paddingx; + } else { + r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + children.x = r_array[0].x - totalwidth / 2 + totalremove + children.width / 2; + totalremove += children.width + paddingx; + } + + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.id; + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.parent; + }.bind(this))[0].x + 20; + var arrowy = arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.parent; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.parent; + }.bind(this))[0].height / 2); + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == children.parent; + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == children.parent; + }.bind(this))[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + } else { + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == children.parent; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + } + } + } + } + }; + + flowy.load(); + + function blockGrabbed(block) { + grab(block); + } + + function blockReleased() { + release(); + } + + function blockSnap(drag, first, parent) { + return snapping(drag, first, parent); + } + + function beforeDelete(drag, parent) { + return rearrange(drag, parent); + } + + function addEventListenerMulti(type, listener, capture, selector) { + var nodes = document.querySelectorAll(selector); + + for (var i = 0; i < nodes.length; i++) { + nodes[i].addEventListener(type, listener, capture); + } + } + + function removeEventListenerMulti(type, listener, capture, selector) { + var nodes = document.querySelectorAll(selector); + + for (var i = 0; i < nodes.length; i++) { + nodes[i].removeEventListener(type, listener, capture); + } + } +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..46014da --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2898 @@ +{ + "name": "flowy", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/cli": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.10.4.tgz", + "integrity": "sha512-xX99K4V1BzGJdQANK5cwK+EpF1vP9gvqhn+iWvG+TubCjecplW7RSQimJ2jcCvu6fnK5pY6mZMdu6EWTj32QVA==", + "dev": true, + "requires": { + "chokidar": "^2.1.8", + "commander": "^4.0.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "lodash": "^4.17.13", + "make-dir": "^2.1.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + } + }, + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/compat-data": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.4.tgz", + "integrity": "sha512-t+rjExOrSVvjQQXNp5zAIYDp00KjdvGl/TpDX5REPr0S9IAIPQMTilcfG6q8c0QFmj9lSTVySV2VTsyggvtNIw==", + "dev": true, + "requires": { + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "semver": "^5.5.0" + } + }, + "@babel/core": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.4.tgz", + "integrity": "sha512-3A0tS0HWpy4XujGc7QtOIHTeNwUgWaZc/WuS5YQrfhU67jnVmsD6OGPc1AKHH0LJHQICGncy3+YUjIhVlfDdcA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.4", + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } + }, + "@babel/generator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.4.tgz", + "integrity": "sha512-toLIHUIAgcQygFZRAQcsLQV3CBuX6yOIru1kJk/qqqvcRmZrYe6WavZTSG+bB8MxhnL9YPf+pKQfuiP161q7ng==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz", + "integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", + "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.4.tgz", + "integrity": "sha512-a3rYhlsGV0UHNDvrtOXBg8/OpfV0OKTkxKPzIplS1zpx7CygDcWWxckxZeDd3gzPzC4kUT0A4nVFDK0wGMh4MQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.10.4", + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "levenary": "^1.1.1", + "semver": "^5.5.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.4.tgz", + "integrity": "sha512-9raUiOsXPxzzLjCXeosApJItoMnX3uyT4QdM2UldffuGApNrF8e938MwNpDCK9CPoyxrEoCgT+hObJc3mZa6lQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4" + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.4.tgz", + "integrity": "sha512-2/hu58IEPKeoLF45DBwx3XFqsbCXmkdAay4spVr2x0jYgRxrSNp+ePwvSsy9g6YSaNDcKIQVPXk1Ov8S2edk2g==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-regex": "^7.10.4", + "regexpu-core": "^4.7.0" + } + }, + "@babel/helper-define-map": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.4.tgz", + "integrity": "sha512-nIij0oKErfCnLUCWaCaHW0Bmtl2RO9cN7+u2QT8yqTywgALKlyUVOvHDElh+b5DwVC6YB1FOYFOTWcN/+41EDA==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/types": "^7.10.4", + "lodash": "^4.17.13" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz", + "integrity": "sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A==", + "dev": true, + "requires": { + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", + "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.4.tgz", + "integrity": "sha512-m5j85pK/KZhuSdM/8cHUABQTAslV47OjfIB9Cc7P+PvlAoBzdb79BGNfw8RhT5Mq3p+xGd0ZfAKixbrUZx0C7A==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-module-transforms": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.4.tgz", + "integrity": "sha512-Er2FQX0oa3nV7eM1o0tNCTx7izmQtwAQsIiaLRWtavAAEcskb0XJ5OjJbVrYXWOTr8om921Scabn4/tzlx7j1Q==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.4.tgz", + "integrity": "sha512-inWpnHGgtg5NOF0eyHlC0/74/VkdRITY9dtTpB2PrxKKn+AkVMRiZz/Adrx+Ssg+MLDesi2zohBW6MVq6b4pOQ==", + "dev": true, + "requires": { + "lodash": "^4.17.13" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz", + "integrity": "sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-wrap-function": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-replace-supers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz", + "integrity": "sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helpers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.4.tgz", + "integrity": "sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA==", + "dev": true + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.4.tgz", + "integrity": "sha512-MJbxGSmejEFVOANAezdO39SObkURO5o/8b6fSH6D1pi9RZQt+ldppKPXfqgUWpSQ9asM6xaSaSJIaeWMDRP0Zg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.10.4", + "@babel/plugin-syntax-async-generators": "^7.8.0" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz", + "integrity": "sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz", + "integrity": "sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.4.tgz", + "integrity": "sha512-fCL7QF0Jo83uy1K0P2YXrfX11tj3lkpN7l4dMv9Y9VkowkhkQDwFHFd8IiwyK5MZjE8UpbgokkgtcReH88Abaw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.0" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz", + "integrity": "sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.4.tgz", + "integrity": "sha512-73/G7QoRoeNkLZFxsoCCvlg4ezE4eM+57PnOqgaPOozd5myfj7p0muD1mRVJvbUWbOzD+q3No2bWbaKy+DJ8DA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.10.4.tgz", + "integrity": "sha512-6vh4SqRuLLarjgeOf4EaROJAHjvu9Gl+/346PbDH9yWbJyfnJ/ah3jmYKYtswEyCoWZiidvVHjHshd4WgjB9BA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.10.4" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz", + "integrity": "sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.10.4.tgz", + "integrity": "sha512-ZIhQIEeavTgouyMSdZRap4VPPHqJJ3NEs2cuHs5p0erH+iz6khB0qfgU8g7UuJkG88+fBMy23ZiU+nuHvekJeQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" + } + }, + "@babel/plugin-proposal-private-methods": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz", + "integrity": "sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz", + "integrity": "sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz", + "integrity": "sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.4.tgz", + "integrity": "sha512-ni1brg4lXEmWyafKr0ccFWkJG0CeMt4WV1oyeBW6EFObF4oOHclbkj5cARxAPQyAQ2UTuplJyK4nfkXIMMFvsQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz", + "integrity": "sha512-9J/oD1jV0ZCBcgnoFWFq1vJd4msoKb/TCpGNFyyLt0zABdcvgK3aYikZ8HjzB14c26bc7E3Q1yugpwGy2aTPNA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.4.tgz", + "integrity": "sha512-F6nREOan7J5UXTLsDsZG3DXmZSVofr2tGNwfdrVwkDWHfQckbQXnXSPfD7iO+c/2HGqycwyLST3DnZ16n+cBJQ==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.10.4" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz", + "integrity": "sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.4.tgz", + "integrity": "sha512-J3b5CluMg3hPUii2onJDRiaVbPtKFPLEaV5dOPY5OeAbDi1iU/UbbFFTgwb7WnanaDy7bjU35kc26W3eM5Qa0A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "lodash": "^4.17.13" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.4.tgz", + "integrity": "sha512-2oZ9qLjt161dn1ZE0Ms66xBncQH4In8Sqw1YWgBUZuGVJJS5c0OFZXL6dP2MRHrkU/eKhWg8CzFJhRQl50rQxA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-define-map": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.4.tgz", + "integrity": "sha512-JFwVDXcP/hM/TbyzGq3l/XWGut7p46Z3QvqFMXTfk6/09m7xZHJUN9xHfsv7vqqD4YnfI5ueYdSJtXqqBLyjBw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.4.tgz", + "integrity": "sha512-+WmfvyfsyF603iPa6825mq6Qrb7uLjTOsa3XOFzlYcYDHSS4QmpOWOL0NNBY5qMbvrcf3tq0Cw+v4lxswOBpgA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.4.tgz", + "integrity": "sha512-ZEAVvUTCMlMFAbASYSVQoxIbHm2OkG2MseW6bV2JjIygOjdVv8tuxrCTzj1+Rynh7ODb8GivUy7dzEXzEhuPaA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.4.tgz", + "integrity": "sha512-GL0/fJnmgMclHiBTTWXNlYjYsA7rDrtsazHG6mglaGSTh0KsrW04qml+Bbz9FL0LcJIRwBWL5ZqlNHKTkU3xAA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.4.tgz", + "integrity": "sha512-S5HgLVgkBcRdyQAHbKj+7KyuWx8C6t5oETmUuwz1pt3WTWJhsUV0WIIXuVvfXMxl/QQyHKlSCNNtaIamG8fysw==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.4.tgz", + "integrity": "sha512-ItdQfAzu9AlEqmusA/65TqJ79eRcgGmpPPFvBnGILXZH975G0LNjP1yjHvGgfuCxqrPPueXOPe+FsvxmxKiHHQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.4.tgz", + "integrity": "sha512-OcDCq2y5+E0dVD5MagT5X+yTRbcvFjDI2ZVAottGH6tzqjx/LKpgkUepu3hp/u4tZBzxxpNGwLsAvGBvQ2mJzg==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.4.tgz", + "integrity": "sha512-Xd/dFSTEVuUWnyZiMu76/InZxLTYilOSr1UlHV+p115Z/Le2Fi1KXkJUYz0b42DfndostYlPub3m8ZTQlMaiqQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.4.tgz", + "integrity": "sha512-0bFOvPyAoTBhtcJLr9VcwZqKmSjFml1iVxvPL0ReomGU53CX53HsM4h2SzckNdkQcHox1bpAqzxBI1Y09LlBSw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.4.tgz", + "integrity": "sha512-3Fw+H3WLUrTlzi3zMiZWp3AR4xadAEMv6XRCYnd5jAlLM61Rn+CRJaZMaNvIpcJpQ3vs1kyifYvEVPFfoSkKOA==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz", + "integrity": "sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.4.tgz", + "integrity": "sha512-Tb28LlfxrTiOTGtZFsvkjpyjCl9IoaRI52AEU/VIwOwvDQWtbNJsAqTXzh+5R7i74e/OZHH2c2w2fsOqAfnQYQ==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.10.4", + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz", + "integrity": "sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.10.4.tgz", + "integrity": "sha512-V6LuOnD31kTkxQPhKiVYzYC/Jgdq53irJC/xBSmqcNcqFGV+PER4l6rU5SH2Vl7bH9mLDHcc0+l9HUOe4RNGKA==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.4" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.4.tgz", + "integrity": "sha512-YXwWUDAH/J6dlfwqlWsztI2Puz1NtUAubXhOPLQ5gjR/qmQ5U96DY4FQO8At33JN4XPBhrjB8I4eMmLROjjLjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.4.tgz", + "integrity": "sha512-5iTw0JkdRdJvr7sY0vHqTpnruUpTea32JHmq/atIWqsnNussbRzjEDyWep8UNztt1B5IusBYg8Irb0bLbiEBCQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.4.tgz", + "integrity": "sha512-RurVtZ/D5nYfEg0iVERXYKEgDFeesHrHfx8RT05Sq57ucj2eOYAP6eu5fynL4Adju4I/mP/I6SO0DqNWAXjfLQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.4.tgz", + "integrity": "sha512-ofsAcKiUxQ8TY4sScgsGeR2vJIsfrzqvFb9GvJ5UdXDzl+MyYCaBj/FGzXuv7qE0aJcjWMILny1epqelnFlz8g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.4.tgz", + "integrity": "sha512-3thAHwtor39A7C04XucbMg17RcZ3Qppfxr22wYzZNcVIkPHfpM9J0SO8zuCV6SZa265kxBJSrfKTvDCYqBFXGw==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.4.tgz", + "integrity": "sha512-hGsw1O6Rew1fkFbDImZIEqA8GoidwTAilwCyWqLBM9f+e/u/sQMQu7uX6dyokfOayRuuVfKOW4O7HvaBWM+JlQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.4.tgz", + "integrity": "sha512-AC2K/t7o07KeTIxMoHneyX90v3zkm5cjHJEokrPEAGEy3UCp8sLKfnfOIGdZ194fyN4wfX/zZUWT9trJZ0qc+Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.10.4.tgz", + "integrity": "sha512-1e/51G/Ni+7uH5gktbWv+eCED9pP8ZpRhZB3jOaI3mmzfvJTWHkuyYTv0Z5PYtyM+Tr2Ccr9kUdQxn60fI5WuQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.4.tgz", + "integrity": "sha512-Ddy3QZfIbEV0VYcVtFDCjeE4xwVTJWTmUtorAJkn6u/92Z/nWJNV+mILyqHKrUxXYKA2EoCilgoPePymKL4DvQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-regex": "^7.10.4" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.4.tgz", + "integrity": "sha512-4NErciJkAYe+xI5cqfS8pV/0ntlY5N5Ske/4ImxAVX7mk9Rxt2bwDTGv1Msc2BRJvWQcmYEC+yoMLdX22aE4VQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.4.tgz", + "integrity": "sha512-QqNgYwuuW0y0H+kUE/GWSR45t/ccRhe14Fs/4ZRouNNQsyd4o3PG4OtHiIrepbM2WKUBDAXKCAK/Lk4VhzTaGA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz", + "integrity": "sha512-y5XJ9waMti2J+e7ij20e+aH+fho7Wb7W8rNuu72aKRwCHFqQdhkdU2lo3uZ9tQuboEJcUFayXdARhcxLQ3+6Fg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.4.tgz", + "integrity": "sha512-wNfsc4s8N2qnIwpO/WP2ZiSyjfpTamT2C9V9FDH/Ljub9zw6P3SjkXcFmc0RQUt96k2fmIvtla2MMjgTwIAC+A==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/preset-env": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.10.4.tgz", + "integrity": "sha512-tcmuQ6vupfMZPrLrc38d0sF2OjLT3/bZ0dry5HchNCQbrokoQi4reXqclvkkAT5b+gWc23meVWpve5P/7+w/zw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.10.4", + "@babel/helper-compilation-targets": "^7.10.4", + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-proposal-async-generator-functions": "^7.10.4", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/plugin-proposal-dynamic-import": "^7.10.4", + "@babel/plugin-proposal-json-strings": "^7.10.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", + "@babel/plugin-proposal-numeric-separator": "^7.10.4", + "@babel/plugin-proposal-object-rest-spread": "^7.10.4", + "@babel/plugin-proposal-optional-catch-binding": "^7.10.4", + "@babel/plugin-proposal-optional-chaining": "^7.10.4", + "@babel/plugin-proposal-private-methods": "^7.10.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.10.4", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.10.4", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.10.4", + "@babel/plugin-transform-arrow-functions": "^7.10.4", + "@babel/plugin-transform-async-to-generator": "^7.10.4", + "@babel/plugin-transform-block-scoped-functions": "^7.10.4", + "@babel/plugin-transform-block-scoping": "^7.10.4", + "@babel/plugin-transform-classes": "^7.10.4", + "@babel/plugin-transform-computed-properties": "^7.10.4", + "@babel/plugin-transform-destructuring": "^7.10.4", + "@babel/plugin-transform-dotall-regex": "^7.10.4", + "@babel/plugin-transform-duplicate-keys": "^7.10.4", + "@babel/plugin-transform-exponentiation-operator": "^7.10.4", + "@babel/plugin-transform-for-of": "^7.10.4", + "@babel/plugin-transform-function-name": "^7.10.4", + "@babel/plugin-transform-literals": "^7.10.4", + "@babel/plugin-transform-member-expression-literals": "^7.10.4", + "@babel/plugin-transform-modules-amd": "^7.10.4", + "@babel/plugin-transform-modules-commonjs": "^7.10.4", + "@babel/plugin-transform-modules-systemjs": "^7.10.4", + "@babel/plugin-transform-modules-umd": "^7.10.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.10.4", + "@babel/plugin-transform-new-target": "^7.10.4", + "@babel/plugin-transform-object-super": "^7.10.4", + "@babel/plugin-transform-parameters": "^7.10.4", + "@babel/plugin-transform-property-literals": "^7.10.4", + "@babel/plugin-transform-regenerator": "^7.10.4", + "@babel/plugin-transform-reserved-words": "^7.10.4", + "@babel/plugin-transform-shorthand-properties": "^7.10.4", + "@babel/plugin-transform-spread": "^7.10.4", + "@babel/plugin-transform-sticky-regex": "^7.10.4", + "@babel/plugin-transform-template-literals": "^7.10.4", + "@babel/plugin-transform-typeof-symbol": "^7.10.4", + "@babel/plugin-transform-unicode-escapes": "^7.10.4", + "@babel/plugin-transform-unicode-regex": "^7.10.4", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.10.4", + "browserslist": "^4.12.0", + "core-js-compat": "^3.6.2", + "invariant": "^2.2.2", + "levenary": "^1.1.1", + "semver": "^5.5.0" + } + }, + "@babel/preset-modules": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", + "integrity": "sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/runtime": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz", + "integrity": "sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/template": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/traverse": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.4.tgz", + "integrity": "sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "optional": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "optional": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "optional": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "optional": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "optional": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true, + "optional": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "optional": true + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "optional": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browserslist": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz", + "integrity": "sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001093", + "electron-to-chromium": "^1.3.488", + "escalade": "^3.0.1", + "node-releases": "^1.1.58" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "optional": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "caniuse-lite": { + "version": "1.0.30001097", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001097.tgz", + "integrity": "sha512-TeuSleKt/vWXaPkLVFqGDnbweYfq4IaZ6rUugFf3rWY6dlII8StUZ8Ddin0PkADfgYZ4wRqCdO2ORl4Rn5eZIA==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "optional": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "optional": true + }, + "core-js-compat": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", + "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", + "dev": true, + "requires": { + "browserslist": "^4.8.5", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "optional": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "electron-to-chromium": { + "version": "1.3.496", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.496.tgz", + "integrity": "sha512-TXY4mwoyowwi4Lsrq9vcTUYBThyc1b2hXaTZI13p8/FRhY2CTaq5lK+DVjhYkKiTLsKt569Xes+0J5JsVXFurQ==", + "dev": true + }, + "escalade": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.1.tgz", + "integrity": "sha512-DR6NO3h9niOT+MZs7bjxlj2a1k+POu5RN8CLTPX2+i78bRi9eLe7+0zXgUHMnGXWybYcL61E9hGhPKqedy8tQA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "optional": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "optional": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "optional": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "optional": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "optional": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "optional": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "optional": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "optional": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levenary": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", + "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", + "dev": true, + "requires": { + "leven": "^3.1.0" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "optional": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "optional": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "optional": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "node-releases": { + "version": "1.1.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.59.tgz", + "integrity": "sha512-H3JrdUczbdiwxN5FuJPyCHnGHIFqQ0wWxo+9j1kAXAzqNMAHlo+4I/sYYxpyK0irQ73HgdiyzD32oqQDcU2Osw==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "optional": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "optional": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "optional": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true, + "optional": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "optional": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "regenerate": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", + "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + }, + "regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpu-core": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", + "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true, + "optional": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true, + "optional": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "optional": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true, + "optional": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "optional": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "optional": true, + "requires": { + "ret": "~0.1.10" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "optional": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "optional": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true, + "optional": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "optional": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "optional": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "optional": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "optional": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true, + "optional": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0b4d762 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "flowy", + "version": "1.0.0", + "description": "", + "main": "flowy.min.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "babel engine/ -d lib" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/iammukeshpatel/flowy.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/iammukeshpatel/flowy/issues" + }, + "homepage": "https://github.com/iammukeshpatel/flowy#readme", + "devDependencies": { + "@babel/cli": "^7.10.4", + "@babel/core": "^7.10.4", + "@babel/preset-env": "^7.10.4" + } +} From 71da1fc1da0b8c7cbb8a9080ad191bbe1cc749d0 Mon Sep 17 00:00:00 2001 From: seema chauhan Date: Sat, 11 Jul 2020 14:39:48 +0530 Subject: [PATCH 2/5] added string to element to support ie --- .vscode/settings.json | 3 + babel.config.json | 23 + demo/flowy.min.css | 44 +- demo/index.html | 11 +- demo/styles.css | 1 - engine/flowy copy.js | 645 +++++++++++++++++++++ engine/flowy.js | 108 ++-- lib/flowy copy.js | 1229 +++++++++++++++++++++++++++++++++++++++++ lib/flowy.js | 110 ++-- lib/helper.js | 4 + 10 files changed, 2060 insertions(+), 118 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 babel.config.json create mode 100644 engine/flowy copy.js create mode 100644 lib/flowy copy.js create mode 100644 lib/helper.js diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000..5f6b1c2 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,23 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "ie": 11 + }, + "debug": true, + "useBuiltIns": "entry", + "sourceMaps": true + } + ] + ], + "plugins": [ + [ + "@babel/plugin-transform-arrow-functions", + { + "spec": false + } + ] + ] +} \ No newline at end of file diff --git a/demo/flowy.min.css b/demo/flowy.min.css index 3c6ebf3..29aca31 100644 --- a/demo/flowy.min.css +++ b/demo/flowy.min.css @@ -1 +1,43 @@ -.dragging{z-index:111!important}.block{position:absolute;z-index:9}.indicator{width:12px;height:12px;border-radius:60px;background-color:#217ce8;margin-top:-5px;opacity:1;transition:all .3s cubic-bezier(.05,.03,.35,1);transform:scale(1);position:absolute;z-index:2}.invisible{opacity:0!important;transform:scale(0)}.indicator:after{content:"";display:block;width:12px;height:12px;background-color:#217ce8;transform:scale(1.7);opacity:.2;border-radius:60px}.arrowblock{position:absolute;width:100%;overflow:visible;pointer-events:none}.arrowblock svg{width: -webkit-fill-available;overflow: visible;} \ No newline at end of file +.dragging { + z-index: 111 !important; +} +.block { + position: absolute; + z-index: 9; +} +.indicator { + width: 12px; + height: 12px; + border-radius: 60px; + background-color: #217ce8; + margin-top: -5px; + opacity: 1; + transition: all 0.3s cubic-bezier(0.05, 0.03, 0.35, 1); + transform: scale(1); + position: absolute; + z-index: 2; +} +.invisible { + opacity: 0 !important; + transform: scale(0); +} +.indicator:after { + content: ""; + display: block; + width: 12px; + height: 12px; + background-color: #217ce8; + transform: scale(1.7); + opacity: 0.2; + border-radius: 60px; +} +.arrowblock { + position: absolute; + width: 100%; + overflow: visible; + pointer-events: none; +} +.arrowblock svg { + width: -webkit-fill-available; + overflow: visible; +} diff --git a/demo/index.html b/demo/index.html index b6ef8bd..131a501 100644 --- a/demo/index.html +++ b/demo/index.html @@ -24,7 +24,11 @@ + + + + @@ -128,13 +132,6 @@ -
diff --git a/demo/styles.css b/demo/styles.css index 181edef..f4055b0 100644 --- a/demo/styles.css +++ b/demo/styles.css @@ -301,7 +301,6 @@ body, html { width: 15px; } #blocklist { - height: calc(100% - 220px); overflow: auto; } #proplist { diff --git a/engine/flowy copy.js b/engine/flowy copy.js new file mode 100644 index 0000000..9807ed7 --- /dev/null +++ b/engine/flowy copy.js @@ -0,0 +1,645 @@ +var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spacing_y) { + if (!grab) { + grab = function() {}; + } + if (!release) { + release = function() {}; + } + if (!snapping) { + snapping = function() { + return true; + } + } + if (!rearrange) { + rearrange = function() { + return false; + } + } + if (!spacing_x) { + spacing_x = 20; + } + if (!spacing_y) { + spacing_y = 80; + } + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + } + if (!Element.prototype.closest) { + Element.prototype.closest = function(s) { + var el = this; + do { + if (Element.prototype.matches.call(el, s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + } + var loaded = false; + flowy.load = function() { + if (!loaded) + loaded = true; + else + return; + var blocks = []; + var blockstemp = []; + var canvas_div = canvas; + var active = false; + var paddingx = spacing_x; + var paddingy = spacing_y; + var offsetleft = 0; + var offsetleftold = 0; + var rearrange = false; + var lastevent = false; + var drag, dragx, dragy, original; + var mouse_x, mouse_y; + var dragblock = false; + var prevblock = 0; + var el = document.createElement("DIV"); + el.classList.add('indicator'); + el.classList.add('invisible'); + canvas_div.appendChild(el); + flowy.import = function(output) { + canvas_div.innerHTML = output.html; + for (var a = 0; a < output.blockarr.length; a++) { + var block = { + childwidth: parseFloat(output.blockarr[a].childwidth), + parent: parseFloat(output.blockarr[a].parent), + id: parseFloat(output.blockarr[a].id), + x: parseFloat(output.blockarr[a].x), + y: parseFloat(output.blockarr[a].y), + width: parseFloat(output.blockarr[a].width), + height: parseFloat(output.blockarr[a].height) + }; + blocks.push(block) + } + if (blocks.length > 1) { + rearrangeMe(); + } + } + flowy.output = function() { + var html_ser = canvas_div.innerHTML; + var json_data = {html:html_ser, blockarr:blocks, blocks:[]}; + if (blocks.length > 0) { + for (var i = 0; i < blocks.length; i++) { + json_data.blocks.push({ + id: blocks[i].id, + parent: blocks[i].parent, + data: [], + attr: [] + }); + var blockParent = document.querySelector(".blockid[value='" + blocks[i].id + "']").parentNode; + blockParent.querySelectorAll("input").forEach(function(block) { + var json_name = block.getAttribute("name"); + var json_value = block.value; + json_data.blocks[i].data.push({ + name: json_name, + value: json_value + }); + }); + Array.prototype.slice.call(blockParent.attributes).forEach(function(attribute) { + var jsonobj = {}; + jsonobj[attribute.name] = attribute.value; + json_data.blocks[i].attr.push(jsonobj); + }); + } + return json_data; + } + } + flowy.deleteBlocks = function() { + blocks = []; + canvas_div.innerHTML = ""; + } + + flowy.beginDrag = function(event) { + if (event.targetTouches) { + mouse_x = event.changedTouches[0].clientX; + mouse_y = event.changedTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + if (event.which != 3 && event.target.closest(".create-flowy")) { + original = event.target.closest(".create-flowy"); + var newNode = event.target.closest(".create-flowy").cloneNode(true); + event.target.closest(".create-flowy").classList.add("dragnow"); + newNode.classList.add("block"); + newNode.classList.remove("create-flowy"); + if (blocks.length === 0) { + newNode.innerHTML += ""; + document.body.appendChild(newNode); + drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; + } else { + newNode.innerHTML += ""; + document.body.appendChild(newNode); + drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(a => a.id))) + 1) + "']").parentNode; + } + blockGrabbed(event.target.closest(".create-flowy")); + drag.classList.add("dragging"); + active = true; + dragx = mouse_x - (event.target.closest(".create-flowy").getBoundingClientRect().left); + dragy = mouse_y - (event.target.closest(".create-flowy").getBoundingClientRect().top); + drag.style.left = mouse_x - dragx + "px"; + drag.style.top = mouse_y - dragy + "px"; + } + } + document.addEventListener("mousedown",touchblock, false); + document.addEventListener("touchstart",touchblock, false); + document.addEventListener("mouseup", touchblock, false); + + flowy.touchDone = function() { + dragblock = false; + } + document.addEventListener('mousedown',flowy.beginDrag); + document.addEventListener('touchstart',flowy.beginDrag); + + flowy.endDrag = function(event) { + if (event.which != 3 && (active || rearrange)) { + dragblock = false; + blockReleased(); + if (!document.querySelector(".indicator").classList.contains("invisible")) { + document.querySelector(".indicator").classList.add("invisible"); + } + if (active) { + original.classList.remove("dragnow"); + drag.classList.remove("dragging"); + } + if (parseInt(drag.querySelector(".blockid").value) === 0 && rearrange) { + drag.classList.remove("dragging"); + rearrange = false; + for (var w = 0; w < blockstemp.length; w++) { + if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { + const blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; + const arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; + blockParent.style.left = (blockParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; + blockParent.style.top = (blockParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop - 1 + "px"; + arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; + arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + canvas_div.scrollTop) - 1 + "px"; + canvas_div.appendChild(blockParent); + canvas_div.appendChild(arrowParent); + blockstemp[w].x = (blockParent.getBoundingClientRect().left + window.scrollX) + (parseInt(blockParent.offsetWidth) / 2) + canvas_div.scrollLeft - 1; + blockstemp[w].y = (blockParent.getBoundingClientRect().top + window.scrollY) + (parseInt(blockParent.offsetHeight) / 2) + canvas_div.scrollTop - 1; + } + } + blockstemp.filter(a => a.id == 0)[0].x = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2); + blockstemp.filter(a => a.id == 0)[0].y = (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2); + blocks = blocks.concat(blockstemp); + blockstemp = []; + } else if (active && blocks.length == 0 && (drag.getBoundingClientRect().top + window.scrollY) > (canvas_div.getBoundingClientRect().top + window.scrollY) && (drag.getBoundingClientRect().left + window.scrollX) > (canvas_div.getBoundingClientRect().left + window.scrollX)) { + blockSnap(drag, true, undefined); + active = false; + drag.style.top = (drag.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + drag.style.left = (drag.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + canvas_div.appendChild(drag); + blocks.push({ + parent: -1, + childwidth: 0, + id: parseInt(drag.querySelector(".blockid").value), + x: (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft, + y: (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop, + width: parseInt(window.getComputedStyle(drag).width), + height: parseInt(window.getComputedStyle(drag).height) + }); + } else if (active && blocks.length == 0) { + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } else if (active) { + var xpos = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + var ypos = (drag.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + var blocko = blocks.map(a => a.id); + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(a => a.id == blocko[i])[0].x - (blocks.filter(a => a.id == blocko[i])[0].width / 2) - paddingx && xpos <= blocks.filter(a => a.id == blocko[i])[0].x + (blocks.filter(a => a.id == blocko[i])[0].width / 2) + paddingx && ypos >= blocks.filter(a => a.id == blocko[i])[0].y - (blocks.filter(a => a.id == blocko[i])[0].height / 2) && ypos <= blocks.filter(a => a.id == blocko[i])[0].y + blocks.filter(a => a.id == blocko[i])[0].height) { + active = false; + if (blockSnap(drag, false, document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode)) { + snap(drag,i, blocko); + } else { + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } + break; + } else if (i == blocks.length - 1) { + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } + } + } else if (rearrange) { + var xpos = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + var ypos = (drag.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + var blocko = blocks.map(a => a.id); + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(a => a.id == blocko[i])[0].x - (blocks.filter(a => a.id == blocko[i])[0].width / 2) - paddingx && xpos <= blocks.filter(a => a.id == blocko[i])[0].x + (blocks.filter(a => a.id == blocko[i])[0].width / 2) + paddingx && ypos >= blocks.filter(a => a.id == blocko[i])[0].y - (blocks.filter(a => a.id == blocko[i])[0].height / 2) && ypos <= blocks.filter(a => a.id == blocko[i])[0].y + blocks.filter(a => a.id == blocko[i])[0].height) { + active = false; + drag.classList.remove("dragging"); + snap(drag,i,blocko); + break; + } else if (i == blocks.length - 1) { + if (beforeDelete(drag, blocks.filter(id => id.id == blocko[i])[0])) { + active = false; + drag.classList.remove("dragging"); + snap(drag, blocko.indexOf(prevblock), blocko); + break; + } else { + rearrange = false; + blockstemp = []; + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + break; + } + } + } + } + } + } + + document.addEventListener("mouseup", flowy.endDrag, false); + document.addEventListener("touchend", flowy.endDrag, false); + + function snap(drag, i, blocko) { + if (!rearrange) { + canvas_div.appendChild(drag); + } + var totalwidth = 0; + var totalremove = 0; + var maxheight = 0; + for (var w = 0; w < blocks.filter(id => id.parent == blocko[i]).length; w++) { + var children = blocks.filter(id => id.parent == blocko[i])[w]; + if (children.childwidth > children.width) { + totalwidth += children.childwidth + paddingx; + } else { + totalwidth += children.width + paddingx; + } + } + totalwidth += parseInt(window.getComputedStyle(drag).width); + for (var w = 0; w < blocks.filter(id => id.parent == blocko[i]).length; w++) { + var children = blocks.filter(id => id.parent == blocko[i])[w]; + if (children.childwidth > children.width) { + document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(a => a.id == blocko[i])[0].x - (totalwidth / 2) + totalremove + (children.childwidth / 2) - (children.width / 2) + "px"; + children.x = blocks.filter(id => id.parent == blocko[i])[0].x - (totalwidth / 2) + totalremove + (children.childwidth / 2); + totalremove += children.childwidth + paddingx; + } else { + document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(a => a.id == blocko[i])[0].x - (totalwidth / 2) + totalremove + "px"; + children.x = blocks.filter(id => id.parent == blocko[i])[0].x - (totalwidth / 2) + totalremove + (children.width / 2); + totalremove += children.width + paddingx; + } + } + drag.style.left = blocks.filter(id => id.id == blocko[i])[0].x - (totalwidth / 2) + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = blocks.filter(id => id.id == blocko[i])[0].y + (blocks.filter(id => id.id == blocko[i])[0].height / 2) + paddingy - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + if (rearrange) { + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value))[0].x = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value))[0].y = (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop; + blockstemp.filter(a => a.id == drag.querySelector(".blockid").value)[0].parent = blocko[i]; + for (var w = 0; w < blockstemp.length; w++) { + if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { + const blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; + const arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; + blockParent.style.left = (blockParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + blockParent.style.top = (blockParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + 20 + "px"; + arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + canvas_div.appendChild(blockParent); + canvas_div.appendChild(arrowParent); + + blockstemp[w].x = (blockParent.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(blockParent).width) / 2) + canvas_div.scrollLeft; + blockstemp[w].y = (blockParent.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(blockParent).height) / 2) + canvas_div.scrollTop; + + } + } + blocks = blocks.concat(blockstemp); + blockstemp = []; + } else { + blocks.push({ + childwidth: 0, + parent: blocko[i], + id: parseInt(drag.querySelector(".blockid").value), + x: (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft, + y: (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop, + width: parseInt(window.getComputedStyle(drag).width), + height: parseInt(window.getComputedStyle(drag).height) + }); + } + var arrowhelp = blocks.filter(a => a.id == parseInt(drag.querySelector(".blockid").value))[0]; + var arrowx = arrowhelp.x - blocks.filter(a => a.id == blocko[i])[0].x + 20; + var arrowy = parseFloat(arrowhelp.y - (arrowhelp.height / 2) - (blocks.filter(id => id.parent == blocko[i])[0].y + (blocks.filter(id => id.parent == blocko[i])[0].height / 2)) + canvas_div.scrollTop); + if (arrowx < 0) { + canvas_div.innerHTML += '
'; + document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = (arrowhelp.x - 5) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + } else { + canvas_div.innerHTML += '
'; + document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(a => a.id == blocko[i])[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + } + document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(a => a.id == blocko[i])[0].y + (blocks.filter(a => a.id == blocko[i])[0].height / 2) + "px"; + if (blocks.filter(a => a.id == blocko[i])[0].parent != -1) { + var flag = false; + var idval = blocko[i]; + while (!flag) { + if (blocks.filter(a => a.id == idval)[0].parent == -1) { + flag = true; + } else { + var zwidth = 0; + for (var w = 0; w < blocks.filter(id => id.parent == idval).length; w++) { + var children = blocks.filter(id => id.parent == idval)[w]; + if (children.childwidth > children.width) { + if (w == blocks.filter(id => id.parent == idval).length - 1) { + zwidth += children.childwidth; + } else { + zwidth += children.childwidth + paddingx; + } + } else { + if (w == blocks.filter(id => id.parent == idval).length - 1) { + zwidth += children.width; + } else { + zwidth += children.width + paddingx; + } + } + } + blocks.filter(a => a.id == idval)[0].childwidth = zwidth; + idval = blocks.filter(a => a.id == idval)[0].parent; + } + } + blocks.filter(id => id.id == idval)[0].childwidth = totalwidth; + } + if (rearrange) { + rearrange = false; + drag.classList.remove("dragging"); + } + rearrangeMe(); + checkOffset(); + } + + function touchblock(event) { + dragblock = false; + if (hasParentClass(event.target, "block")) { + var theblock = event.target.closest(".block"); + if (event.targetTouches) { + mouse_x = event.targetTouches[0].clientX; + mouse_y = event.targetTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + if (event.type !== "mouseup" && hasParentClass(event.target, "block")) { + if (event.which != 3) { + if (!active && !rearrange) { + dragblock = true; + drag = theblock; + dragx = mouse_x - (drag.getBoundingClientRect().left + window.scrollX); + dragy = mouse_y - (drag.getBoundingClientRect().top + window.scrollY); + } + } + } + } + } + + function hasParentClass(element, classname) { + if (element.className) { + if (element.className.split(' ').indexOf(classname)>=0) return true; + } + return element.parentNode && hasParentClass(element.parentNode, classname); + } + + flowy.moveBlock = function(event) { + if (event.targetTouches) { + mouse_x = event.targetTouches[0].clientX; + mouse_y = event.targetTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + if (dragblock) { + rearrange = true; + drag.classList.add("dragging"); + var blockid = parseInt(drag.querySelector(".blockid").value); + prevblock = blocks.filter(a => a.id == blockid)[0].parent; + blockstemp.push(blocks.filter(a => a.id == blockid)[0]); + blocks = blocks.filter(function(e) { + return e.id != blockid + }); + if (blockid != 0) { + document.querySelector(".arrowid[value='" + blockid + "']").parentNode.remove(); + } + var layer = blocks.filter(a => a.parent == blockid); + var flag = false; + var foundids = []; + var allids = []; + while (!flag) { + for (var i = 0; i < layer.length; i++) { + if (layer[i] != blockid) { + blockstemp.push(blocks.filter(a => a.id == layer[i].id)[0]); + const blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; + const arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; + blockParent.style.left = (blockParent.getBoundingClientRect().left + window.scrollX) - (drag.getBoundingClientRect().left + window.scrollX) + "px"; + blockParent.style.top = (blockParent.getBoundingClientRect().top + window.scrollY) - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.scrollX) - (drag.getBoundingClientRect().left + window.scrollX) + "px"; + arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.scrollY) - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + drag.appendChild(blockParent); + drag.appendChild(arrowParent); + foundids.push(layer[i].id); + allids.push(layer[i].id); + } + } + if (foundids.length == 0) { + flag = true; + } else { + layer = blocks.filter(a => foundids.includes(a.parent)); + foundids = []; + } + } + for (var i = 0; i < blocks.filter(a => a.parent == blockid).length; i++) { + var blocknumber = blocks.filter(a => a.parent == blockid)[i]; + blocks = blocks.filter(function(e) { + return e.id != blocknumber + }); + } + for (var i = 0; i < allids.length; i++) { + var blocknumber = allids[i]; + blocks = blocks.filter(function(e) { + return e.id != blocknumber + }); + } + if (blocks.length > 1) { + rearrangeMe(); + } + if (lastevent) { + fixOffset(); + } + dragblock = false; + } + if (active) { + drag.style.left = mouse_x - dragx + "px"; + drag.style.top = mouse_y - dragy + "px"; + } else if (rearrange) { + drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value)).x = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value)).y = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop; + } + if (active || rearrange) { + var xpos = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + var ypos = (drag.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop; + var blocko = blocks.map(a => a.id); + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(a => a.id == blocko[i])[0].x - (blocks.filter(a => a.id == blocko[i])[0].width / 2) - paddingx && xpos <= blocks.filter(a => a.id == blocko[i])[0].x + (blocks.filter(a => a.id == blocko[i])[0].width / 2) + paddingx && ypos >= blocks.filter(a => a.id == blocko[i])[0].y - (blocks.filter(a => a.id == blocko[i])[0].height / 2) && ypos <= blocks.filter(a => a.id == blocko[i])[0].y + blocks.filter(a => a.id == blocko[i])[0].height) { + document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode.appendChild(document.querySelector(".indicator")); + document.querySelector(".indicator").style.left = (parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).width) / 2) - 5 + "px"; + document.querySelector(".indicator").style.top = window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).height + "px"; + document.querySelector(".indicator").classList.remove("invisible"); + break; + } else if (i == blocks.length - 1) { + if (!document.querySelector(".indicator").classList.contains("invisible")) { + document.querySelector(".indicator").classList.add("invisible"); + } + } + } + } + } + + document.addEventListener("mousemove", flowy.moveBlock, false); + document.addEventListener("touchmove", flowy.moveBlock, false); + + function checkOffset() { + offsetleft = blocks.map(a => a.x); + var widths = blocks.map(a => a.width); + var mathmin = offsetleft.map(function(item, index) { + return item - (widths[index] / 2); + }) + offsetleft = Math.min.apply(Math, mathmin); + if (offsetleft < (canvas_div.getBoundingClientRect().left + window.scrollX)) { + lastevent = true; + var blocko = blocks.map(a => a.id); + for (var w = 0; w < blocks.length; w++) { + document.querySelector(".blockid[value='" + blocks.filter(a => a.id == blocko[w])[0].id + "']").parentNode.style.left = blocks.filter(a => a.id == blocko[w])[0].x - (blocks.filter(a => a.id == blocko[w])[0].width / 2) - offsetleft + 20 + "px"; + if (blocks.filter(a => a.id == blocko[w])[0].parent != -1) { + var arrowhelp = blocks.filter(a => a.id == blocko[w])[0]; + var arrowx = arrowhelp.x - blocks.filter(a => a.id == blocks.filter(a => a.id == blocko[w])[0].parent)[0].x; + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = (arrowhelp.x - offsetleft + 20 - 5) + "px"; + } else { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(id => id.id == blocks.filter(a => a.id == blocko[w])[0].parent)[0].x - 20 - offsetleft + 20 + "px"; + } + } + } + for (var w = 0; w < blocks.length; w++) { + blocks[w].x = (document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode.getBoundingClientRect().left + window.scrollX) + (canvas_div.getBoundingClientRect().left + canvas_div.scrollLeft) - (parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode).width) / 2) - 40; + } + offsetleftold = offsetleft; + } + } + + function fixOffset() { + if (offsetleftold < (canvas_div.getBoundingClientRect().left + window.scrollX)) { + lastevent = false; + var blocko = blocks.map(a => a.id); + for (var w = 0; w < blocks.length; w++) { + document.querySelector(".blockid[value='" + blocks.filter(a => a.id == blocko[w])[0].id + "']").parentNode.style.left = blocks.filter(a => a.id == blocko[w])[0].x - (blocks.filter(a => a.id == blocko[w])[0].width / 2) - offsetleftold - 20 + "px"; + blocks.filter(a => a.id == blocko[w])[0].x = (document.querySelector(".blockid[value='" + blocks.filter(a => a.id == blocko[w])[0].id + "']").parentNode.getBoundingClientRect().left + window.scrollX) + (blocks.filter(a => a.id == blocko[w])[0].width / 2); + + if (blocks.filter(a => a.id == blocko[w])[0].parent != -1) { + var arrowhelp = blocks.filter(a => a.id == blocko[w])[0]; + var arrowx = arrowhelp.x - blocks.filter(a => a.id == blocks.filter(a => a.id == blocko[w])[0].parent)[0].x; + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = (arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"); + } else { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(id => id.id == blocks.filter(a => a.id == blocko[w])[0].parent)[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + } + } + } + offsetleftold = 0; + } + } + + function rearrangeMe() { + var result = blocks.map(a => a.parent); + for (var z = 0; z < result.length; z++) { + if (result[z] == -1) { + z++; + } + var totalwidth = 0; + var totalremove = 0; + var maxheight = 0; + for (var w = 0; w < blocks.filter(id => id.parent == result[z]).length; w++) { + var children = blocks.filter(id => id.parent == result[z])[w]; + if (blocks.filter(id => id.parent == children.id).length == 0) { + children.childwidth = 0; + } + if (children.childwidth > children.width) { + if (w == blocks.filter(id => id.parent == result[z]).length - 1) { + totalwidth += children.childwidth; + } else { + totalwidth += children.childwidth + paddingx; + } + } else { + if (w == blocks.filter(id => id.parent == result[z]).length - 1) { + totalwidth += children.width; + } else { + totalwidth += children.width + paddingx; + } + } + } + if (result[z] != -1) { + blocks.filter(a => a.id == result[z])[0].childwidth = totalwidth; + } + for (var w = 0; w < blocks.filter(id => id.parent == result[z]).length; w++) { + var children = blocks.filter(id => id.parent == result[z])[w]; + const r_block = document.querySelector(".blockid[value='" + children.id + "']").parentNode; + const r_array = blocks.filter(id => id.id == result[z]); + r_block.style.top = r_array.y + paddingy + "px"; + r_array.y = r_array.y + paddingy; + if (children.childwidth > children.width) { + r_block.style.left = r_array[0].x - (totalwidth / 2) + totalremove + (children.childwidth / 2) - (children.width / 2) - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + children.x = r_array[0].x - (totalwidth / 2) + totalremove + (children.childwidth / 2); + totalremove += children.childwidth + paddingx; + } else { + r_block.style.left = r_array[0].x - (totalwidth / 2) + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + children.x = r_array[0].x - (totalwidth / 2) + totalremove + (children.width / 2); + totalremove += children.width + paddingx; + } + var arrowhelp = blocks.filter(a => a.id == children.id)[0]; + var arrowx = arrowhelp.x - blocks.filter(a => a.id == children.parent)[0].x + 20; + var arrowy = arrowhelp.y - (arrowhelp.height / 2) - (blocks.filter(a => a.id == children.parent)[0].y + (blocks.filter(a => a.id == children.parent)[0].height / 2)); + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(id => id.id == children.parent)[0].y + (blocks.filter(id => id.id == children.parent)[0].height / 2) - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = (arrowhelp.x - 5) - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + } else { + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(id => id.id == children.parent)[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + } + } + } + } + } + flowy.load(); + + function blockGrabbed(block) { + grab(block); + } + + function blockReleased() { + release(); + } + + function blockSnap(drag, first, parent) { + return snapping(drag, first, parent); + } + + function beforeDelete(drag, parent) { + return rearrange(drag, parent); + } + + function addEventListenerMulti(type, listener, capture, selector) { + var nodes = document.querySelectorAll(selector); + for (var i=0; i < nodes.length; i++) { + nodes[i].addEventListener(type, listener, capture); + } + } + + function removeEventListenerMulti(type, listener, capture, selector) { + var nodes = document.querySelectorAll(selector); + for (var i = 0; i < nodes.length; i++) { + nodes[i].removeEventListener(type, listener, capture); + } + } +} diff --git a/engine/flowy.js b/engine/flowy.js index 9807ed7..7726b53 100644 --- a/engine/flowy.js +++ b/engine/flowy.js @@ -171,32 +171,32 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { const blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; const arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; - blockParent.style.left = (blockParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; - blockParent.style.top = (blockParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop - 1 + "px"; - arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; - arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + canvas_div.scrollTop) - 1 + "px"; + blockParent.style.left = (blockParent.getBoundingClientRect().left + window.pageXOffset) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft - 1 + "px"; + blockParent.style.top = (blockParent.getBoundingClientRect().top + window.pageYOffset) - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop - 1 + "px"; + arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.pageXOffset) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft - 1 + "px"; + arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.pageYOffset) - (canvas_div.getBoundingClientRect().top + canvas_div.scrollTop) - 1 + "px"; canvas_div.appendChild(blockParent); canvas_div.appendChild(arrowParent); - blockstemp[w].x = (blockParent.getBoundingClientRect().left + window.scrollX) + (parseInt(blockParent.offsetWidth) / 2) + canvas_div.scrollLeft - 1; - blockstemp[w].y = (blockParent.getBoundingClientRect().top + window.scrollY) + (parseInt(blockParent.offsetHeight) / 2) + canvas_div.scrollTop - 1; + blockstemp[w].x = (blockParent.getBoundingClientRect().left + window.pageXOffset) + (parseInt(blockParent.offsetWidth) / 2) + canvas_div.scrollLeft - 1; + blockstemp[w].y = (blockParent.getBoundingClientRect().top + window.pageYOffset) + (parseInt(blockParent.offsetHeight) / 2) + canvas_div.scrollTop - 1; } } - blockstemp.filter(a => a.id == 0)[0].x = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2); - blockstemp.filter(a => a.id == 0)[0].y = (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2); + blockstemp.filter(a => a.id == 0)[0].x = (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2); + blockstemp.filter(a => a.id == 0)[0].y = (drag.getBoundingClientRect().top + window.pageYOffset) + (parseInt(window.getComputedStyle(drag).height) / 2); blocks = blocks.concat(blockstemp); blockstemp = []; - } else if (active && blocks.length == 0 && (drag.getBoundingClientRect().top + window.scrollY) > (canvas_div.getBoundingClientRect().top + window.scrollY) && (drag.getBoundingClientRect().left + window.scrollX) > (canvas_div.getBoundingClientRect().left + window.scrollX)) { + } else if (active && blocks.length == 0 && (drag.getBoundingClientRect().top + window.pageYOffset) > (canvas_div.getBoundingClientRect().top + window.pageYOffset) && (drag.getBoundingClientRect().left + window.pageXOffset) > (canvas_div.getBoundingClientRect().left + window.pageXOffset)) { blockSnap(drag, true, undefined); active = false; - drag.style.top = (drag.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; - drag.style.left = (drag.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = (drag.getBoundingClientRect().top + window.pageYOffset) - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; + drag.style.left = (drag.getBoundingClientRect().left + window.pageXOffset) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; canvas_div.appendChild(drag); blocks.push({ parent: -1, childwidth: 0, id: parseInt(drag.querySelector(".blockid").value), - x: (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft, - y: (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop, + x: (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft, + y: (drag.getBoundingClientRect().top + window.pageYOffset) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop, width: parseInt(window.getComputedStyle(drag).width), height: parseInt(window.getComputedStyle(drag).height) }); @@ -204,8 +204,8 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac canvas_div.appendChild(document.querySelector(".indicator")); drag.parentNode.removeChild(drag); } else if (active) { - var xpos = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; - var ypos = (drag.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + var xpos = (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + var ypos = (drag.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop var blocko = blocks.map(a => a.id); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(a => a.id == blocko[i])[0].x - (blocks.filter(a => a.id == blocko[i])[0].width / 2) - paddingx && xpos <= blocks.filter(a => a.id == blocko[i])[0].x + (blocks.filter(a => a.id == blocko[i])[0].width / 2) + paddingx && ypos >= blocks.filter(a => a.id == blocko[i])[0].y - (blocks.filter(a => a.id == blocko[i])[0].height / 2) && ypos <= blocks.filter(a => a.id == blocko[i])[0].y + blocks.filter(a => a.id == blocko[i])[0].height) { @@ -225,8 +225,8 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac } } } else if (rearrange) { - var xpos = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; - var ypos = (drag.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + var xpos = (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + var ypos = (drag.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop var blocko = blocks.map(a => a.id); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(a => a.id == blocko[i])[0].x - (blocks.filter(a => a.id == blocko[i])[0].width / 2) - paddingx && xpos <= blocks.filter(a => a.id == blocko[i])[0].x + (blocks.filter(a => a.id == blocko[i])[0].width / 2) + paddingx && ypos >= blocks.filter(a => a.id == blocko[i])[0].y - (blocks.filter(a => a.id == blocko[i])[0].height / 2) && ypos <= blocks.filter(a => a.id == blocko[i])[0].y + blocks.filter(a => a.id == blocko[i])[0].height) { @@ -285,25 +285,25 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac totalremove += children.width + paddingx; } } - drag.style.left = blocks.filter(id => id.id == blocko[i])[0].x - (totalwidth / 2) + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; - drag.style.top = blocks.filter(id => id.id == blocko[i])[0].y + (blocks.filter(id => id.id == blocko[i])[0].height / 2) + paddingy - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + drag.style.left = blocks.filter(id => id.id == blocko[i])[0].x - (totalwidth / 2) + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + drag.style.top = blocks.filter(id => id.id == blocko[i])[0].y + (blocks.filter(id => id.id == blocko[i])[0].height / 2) + paddingy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (rearrange) { - blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value))[0].x = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; - blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value))[0].y = (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop; + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value))[0].x = (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value))[0].y = (drag.getBoundingClientRect().top + window.pageYOffset) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop; blockstemp.filter(a => a.id == drag.querySelector(".blockid").value)[0].parent = blocko[i]; for (var w = 0; w < blockstemp.length; w++) { if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { const blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; const arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; - blockParent.style.left = (blockParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; - blockParent.style.top = (blockParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; - arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.scrollX) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + 20 + "px"; - arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.scrollY) - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + blockParent.style.left = (blockParent.getBoundingClientRect().left + window.pageXOffset) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + blockParent.style.top = (blockParent.getBoundingClientRect().top + window.pageYOffset) - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; + arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.pageXOffset) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + 20 + "px"; + arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.pageYOffset) - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; canvas_div.appendChild(blockParent); canvas_div.appendChild(arrowParent); - blockstemp[w].x = (blockParent.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(blockParent).width) / 2) + canvas_div.scrollLeft; - blockstemp[w].y = (blockParent.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(blockParent).height) / 2) + canvas_div.scrollTop; + blockstemp[w].x = (blockParent.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(blockParent).width) / 2) + canvas_div.scrollLeft; + blockstemp[w].y = (blockParent.getBoundingClientRect().top + window.pageYOffset) + (parseInt(window.getComputedStyle(blockParent).height) / 2) + canvas_div.scrollTop; } } @@ -314,8 +314,8 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac childwidth: 0, parent: blocko[i], id: parseInt(drag.querySelector(".blockid").value), - x: (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft, - y: (drag.getBoundingClientRect().top + window.scrollY) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop, + x: (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft, + y: (drag.getBoundingClientRect().top + window.pageYOffset) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop, width: parseInt(window.getComputedStyle(drag).width), height: parseInt(window.getComputedStyle(drag).height) }); @@ -325,10 +325,10 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac var arrowy = parseFloat(arrowhelp.y - (arrowhelp.height / 2) - (blocks.filter(id => id.parent == blocko[i])[0].y + (blocks.filter(id => id.parent == blocko[i])[0].height / 2)) + canvas_div.scrollTop); if (arrowx < 0) { canvas_div.innerHTML += '
'; - document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = (arrowhelp.x - 5) - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = (arrowhelp.x - 5) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } else { canvas_div.innerHTML += '
'; - document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(a => a.id == blocko[i])[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(a => a.id == blocko[i])[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(a => a.id == blocko[i])[0].y + (blocks.filter(a => a.id == blocko[i])[0].height / 2) + "px"; if (blocks.filter(a => a.id == blocko[i])[0].parent != -1) { @@ -385,8 +385,8 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac if (!active && !rearrange) { dragblock = true; drag = theblock; - dragx = mouse_x - (drag.getBoundingClientRect().left + window.scrollX); - dragy = mouse_y - (drag.getBoundingClientRect().top + window.scrollY); + dragx = mouse_x - (drag.getBoundingClientRect().left + window.pageXOffset); + dragy = mouse_y - (drag.getBoundingClientRect().top + window.pageYOffset); } } } @@ -430,10 +430,10 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac blockstemp.push(blocks.filter(a => a.id == layer[i].id)[0]); const blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; const arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; - blockParent.style.left = (blockParent.getBoundingClientRect().left + window.scrollX) - (drag.getBoundingClientRect().left + window.scrollX) + "px"; - blockParent.style.top = (blockParent.getBoundingClientRect().top + window.scrollY) - (drag.getBoundingClientRect().top + window.scrollY) + "px"; - arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.scrollX) - (drag.getBoundingClientRect().left + window.scrollX) + "px"; - arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.scrollY) - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + blockParent.style.left = (blockParent.getBoundingClientRect().left + window.pageXOffset) - (drag.getBoundingClientRect().left + window.pageXOffset) + "px"; + blockParent.style.top = (blockParent.getBoundingClientRect().top + window.pageYOffset) - (drag.getBoundingClientRect().top + window.pageYOffset) + "px"; + arrowParent.style.left = (arrowParent.getBoundingClientRect().left + window.pageXOffset) - (drag.getBoundingClientRect().left + window.pageXOffset) + "px"; + arrowParent.style.top = (arrowParent.getBoundingClientRect().top + window.pageYOffset) - (drag.getBoundingClientRect().top + window.pageYOffset) + "px"; drag.appendChild(blockParent); drag.appendChild(arrowParent); foundids.push(layer[i].id); @@ -471,14 +471,14 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac drag.style.left = mouse_x - dragx + "px"; drag.style.top = mouse_y - dragy + "px"; } else if (rearrange) { - drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; - drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; - blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value)).x = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; - blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value)).y = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop; + drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value)).x = (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + blockstemp.filter(a => a.id == parseInt(drag.querySelector(".blockid").value)).y = (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).height) / 2) + canvas_div.scrollTop; } if (active || rearrange) { - var xpos = (drag.getBoundingClientRect().left + window.scrollX) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; - var ypos = (drag.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop; + var xpos = (drag.getBoundingClientRect().left + window.pageXOffset) + (parseInt(window.getComputedStyle(drag).width) / 2) + canvas_div.scrollLeft; + var ypos = (drag.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop; var blocko = blocks.map(a => a.id); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(a => a.id == blocko[i])[0].x - (blocks.filter(a => a.id == blocko[i])[0].width / 2) - paddingx && xpos <= blocks.filter(a => a.id == blocko[i])[0].x + (blocks.filter(a => a.id == blocko[i])[0].width / 2) + paddingx && ypos >= blocks.filter(a => a.id == blocko[i])[0].y - (blocks.filter(a => a.id == blocko[i])[0].height / 2) && ypos <= blocks.filter(a => a.id == blocko[i])[0].y + blocks.filter(a => a.id == blocko[i])[0].height) { @@ -506,7 +506,7 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac return item - (widths[index] / 2); }) offsetleft = Math.min.apply(Math, mathmin); - if (offsetleft < (canvas_div.getBoundingClientRect().left + window.scrollX)) { + if (offsetleft < (canvas_div.getBoundingClientRect().left + window.pageXOffset)) { lastevent = true; var blocko = blocks.map(a => a.id); for (var w = 0; w < blocks.length; w++) { @@ -522,27 +522,27 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac } } for (var w = 0; w < blocks.length; w++) { - blocks[w].x = (document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode.getBoundingClientRect().left + window.scrollX) + (canvas_div.getBoundingClientRect().left + canvas_div.scrollLeft) - (parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode).width) / 2) - 40; + blocks[w].x = (document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset) + (canvas_div.getBoundingClientRect().left + canvas_div.scrollLeft) - (parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode).width) / 2) - 40; } offsetleftold = offsetleft; } } function fixOffset() { - if (offsetleftold < (canvas_div.getBoundingClientRect().left + window.scrollX)) { + if (offsetleftold < (canvas_div.getBoundingClientRect().left + window.pageXOffset)) { lastevent = false; var blocko = blocks.map(a => a.id); for (var w = 0; w < blocks.length; w++) { document.querySelector(".blockid[value='" + blocks.filter(a => a.id == blocko[w])[0].id + "']").parentNode.style.left = blocks.filter(a => a.id == blocko[w])[0].x - (blocks.filter(a => a.id == blocko[w])[0].width / 2) - offsetleftold - 20 + "px"; - blocks.filter(a => a.id == blocko[w])[0].x = (document.querySelector(".blockid[value='" + blocks.filter(a => a.id == blocko[w])[0].id + "']").parentNode.getBoundingClientRect().left + window.scrollX) + (blocks.filter(a => a.id == blocko[w])[0].width / 2); + blocks.filter(a => a.id == blocko[w])[0].x = (document.querySelector(".blockid[value='" + blocks.filter(a => a.id == blocko[w])[0].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset) + (blocks.filter(a => a.id == blocko[w])[0].width / 2); if (blocks.filter(a => a.id == blocko[w])[0].parent != -1) { var arrowhelp = blocks.filter(a => a.id == blocko[w])[0]; var arrowx = arrowhelp.x - blocks.filter(a => a.id == blocks.filter(a => a.id == blocko[w])[0].parent)[0].x; if (arrowx < 0) { - document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = (arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"); + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = (arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"); } else { - document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(id => id.id == blocks.filter(a => a.id == blocko[w])[0].parent)[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(id => id.id == blocks.filter(a => a.id == blocko[w])[0].parent)[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; } } } @@ -588,23 +588,23 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac r_block.style.top = r_array.y + paddingy + "px"; r_array.y = r_array.y + paddingy; if (children.childwidth > children.width) { - r_block.style.left = r_array[0].x - (totalwidth / 2) + totalremove + (children.childwidth / 2) - (children.width / 2) - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + r_block.style.left = r_array[0].x - (totalwidth / 2) + totalremove + (children.childwidth / 2) - (children.width / 2) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; children.x = r_array[0].x - (totalwidth / 2) + totalremove + (children.childwidth / 2); totalremove += children.childwidth + paddingx; } else { - r_block.style.left = r_array[0].x - (totalwidth / 2) + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + r_block.style.left = r_array[0].x - (totalwidth / 2) + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; children.x = r_array[0].x - (totalwidth / 2) + totalremove + (children.width / 2); totalremove += children.width + paddingx; } var arrowhelp = blocks.filter(a => a.id == children.id)[0]; var arrowx = arrowhelp.x - blocks.filter(a => a.id == children.parent)[0].x + 20; var arrowy = arrowhelp.y - (arrowhelp.height / 2) - (blocks.filter(a => a.id == children.parent)[0].y + (blocks.filter(a => a.id == children.parent)[0].height / 2)); - document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(id => id.id == children.parent)[0].y + (blocks.filter(id => id.id == children.parent)[0].height / 2) - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(id => id.id == children.parent)[0].y + (blocks.filter(id => id.id == children.parent)[0].height / 2) - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (arrowx < 0) { - document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = (arrowhelp.x - 5) - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = (arrowhelp.x - 5) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; } else { - document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(id => id.id == children.parent)[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(id => id.id == children.parent)[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; } } diff --git a/lib/flowy copy.js b/lib/flowy copy.js new file mode 100644 index 0000000..9792f08 --- /dev/null +++ b/lib/flowy copy.js @@ -0,0 +1,1229 @@ +"use strict"; + +function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } + +var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x, spacing_y) { + if (!grab) { + grab = function grab() {}; + } + + if (!release) { + release = function release() {}; + } + + if (!snapping) { + snapping = function snapping() { + return true; + }; + } + + if (!rearrange) { + rearrange = function rearrange() { + return false; + }; + } + + if (!spacing_x) { + spacing_x = 20; + } + + if (!spacing_y) { + spacing_y = 80; + } + + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + } + + if (!Element.prototype.closest) { + Element.prototype.closest = function (s) { + var el = this; + + do { + if (Element.prototype.matches.call(el, s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + + return null; + }; + } + + var loaded = false; + + flowy.load = function () { + if (!loaded) loaded = true;else return; + var blocks = []; + var blockstemp = []; + var canvas_div = canvas; + var active = false; + var paddingx = spacing_x; + var paddingy = spacing_y; + var offsetleft = 0; + var offsetleftold = 0; + var rearrange = false; + var lastevent = false; + var drag, dragx, dragy, original; + var mouse_x, mouse_y; + var dragblock = false; + var prevblock = 0; + var el = document.createElement("DIV"); + el.classList.add('indicator'); + el.classList.add('invisible'); + canvas_div.appendChild(el); + + flowy["import"] = function (output) { + canvas_div.innerHTML = output.html; + + for (var a = 0; a < output.blockarr.length; a++) { + var block = { + childwidth: parseFloat(output.blockarr[a].childwidth), + parent: parseFloat(output.blockarr[a].parent), + id: parseFloat(output.blockarr[a].id), + x: parseFloat(output.blockarr[a].x), + y: parseFloat(output.blockarr[a].y), + width: parseFloat(output.blockarr[a].width), + height: parseFloat(output.blockarr[a].height) + }; + blocks.push(block); + } + + if (blocks.length > 1) { + rearrangeMe(); + } + }; + + flowy.output = function () { + var html_ser = canvas_div.innerHTML; + var json_data = { + html: html_ser, + blockarr: blocks, + blocks: [] + }; + + if (blocks.length > 0) { + for (var i = 0; i < blocks.length; i++) { + json_data.blocks.push({ + id: blocks[i].id, + parent: blocks[i].parent, + data: [], + attr: [] + }); + var blockParent = document.querySelector(".blockid[value='" + blocks[i].id + "']").parentNode; + blockParent.querySelectorAll("input").forEach(function (block) { + var json_name = block.getAttribute("name"); + var json_value = block.value; + json_data.blocks[i].data.push({ + name: json_name, + value: json_value + }); + }); + Array.prototype.slice.call(blockParent.attributes).forEach(function (attribute) { + var jsonobj = {}; + jsonobj[attribute.name] = attribute.value; + json_data.blocks[i].attr.push(jsonobj); + }); + } + + return json_data; + } + }; + + flowy.deleteBlocks = function () { + blocks = []; + canvas_div.innerHTML = ""; + }; + + flowy.beginDrag = function (event) { + var _this = this; + + if (event.targetTouches) { + mouse_x = event.changedTouches[0].clientX; + mouse_y = event.changedTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + + if (event.which != 3 && event.target.closest(".create-flowy")) { + original = event.target.closest(".create-flowy"); + var newNode = event.target.closest(".create-flowy").cloneNode(true); + event.target.closest(".create-flowy").classList.add("dragnow"); + newNode.classList.add("block"); + newNode.classList.remove("create-flowy"); + + if (blocks.length === 0) { + newNode.innerHTML += ""; + document.body.appendChild(newNode); + drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; + } else { + newNode.innerHTML += ""; + document.body.appendChild(newNode); + drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(function (a) { + _newArrowCheck(this, _this); + + return a.id; + }.bind(this)))) + 1) + "']").parentNode; + } + + blockGrabbed(event.target.closest(".create-flowy")); + drag.classList.add("dragging"); + active = true; + dragx = mouse_x - event.target.closest(".create-flowy").getBoundingClientRect().left; + dragy = mouse_y - event.target.closest(".create-flowy").getBoundingClientRect().top; + drag.style.left = mouse_x - dragx + "px"; + drag.style.top = mouse_y - dragy + "px"; + } + }; + + document.addEventListener("mousedown", touchblock, false); + document.addEventListener("touchstart", touchblock, false); + document.addEventListener("mouseup", touchblock, false); + + flowy.touchDone = function () { + dragblock = false; + }; + + document.addEventListener('mousedown', flowy.beginDrag); + document.addEventListener('touchstart', flowy.beginDrag); + + flowy.endDrag = function (event) { + var _this2 = this; + + if (event.which != 3 && (active || rearrange)) { + dragblock = false; + blockReleased(); + + if (!document.querySelector(".indicator").classList.contains("invisible")) { + document.querySelector(".indicator").classList.add("invisible"); + } + + if (active) { + original.classList.remove("dragnow"); + drag.classList.remove("dragging"); + } + + if (parseInt(drag.querySelector(".blockid").value) === 0 && rearrange) { + drag.classList.remove("dragging"); + rearrange = false; + + for (var w = 0; w < blockstemp.length; w++) { + if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { + var blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; + var arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop - 1 + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + canvas_div.scrollTop) - 1 + "px"; + canvas_div.appendChild(blockParent); + canvas_div.appendChild(arrowParent); + blockstemp[w].x = blockParent.getBoundingClientRect().left + window.scrollX + parseInt(blockParent.offsetWidth) / 2 + canvas_div.scrollLeft - 1; + blockstemp[w].y = blockParent.getBoundingClientRect().top + window.scrollY + parseInt(blockParent.offsetHeight) / 2 + canvas_div.scrollTop - 1; + } + } + + blockstemp.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == 0; + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == 0; + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2; + blocks = blocks.concat(blockstemp); + blockstemp = []; + } else if (active && blocks.length == 0 && drag.getBoundingClientRect().top + window.scrollY > canvas_div.getBoundingClientRect().top + window.scrollY && drag.getBoundingClientRect().left + window.scrollX > canvas_div.getBoundingClientRect().left + window.scrollX) { + blockSnap(drag, true, undefined); + active = false; + drag.style.top = drag.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + drag.style.left = drag.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + canvas_div.appendChild(drag); + blocks.push({ + parent: -1, + childwidth: 0, + id: parseInt(drag.querySelector(".blockid").value), + x: drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, + y: drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, + width: parseInt(window.getComputedStyle(drag).width), + height: parseInt(window.getComputedStyle(drag).height) + }); + } else if (active && blocks.length == 0) { + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } else if (active) { + var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this2); + + return a.id; + }.bind(this)); + + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height) { + active = false; + + if (blockSnap(drag, false, document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode)) { + snap(drag, i, blocko); + } else { + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } + + break; + } else if (i == blocks.length - 1) { + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + } + } + } else if (rearrange) { + var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this2); + + return a.id; + }.bind(this)); + + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + + return a.id == blocko[i]; + }.bind(this))[0].height) { + active = false; + drag.classList.remove("dragging"); + snap(drag, i, blocko); + break; + } else if (i == blocks.length - 1) { + if (beforeDelete(drag, blocks.filter(function (id) { + _newArrowCheck(this, _this2); + + return id.id == blocko[i]; + }.bind(this))[0])) { + active = false; + drag.classList.remove("dragging"); + snap(drag, blocko.indexOf(prevblock), blocko); + break; + } else { + rearrange = false; + blockstemp = []; + active = false; + canvas_div.appendChild(document.querySelector(".indicator")); + drag.parentNode.removeChild(drag); + break; + } + } + } + } + } + }; + + document.addEventListener("mouseup", flowy.endDrag, false); + document.addEventListener("touchend", flowy.endDrag, false); + + function snap(drag, i, blocko) { + var _this3 = this; + + if (!rearrange) { + canvas_div.appendChild(drag); + } + + var totalwidth = 0; + var totalremove = 0; + var maxheight = 0; + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[w]; + + if (children.childwidth > children.width) { + totalwidth += children.childwidth + paddingx; + } else { + totalwidth += children.width + paddingx; + } + } + + totalwidth += parseInt(window.getComputedStyle(drag).width); + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[w]; + + if (children.childwidth > children.width) { + document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; + children.x = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; + totalremove += children.childwidth + paddingx; + } else { + document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + "px"; + children.x = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.width / 2; + totalremove += children.width + paddingx; + } + } + + drag.style.left = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == blocko[i]; + }.bind(this))[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == blocko[i]; + }.bind(this))[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + + if (rearrange) { + blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == drag.querySelector(".blockid").value; + }.bind(this))[0].parent = blocko[i]; + + for (var w = 0; w < blockstemp.length; w++) { + if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { + var blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; + var arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + 20 + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + canvas_div.appendChild(blockParent); + canvas_div.appendChild(arrowParent); + blockstemp[w].x = blockParent.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(blockParent).width) / 2 + canvas_div.scrollLeft; + blockstemp[w].y = blockParent.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(blockParent).height) / 2 + canvas_div.scrollTop; + } + } + + blocks = blocks.concat(blockstemp); + blockstemp = []; + } else { + blocks.push({ + childwidth: 0, + parent: blocko[i], + id: parseInt(drag.querySelector(".blockid").value), + x: drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, + y: drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, + width: parseInt(window.getComputedStyle(drag).width), + height: parseInt(window.getComputedStyle(drag).height) + }); + } + + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x + 20; + var arrowy = parseFloat(arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == blocko[i]; + }.bind(this))[0].height / 2) + canvas_div.scrollTop); + + if (arrowx < 0) { + canvas_div.innerHTML += '
'; + document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + } else { + canvas_div.innerHTML += '
'; + document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + } + + document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 + "px"; + + if (blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == blocko[i]; + }.bind(this))[0].parent != -1) { + var flag = false; + var idval = blocko[i]; + + while (!flag) { + if (blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == idval; + }.bind(this))[0].parent == -1) { + flag = true; + } else { + var zwidth = 0; + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this))[w]; + + if (children.childwidth > children.width) { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this)).length - 1) { + zwidth += children.childwidth; + } else { + zwidth += children.childwidth + paddingx; + } + } else { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.parent == idval; + }.bind(this)).length - 1) { + zwidth += children.width; + } else { + zwidth += children.width + paddingx; + } + } + } + + blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == idval; + }.bind(this))[0].childwidth = zwidth; + idval = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + + return a.id == idval; + }.bind(this))[0].parent; + } + } + + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + + return id.id == idval; + }.bind(this))[0].childwidth = totalwidth; + } + + if (rearrange) { + rearrange = false; + drag.classList.remove("dragging"); + } + + rearrangeMe(); + checkOffset(); + } + + function touchblock(event) { + dragblock = false; + + if (hasParentClass(event.target, "block")) { + var theblock = event.target.closest(".block"); + + if (event.targetTouches) { + mouse_x = event.targetTouches[0].clientX; + mouse_y = event.targetTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + + if (event.type !== "mouseup" && hasParentClass(event.target, "block")) { + if (event.which != 3) { + if (!active && !rearrange) { + dragblock = true; + drag = theblock; + dragx = mouse_x - (drag.getBoundingClientRect().left + window.scrollX); + dragy = mouse_y - (drag.getBoundingClientRect().top + window.scrollY); + } + } + } + } + } + + function hasParentClass(element, classname) { + if (element.className) { + if (element.className.split(' ').indexOf(classname) >= 0) return true; + } + + return element.parentNode && hasParentClass(element.parentNode, classname); + } + + flowy.moveBlock = function (event) { + var _this4 = this; + + if (event.targetTouches) { + mouse_x = event.targetTouches[0].clientX; + mouse_y = event.targetTouches[0].clientY; + } else { + mouse_x = event.clientX; + mouse_y = event.clientY; + } + + if (dragblock) { + rearrange = true; + drag.classList.add("dragging"); + var blockid = parseInt(drag.querySelector(".blockid").value); + prevblock = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blockid; + }.bind(this))[0].parent; + blockstemp.push(blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blockid; + }.bind(this))[0]); + blocks = blocks.filter(function (e) { + return e.id != blockid; + }); + + if (blockid != 0) { + document.querySelector(".arrowid[value='" + blockid + "']").parentNode.remove(); + } + + var layer = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.parent == blockid; + }.bind(this)); + var flag = false; + var foundids = []; + var allids = []; + + while (!flag) { + for (var i = 0; i < layer.length; i++) { + if (layer[i] != blockid) { + blockstemp.push(blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == layer[i].id; + }.bind(this))[0]); + var blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; + var arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (drag.getBoundingClientRect().left + window.scrollX) + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (drag.getBoundingClientRect().left + window.scrollX) + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + drag.appendChild(blockParent); + drag.appendChild(arrowParent); + foundids.push(layer[i].id); + allids.push(layer[i].id); + } + } + + if (foundids.length == 0) { + flag = true; + } else { + layer = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return foundids.includes(a.parent); + }.bind(this)); + foundids = []; + } + } + + for (var i = 0; i < blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.parent == blockid; + }.bind(this)).length; i++) { + var blocknumber = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.parent == blockid; + }.bind(this))[i]; + blocks = blocks.filter(function (e) { + return e.id != blocknumber; + }); + } + + for (var i = 0; i < allids.length; i++) { + var blocknumber = allids[i]; + blocks = blocks.filter(function (e) { + return e.id != blocknumber; + }); + } + + if (blocks.length > 1) { + rearrangeMe(); + } + + if (lastevent) { + fixOffset(); + } + + dragblock = false; + } + + if (active) { + drag.style.left = mouse_x - dragx + "px"; + drag.style.top = mouse_y - dragy + "px"; + } else if (rearrange) { + drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this)).x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + blockstemp.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == parseInt(drag.querySelector(".blockid").value); + }.bind(this)).y = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + } + + if (active || rearrange) { + var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this4); + + return a.id; + }.bind(this)); + + for (var i = 0; i < blocks.length; i++) { + if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this4); + + return a.id == blocko[i]; + }.bind(this))[0].height) { + document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode.appendChild(document.querySelector(".indicator")); + document.querySelector(".indicator").style.left = parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).width) / 2 - 5 + "px"; + document.querySelector(".indicator").style.top = window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).height + "px"; + document.querySelector(".indicator").classList.remove("invisible"); + break; + } else if (i == blocks.length - 1) { + if (!document.querySelector(".indicator").classList.contains("invisible")) { + document.querySelector(".indicator").classList.add("invisible"); + } + } + } + } + }; + + document.addEventListener("mousemove", flowy.moveBlock, false); + document.addEventListener("touchmove", flowy.moveBlock, false); + + function checkOffset() { + var _this5 = this; + + offsetleft = blocks.map(function (a) { + _newArrowCheck(this, _this5); + + return a.x; + }.bind(this)); + var widths = blocks.map(function (a) { + _newArrowCheck(this, _this5); + + return a.width; + }.bind(this)); + var mathmin = offsetleft.map(function (item, index) { + return item - widths[index] / 2; + }); + offsetleft = Math.min.apply(Math, mathmin); + + if (offsetleft < canvas_div.getBoundingClientRect().left + window.scrollX) { + lastevent = true; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this5); + + return a.id; + }.bind(this)); + + for (var w = 0; w < blocks.length; w++) { + document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].width / 2 - offsetleft + 20 + "px"; + + if (blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0].parent != -1) { + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this5); + + return a.id == blocko[w]; + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + var _this6 = this; + + _newArrowCheck(this, _this5); + + return a.id == blocks.filter(function (a) { + _newArrowCheck(this, _this6); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x; + + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - offsetleft + 20 - 5 + "px"; + } else { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { + var _this7 = this; + + _newArrowCheck(this, _this5); + + return id.id == blocks.filter(function (a) { + _newArrowCheck(this, _this7); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x - 20 - offsetleft + 20 + "px"; + } + } + } + + for (var w = 0; w < blocks.length; w++) { + blocks[w].x = document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + (canvas_div.getBoundingClientRect().left + canvas_div.scrollLeft) - parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode).width) / 2 - 40; + } + + offsetleftold = offsetleft; + } + } + + function fixOffset() { + var _this8 = this; + + if (offsetleftold < canvas_div.getBoundingClientRect().left + window.scrollX) { + lastevent = false; + var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this8); + + return a.id; + }.bind(this)); + + for (var w = 0; w < blocks.length; w++) { + document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].width / 2 - offsetleftold - 20 + "px"; + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].width / 2; + + if (blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0].parent != -1) { + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this8); + + return a.id == blocko[w]; + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + var _this9 = this; + + _newArrowCheck(this, _this8); + + return a.id == blocks.filter(function (a) { + _newArrowCheck(this, _this9); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x; + + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + } else { + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { + var _this10 = this; + + _newArrowCheck(this, _this8); + + return id.id == blocks.filter(function (a) { + _newArrowCheck(this, _this10); + + return a.id == blocko[w]; + }.bind(this))[0].parent; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + } + } + } + + offsetleftold = 0; + } + } + + function rearrangeMe() { + var _this11 = this; + + var result = blocks.map(function (a) { + _newArrowCheck(this, _this11); + + return a.parent; + }.bind(this)); + + for (var z = 0; z < result.length; z++) { + if (result[z] == -1) { + z++; + } + + var totalwidth = 0; + var totalremove = 0; + var maxheight = 0; + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this))[w]; + + if (blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == children.id; + }.bind(this)).length == 0) { + children.childwidth = 0; + } + + if (children.childwidth > children.width) { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length - 1) { + totalwidth += children.childwidth; + } else { + totalwidth += children.childwidth + paddingx; + } + } else { + if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length - 1) { + totalwidth += children.width; + } else { + totalwidth += children.width + paddingx; + } + } + } + + if (result[z] != -1) { + blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == result[z]; + }.bind(this))[0].childwidth = totalwidth; + } + + for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this)).length; w++) { + var children = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.parent == result[z]; + }.bind(this))[w]; + var r_block = document.querySelector(".blockid[value='" + children.id + "']").parentNode; + var r_array = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == result[z]; + }.bind(this)); + r_block.style.top = r_array.y + paddingy + "px"; + r_array.y = r_array.y + paddingy; + + if (children.childwidth > children.width) { + r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + children.x = r_array[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; + totalremove += children.childwidth + paddingx; + } else { + r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + children.x = r_array[0].x - totalwidth / 2 + totalremove + children.width / 2; + totalremove += children.width + paddingx; + } + + var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.id; + }.bind(this))[0]; + var arrowx = arrowhelp.x - blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.parent; + }.bind(this))[0].x + 20; + var arrowy = arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.parent; + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this11); + + return a.id == children.parent; + }.bind(this))[0].height / 2); + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == children.parent; + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == children.parent; + }.bind(this))[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + + if (arrowx < 0) { + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + } else { + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + + return id.id == children.parent; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + } + } + } + } + }; + + flowy.load(); + + function blockGrabbed(block) { + grab(block); + } + + function blockReleased() { + release(); + } + + function blockSnap(drag, first, parent) { + return snapping(drag, first, parent); + } + + function beforeDelete(drag, parent) { + return rearrange(drag, parent); + } + + function addEventListenerMulti(type, listener, capture, selector) { + var nodes = document.querySelectorAll(selector); + + for (var i = 0; i < nodes.length; i++) { + nodes[i].addEventListener(type, listener, capture); + } + } + + function removeEventListenerMulti(type, listener, capture, selector) { + var nodes = document.querySelectorAll(selector); + + for (var i = 0; i < nodes.length; i++) { + nodes[i].removeEventListener(type, listener, capture); + } + } +}; \ No newline at end of file diff --git a/lib/flowy.js b/lib/flowy.js index 9792f08..45435da 100644 --- a/lib/flowy.js +++ b/lib/flowy.js @@ -214,14 +214,14 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { var blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; var arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; - blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; - blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop - 1 + "px"; - arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft - 1 + "px"; - arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + canvas_div.scrollTop) - 1 + "px"; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.pageXOffset - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft - 1 + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.pageYOffset - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop - 1 + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.pageXOffset - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft - 1 + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.pageYOffset - (canvas_div.getBoundingClientRect().top + canvas_div.scrollTop) - 1 + "px"; canvas_div.appendChild(blockParent); canvas_div.appendChild(arrowParent); - blockstemp[w].x = blockParent.getBoundingClientRect().left + window.scrollX + parseInt(blockParent.offsetWidth) / 2 + canvas_div.scrollLeft - 1; - blockstemp[w].y = blockParent.getBoundingClientRect().top + window.scrollY + parseInt(blockParent.offsetHeight) / 2 + canvas_div.scrollTop - 1; + blockstemp[w].x = blockParent.getBoundingClientRect().left + window.pageXOffset + parseInt(blockParent.offsetWidth) / 2 + canvas_div.scrollLeft - 1; + blockstemp[w].y = blockParent.getBoundingClientRect().top + window.pageYOffset + parseInt(blockParent.offsetHeight) / 2 + canvas_div.scrollTop - 1; } } @@ -229,26 +229,26 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x _newArrowCheck(this, _this2); return a.id == 0; - }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2; + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2; blockstemp.filter(function (a) { _newArrowCheck(this, _this2); return a.id == 0; - }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2; + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2; blocks = blocks.concat(blockstemp); blockstemp = []; - } else if (active && blocks.length == 0 && drag.getBoundingClientRect().top + window.scrollY > canvas_div.getBoundingClientRect().top + window.scrollY && drag.getBoundingClientRect().left + window.scrollX > canvas_div.getBoundingClientRect().left + window.scrollX) { + } else if (active && blocks.length == 0 && drag.getBoundingClientRect().top + window.pageYOffset > canvas_div.getBoundingClientRect().top + window.pageYOffset && drag.getBoundingClientRect().left + window.pageXOffset > canvas_div.getBoundingClientRect().left + window.pageXOffset) { blockSnap(drag, true, undefined); active = false; - drag.style.top = drag.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; - drag.style.left = drag.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + drag.style.top = drag.getBoundingClientRect().top + window.pageYOffset - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; + drag.style.left = drag.getBoundingClientRect().left + window.pageXOffset - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; canvas_div.appendChild(drag); blocks.push({ parent: -1, childwidth: 0, id: parseInt(drag.querySelector(".blockid").value), - x: drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, - y: drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, + x: drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, + y: drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, width: parseInt(window.getComputedStyle(drag).width), height: parseInt(window.getComputedStyle(drag).height) }); @@ -256,8 +256,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x canvas_div.appendChild(document.querySelector(".indicator")); drag.parentNode.removeChild(drag); } else if (active) { - var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; - var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { _newArrowCheck(this, _this2); @@ -316,8 +316,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } } } else if (rearrange) { - var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; - var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { _newArrowCheck(this, _this2); @@ -462,7 +462,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x _newArrowCheck(this, _this3); return id.id == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + }.bind(this))[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; drag.style.top = blocks.filter(function (id) { _newArrowCheck(this, _this3); @@ -471,19 +471,19 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x _newArrowCheck(this, _this3); return id.id == blocko[i]; - }.bind(this))[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + }.bind(this))[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (rearrange) { blockstemp.filter(function (a) { _newArrowCheck(this, _this3); return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { _newArrowCheck(this, _this3); return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; blockstemp.filter(function (a) { _newArrowCheck(this, _this3); @@ -494,14 +494,14 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { var blockParent = document.querySelector(".blockid[value='" + blockstemp[w].id + "']").parentNode; var arrowParent = document.querySelector(".arrowid[value='" + blockstemp[w].id + "']").parentNode; - blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; - blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; - arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + 20 + "px"; - arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.pageXOffset - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.pageYOffset - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.pageXOffset - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + 20 + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.pageYOffset - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; canvas_div.appendChild(blockParent); canvas_div.appendChild(arrowParent); - blockstemp[w].x = blockParent.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(blockParent).width) / 2 + canvas_div.scrollLeft; - blockstemp[w].y = blockParent.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(blockParent).height) / 2 + canvas_div.scrollTop; + blockstemp[w].x = blockParent.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(blockParent).width) / 2 + canvas_div.scrollLeft; + blockstemp[w].y = blockParent.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(blockParent).height) / 2 + canvas_div.scrollTop; } } @@ -512,8 +512,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x childwidth: 0, parent: blocko[i], id: parseInt(drag.querySelector(".blockid").value), - x: drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, - y: drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, + x: drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft, + y: drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop, width: parseInt(window.getComputedStyle(drag).width), height: parseInt(window.getComputedStyle(drag).height) }); @@ -549,14 +549,14 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x return a.id == blocko[i]; }.bind(this))[0].x - arrowhelp.x + 5) + ' ' + paddingy / 2 + 'L5 ' + paddingy / 2 + 'L5 ' + arrowy + '" stroke="#C5CCD0" stroke-width="2px"/>
'; - document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } else { - canvas_div.innerHTML += '
'; + canvas_div.appendChild(string2Elemnt('
')); document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(function (a) { _newArrowCheck(this, _this3); return a.id == blocko[i]; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(function (a) { @@ -669,8 +669,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (!active && !rearrange) { dragblock = true; drag = theblock; - dragx = mouse_x - (drag.getBoundingClientRect().left + window.scrollX); - dragy = mouse_y - (drag.getBoundingClientRect().top + window.scrollY); + dragx = mouse_x - (drag.getBoundingClientRect().left + window.pageXOffset); + dragy = mouse_y - (drag.getBoundingClientRect().top + window.pageYOffset); } } } @@ -737,10 +737,10 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x }.bind(this))[0]); var blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; var arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; - blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (drag.getBoundingClientRect().left + window.scrollX) + "px"; - blockParent.style.top = blockParent.getBoundingClientRect().top + window.scrollY - (drag.getBoundingClientRect().top + window.scrollY) + "px"; - arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.scrollX - (drag.getBoundingClientRect().left + window.scrollX) + "px"; - arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.scrollY - (drag.getBoundingClientRect().top + window.scrollY) + "px"; + blockParent.style.left = blockParent.getBoundingClientRect().left + window.pageXOffset - (drag.getBoundingClientRect().left + window.pageXOffset) + "px"; + blockParent.style.top = blockParent.getBoundingClientRect().top + window.pageYOffset - (drag.getBoundingClientRect().top + window.pageYOffset) + "px"; + arrowParent.style.left = arrowParent.getBoundingClientRect().left + window.pageXOffset - (drag.getBoundingClientRect().left + window.pageXOffset) + "px"; + arrowParent.style.top = arrowParent.getBoundingClientRect().top + window.pageYOffset - (drag.getBoundingClientRect().top + window.pageYOffset) + "px"; drag.appendChild(blockParent); drag.appendChild(arrowParent); foundids.push(layer[i].id); @@ -797,23 +797,23 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag.style.left = mouse_x - dragx + "px"; drag.style.top = mouse_y - dragy + "px"; } else if (rearrange) { - drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; - drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; + drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; blockstemp.filter(function (a) { _newArrowCheck(this, _this4); return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this)).x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + }.bind(this)).x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { _newArrowCheck(this, _this4); return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this)).y = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + }.bind(this)).y = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; } if (active || rearrange) { - var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; - var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; + var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { _newArrowCheck(this, _this4); @@ -889,7 +889,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x }); offsetleft = Math.min.apply(Math, mathmin); - if (offsetleft < canvas_div.getBoundingClientRect().left + window.scrollX) { + if (offsetleft < canvas_div.getBoundingClientRect().left + window.pageXOffset) { lastevent = true; var blocko = blocks.map(function (a) { _newArrowCheck(this, _this5); @@ -953,7 +953,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } for (var w = 0; w < blocks.length; w++) { - blocks[w].x = document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + (canvas_div.getBoundingClientRect().left + canvas_div.scrollLeft) - parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode).width) / 2 - 40; + blocks[w].x = document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset + (canvas_div.getBoundingClientRect().left + canvas_div.scrollLeft) - parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocks[w].id + "']").parentNode).width) / 2 - 40; } offsetleftold = offsetleft; @@ -963,7 +963,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x function fixOffset() { var _this8 = this; - if (offsetleftold < canvas_div.getBoundingClientRect().left + window.scrollX) { + if (offsetleftold < canvas_div.getBoundingClientRect().left + window.pageXOffset) { lastevent = false; var blocko = blocks.map(function (a) { _newArrowCheck(this, _this8); @@ -993,7 +993,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x _newArrowCheck(this, _this8); return a.id == blocko[w]; - }.bind(this))[0].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + blocks.filter(function (a) { + }.bind(this))[0].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset + blocks.filter(function (a) { _newArrowCheck(this, _this8); return a.id == blocko[w]; @@ -1022,7 +1022,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x }.bind(this))[0].x; if (arrowx < 0) { - document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; } else { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { var _this10 = this; @@ -1034,7 +1034,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x return a.id == blocko[w]; }.bind(this))[0].parent; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; } } } @@ -1131,11 +1131,11 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x r_array.y = r_array.y + paddingy; if (children.childwidth > children.width) { - r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; children.x = r_array[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; totalremove += children.childwidth + paddingx; } else { - r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + r_block.style.left = r_array[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; children.x = r_array[0].x - totalwidth / 2 + totalremove + children.width / 2; totalremove += children.width + paddingx; } @@ -1167,10 +1167,10 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x _newArrowCheck(this, _this11); return id.id == children.parent; - }.bind(this))[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + }.bind(this))[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (arrowx < 0) { - document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; } } diff --git a/lib/helper.js b/lib/helper.js new file mode 100644 index 0000000..2a84061 --- /dev/null +++ b/lib/helper.js @@ -0,0 +1,4 @@ +function string2Elemnt(html) { + var parser = new DOMParser(); + return parser.parseFromString(html, 'text/html').body.childNodes[0]; +} \ No newline at end of file From 82264f728954bae645c418976fa8092a07e356d7 Mon Sep 17 00:00:00 2001 From: Kirit1592 Date: Sat, 11 Jul 2020 16:44:07 +0530 Subject: [PATCH 3/5] updated engine/flowy.js to support ie --- .babelrc | 6 ------ engine/flowy.js | 13 +++++++++---- 2 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 .babelrc diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 99832fc..0000000 --- a/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-env"], - "plugins": [ - ["@babel/plugin-transform-arrow-functions", { "spec": true }] - ] -} diff --git a/engine/flowy.js b/engine/flowy.js index 7726b53..ca91be7 100644 --- a/engine/flowy.js +++ b/engine/flowy.js @@ -126,11 +126,11 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac newNode.classList.add("block"); newNode.classList.remove("create-flowy"); if (blocks.length === 0) { - newNode.innerHTML += "
'; + canvas_div.appendChild(string2DomElem('
')); document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = (arrowhelp.x - 5) - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } else { - canvas_div.innerHTML += '
'; + canvas_div.appendChild(string2DomElem('
')); document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(a => a.id == blocko[i])[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(a => a.id == blocko[i])[0].y + (blocks.filter(a => a.id == blocko[i])[0].height / 2) + "px"; @@ -642,4 +642,9 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac nodes[i].removeEventListener(type, listener, capture); } } + + function string2DomElem(html) { + var parser = new DOMParser(); + return parser.parseFromString(html, 'text/html').body.childNodes[0]; + } } From 3d6cfa27026098e8dba7d62692004ca2ac980858 Mon Sep 17 00:00:00 2001 From: Kirit1592 Date: Wed, 15 Jul 2020 07:55:02 +0530 Subject: [PATCH 4/5] resolved parent issue --- babel.config.json | 4 +- demo/index.html | 1 - engine/flowy.js | 2 +- lib/flowy copy.js | 494 +++++++++++--------------------------------- lib/flowy.js | 507 ++++++++++++---------------------------------- lib/helper.js | 4 - 6 files changed, 247 insertions(+), 765 deletions(-) delete mode 100644 lib/helper.js diff --git a/babel.config.json b/babel.config.json index 5f6b1c2..efe697d 100644 --- a/babel.config.json +++ b/babel.config.json @@ -6,9 +6,7 @@ "targets": { "ie": 11 }, - "debug": true, - "useBuiltIns": "entry", - "sourceMaps": true + "useBuiltIns": "entry" } ] ], diff --git a/demo/index.html b/demo/index.html index 131a501..5fa5335 100644 --- a/demo/index.html +++ b/demo/index.html @@ -28,7 +28,6 @@ - diff --git a/engine/flowy.js b/engine/flowy.js index ca91be7..cc846ae 100644 --- a/engine/flowy.js +++ b/engine/flowy.js @@ -130,7 +130,7 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac document.body.appendChild(newNode); drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; } else { - newNode.append(string2DomElem("")); + newNode.appendChild(string2DomElem("")); document.body.appendChild(newNode); drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(a => a.id))) + 1) + "']").parentNode; } diff --git a/lib/flowy copy.js b/lib/flowy copy.js index 9792f08..aee18eb 100644 --- a/lib/flowy copy.js +++ b/lib/flowy copy.js @@ -1,7 +1,5 @@ "use strict"; -function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } - var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x, spacing_y) { if (!grab) { grab = function grab() {}; @@ -71,7 +69,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x el.classList.add('invisible'); canvas_div.appendChild(el); - flowy["import"] = function (output) { + flowy.import = function (output) { canvas_div.innerHTML = output.html; for (var a = 0; a < output.blockarr.length; a++) { @@ -134,8 +132,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x }; flowy.beginDrag = function (event) { - var _this = this; - if (event.targetTouches) { mouse_x = event.changedTouches[0].clientX; mouse_y = event.changedTouches[0].clientY; @@ -157,16 +153,12 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; } else { newNode.innerHTML += ""; + })) + 1) + "'>"; document.body.appendChild(newNode); drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(function (a) { - _newArrowCheck(this, _this); - return a.id; - }.bind(this)))) + 1) + "']").parentNode; + }))) + 1) + "']").parentNode; } blockGrabbed(event.target.closest(".create-flowy")); @@ -191,8 +183,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x document.addEventListener('touchstart', flowy.beginDrag); flowy.endDrag = function (event) { - var _this2 = this; - if (event.which != 3 && (active || rearrange)) { dragblock = false; blockReleased(); @@ -226,15 +216,11 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } blockstemp.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == 0; - }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2; + })[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2; blockstemp.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == 0; - }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2; + })[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2; blocks = blocks.concat(blockstemp); blockstemp = []; } else if (active && blocks.length == 0 && drag.getBoundingClientRect().top + window.scrollY > canvas_div.getBoundingClientRect().top + window.scrollY && drag.getBoundingClientRect().left + window.scrollX > canvas_div.getBoundingClientRect().left + window.scrollX) { @@ -259,45 +245,27 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this2); - return a.id; - }.bind(this)); + }); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == blocko[i]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].x + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].height / 2 && ypos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height) { + })[0].height) { active = false; if (blockSnap(drag, false, document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode)) { @@ -319,55 +287,35 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this2); - return a.id; - }.bind(this)); + }); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == blocko[i]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].x + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].height / 2 && ypos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height) { + })[0].height) { active = false; drag.classList.remove("dragging"); snap(drag, i, blocko); break; } else if (i == blocks.length - 1) { if (beforeDelete(drag, blocks.filter(function (id) { - _newArrowCheck(this, _this2); - return id.id == blocko[i]; - }.bind(this))[0])) { + })[0])) { active = false; drag.classList.remove("dragging"); snap(drag, blocko.indexOf(prevblock), blocko); @@ -390,8 +338,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x document.addEventListener("touchend", flowy.endDrag, false); function snap(drag, i, blocko) { - var _this3 = this; - if (!rearrange) { canvas_div.appendChild(drag); } @@ -401,15 +347,11 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var maxheight = 0; for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[w]; + })[w]; if (children.childwidth > children.width) { totalwidth += children.childwidth + paddingx; @@ -421,74 +363,50 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x totalwidth += parseInt(window.getComputedStyle(drag).width); for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[w]; + })[w]; if (children.childwidth > children.width) { document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; + })[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; children.x = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; + })[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; totalremove += children.childwidth + paddingx; } else { document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + "px"; + })[0].x - totalwidth / 2 + totalremove + "px"; children.x = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + children.width / 2; + })[0].x - totalwidth / 2 + totalremove + children.width / 2; totalremove += children.width + paddingx; } } drag.style.left = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.id == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + })[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; drag.style.top = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (id) { - _newArrowCheck(this, _this3); - + })[0].y + blocks.filter(function (id) { return id.id == blocko[i]; - }.bind(this))[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + })[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; if (rearrange) { blockstemp.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + })[0].x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + })[0].y = drag.getBoundingClientRect().top + window.scrollY + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; blockstemp.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == drag.querySelector(".blockid").value; - }.bind(this))[0].parent = blocko[i]; + })[0].parent = blocko[i]; for (var w = 0; w < blockstemp.length; w++) { if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { @@ -520,100 +438,70 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x + 20; + })[0].x + 20; var arrowy = parseFloat(arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (id) { - _newArrowCheck(this, _this3); - + })[0].y + blocks.filter(function (id) { return id.parent == blocko[i]; - }.bind(this))[0].height / 2) + canvas_div.scrollTop); + })[0].height / 2) + canvas_div.scrollTop); if (arrowx < 0) { canvas_div.innerHTML += '
'; + })[0].x - arrowhelp.x + 5) + ' ' + paddingy / 2 + 'L5 ' + paddingy / 2 + 'L5 ' + arrowy + '" stroke="#C5CCD0" stroke-width="2px"/>
'; document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; } else { canvas_div.innerHTML += '
'; document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; + })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; } document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this3); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 + "px"; + })[0].height / 2 + "px"; if (blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].parent != -1) { + })[0].parent != -1) { var flag = false; var idval = blocko[i]; while (!flag) { if (blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == idval; - }.bind(this))[0].parent == -1) { + })[0].parent == -1) { flag = true; } else { var zwidth = 0; for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this))[w]; + })[w]; if (children.childwidth > children.width) { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this)).length - 1) { + }).length - 1) { zwidth += children.childwidth; } else { zwidth += children.childwidth + paddingx; } } else { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this)).length - 1) { + }).length - 1) { zwidth += children.width; } else { zwidth += children.width + paddingx; @@ -622,23 +510,17 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == idval; - }.bind(this))[0].childwidth = zwidth; + })[0].childwidth = zwidth; idval = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == idval; - }.bind(this))[0].parent; + })[0].parent; } } blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.id == idval; - }.bind(this))[0].childwidth = totalwidth; + })[0].childwidth = totalwidth; } if (rearrange) { @@ -686,8 +568,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } flowy.moveBlock = function (event) { - var _this4 = this; - if (event.targetTouches) { mouse_x = event.targetTouches[0].clientX; mouse_y = event.targetTouches[0].clientY; @@ -701,15 +581,11 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag.classList.add("dragging"); var blockid = parseInt(drag.querySelector(".blockid").value); prevblock = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == blockid; - }.bind(this))[0].parent; + })[0].parent; blockstemp.push(blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == blockid; - }.bind(this))[0]); + })[0]); blocks = blocks.filter(function (e) { return e.id != blockid; }); @@ -719,10 +595,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var layer = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.parent == blockid; - }.bind(this)); + }); var flag = false; var foundids = []; var allids = []; @@ -731,10 +605,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x for (var i = 0; i < layer.length; i++) { if (layer[i] != blockid) { blockstemp.push(blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == layer[i].id; - }.bind(this))[0]); + })[0]); var blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; var arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; blockParent.style.left = blockParent.getBoundingClientRect().left + window.scrollX - (drag.getBoundingClientRect().left + window.scrollX) + "px"; @@ -752,24 +624,18 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x flag = true; } else { layer = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return foundids.includes(a.parent); - }.bind(this)); + }); foundids = []; } } for (var i = 0; i < blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.parent == blockid; - }.bind(this)).length; i++) { + }).length; i++) { var blocknumber = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.parent == blockid; - }.bind(this))[i]; + })[i]; blocks = blocks.filter(function (e) { return e.id != blocknumber; }); @@ -800,60 +666,38 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.scrollX) + canvas_div.scrollLeft + "px"; drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.scrollY) + canvas_div.scrollTop + "px"; blockstemp.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this)).x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + }).x = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this)).y = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + }).y = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; } if (active || rearrange) { var xpos = drag.getBoundingClientRect().left + window.scrollX + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.scrollY + canvas_div.scrollTop; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this4); - return a.id; - }.bind(this)); + }); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == blocko[i]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].x + blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].x + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y - blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].y - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].height / 2 && ypos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height) { + })[0].height) { document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode.appendChild(document.querySelector(".indicator")); document.querySelector(".indicator").style.left = parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).width) / 2 - 5 + "px"; document.querySelector(".indicator").style.top = window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).height + "px"; @@ -872,18 +716,12 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x document.addEventListener("touchmove", flowy.moveBlock, false); function checkOffset() { - var _this5 = this; - offsetleft = blocks.map(function (a) { - _newArrowCheck(this, _this5); - return a.x; - }.bind(this)); + }); var widths = blocks.map(function (a) { - _newArrowCheck(this, _this5); - return a.width; - }.bind(this)); + }); var mathmin = offsetleft.map(function (item, index) { return item - widths[index] / 2; }); @@ -892,62 +730,38 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (offsetleft < canvas_div.getBoundingClientRect().left + window.scrollX) { lastevent = true; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this5); - return a.id; - }.bind(this)); + }); for (var w = 0; w < blocks.length; w++) { document.querySelector(".blockid[value='" + blocks.filter(function (a) { - _newArrowCheck(this, _this5); - return a.id == blocko[w]; - }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this5); - + })[0].id + "']").parentNode.style.left = blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this5); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].width / 2 - offsetleft + 20 + "px"; + })[0].width / 2 - offsetleft + 20 + "px"; if (blocks.filter(function (a) { - _newArrowCheck(this, _this5); - return a.id == blocko[w]; - }.bind(this))[0].parent != -1) { + })[0].parent != -1) { var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this5); - return a.id == blocko[w]; - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - var _this6 = this; - - _newArrowCheck(this, _this5); - return a.id == blocks.filter(function (a) { - _newArrowCheck(this, _this6); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x; + })[0].parent; + })[0].x; if (arrowx < 0) { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - offsetleft + 20 - 5 + "px"; } else { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { - var _this7 = this; - - _newArrowCheck(this, _this5); - return id.id == blocks.filter(function (a) { - _newArrowCheck(this, _this7); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x - 20 - offsetleft + 20 + "px"; + })[0].parent; + })[0].x - 20 - offsetleft + 20 + "px"; } } } @@ -961,80 +775,48 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } function fixOffset() { - var _this8 = this; - if (offsetleftold < canvas_div.getBoundingClientRect().left + window.scrollX) { lastevent = false; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this8); - return a.id; - }.bind(this)); + }); for (var w = 0; w < blocks.length; w++) { document.querySelector(".blockid[value='" + blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].id + "']").parentNode.style.left = blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].width / 2 - offsetleftold - 20 + "px"; + })[0].width / 2 - offsetleftold - 20 + "px"; blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].id + "']").parentNode.getBoundingClientRect().left + window.scrollX + blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].width / 2; + })[0].width / 2; if (blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0].parent != -1) { + })[0].parent != -1) { var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - var _this9 = this; - - _newArrowCheck(this, _this8); - return a.id == blocks.filter(function (a) { - _newArrowCheck(this, _this9); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x; + })[0].parent; + })[0].x; if (arrowx < 0) { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; } else { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { - var _this10 = this; - - _newArrowCheck(this, _this8); - return id.id == blocks.filter(function (a) { - _newArrowCheck(this, _this10); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + })[0].parent; + })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; } } } @@ -1044,13 +826,9 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } function rearrangeMe() { - var _this11 = this; - var result = blocks.map(function (a) { - _newArrowCheck(this, _this11); - return a.parent; - }.bind(this)); + }); for (var z = 0; z < result.length; z++) { if (result[z] == -1) { @@ -1062,40 +840,30 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var maxheight = 0; for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this))[w]; + })[w]; if (blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == children.id; - }.bind(this)).length == 0) { + }).length == 0) { children.childwidth = 0; } if (children.childwidth > children.width) { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length - 1) { + }).length - 1) { totalwidth += children.childwidth; } else { totalwidth += children.childwidth + paddingx; } } else { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length - 1) { + }).length - 1) { totalwidth += children.width; } else { totalwidth += children.width + paddingx; @@ -1105,28 +873,20 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (result[z] != -1) { blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == result[z]; - }.bind(this))[0].childwidth = totalwidth; + })[0].childwidth = totalwidth; } for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this))[w]; + })[w]; var r_block = document.querySelector(".blockid[value='" + children.id + "']").parentNode; var r_array = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.id == result[z]; - }.bind(this)); + }); r_block.style.top = r_array.y + paddingy + "px"; r_array.y = r_array.y + paddingy; @@ -1141,51 +901,33 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == children.id; - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == children.parent; - }.bind(this))[0].x + 20; + })[0].x + 20; var arrowy = arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == children.parent; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this11); - + })[0].y + blocks.filter(function (a) { return a.id == children.parent; - }.bind(this))[0].height / 2); + })[0].height / 2); document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.id == children.parent; - }.bind(this))[0].y + blocks.filter(function (id) { - _newArrowCheck(this, _this11); - + })[0].y + blocks.filter(function (id) { return id.id == children.parent; - }.bind(this))[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; + })[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.scrollY) + "px"; if (arrowx < 0) { document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + })[0].x - arrowhelp.x + 5) + ' ' + paddingy / 2 + 'L5 ' + paddingy / 2 + 'L5 ' + arrowy + '" stroke="#C5CCD0" stroke-width="2px"/>'; } else { document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.id == children.parent; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; + })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.scrollX) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; } } diff --git a/lib/flowy.js b/lib/flowy.js index 45435da..19e1cd1 100644 --- a/lib/flowy.js +++ b/lib/flowy.js @@ -1,7 +1,5 @@ "use strict"; -function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } - var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x, spacing_y) { if (!grab) { grab = function grab() {}; @@ -71,7 +69,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x el.classList.add('invisible'); canvas_div.appendChild(el); - flowy["import"] = function (output) { + flowy.import = function (output) { canvas_div.innerHTML = output.html; for (var a = 0; a < output.blockarr.length; a++) { @@ -134,8 +132,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x }; flowy.beginDrag = function (event) { - var _this = this; - if (event.targetTouches) { mouse_x = event.changedTouches[0].clientX; mouse_y = event.changedTouches[0].clientY; @@ -152,21 +148,17 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x newNode.classList.remove("create-flowy"); if (blocks.length === 0) { - newNode.innerHTML += ""; + newNode.appendChild(string2DomElem("")); document.body.appendChild(newNode); drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; } else { - newNode.innerHTML += ""; + })) + 1) + "'>")); document.body.appendChild(newNode); drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(function (a) { - _newArrowCheck(this, _this); - return a.id; - }.bind(this)))) + 1) + "']").parentNode; + }))) + 1) + "']").parentNode; } blockGrabbed(event.target.closest(".create-flowy")); @@ -191,8 +183,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x document.addEventListener('touchstart', flowy.beginDrag); flowy.endDrag = function (event) { - var _this2 = this; - if (event.which != 3 && (active || rearrange)) { dragblock = false; blockReleased(); @@ -226,15 +216,11 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } blockstemp.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == 0; - }.bind(this))[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2; + })[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2; blockstemp.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == 0; - }.bind(this))[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2; + })[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2; blocks = blocks.concat(blockstemp); blockstemp = []; } else if (active && blocks.length == 0 && drag.getBoundingClientRect().top + window.pageYOffset > canvas_div.getBoundingClientRect().top + window.pageYOffset && drag.getBoundingClientRect().left + window.pageXOffset > canvas_div.getBoundingClientRect().left + window.pageXOffset) { @@ -259,45 +245,27 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this2); - return a.id; - }.bind(this)); + }); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == blocko[i]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].x + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].height / 2 && ypos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height) { + })[0].height) { active = false; if (blockSnap(drag, false, document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode)) { @@ -319,55 +287,35 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this2); - return a.id; - }.bind(this)); + }); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - return a.id == blocko[i]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].x + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].x + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y - blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].height / 2 && ypos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this2); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height) { + })[0].height) { active = false; drag.classList.remove("dragging"); snap(drag, i, blocko); break; } else if (i == blocks.length - 1) { if (beforeDelete(drag, blocks.filter(function (id) { - _newArrowCheck(this, _this2); - return id.id == blocko[i]; - }.bind(this))[0])) { + })[0])) { active = false; drag.classList.remove("dragging"); snap(drag, blocko.indexOf(prevblock), blocko); @@ -390,8 +338,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x document.addEventListener("touchend", flowy.endDrag, false); function snap(drag, i, blocko) { - var _this3 = this; - if (!rearrange) { canvas_div.appendChild(drag); } @@ -401,15 +347,11 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var maxheight = 0; for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[w]; + })[w]; if (children.childwidth > children.width) { totalwidth += children.childwidth + paddingx; @@ -421,74 +363,50 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x totalwidth += parseInt(window.getComputedStyle(drag).width); for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[w]; + })[w]; if (children.childwidth > children.width) { document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; + })[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; children.x = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; + })[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; totalremove += children.childwidth + paddingx; } else { document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + "px"; + })[0].x - totalwidth / 2 + totalremove + "px"; children.x = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove + children.width / 2; + })[0].x - totalwidth / 2 + totalremove + children.width / 2; totalremove += children.width + paddingx; } } drag.style.left = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.id == blocko[i]; - }.bind(this))[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + })[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; drag.style.top = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (id) { - _newArrowCheck(this, _this3); - + })[0].y + blocks.filter(function (id) { return id.id == blocko[i]; - }.bind(this))[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; + })[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (rearrange) { blockstemp.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + })[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + })[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; blockstemp.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == drag.querySelector(".blockid").value; - }.bind(this))[0].parent = blocko[i]; + })[0].parent = blocko[i]; for (var w = 0; w < blockstemp.length; w++) { if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { @@ -520,100 +438,70 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x + 20; + })[0].x + 20; var arrowy = parseFloat(arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (id) { - _newArrowCheck(this, _this3); - + })[0].y + blocks.filter(function (id) { return id.parent == blocko[i]; - }.bind(this))[0].height / 2) + canvas_div.scrollTop); + })[0].height / 2) + canvas_div.scrollTop); if (arrowx < 0) { - canvas_div.innerHTML += '
'; + })[0].x - arrowhelp.x + 5) + ' ' + paddingy / 2 + 'L5 ' + paddingy / 2 + 'L5 ' + arrowy + '" stroke="#C5CCD0" stroke-width="2px"/>')); document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } else { - canvas_div.appendChild(string2Elemnt('
')); + canvas_div.appendChild(string2DomElem('
')); document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this3); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 + "px"; + })[0].height / 2 + "px"; if (blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == blocko[i]; - }.bind(this))[0].parent != -1) { + })[0].parent != -1) { var flag = false; var idval = blocko[i]; while (!flag) { if (blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == idval; - }.bind(this))[0].parent == -1) { + })[0].parent == -1) { flag = true; } else { var zwidth = 0; for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this))[w]; + })[w]; if (children.childwidth > children.width) { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this)).length - 1) { + }).length - 1) { zwidth += children.childwidth; } else { zwidth += children.childwidth + paddingx; } } else { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.parent == idval; - }.bind(this)).length - 1) { + }).length - 1) { zwidth += children.width; } else { zwidth += children.width + paddingx; @@ -622,23 +510,17 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == idval; - }.bind(this))[0].childwidth = zwidth; + })[0].childwidth = zwidth; idval = blocks.filter(function (a) { - _newArrowCheck(this, _this3); - return a.id == idval; - }.bind(this))[0].parent; + })[0].parent; } } blocks.filter(function (id) { - _newArrowCheck(this, _this3); - return id.id == idval; - }.bind(this))[0].childwidth = totalwidth; + })[0].childwidth = totalwidth; } if (rearrange) { @@ -686,8 +568,6 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } flowy.moveBlock = function (event) { - var _this4 = this; - if (event.targetTouches) { mouse_x = event.targetTouches[0].clientX; mouse_y = event.targetTouches[0].clientY; @@ -701,15 +581,11 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag.classList.add("dragging"); var blockid = parseInt(drag.querySelector(".blockid").value); prevblock = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == blockid; - }.bind(this))[0].parent; + })[0].parent; blockstemp.push(blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == blockid; - }.bind(this))[0]); + })[0]); blocks = blocks.filter(function (e) { return e.id != blockid; }); @@ -719,10 +595,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var layer = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.parent == blockid; - }.bind(this)); + }); var flag = false; var foundids = []; var allids = []; @@ -731,10 +605,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x for (var i = 0; i < layer.length; i++) { if (layer[i] != blockid) { blockstemp.push(blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == layer[i].id; - }.bind(this))[0]); + })[0]); var blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; var arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; blockParent.style.left = blockParent.getBoundingClientRect().left + window.pageXOffset - (drag.getBoundingClientRect().left + window.pageXOffset) + "px"; @@ -752,24 +624,18 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x flag = true; } else { layer = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return foundids.includes(a.parent); - }.bind(this)); + }); foundids = []; } } for (var i = 0; i < blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.parent == blockid; - }.bind(this)).length; i++) { + }).length; i++) { var blocknumber = blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.parent == blockid; - }.bind(this))[i]; + })[i]; blocks = blocks.filter(function (e) { return e.id != blocknumber; }); @@ -800,60 +666,38 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; blockstemp.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this)).x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + }).x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == parseInt(drag.querySelector(".blockid").value); - }.bind(this)).y = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + }).y = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; } if (active || rearrange) { var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this4); - return a.id; - }.bind(this)); + }); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - return a.id == blocko[i]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].x + blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].x + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y - blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].y - blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].height / 2 && ypos <= blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this4); - + })[0].y + blocks.filter(function (a) { return a.id == blocko[i]; - }.bind(this))[0].height) { + })[0].height) { document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode.appendChild(document.querySelector(".indicator")); document.querySelector(".indicator").style.left = parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).width) / 2 - 5 + "px"; document.querySelector(".indicator").style.top = window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).height + "px"; @@ -872,18 +716,12 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x document.addEventListener("touchmove", flowy.moveBlock, false); function checkOffset() { - var _this5 = this; - offsetleft = blocks.map(function (a) { - _newArrowCheck(this, _this5); - return a.x; - }.bind(this)); + }); var widths = blocks.map(function (a) { - _newArrowCheck(this, _this5); - return a.width; - }.bind(this)); + }); var mathmin = offsetleft.map(function (item, index) { return item - widths[index] / 2; }); @@ -892,62 +730,38 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (offsetleft < canvas_div.getBoundingClientRect().left + window.pageXOffset) { lastevent = true; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this5); - return a.id; - }.bind(this)); + }); for (var w = 0; w < blocks.length; w++) { document.querySelector(".blockid[value='" + blocks.filter(function (a) { - _newArrowCheck(this, _this5); - return a.id == blocko[w]; - }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this5); - + })[0].id + "']").parentNode.style.left = blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this5); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].width / 2 - offsetleft + 20 + "px"; + })[0].width / 2 - offsetleft + 20 + "px"; if (blocks.filter(function (a) { - _newArrowCheck(this, _this5); - return a.id == blocko[w]; - }.bind(this))[0].parent != -1) { + })[0].parent != -1) { var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this5); - return a.id == blocko[w]; - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - var _this6 = this; - - _newArrowCheck(this, _this5); - return a.id == blocks.filter(function (a) { - _newArrowCheck(this, _this6); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x; + })[0].parent; + })[0].x; if (arrowx < 0) { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - offsetleft + 20 - 5 + "px"; } else { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { - var _this7 = this; - - _newArrowCheck(this, _this5); - return id.id == blocks.filter(function (a) { - _newArrowCheck(this, _this7); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x - 20 - offsetleft + 20 + "px"; + })[0].parent; + })[0].x - 20 - offsetleft + 20 + "px"; } } } @@ -961,80 +775,48 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } function fixOffset() { - var _this8 = this; - if (offsetleftold < canvas_div.getBoundingClientRect().left + window.pageXOffset) { lastevent = false; var blocko = blocks.map(function (a) { - _newArrowCheck(this, _this8); - return a.id; - }.bind(this)); + }); for (var w = 0; w < blocks.length; w++) { document.querySelector(".blockid[value='" + blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].id + "']").parentNode.style.left = blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].x - blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].x - blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].width / 2 - offsetleftold - 20 + "px"; + })[0].width / 2 - offsetleftold - 20 + "px"; blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset + blocks.filter(function (a) { - _newArrowCheck(this, _this8); - + })[0].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset + blocks.filter(function (a) { return a.id == blocko[w]; - }.bind(this))[0].width / 2; + })[0].width / 2; if (blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0].parent != -1) { + })[0].parent != -1) { var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this8); - return a.id == blocko[w]; - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - var _this9 = this; - - _newArrowCheck(this, _this8); - return a.id == blocks.filter(function (a) { - _newArrowCheck(this, _this9); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x; + })[0].parent; + })[0].x; if (arrowx < 0) { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; } else { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { - var _this10 = this; - - _newArrowCheck(this, _this8); - return id.id == blocks.filter(function (a) { - _newArrowCheck(this, _this10); - return a.id == blocko[w]; - }.bind(this))[0].parent; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; + })[0].parent; + })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; } } } @@ -1044,13 +826,9 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } function rearrangeMe() { - var _this11 = this; - var result = blocks.map(function (a) { - _newArrowCheck(this, _this11); - return a.parent; - }.bind(this)); + }); for (var z = 0; z < result.length; z++) { if (result[z] == -1) { @@ -1062,40 +840,30 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var maxheight = 0; for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this))[w]; + })[w]; if (blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == children.id; - }.bind(this)).length == 0) { + }).length == 0) { children.childwidth = 0; } if (children.childwidth > children.width) { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length - 1) { + }).length - 1) { totalwidth += children.childwidth; } else { totalwidth += children.childwidth + paddingx; } } else { if (w == blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length - 1) { + }).length - 1) { totalwidth += children.width; } else { totalwidth += children.width + paddingx; @@ -1105,28 +873,20 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (result[z] != -1) { blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == result[z]; - }.bind(this))[0].childwidth = totalwidth; + })[0].childwidth = totalwidth; } for (var w = 0; w < blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this)).length; w++) { + }).length; w++) { var children = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.parent == result[z]; - }.bind(this))[w]; + })[w]; var r_block = document.querySelector(".blockid[value='" + children.id + "']").parentNode; var r_array = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.id == result[z]; - }.bind(this)); + }); r_block.style.top = r_array.y + paddingy + "px"; r_array.y = r_array.y + paddingy; @@ -1141,51 +901,33 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var arrowhelp = blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == children.id; - }.bind(this))[0]; + })[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == children.parent; - }.bind(this))[0].x + 20; + })[0].x + 20; var arrowy = arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (a) { - _newArrowCheck(this, _this11); - return a.id == children.parent; - }.bind(this))[0].y + blocks.filter(function (a) { - _newArrowCheck(this, _this11); - + })[0].y + blocks.filter(function (a) { return a.id == children.parent; - }.bind(this))[0].height / 2); + })[0].height / 2); document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.id == children.parent; - }.bind(this))[0].y + blocks.filter(function (id) { - _newArrowCheck(this, _this11); - + })[0].y + blocks.filter(function (id) { return id.id == children.parent; - }.bind(this))[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; + })[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (arrowx < 0) { document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + })[0].x - arrowhelp.x + 5) + ' ' + paddingy / 2 + 'L5 ' + paddingy / 2 + 'L5 ' + arrowy + '" stroke="#C5CCD0" stroke-width="2px"/>'; } else { document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(function (id) { - _newArrowCheck(this, _this11); - return id.id == children.parent; - }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; + })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; } } @@ -1226,4 +968,9 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x nodes[i].removeEventListener(type, listener, capture); } } + + function string2DomElem(html) { + var parser = new DOMParser(); + return parser.parseFromString(html, 'text/html').body.childNodes[0]; + } }; \ No newline at end of file diff --git a/lib/helper.js b/lib/helper.js deleted file mode 100644 index 2a84061..0000000 --- a/lib/helper.js +++ /dev/null @@ -1,4 +0,0 @@ -function string2Elemnt(html) { - var parser = new DOMParser(); - return parser.parseFromString(html, 'text/html').body.childNodes[0]; -} \ No newline at end of file From 9f112589bb2b7a3b69d1c8c167ecae4272a5b59c Mon Sep 17 00:00:00 2001 From: Kirit1592 Date: Sat, 18 Jul 2020 12:08:01 +0530 Subject: [PATCH 5/5] update flowy to support the parent element as wrapper. --- babel.config.json | 2 +- demo/index.html | 380 ++++++++++++++++++++-------------- demo/main.js | 6 +- engine/flowy.js | 26 +-- lib/flowy.js | 518 ++++++++++++++++++++++++++++++++++------------ package-lock.json | 5 + package.json | 3 + 7 files changed, 638 insertions(+), 302 deletions(-) diff --git a/babel.config.json b/babel.config.json index efe697d..bf7c978 100644 --- a/babel.config.json +++ b/babel.config.json @@ -14,7 +14,7 @@ [ "@babel/plugin-transform-arrow-functions", { - "spec": false + "spec": true } ] ] diff --git a/demo/index.html b/demo/index.html index 5fa5335..a2662cd 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,161 +1,229 @@ - + - - -Flowy - The simple flowchart engine - - + + + Flowy - The simple flowchart engine + + - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - -
-
- -
- - - -
-
- -
- -
-
-
- - -
-
-

New visitor

-

Triggers when somebody visits a specified page

-
-
-
-
- -
- -
-
-
- - -
-
-

Action is performed

-

Triggers when somebody performs a specified action

-
-
-
-
- -
- -
-
-
- - -
-
-

Time has passed

-

Triggers after a specified amount of time

-
-
-
-
- -
- -
-
-
- - -
-
-

Error prompt

-

Triggers when a specified error happens

-
-
-
-
-
-
-
-
- -
-

Properties

-
-
Data
-
Alerts
-
Logs
-
-
-

Select database

-
Database 1
-

Check properties

-
All
-

Log on successful performance

-

Give priority to this block

-
-
-
Delete blocks
-
-
-
-
- + + + + + + + +
+ +
+
+ +
+ + + +
+
+ +
+ +
+
+
+ + +
+
+

New visitor

+

+ Triggers when somebody visits a specified + page +

+
+
+
+
+ +
+ +
+
+
+ + +
+
+

Action is performed

+

+ Triggers when somebody performs a specified + action +

+
+
+
+
+ +
+ +
+
+
+ + +
+
+

Time has passed

+

+ Triggers after a specified amount of time +

+
+
+
+
+ +
+ +
+
+
+ + +
+
+

Error prompt

+

+ Triggers when a specified error happens +

+
+
+
+
+
+
+
+
+ +
+

Properties

+
+
Data
+
Alerts
+
Logs
+
+
+

Select database

+
+ Database 1 +
+

Check properties

+
+ All +
+
+ +

Log on successful performance

+
+
+ +

Give priority to this block

+
+
+
+
Delete blocks
+
+
+
+
+ diff --git a/demo/main.js b/demo/main.js index 89715c9..1fbdcbd 100644 --- a/demo/main.js +++ b/demo/main.js @@ -2,8 +2,10 @@ document.addEventListener("DOMContentLoaded", function(){ var rightcard = false; var tempblock; var tempblock2; - document.getElementById("blocklist").innerHTML = '

New visitor

Triggers when somebody visits a specified page

Action is performed

Triggers when somebody performs a specified action

Time has passed

Triggers after a specified amount of time

Error prompt

Triggers when a specified error happens

'; - flowy(document.getElementById("canvas"), drag, release, snapping); + // document.getElementById("blocklist").innerHTML = '

New visitor

Triggers when somebody visits a specified page

Action is performed

Triggers when somebody performs a specified action

Time has passed

Triggers after a specified amount of time

Error prompt

Triggers when a specified error happens

'; + // flowy(document.getElementById("canvas"), drag, release, snapping); + flowy(document.getElementById("wrapper"), drag, release, snapping); + function addEventListenerMulti(type, listener, capture, selector) { var nodes = document.querySelectorAll(selector); for (var i = 0; i < nodes.length; i++) { diff --git a/engine/flowy.js b/engine/flowy.js index cc846ae..f1c9075 100644 --- a/engine/flowy.js +++ b/engine/flowy.js @@ -1,4 +1,4 @@ -var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spacing_y) { +var flowy = function(wrapperElement, grab, release, snapping, rearrange, spacing_x, spacing_y) { if (!grab) { grab = function() {}; } @@ -43,7 +43,7 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac return; var blocks = []; var blockstemp = []; - var canvas_div = canvas; + var canvas_div = wrapperElement.querySelector('#canvas'); var active = false; var paddingx = spacing_x; var paddingy = spacing_y; @@ -127,11 +127,11 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac newNode.classList.remove("create-flowy"); if (blocks.length === 0) { newNode.appendChild(string2DomElem("")); - document.body.appendChild(newNode); + wrapperElement.appendChild(newNode); drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; } else { newNode.appendChild(string2DomElem("")); - document.body.appendChild(newNode); + wrapperElement.appendChild(newNode); drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(a => a.id))) + 1) + "']").parentNode; } blockGrabbed(event.target.closest(".create-flowy")); @@ -143,15 +143,15 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac drag.style.top = mouse_y - dragy + "px"; } } - document.addEventListener("mousedown",touchblock, false); - document.addEventListener("touchstart",touchblock, false); - document.addEventListener("mouseup", touchblock, false); + wrapperElement.addEventListener("mousedown",touchblock, false); + wrapperElement.addEventListener("touchstart",touchblock, false); + wrapperElement.addEventListener("mouseup", touchblock, false); flowy.touchDone = function() { dragblock = false; } - document.addEventListener('mousedown',flowy.beginDrag); - document.addEventListener('touchstart',flowy.beginDrag); + wrapperElement.addEventListener('mousedown',flowy.beginDrag); + wrapperElement.addEventListener('touchstart',flowy.beginDrag); flowy.endDrag = function(event) { if (event.which != 3 && (active || rearrange)) { @@ -254,8 +254,8 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac } } - document.addEventListener("mouseup", flowy.endDrag, false); - document.addEventListener("touchend", flowy.endDrag, false); + wrapperElement.addEventListener("mouseup", flowy.endDrag, false); + wrapperElement.addEventListener("touchend", flowy.endDrag, false); function snap(drag, i, blocko) { if (!rearrange) { @@ -496,8 +496,8 @@ var flowy = function(canvas, grab, release, snapping, rearrange, spacing_x, spac } } - document.addEventListener("mousemove", flowy.moveBlock, false); - document.addEventListener("touchmove", flowy.moveBlock, false); + wrapperElement.addEventListener("mousemove", flowy.moveBlock, false); + wrapperElement.addEventListener("touchmove", flowy.moveBlock, false); function checkOffset() { offsetleft = blocks.map(a => a.x); diff --git a/lib/flowy.js b/lib/flowy.js index 19e1cd1..15caf6e 100644 --- a/lib/flowy.js +++ b/lib/flowy.js @@ -1,6 +1,8 @@ "use strict"; -var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x, spacing_y) { +function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } + +var flowy = function flowy(wrapperElement, grab, release, snapping, rearrange, spacing_x, spacing_y) { if (!grab) { grab = function grab() {}; } @@ -52,7 +54,7 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (!loaded) loaded = true;else return; var blocks = []; var blockstemp = []; - var canvas_div = canvas; + var canvas_div = wrapperElement.querySelector('#canvas'); var active = false; var paddingx = spacing_x; var paddingy = spacing_y; @@ -132,6 +134,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x }; flowy.beginDrag = function (event) { + var _this = this; + if (event.targetTouches) { mouse_x = event.changedTouches[0].clientX; mouse_y = event.changedTouches[0].clientY; @@ -149,16 +153,20 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (blocks.length === 0) { newNode.appendChild(string2DomElem("")); - document.body.appendChild(newNode); + wrapperElement.appendChild(newNode); drag = document.querySelector(".blockid[value='" + blocks.length + "']").parentNode; } else { newNode.appendChild(string2DomElem("")); - document.body.appendChild(newNode); + }.bind(this))) + 1) + "'>")); + wrapperElement.appendChild(newNode); drag = document.querySelector(".blockid[value='" + (parseInt(Math.max.apply(Math, blocks.map(function (a) { + _newArrowCheck(this, _this); + return a.id; - }))) + 1) + "']").parentNode; + }.bind(this)))) + 1) + "']").parentNode; } blockGrabbed(event.target.closest(".create-flowy")); @@ -171,18 +179,20 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } }; - document.addEventListener("mousedown", touchblock, false); - document.addEventListener("touchstart", touchblock, false); - document.addEventListener("mouseup", touchblock, false); + wrapperElement.addEventListener("mousedown", touchblock, false); + wrapperElement.addEventListener("touchstart", touchblock, false); + wrapperElement.addEventListener("mouseup", touchblock, false); flowy.touchDone = function () { dragblock = false; }; - document.addEventListener('mousedown', flowy.beginDrag); - document.addEventListener('touchstart', flowy.beginDrag); + wrapperElement.addEventListener('mousedown', flowy.beginDrag); + wrapperElement.addEventListener('touchstart', flowy.beginDrag); flowy.endDrag = function (event) { + var _this2 = this; + if (event.which != 3 && (active || rearrange)) { dragblock = false; blockReleased(); @@ -216,11 +226,15 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } blockstemp.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == 0; - })[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2; + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2; blockstemp.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == 0; - })[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2; + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2; blocks = blocks.concat(blockstemp); blockstemp = []; } else if (active && blocks.length == 0 && drag.getBoundingClientRect().top + window.pageYOffset > canvas_div.getBoundingClientRect().top + window.pageYOffset && drag.getBoundingClientRect().left + window.pageXOffset > canvas_div.getBoundingClientRect().left + window.pageXOffset) { @@ -245,27 +259,45 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this2); + return a.id; - }); + }.bind(this)); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].x - blocks.filter(function (a) { + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].x + blocks.filter(function (a) { + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].y - blocks.filter(function (a) { + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].height / 2 && ypos <= blocks.filter(function (a) { + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].y + blocks.filter(function (a) { + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].height) { + }.bind(this))[0].height) { active = false; if (blockSnap(drag, false, document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode)) { @@ -287,35 +319,55 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this2); + return a.id; - }); + }.bind(this)); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].x - blocks.filter(function (a) { + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].x + blocks.filter(function (a) { + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].y - blocks.filter(function (a) { + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].height / 2 && ypos <= blocks.filter(function (a) { + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].y + blocks.filter(function (a) { + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this2); + return a.id == blocko[i]; - })[0].height) { + }.bind(this))[0].height) { active = false; drag.classList.remove("dragging"); snap(drag, i, blocko); break; } else if (i == blocks.length - 1) { if (beforeDelete(drag, blocks.filter(function (id) { + _newArrowCheck(this, _this2); + return id.id == blocko[i]; - })[0])) { + }.bind(this))[0])) { active = false; drag.classList.remove("dragging"); snap(drag, blocko.indexOf(prevblock), blocko); @@ -334,10 +386,12 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } }; - document.addEventListener("mouseup", flowy.endDrag, false); - document.addEventListener("touchend", flowy.endDrag, false); + wrapperElement.addEventListener("mouseup", flowy.endDrag, false); + wrapperElement.addEventListener("touchend", flowy.endDrag, false); function snap(drag, i, blocko) { + var _this3 = this; + if (!rearrange) { canvas_div.appendChild(drag); } @@ -347,11 +401,15 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var maxheight = 0; for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - }).length; w++) { + }.bind(this)).length; w++) { var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - })[w]; + }.bind(this))[w]; if (children.childwidth > children.width) { totalwidth += children.childwidth + paddingx; @@ -363,50 +421,74 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x totalwidth += parseInt(window.getComputedStyle(drag).width); for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - }).length; w++) { + }.bind(this)).length; w++) { var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - })[w]; + }.bind(this))[w]; if (children.childwidth > children.width) { document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == blocko[i]; - })[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2 - children.width / 2 + "px"; children.x = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - })[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.childwidth / 2; totalremove += children.childwidth + paddingx; } else { document.querySelector(".blockid[value='" + children.id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == blocko[i]; - })[0].x - totalwidth / 2 + totalremove + "px"; + }.bind(this))[0].x - totalwidth / 2 + totalremove + "px"; children.x = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - })[0].x - totalwidth / 2 + totalremove + children.width / 2; + }.bind(this))[0].x - totalwidth / 2 + totalremove + children.width / 2; totalremove += children.width + paddingx; } } drag.style.left = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.id == blocko[i]; - })[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + }.bind(this))[0].x - totalwidth / 2 + totalremove - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; drag.style.top = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.id == blocko[i]; - })[0].y + blocks.filter(function (id) { + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.id == blocko[i]; - })[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; + }.bind(this))[0].height / 2 + paddingy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (rearrange) { blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == parseInt(drag.querySelector(".blockid").value); - })[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + }.bind(this))[0].x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == parseInt(drag.querySelector(".blockid").value); - })[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + }.bind(this))[0].y = drag.getBoundingClientRect().top + window.pageYOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; blockstemp.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == drag.querySelector(".blockid").value; - })[0].parent = blocko[i]; + }.bind(this))[0].parent = blocko[i]; for (var w = 0; w < blockstemp.length; w++) { if (blockstemp[w].id != parseInt(drag.querySelector(".blockid").value)) { @@ -438,70 +520,100 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == parseInt(drag.querySelector(".blockid").value); - })[0]; + }.bind(this))[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == blocko[i]; - })[0].x + 20; + }.bind(this))[0].x + 20; var arrowy = parseFloat(arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - })[0].y + blocks.filter(function (id) { + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == blocko[i]; - })[0].height / 2) + canvas_div.scrollTop); + }.bind(this))[0].height / 2) + canvas_div.scrollTop); if (arrowx < 0) { canvas_div.appendChild(string2DomElem('
')); + }.bind(this))[0].x - arrowhelp.x + 5) + ' ' + paddingy / 2 + 'L5 ' + paddingy / 2 + 'L5 ' + arrowy + '" stroke="#C5CCD0" stroke-width="2px"/>')); document.querySelector('.arrowid[value="' + drag.querySelector(".blockid").value + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } else { canvas_div.appendChild(string2DomElem('
')); document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == blocko[i]; - })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; } document.querySelector('.arrowid[value="' + parseInt(drag.querySelector(".blockid").value) + '"]').parentNode.style.top = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == blocko[i]; - })[0].y + blocks.filter(function (a) { + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == blocko[i]; - })[0].height / 2 + "px"; + }.bind(this))[0].height / 2 + "px"; if (blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == blocko[i]; - })[0].parent != -1) { + }.bind(this))[0].parent != -1) { var flag = false; var idval = blocko[i]; while (!flag) { if (blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == idval; - })[0].parent == -1) { + }.bind(this))[0].parent == -1) { flag = true; } else { var zwidth = 0; for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == idval; - }).length; w++) { + }.bind(this)).length; w++) { var children = blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == idval; - })[w]; + }.bind(this))[w]; if (children.childwidth > children.width) { if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == idval; - }).length - 1) { + }.bind(this)).length - 1) { zwidth += children.childwidth; } else { zwidth += children.childwidth + paddingx; } } else { if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.parent == idval; - }).length - 1) { + }.bind(this)).length - 1) { zwidth += children.width; } else { zwidth += children.width + paddingx; @@ -510,17 +622,23 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == idval; - })[0].childwidth = zwidth; + }.bind(this))[0].childwidth = zwidth; idval = blocks.filter(function (a) { + _newArrowCheck(this, _this3); + return a.id == idval; - })[0].parent; + }.bind(this))[0].parent; } } blocks.filter(function (id) { + _newArrowCheck(this, _this3); + return id.id == idval; - })[0].childwidth = totalwidth; + }.bind(this))[0].childwidth = totalwidth; } if (rearrange) { @@ -568,6 +686,8 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } flowy.moveBlock = function (event) { + var _this4 = this; + if (event.targetTouches) { mouse_x = event.targetTouches[0].clientX; mouse_y = event.targetTouches[0].clientY; @@ -581,11 +701,15 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag.classList.add("dragging"); var blockid = parseInt(drag.querySelector(".blockid").value); prevblock = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blockid; - })[0].parent; + }.bind(this))[0].parent; blockstemp.push(blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blockid; - })[0]); + }.bind(this))[0]); blocks = blocks.filter(function (e) { return e.id != blockid; }); @@ -595,8 +719,10 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var layer = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.parent == blockid; - }); + }.bind(this)); var flag = false; var foundids = []; var allids = []; @@ -605,8 +731,10 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x for (var i = 0; i < layer.length; i++) { if (layer[i] != blockid) { blockstemp.push(blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == layer[i].id; - })[0]); + }.bind(this))[0]); var blockParent = document.querySelector(".blockid[value='" + layer[i].id + "']").parentNode; var arrowParent = document.querySelector(".arrowid[value='" + layer[i].id + "']").parentNode; blockParent.style.left = blockParent.getBoundingClientRect().left + window.pageXOffset - (drag.getBoundingClientRect().left + window.pageXOffset) + "px"; @@ -624,18 +752,24 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x flag = true; } else { layer = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return foundids.includes(a.parent); - }); + }.bind(this)); foundids = []; } } for (var i = 0; i < blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.parent == blockid; - }).length; i++) { + }.bind(this)).length; i++) { var blocknumber = blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.parent == blockid; - })[i]; + }.bind(this))[i]; blocks = blocks.filter(function (e) { return e.id != blocknumber; }); @@ -666,38 +800,60 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x drag.style.left = mouse_x - dragx - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + canvas_div.scrollLeft + "px"; drag.style.top = mouse_y - dragy - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + canvas_div.scrollTop + "px"; blockstemp.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == parseInt(drag.querySelector(".blockid").value); - }).x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; + }.bind(this)).x = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; blockstemp.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == parseInt(drag.querySelector(".blockid").value); - }).y = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; + }.bind(this)).y = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).height) / 2 + canvas_div.scrollTop; } if (active || rearrange) { var xpos = drag.getBoundingClientRect().left + window.pageXOffset + parseInt(window.getComputedStyle(drag).width) / 2 + canvas_div.scrollLeft; var ypos = drag.getBoundingClientRect().top + window.pageYOffset + canvas_div.scrollTop; var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this4); + return a.id; - }); + }.bind(this)); for (var i = 0; i < blocks.length; i++) { if (xpos >= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].x - blocks.filter(function (a) { + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + }.bind(this))[0].width / 2 - paddingx && xpos <= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].x + blocks.filter(function (a) { + }.bind(this))[0].x + blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + }.bind(this))[0].width / 2 + paddingx && ypos >= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].y - blocks.filter(function (a) { + }.bind(this))[0].y - blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].height / 2 && ypos <= blocks.filter(function (a) { + }.bind(this))[0].height / 2 && ypos <= blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].y + blocks.filter(function (a) { + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this4); + return a.id == blocko[i]; - })[0].height) { + }.bind(this))[0].height) { document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode.appendChild(document.querySelector(".indicator")); document.querySelector(".indicator").style.left = parseInt(window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).width) / 2 - 5 + "px"; document.querySelector(".indicator").style.top = window.getComputedStyle(document.querySelector(".blockid[value='" + blocko[i] + "']").parentNode).height + "px"; @@ -712,16 +868,22 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } }; - document.addEventListener("mousemove", flowy.moveBlock, false); - document.addEventListener("touchmove", flowy.moveBlock, false); + wrapperElement.addEventListener("mousemove", flowy.moveBlock, false); + wrapperElement.addEventListener("touchmove", flowy.moveBlock, false); function checkOffset() { + var _this5 = this; + offsetleft = blocks.map(function (a) { + _newArrowCheck(this, _this5); + return a.x; - }); + }.bind(this)); var widths = blocks.map(function (a) { + _newArrowCheck(this, _this5); + return a.width; - }); + }.bind(this)); var mathmin = offsetleft.map(function (item, index) { return item - widths[index] / 2; }); @@ -730,38 +892,62 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (offsetleft < canvas_div.getBoundingClientRect().left + window.pageXOffset) { lastevent = true; var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this5); + return a.id; - }); + }.bind(this)); for (var w = 0; w < blocks.length; w++) { document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this5); + return a.id == blocko[w]; - })[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this5); + return a.id == blocko[w]; - })[0].x - blocks.filter(function (a) { + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this5); + return a.id == blocko[w]; - })[0].width / 2 - offsetleft + 20 + "px"; + }.bind(this))[0].width / 2 - offsetleft + 20 + "px"; if (blocks.filter(function (a) { + _newArrowCheck(this, _this5); + return a.id == blocko[w]; - })[0].parent != -1) { + }.bind(this))[0].parent != -1) { var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this5); + return a.id == blocko[w]; - })[0]; + }.bind(this))[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { + var _this6 = this; + + _newArrowCheck(this, _this5); + return a.id == blocks.filter(function (a) { + _newArrowCheck(this, _this6); + return a.id == blocko[w]; - })[0].parent; - })[0].x; + }.bind(this))[0].parent; + }.bind(this))[0].x; if (arrowx < 0) { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - offsetleft + 20 - 5 + "px"; } else { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { + var _this7 = this; + + _newArrowCheck(this, _this5); + return id.id == blocks.filter(function (a) { + _newArrowCheck(this, _this7); + return a.id == blocko[w]; - })[0].parent; - })[0].x - 20 - offsetleft + 20 + "px"; + }.bind(this))[0].parent; + }.bind(this))[0].x - 20 - offsetleft + 20 + "px"; } } } @@ -775,48 +961,80 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } function fixOffset() { + var _this8 = this; + if (offsetleftold < canvas_div.getBoundingClientRect().left + window.pageXOffset) { lastevent = false; var blocko = blocks.map(function (a) { + _newArrowCheck(this, _this8); + return a.id; - }); + }.bind(this)); for (var w = 0; w < blocks.length; w++) { document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + }.bind(this))[0].id + "']").parentNode.style.left = blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0].x - blocks.filter(function (a) { + }.bind(this))[0].x - blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0].width / 2 - offsetleftold - 20 + "px"; + }.bind(this))[0].width / 2 - offsetleftold - 20 + "px"; blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { + }.bind(this))[0].x = document.querySelector(".blockid[value='" + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset + blocks.filter(function (a) { + }.bind(this))[0].id + "']").parentNode.getBoundingClientRect().left + window.pageXOffset + blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0].width / 2; + }.bind(this))[0].width / 2; if (blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0].parent != -1) { + }.bind(this))[0].parent != -1) { var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this8); + return a.id == blocko[w]; - })[0]; + }.bind(this))[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { + var _this9 = this; + + _newArrowCheck(this, _this8); + return a.id == blocks.filter(function (a) { + _newArrowCheck(this, _this9); + return a.id == blocko[w]; - })[0].parent; - })[0].x; + }.bind(this))[0].parent; + }.bind(this))[0].x; if (arrowx < 0) { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; } else { document.querySelector('.arrowid[value="' + blocko[w] + '"]').parentNode.style.left = blocks.filter(function (id) { + var _this10 = this; + + _newArrowCheck(this, _this8); + return id.id == blocks.filter(function (a) { + _newArrowCheck(this, _this10); + return a.id == blocko[w]; - })[0].parent; - })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; + }.bind(this))[0].parent; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; } } } @@ -826,9 +1044,13 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } function rearrangeMe() { + var _this11 = this; + var result = blocks.map(function (a) { + _newArrowCheck(this, _this11); + return a.parent; - }); + }.bind(this)); for (var z = 0; z < result.length; z++) { if (result[z] == -1) { @@ -840,30 +1062,40 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x var maxheight = 0; for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.parent == result[z]; - }).length; w++) { + }.bind(this)).length; w++) { var children = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.parent == result[z]; - })[w]; + }.bind(this))[w]; if (blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.parent == children.id; - }).length == 0) { + }.bind(this)).length == 0) { children.childwidth = 0; } if (children.childwidth > children.width) { if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.parent == result[z]; - }).length - 1) { + }.bind(this)).length - 1) { totalwidth += children.childwidth; } else { totalwidth += children.childwidth + paddingx; } } else { if (w == blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.parent == result[z]; - }).length - 1) { + }.bind(this)).length - 1) { totalwidth += children.width; } else { totalwidth += children.width + paddingx; @@ -873,20 +1105,28 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x if (result[z] != -1) { blocks.filter(function (a) { + _newArrowCheck(this, _this11); + return a.id == result[z]; - })[0].childwidth = totalwidth; + }.bind(this))[0].childwidth = totalwidth; } for (var w = 0; w < blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.parent == result[z]; - }).length; w++) { + }.bind(this)).length; w++) { var children = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.parent == result[z]; - })[w]; + }.bind(this))[w]; var r_block = document.querySelector(".blockid[value='" + children.id + "']").parentNode; var r_array = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.id == result[z]; - }); + }.bind(this)); r_block.style.top = r_array.y + paddingy + "px"; r_array.y = r_array.y + paddingy; @@ -901,33 +1141,51 @@ var flowy = function flowy(canvas, grab, release, snapping, rearrange, spacing_x } var arrowhelp = blocks.filter(function (a) { + _newArrowCheck(this, _this11); + return a.id == children.id; - })[0]; + }.bind(this))[0]; var arrowx = arrowhelp.x - blocks.filter(function (a) { + _newArrowCheck(this, _this11); + return a.id == children.parent; - })[0].x + 20; + }.bind(this))[0].x + 20; var arrowy = arrowhelp.y - arrowhelp.height / 2 - (blocks.filter(function (a) { + _newArrowCheck(this, _this11); + return a.id == children.parent; - })[0].y + blocks.filter(function (a) { + }.bind(this))[0].y + blocks.filter(function (a) { + _newArrowCheck(this, _this11); + return a.id == children.parent; - })[0].height / 2); + }.bind(this))[0].height / 2); document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.top = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.id == children.parent; - })[0].y + blocks.filter(function (id) { + }.bind(this))[0].y + blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.id == children.parent; - })[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; + }.bind(this))[0].height / 2 - (canvas_div.getBoundingClientRect().top + window.pageYOffset) + "px"; if (arrowx < 0) { document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = arrowhelp.x - 5 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; + }.bind(this))[0].x - arrowhelp.x + 5) + ' ' + paddingy / 2 + 'L5 ' + paddingy / 2 + 'L5 ' + arrowy + '" stroke="#C5CCD0" stroke-width="2px"/>'; } else { document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.style.left = blocks.filter(function (id) { + _newArrowCheck(this, _this11); + return id.id == children.parent; - })[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; + }.bind(this))[0].x - 20 - (canvas_div.getBoundingClientRect().left + window.pageXOffset) + "px"; document.querySelector('.arrowid[value="' + children.id + '"]').parentNode.innerHTML = ''; } } diff --git a/package-lock.json b/package-lock.json index 46014da..ee22a67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1349,6 +1349,11 @@ "dev": true, "optional": true }, + "core-js": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", + "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" + }, "core-js-compat": { "version": "3.6.5", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", diff --git a/package.json b/package.json index 0b4d762..ef390b7 100644 --- a/package.json +++ b/package.json @@ -21,5 +21,8 @@ "@babel/cli": "^7.10.4", "@babel/core": "^7.10.4", "@babel/preset-env": "^7.10.4" + }, + "dependencies": { + "core-js": "^3.6.5" } }