diff --git a/.appcast.xml b/.appcast.xml index 1dbf0b5..2650281 100644 --- a/.appcast.xml +++ b/.appcast.xml @@ -1,6 +1,9 @@ + + + diff --git a/.vscode/launch.json b/.vscode/launch.json index 6f4cf2a..c17b667 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,8 +7,8 @@ { "type": "node", "request": "launch", - "name": "Sketch Plugin", - "program": "${workspaceFolder}/--run" + "name": "Sketch Arrows Plugin", + "program": "${workspaceFolder}/src/script.js" } ] } \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/autoUpdate.js b/arrows.sketchplugin/Contents/Sketch/autoUpdate.js new file mode 100644 index 0000000..86c9c96 --- /dev/null +++ b/arrows.sketchplugin/Contents/Sketch/autoUpdate.js @@ -0,0 +1,49 @@ +var that=this;function __skpm_run(e,t){that.context=t;var r=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./src/autoUpdate.js")}({"./src/autoUpdate.js": +/*!***************************!*\ + !*** ./src/autoUpdate.js ***! + \***************************/ +/*! exports provided: autoUpdateSelectedArrows */function(e,t,r){"use strict";r.r(t),r.d(t,"autoUpdateSelectedArrows",function(){return l});var o=r(/*! sketch */"sketch"),n=r.n(o),i=r(/*! ./utilities/lines.js */"./src/utilities/lines.js"),a=r(/*! ./createArrow.js */"./src/createArrow.js"),s=r(/*! ./utilities/data.js */"./src/utilities/data.js"),c=(r(/*! sketch/ui */"sketch/ui"),"flowArrows"),u=r(/*! sketch/settings */"sketch/settings");function l(e){if(0!=u.settingForKey("autoDraw")){var t,r=n.a.fromNative(e.actionContext.document),o=e.actionContext.document.documentData(),l=Object(s.getConnectionsData)(o),d=Array.from(e.actionContext.layers).map(function(e){return n.a.fromNative(e)});if((t=function(e,t){var r=[];if(e.length>0)for(var o=0;o0){for(var f=0;fa?u>s?l>d?"Down":"Right":f>y?"Right":"Up":u>s?f>y?"Left":"Down":l>d?"Left":"Up";return o}(e,t,u):a;!function(e,t,r,o){var i=o.getLayerWithID(e),a=o.getLayerWithID(t);if(n.settingForKey("arrowSpacing")&&0!=n.settingForKey("arrowSpacing")){var s=n.settingForKey("arrowSpacing");"Right"==r&&(a.frame.x=i.frame.x+i.frame.width+s),"Down"==r&&(a.frame.y=i.frame.y+i.frame.height+s),"Left"==r&&(a.frame.x=i.frame.x-a.frame.width-s),"Up"==r&&(a.frame.y=i.frame.y-a.frame.height-s)}}(e,t,d,u),function(e,t,r,o){var i,a,s,c,u,l=o.getLayerWithID(e),d=o.getLayerWithID(t);n.settingForKey("autoAlign")&&1==n.settingForKey("autoAlign")&&("Right"!=r&&"Left"!=r||(i=l.frame.y+l.frame.height/2,a=d.frame.y+d.frame.height/2,(u=i-a)>-6&&u<6&&(d.frame.y=d.frame.y+u)),"Down"!=r&&"Up"!=r||(s=l.frame.x+l.frame.width/2,c=d.frame.x+d.frame.width/2,(u=s-c)>-6&&u<6&&(d.frame.x=d.frame.x+u)))}(e,t,d,u);var f=Object(o.drawConnection)(e,t,r,i,d,s,c,u,l);return{firstObject:e,secondObject:t,style:f.style,condition:f.conditionID,isCondition:c,type:f.type,direction:d,line:f.line.objectID()}}},"./src/draw.js": +/*!*********************!*\ + !*** ./src/draw.js ***! + \*********************/ +/*! exports provided: drawConnection */function(e,t,r){"use strict";r.r(t),r.d(t,"drawConnection",function(){return s});r(/*! sketch */"sketch");var o=r(/*! ./utilities/styling.js */"./src/utilities/styling.js"),n=r(/*! ./utilities/conditions.js */"./src/utilities/conditions.js"),i=r(/*! ./utilities/groups.js */"./src/utilities/groups.js"),a=r(/*! sketch/settings */"sketch/settings");r(/*! sketch/ui */"sketch/ui");function s(e,t,r,s,c,u,l,d,f){var y=f.currentPage().currentArtboard()||f.currentPage(),h=function(e,t,r,o){var n,a,s=e.frame.changeBasis({from:e.parent,to:o}),c=t.frame.changeBasis({from:t.parent,to:o}),u=Object(i.checkForGroup)("Arrows",o);u?(n=u.frame().x(),a=u.frame().y()):(n=0,a=0);var l={firstLayerPosX:null,firstLayerPosY:null,secondLayerPosX:null,secondLayerPosY:null,middlePosX:null,middlePosY:null};"Up"==r&&(l.firstLayerPosX=s.x+s.width/2-n,l.firstLayerPosY=s.y-a,l.secondLayerPosX=c.x+c.width/2-n,l.secondLayerPosY=c.y+c.height-a,l.middlePosX=(l.firstLayerPosX+l.secondLayerPosX)/2,l.middlePosY=(l.firstLayerPosY+l.secondLayerPosY)/2);"Right"==r&&(l.firstLayerPosX=s.x+s.width-n,l.firstLayerPosY=s.y+s.height/2-a,l.secondLayerPosX=c.x-n,l.secondLayerPosY=c.y+c.height/2-a,l.middlePosX=(l.firstLayerPosX+l.secondLayerPosX)/2,l.middlePosY=(l.firstLayerPosY+l.secondLayerPosY)/2);"Down"==r&&(l.firstLayerPosX=s.x+s.width/2-n,l.firstLayerPosY=s.y+s.height-a,l.secondLayerPosX=c.x+c.width/2-n,l.secondLayerPosY=c.y-a,l.middlePosX=(l.firstLayerPosX+l.secondLayerPosX)/2,l.middlePosY=(l.firstLayerPosY+l.secondLayerPosY)/2);"Left"==r&&(l.firstLayerPosX=s.x-n,l.firstLayerPosY=s.y+s.height/2-a,l.secondLayerPosX=c.x+c.width-n,l.secondLayerPosY=c.y+c.height/2-a,l.middlePosX=(l.firstLayerPosX+l.secondLayerPosX)/2,l.middlePosY=(l.firstLayerPosY+l.secondLayerPosY)/2);return l}(d.getLayerWithID(e),d.getLayerWithID(t),c,y),m={line:[],conditionID:[],type:[],style:[]};return m.type=null==s?a.settingForKey("arrowType"):s,"Angled"!=m.type&&null!=m.type||(m.line=function(e,t,r,o,n,i,a){var s=NSBezierPath.bezierPath();"Up"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(e,o)),s.lineToPoint(NSMakePoint(n,o)),s.lineToPoint(NSMakePoint(n,i)));"Right"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(r,t)),s.lineToPoint(NSMakePoint(r,i)),s.lineToPoint(NSMakePoint(n,i)));"Down"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(e,o)),s.lineToPoint(NSMakePoint(n,o)),s.lineToPoint(NSMakePoint(n,i)));"Left"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(r,t)),s.lineToPoint(NSMakePoint(r,i)),s.lineToPoint(NSMakePoint(n,i)));var c=MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(s)),u=c.layers().firstObject().points();return u[1].cornerRadius=20,u[2].cornerRadius=20,c.setName("Angled Arrow"),c}(h.firstLayerPosX,h.firstLayerPosY,h.middlePosX,h.middlePosY,h.secondLayerPosX,h.secondLayerPosY,c)),"Straight"==m.type&&(m.line=function(e,t,r,o,n){var i=NSBezierPath.bezierPath();"Up"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));"Right"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));"Down"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));"Left"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));var a=MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(i));return a.setName("Straight Arrow"),a}(h.firstLayerPosX,h.firstLayerPosY,h.secondLayerPosX,h.secondLayerPosY,c)),"Curved"==m.type&&(m.line=function(e,t,r,o,n){var i,a=NSBezierPath.bezierPath();if("Up"==n){a.moveToPoint(NSMakePoint(e,t)),a.lineToPoint(NSMakePoint(r,o));var s=(i=MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(a))).layers().firstObject().points();s[0].curveMode=4,s[1].curveMode=4,s[0].hasCurveFrom=!0,s[1].hasCurveTo=!0,e Connection Arrows -> Get Free Library. Conditions are taken from the library based on their names. Make sure to name symbol as "#condition" so it will be added here')):(l=c.import().createNewInstance(),l=Object(i.addToConditionGroup)(l,t,r,f));return l}function c(e,t,r,o,n){var a=n.currentPage().currentArtboard()||n.currentPage(),s=o.getLayerWithID(e),c=Object(i.checkForGroup)("Conditions",a),u=Object(i.checkForGroup)("Arrows",a),l=null!=u?u.frame().x():0,d=null!=u?u.frame().y():0;return c?(s.frame.x=t-s.frame.width/2-(c.frame().x()-l),s.frame.y=r-s.frame.height/2-(c.frame().y()-d),c.fixGeometryWithOptions(1)):(s.frame.x=t-s.frame.width/2,s.frame.y=r-s.frame.height/2),s.id}function u(e,t){var r,o=t.getLayerWithID(e);o&&(r=o.parent,o.remove(),0==r.layers.length&&r.remove())}},"./src/utilities/data.js": +/*!*******************************!*\ + !*** ./src/utilities/data.js ***! + \*******************************/ +/*! exports provided: getConnectionsData, deleteConnectionFromData */function(e,r,o){"use strict";o.r(r),o.d(r,"getConnectionsData",function(){return i}),o.d(r,"deleteConnectionFromData",function(){return a});o(/*! sketch */"sketch"),o(/*! sketch/ui */"sketch/ui"),o(/*! sketch/settings */"sketch/settings");var n="flowArrows";function i(e){var r=t.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections",e,n),o=[];if(r)for(var i=0;i=0;r--)t.splice(e[r],1);return t}},"./src/utilities/groups.js": +/*!*********************************!*\ + !*** ./src/utilities/groups.js ***! + \*********************************/ +/*! exports provided: checkForGroup, addToArrowsGroup, addToConditionGroup */function(e,t,r){"use strict";r.r(t),r.d(t,"checkForGroup",function(){return o}),r.d(t,"addToArrowsGroup",function(){return n}),r.d(t,"addToConditionGroup",function(){return i});r(/*! sketch */"sketch"),r(/*! sketch/settings */"sketch/settings"),r(/*! sketch/ui */"sketch/ui");function o(e,t){for(var r=null,o=0;o sketch.fromNative(layer))\n let firstObjectID = String(movedLayers[0].id);\n let connectionIndex = []\n\n connectionIndex = getIndex(connectionsData, firstObjectID);\n\n if(connectionIndex.length > 0){\n for (let x = 0; x < connectionIndex.length; x++) {\n deleteLine(connectionsData[connectionIndex[x]].line, document);\n let connection = createArrow(\n connectionsData[connectionIndex[x]].firstObject, \n connectionsData[connectionIndex[x]].secondObject, \n connectionsData[connectionIndex[x]].style,\n connectionsData[connectionIndex[x]].type, \n connectionsData[connectionIndex[x]].direction, \n connectionsData[connectionIndex[x]].condition, \n connectionsData[connectionIndex[x]].isCondition,\n document, \n docData\n );\n connectionsData.push(connection);\n }\n connectionsData = deleteConnectionFromData(connectionIndex, connectionsData);\n }\n\n context.command.setValue_forKey_onLayer_forPluginIdentifier(connectionsData, \"arrowConnections\", docData, pluginKey);\n }\n}\n\nfunction getIndex(connectionsData, firstObjectID){\n let connectionIndex = [];\n if(connectionsData.length > 0){\n for (let y = 0; y < connectionsData.length; y++) {\n if (firstObjectID == connectionsData[y].firstObject || firstObjectID == connectionsData[y].secondObject) {\n connectionIndex.push(y);\n }\n }\n } \n\n return connectionIndex;\n}","import sketch from 'sketch';\nimport { drawConnection } from \"./draw.js\";\n\nvar Settings = require('sketch/settings');\n\n\n// Main Function\n\nexport function createArrow(firstObjectID, secondObjectID, style, type, direction, conditionID, isCondition, document, docData) { // Refactored\n let localDirection = direction == \"Auto\" ? getDirection(firstObjectID, secondObjectID, document) : direction;\n\n // Main Operations based on the settings\n updateSpacing(firstObjectID, secondObjectID, localDirection, document);\n autoAlignLayer(firstObjectID, secondObjectID, localDirection, document);\n\n // Making an Arrow \n let arrow = drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, isCondition, document, docData);\n \n // Storage for current connection\n let connection = {\n firstObject : firstObjectID,\n secondObject : secondObjectID,\n style : arrow.style,\n condition : arrow.conditionID,\n isCondition : isCondition,\n type : arrow.type,\n direction: localDirection,\n line : arrow.line.objectID()\n }\n return connection;\n}\n\nfunction getDirection(firstObjectID, secondObjectID, document){ // Refactored\n // Get direction from the source object\n const firstObject = document.getLayerWithID(firstObjectID);\n const secondObject = document.getLayerWithID(secondObjectID);\n const firstObjectMidX = firstObject.frame.x+firstObject.frame.width/2;\n const firstObjectMidY = firstObject.frame.y+firstObject.frame.height/2;\n const secondObjectMidX = secondObject.frame.x+secondObject.frame.width/2;\n const secondObjectMidY = secondObject.frame.y+secondObject.frame.height/2;\n\n const diffX = firstObjectMidX - secondObjectMidX;\n const diffY = firstObjectMidY - secondObjectMidY;\n const absDiffX = Math.abs(diffX);\n const absDiffY = Math.abs(diffY);\n let direction;\n\n if(secondObjectMidX > firstObjectMidX){\n // Right Half\n if(secondObjectMidY > firstObjectMidY){\n // Bottom quarter\n direction = diffX > diffY ? \"Down\" : \"Right\";\n } else {\n // Top quarter\n direction = absDiffX > absDiffY ? \"Right\" : \"Up\";\n }\n } else {\n // Left Half\n if(secondObjectMidY > firstObjectMidY){\n // Bottom quarter\n direction = absDiffX > absDiffY ? \"Left\" : \"Down\";\n } else {\n // Top quarter\n direction = diffX > diffY ? \"Left\" : \"Up\";\n }\n }\n\n return direction;\n}\n\nfunction updateSpacing(sourceObjectID, childObjectID, direction, document){\n let sourceObject = document.getLayerWithID(sourceObjectID);\n let childObject = document.getLayerWithID(childObjectID);\n\n if(Settings.settingForKey(\"arrowSpacing\") && Settings.settingForKey(\"arrowSpacing\") != 0){\n let currentSpacing = Settings.settingForKey(\"arrowSpacing\");\n \n if(direction == \"Right\"){\n childObject.frame.x = sourceObject.frame.x + sourceObject.frame.width + currentSpacing;\n }\n \n if(direction == \"Down\"){\n childObject.frame.y = sourceObject.frame.y + sourceObject.frame.height + currentSpacing;\n }\n \n if(direction == \"Left\"){\n childObject.frame.x = sourceObject.frame.x - childObject.frame.width - currentSpacing;\n }\n \n if(direction == \"Up\"){\n childObject.frame.y = sourceObject.frame.y - childObject.frame.height - currentSpacing;\n }\n }\n}\n\nfunction autoAlignLayer(sourceObjectID, childObjectID, direction, document){\n let sourceObject = document.getLayerWithID(sourceObjectID);\n let childObject = document.getLayerWithID(childObjectID);\n let sourceMidY, childMidY, sourceMidX, childMidX, diff;\n\n if(Settings.settingForKey(\"autoAlign\")){\n if(Settings.settingForKey(\"autoAlign\") == true){\n // If user turned on Auto-Align settings\n \n if(direction == \"Right\" || direction == \"Left\"){\n sourceMidY = sourceObject.frame.y + sourceObject.frame.height/2;\n childMidY = childObject.frame.y + childObject.frame.height/2;\n diff = sourceMidY - childMidY;\n if(diff > -6 && diff < 6){childObject.frame.y = childObject.frame.y + diff;}\n }\n \n if(direction == \"Down\" || direction == \"Up\"){\n sourceMidX = sourceObject.frame.x + sourceObject.frame.width/2;\n childMidX = childObject.frame.x + childObject.frame.width/2;\n diff = sourceMidX - childMidX;\n if(diff > -6 && diff < 6){childObject.frame.x = childObject.frame.x + diff;}\n }\n }\n }\n}","import sketch from 'sketch';\nimport { styleLine } from \"./utilities/styling.js\";\nimport { addCondition, updateCondition } from \"./utilities/conditions.js\";\nimport { checkForGroup, addToArrowsGroup } from \"./utilities/groups.js\";\nlet Settings = require('sketch/settings');\nlet UI = require('sketch/ui') ;\n\n// let document = sketch.fromNative(context.document);\n// let docData = context.document.documentData();\n// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n\n\n// Main Function\n\nexport function drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, isCondition, document, docData){ // Refactored\n // Process of creating new connection \n let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n let firstObject = document.getLayerWithID(firstObjectID);\n let secondObject = document.getLayerWithID(secondObjectID);\n let connectionPos = getConnectionPos(firstObject, secondObject, localDirection, currentParentGroup);\n let connection = {\n line: [], \n conditionID: [],\n type: [],\n style: []\n }\n\n // Type \n connection.type = type == null ? Settings.settingForKey(\"arrowType\") : type;\n if(connection.type == \"Angled\" || connection.type == null){ connection.line = drawAngledLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.middlePosX, connectionPos.middlePosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n if(connection.type == \"Straight\"){ connection.line = drawStraightLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n if(connection.type == \"Curved\"){ connection.line = drawCurvedLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n\n\n // Condition\n if(isCondition == true){\n if(document.getLayerWithID(conditionID)){\n connection.conditionID = updateCondition(conditionID, connectionPos.middlePosX, connectionPos.middlePosY, document, docData);\n } else {\n connection.conditionID = addCondition(\"#con\", connectionPos.middlePosX, connectionPos.middlePosY, document, docData);\n }\n } else {\n connection.conditionID = null;\n }\n \n // Style\n connection.style = styleLine(connection.line, style, docData);\n\n // Add to group\n addToArrowsGroup(connection.line, currentParentGroup);\n \n return connection\n}\n\n// Positions\n\nfunction getConnectionPos(firstObject, secondObject, direction, currentParentGroup){ // Refactored\n\n let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup});\n let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup});\n let currentGroup = checkForGroup(\"Arrows\", currentParentGroup);\n let diffX, diffY;\n \n if(currentGroup){\n diffX = currentGroup.frame().x();\n diffY = currentGroup.frame().y();\n } else {\n diffX = 0;\n diffY = 0;\n }\n \n let connectionPos = {\n firstLayerPosX: null,\n firstLayerPosY: null, \n secondLayerPosX: null, \n secondLayerPosY: null, \n middlePosX: null, \n middlePosY: null\n }\n \n // Getting all the positions\n if(direction == \"Up\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Right\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Down\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Left\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n\n return connectionPos\n}\n\n// Drawing Types\n\nfunction drawAngledLine(firstLayerPosX, firstLayerPosY, middlePosX, middlePosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n \n if(direction == \"Up\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Right\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Down\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Left\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n let points = line.layers().firstObject().points();\n points[1].cornerRadius = 20;\n points[2].cornerRadius = 20;\n line.setName(\"Angled Arrow\");\n \n return line;\n}\n\nfunction drawStraightLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n \n if(direction == \"Up\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Right\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Down\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Left\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n line.setName(\"Straight Arrow\");\n \n return line;\n}\n\nfunction drawCurvedLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n let line;\n \n if(direction == \"Up\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n \n // Painting the line\n line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n let points = line.layers().firstObject().points();\n \n points[0].curveMode = 4;\n points[1].curveMode = 4;\n points[0].hasCurveFrom = true;\n points[1].hasCurveTo = true;\n \n if(firstLayerPosX Connection Arrows -> Get Free Library. Conditions are taken from the library based on their names. Make sure to name symbol as \"#condition\" so it will be added here'\n );\n } else {\n let symbolMaster = libraryObject.import();\n symbol = symbolMaster.createNewInstance();\n symbol = addToConditionGroup(symbol, x, y, currentParentGroup);\n }\n return symbol;\n}\n\nexport function updateCondition(conditionID, x, y, document, docData) {\n let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n let condition = document.getLayerWithID(conditionID);\n let conGroup = checkForGroup(\"Conditions\", currentParentGroup);\n let arGroup = checkForGroup(\"Arrows\", currentParentGroup);\n let arGroupX = arGroup != null ? arGroup.frame().x() : 0;\n let arGroupY = arGroup != null ? arGroup.frame().y() : 0;\n\n if (conGroup) {\n condition.frame.x =\n x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX);\n condition.frame.y =\n y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY);\n conGroup.fixGeometryWithOptions(1);\n } else {\n condition.frame.x = x - condition.frame.width / 2;\n condition.frame.y = y - condition.frame.height / 2;\n }\n return condition.id;\n}\n\nexport function deleteCondition(conditionID, document) {\n let conditionObject = document.getLayerWithID(conditionID);\n let selectedGroup;\n if(conditionObject){\n selectedGroup = conditionObject.parent;\n conditionObject.remove();\n if(selectedGroup.layers.length == 0){\n selectedGroup.remove();\n }\n }\n }\n \n","import sketch from 'sketch';\n\nlet UI = require('sketch/ui') ;\nvar Settings = require('sketch/settings');\n\nconst pluginKey = \"flowArrows\";\n\n\nexport function getConnectionsData(docData) {\n let pluginData = context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowConnections\", docData, pluginKey);\n let dataArray = [];\n\n if (pluginData) {\n for (let i = 0; i < pluginData.length; i++) {\n dataArray.push(pluginData[i]);\n }\n }\n return dataArray;\n}\n\nexport function deleteConnectionFromData(connectionIndexArray, data){\n if(data){\n for (let i = connectionIndexArray.length -1; i >= 0; i--) {\n data.splice(connectionIndexArray[i],1);\n }\n }\n return data;\n}\n","import sketch from 'sketch';\nlet Settings = require('sketch/settings');\nlet UI = require('sketch/ui') ;\n\n// let document = sketch.fromNative(context.document);\n// let docData = context.document.documentData();\n// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n\n\nexport function checkForGroup(groupName, currentParentGroup) { // refactored\n let currentGroup = null;\n \n // Checking all the groups that we have\n for(let i = 0; i < currentParentGroup.layers().count(); i++){\n if(currentParentGroup.layers()[i].name() == groupName) {\n currentGroup = currentParentGroup.layers()[i];\n } \n }\n\n return currentGroup;\n}\n\nexport function addToArrowsGroup(line, currentParentGroup){\n let currentGroup = checkForGroup(\"Arrows\", currentParentGroup);\n if(currentGroup){\n currentGroup.addLayers([line]);\n currentGroup.fixGeometryWithOptions(1);\n } else {\n let Group = require('sketch/dom').Group;\n let group = new Group({\n parent: currentParentGroup,\n name: 'Arrows',\n locked: true,\n layers: [line]\n });\n group.moveToBack();\n group.adjustToFit();\n }\n}\n\nexport function addToConditionGroup(condition, x, y, currentParentGroup) {\n let conGroup = checkForGroup(\"Conditions\", currentParentGroup);\n let arGroup = checkForGroup(\"Arrows\", currentParentGroup);\n \n let arGroupX = arGroup != null ? arGroup.frame().x() : 0;\n let arGroupY = arGroup != null ? arGroup.frame().y() : 0;\n\n if (conGroup) {\n condition.frame.x =\n x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX);\n condition.frame.y =\n y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY);\n condition.parent = conGroup;\n conGroup.fixGeometryWithOptions(1);\n } else {\n condition.frame.x = x - condition.frame.width / 2 + arGroupX;\n condition.frame.y = y - condition.frame.height / 2 + arGroupY;\n let Group = require(\"sketch/dom\").Group;\n let group = new Group({\n parent: currentParentGroup,\n name: \"Conditions\",\n layers: [condition]\n });\n group.moveToBack();\n group.adjustToFit();\n }\n return condition.id;\n }","import sketch from 'sketch';\nlet UI = require('sketch/ui');\n\nexport function deleteLine(lineID, document){\n let lineObject = document.getLayerWithID(lineID);\n let selectedGroup;\n if(lineObject){\n selectedGroup = lineObject.parent;\n lineObject.remove();\n if(selectedGroup.layers.length == 0){\n selectedGroup.remove();\n }\n }\n}\n","import sketch from 'sketch';\nconst pluginKey = \"flowArrows\";\n// let document = sketch.fromNative(context.document);\n// let docData = context.document.documentData();\n\nexport function styleLine(line, style, docData){ // Refactored\n let localStyle;\n \n if(style != null){ \n // For updates\n if(getLayerStyles(style, docData) != null && style != \"Default Style\"){\n // If style is specified\n localStyle = style;\n let ownStyle = getLayerStyles(style, docData);\n line.sharedStyle = ownStyle[0];\n } else {\n // if there is no specific style\n localStyle = \"Default Style\";\n let border = line.style().addStylePartOfType(1);\n border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1});\n border.thickness = 2;\n line.style().endMarkerType = 2;\n }\n } else {\n // For creating new\n if(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey) != null && context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey) != \"Default Style\"){\n // we have settins almost all the time and it's not default\n localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey), docData);\n line.sharedStyle = localStyle[0];\n localStyle = localStyle[0].name();\n } else {\n localStyle = \"Default Style\";\n let border = line.style().addStylePartOfType(1);\n border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1});\n border.thickness = 2;\n line.style().endMarkerType = 2;\n } \n }\n \n return localStyle;\n}\n\nexport function getLayerStyles(name, docData) { // Refactored\n let allStyles = docData.allLayerStyles();\n let keyword = \"$arrow\";\n let styles = [];\n \n for(let i = 0; i < allStyles.count(); i++){\n if(name == null) {\n if(allStyles[i].name().includes(keyword)){styles.push(allStyles[i]);}\n } else {\n if(allStyles[i].name() == name){styles.push(allStyles[i]);}\n }\n }\n return styles;\n}","module.exports = require(\"sketch\");","module.exports = require(\"sketch/dom\");","module.exports = require(\"sketch/settings\");","module.exports = require(\"sketch/ui\");"],"sourceRoot":""} \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/draw.js b/arrows.sketchplugin/Contents/Sketch/draw.js new file mode 100644 index 0000000..ff20cbd --- /dev/null +++ b/arrows.sketchplugin/Contents/Sketch/draw.js @@ -0,0 +1,727 @@ +var that = this; +function __skpm_run (key, context) { + that.context = context; + +var exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./src/draw.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./src/draw.js": +/*!*********************!*\ + !*** ./src/draw.js ***! + \*********************/ +/*! exports provided: drawConnection */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawConnection", function() { return drawConnection; }); +// Main Function +function drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, condition) { + // Refactored + // Process of creating new connection + var firstObject = document.getLayerWithID(firstObjectID); + var secondObject = document.getLayerWithID(secondObjectID); + var connectionPos = getConnectionPos(firstObject, secondObject, localDirection); + var connection = { + line: [], + conditionID: [], + type: [], + style: [] // Type + + }; + connection.type = type == null ? Settings.settingForKey("arrowType") : type; + + if (connection.type == "Angled" || connection.type == null) { + connection.line = drawAngledLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.middlePosX, connectionPos.middlePosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection); + } + + if (connection.type == "Straight") { + connection.line = drawStraightLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection); + } + + if (connection.type == "Curved") { + connection.line = drawCurvedLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection); + } // Condition + + + if (condition == true) { + if (conditionID != null) { + connection.conditionID = updateCondition(conditionID, connectionPos.middlePosX, connectionPos.middlePosY); + } else { + connection.conditionID = addCondition("#con", connectionPos.middlePosX, connectionPos.middlePosY); + } + } else { + connection.conditionID = null; + } // connection.conditionID = condition != false ? connection.conditionID = addCondition("#con", connectionPos.middlePosX, connectionPos.middlePosY) : connection.conditionID = null + // Style + + + connection.style = styleLine(connection.line, style); // Add to group + + addToArrowsGroup(connection.line); + return connection; +} // Positions + +function getConnectionPos(firstObject, secondObject, direction) { + // Refactored + var firstObjectAbsPos = firstObject.frame.changeBasis({ + from: firstObject.parent, + to: currentParentGroup + }); + var secondObjectAbsPos = secondObject.frame.changeBasis({ + from: secondObject.parent, + to: currentParentGroup + }); + var currentGroup = checkForGroup("Arrows"); + var diffX, diffY; + + if (currentGroup) { + diffX = currentGroup.frame().x(); + diffY = currentGroup.frame().y(); + } else { + diffX = 0; + diffY = 0; + } + + var connectionPos = { + firstLayerPosX: null, + firstLayerPosY: null, + secondLayerPosX: null, + secondLayerPosY: null, + middlePosX: null, + middlePosY: null // Getting all the positions + + }; + + if (direction == "Up") { + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y - diffY; // Second Layer Position End Point Position + + connectionPos.secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height - diffY; // Middle Points + + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX) / 2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY) / 2; + } + + if (direction == "Right") { + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width - diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position + + connectionPos.secondLayerPosX = secondObjectAbsPos.x - diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points + + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX) / 2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY) / 2; + } + + if (direction == "Down") { + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height - diffY; // Second Layer Position End Point Position + + connectionPos.secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y - diffY; // Middle Points + + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX) / 2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY) / 2; + } + + if (direction == "Left") { + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x - diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position + + connectionPos.secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width - diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points + + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX) / 2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY) / 2; + } + + return connectionPos; +} // Drawing Types + + +function drawAngledLine(firstLayerPosX, firstLayerPosY, middlePosX, middlePosY, secondLayerPosX, secondLayerPosY, direction) { + // Refactored + var path = NSBezierPath.bezierPath(); + + if (direction == "Up") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if (direction == "Right") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if (direction == "Down") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if (direction == "Left") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + var line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + var points = line.layers().firstObject().points(); + points[1].cornerRadius = 20; + points[2].cornerRadius = 20; + line.setName("Angled Arrow"); + return line; +} + +function drawStraightLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction) { + // Refactored + var path = NSBezierPath.bezierPath(); + + if (direction == "Up") { + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if (direction == "Right") { + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if (direction == "Down") { + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if (direction == "Left") { + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + var line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + line.setName("Straight Arrow"); + return line; +} + +function drawCurvedLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction) { + // Refactored + var path = NSBezierPath.bezierPath(); + var line; + + if (direction == "Up") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line + + line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + var points = line.layers().firstObject().points(); + points[0].curveMode = 4; + points[1].curveMode = 4; + points[0].hasCurveFrom = true; + points[1].hasCurveTo = true; + + if (firstLayerPosX < secondLayerPosX) { + points[0].curveFrom = { + x: 0, + y: 0.5 + }; + points[0].curveTo = { + x: -0.5, + y: 1 + }; + points[1].curveFrom = { + x: 1, + y: 1 + }; + points[1].curveTo = { + x: 1, + y: 0.5 + }; + } else { + points[0].curveFrom = { + x: 1, + y: 0.5 + }; + points[0].curveTo = { + x: -0.5, + y: 1 + }; + points[1].curveFrom = { + x: 1, + y: 1 + }; + points[1].curveTo = { + x: 0, + y: 0.5 + }; + } + } + + if (direction == "Right") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line + + line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + + var _points = line.layers().firstObject().points(); + + _points[0].curveMode = 4; + _points[1].curveMode = 4; + _points[0].hasCurveFrom = true; + _points[1].hasCurveTo = true; + + if (firstLayerPosY < secondLayerPosY) { + _points[0].curveFrom = { + x: 0.5, + y: 0 + }; + _points[0].curveTo = { + x: -0.5, + y: 1 + }; + _points[1].curveFrom = { + x: 1, + y: 1 + }; + _points[1].curveTo = { + x: 0.5, + y: 1 + }; + } else { + _points[0].curveFrom = { + x: 0.5, + y: 1 + }; + _points[0].curveTo = { + x: -0.5, + y: 1 + }; + _points[1].curveFrom = { + x: 1, + y: 1 + }; + _points[1].curveTo = { + x: 0.5, + y: 0 + }; + } + } + + if (direction == "Down") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line + + line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + + var _points2 = line.layers().firstObject().points(); + + _points2[0].curveMode = 4; + _points2[1].curveMode = 4; + _points2[0].hasCurveFrom = true; + _points2[1].hasCurveTo = true; + + if (firstLayerPosX < secondLayerPosX) { + _points2[0].curveFrom = { + x: 0, + y: 0.5 + }; + _points2[0].curveTo = { + x: -0.5, + y: 1 + }; + _points2[1].curveFrom = { + x: 1, + y: 1 + }; + _points2[1].curveTo = { + x: 1, + y: 0.5 + }; + } else { + _points2[0].curveFrom = { + x: 1, + y: 0.5 + }; + _points2[0].curveTo = { + x: -0.5, + y: 1 + }; + _points2[1].curveFrom = { + x: 1, + y: 1 + }; + _points2[1].curveTo = { + x: 0, + y: 0.5 + }; + } + } + + if (direction == "Left") { + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line + + line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + + var _points3 = line.layers().firstObject().points(); + + _points3[0].curveMode = 4; + _points3[1].curveMode = 4; + _points3[0].hasCurveFrom = true; + _points3[1].hasCurveTo = true; + + if (firstLayerPosY < secondLayerPosY) { + _points3[0].curveFrom = { + x: 0.5, + y: 0 + }; + _points3[0].curveTo = { + x: -0.5, + y: 1 + }; + _points3[1].curveFrom = { + x: 1, + y: 1 + }; + _points3[1].curveTo = { + x: 0.5, + y: 1 + }; + } else { + _points3[0].curveFrom = { + x: 0.5, + y: 1 + }; + _points3[0].curveTo = { + x: -0.5, + y: 1 + }; + _points3[1].curveFrom = { + x: 1, + y: 1 + }; + _points3[1].curveTo = { + x: 0.5, + y: 0 + }; + } + } // Providing Settings for the arrow + + + line.setName("Curved Arrow"); + return line; +} // Conditions + + +function addCondition(keyword, x, y) { + // Refactored + var libraries = sketch.getLibraries(); + var libraryObject, symbolReferences, symbol; + + for (var g = 0; g < libraries.length; g++) { + symbolReferences = libraries[g].getImportableSymbolReferencesForDocument(document); + + for (var i = 0; i < symbolReferences.length; i++) { + if (symbolReferences[i].name.includes(keyword)) { + libraryObject = symbolReferences[i]; + } + } + } + + if (libraryObject == null) { + symbol = null; + UI.alert('Condition symbol is not found', 'If you would like to add arrows with specific conditions, you need to specify them in your libraries. You can download the library that works well with the plugin by going into Plugins -> Connection Arrows -> Get Free Library. Conditions are taken from the library based on their names. Make sure to name symbol as "#condition" so it will be added here'); + } else { + var symbolMaster = libraryObject.import(); + symbol = symbolMaster.createNewInstance(); + symbol = addToConditionGroup(symbol, x, y); + } + + return symbol; +} + +function addToConditionGroup(condition, x, y) { + // Refactored + var conGroup = checkForGroup("Conditions"); + var arGroup = checkForGroup("Arrows"); + var arGroupX = arGroup != null ? arGroup.frame().x() : 0; + var arGroupY = arGroup != null ? arGroup.frame().y() : 0; + + if (conGroup) { + condition.frame.x = x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX); + condition.frame.y = y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY); + condition.parent = conGroup; + conGroup.fixGeometryWithOptions(1); + } else { + condition.frame.x = x - condition.frame.width / 2; + condition.frame.y = y - condition.frame.height / 2; + + var Group = __webpack_require__(/*! sketch/dom */ "sketch/dom").Group; + + var group = new Group({ + parent: currentParentGroup, + name: 'Conditions', + layers: [condition] + }); + group.moveToBack(); + group.adjustToFit(); + } + + return condition.id; +} + +function updateCondition(conditionID, x, y) { + // Refactored + var condition = document.getLayerWithID(conditionID); // log (condition) + + var conGroup = checkForGroup("Conditions"); + var arGroup = checkForGroup("Arrows"); + var arGroupX = arGroup != null ? arGroup.frame().x() : 0; + var arGroupY = arGroup != null ? arGroup.frame().y() : 0; + + if (conGroup) { + condition.frame.x = x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX); + condition.frame.y = y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY); + conGroup.fixGeometryWithOptions(1); + } else { + condition.frame.x = x - condition.frame.width / 2; + condition.frame.y = y - condition.frame.height / 2; + } + + return condition.id; +} // Style + + +function styleLine(line, style) { + // Refactored + var localStyle; + + if (style != null) { + // For updates + if (getLayerStyles(style) != null && style != "Default Style") { + // If style is specified + localStyle = style; + var ownStyle = getLayerStyles(style); + line.sharedStyle = ownStyle[0]; + } else { + // if there is no specific style + localStyle = "Default Style"; + var border = line.style().addStylePartOfType(1); + border.color = MSColor.colorWithRGBADictionary({ + r: 0.89, + g: 0.89, + b: 0.89, + a: 1 + }); + border.thickness = 2; + line.style().endMarkerType = 2; + } + } else { + // For creating new + if (context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey) != null && context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey) != "Default Style") { + // we have settins almost all the time and it's not default + localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)); + line.sharedStyle = localStyle[0]; + localStyle = localStyle[0].name(); + } else { + localStyle = "Default Style"; + + var _border = line.style().addStylePartOfType(1); + + _border.color = MSColor.colorWithRGBADictionary({ + r: 0.89, + g: 0.89, + b: 0.89, + a: 1 + }); + _border.thickness = 2; + line.style().endMarkerType = 2; + } + } + + return localStyle; +} + +function getLayerStyles(name) { + // Refactored + var allStyles = docData.allLayerStyles(); + var keyword = "$arrow"; + var styles = []; + + for (var i = 0; i < allStyles.count(); i++) { + if (name == null) { + if (allStyles[i].name().includes(keyword)) { + styles.push(allStyles[i]); + } + } else { + if (allStyles[i].name() == name) { + styles.push(allStyles[i]); + } + } + } + + return styles; +} // Groups + + +function addToArrowsGroup(line) { + var currentGroup = checkForGroup("Arrows"); + + if (currentGroup) { + currentGroup.addLayers([line]); + currentGroup.fixGeometryWithOptions(1); + } else { + var Group = __webpack_require__(/*! sketch/dom */ "sketch/dom").Group; + + var group = new Group({ + parent: currentParentGroup, + name: 'Arrows', + locked: true, + layers: [line] + }); + group.moveToBack(); + group.adjustToFit(); + } +} + +function checkForGroup(groupName) { + // refactored + var currentGroup = null; // Checking all the groups that we have + + for (var i = 0; i < currentParentGroup.layers().count(); i++) { + if (currentParentGroup.layers()[i].name() == groupName) { + currentGroup = currentParentGroup.layers()[i]; + } + } + + return currentGroup; +} + +/***/ }), + +/***/ "sketch/dom": +/*!*****************************!*\ + !*** external "sketch/dom" ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("sketch/dom"); + +/***/ }) + +/******/ }); + if (key === 'default' && typeof exports === 'function') { + exports(context); + } else { + exports[key](context); + } +} +that['deleteAllArrows'] = __skpm_run.bind(this, 'deleteAllArrows'); +that['onRun'] = __skpm_run.bind(this, 'default') + +//# sourceMappingURL=draw.js.map \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/draw.js.map b/arrows.sketchplugin/Contents/Sketch/draw.js.map new file mode 100644 index 0000000..31faa87 --- /dev/null +++ b/arrows.sketchplugin/Contents/Sketch/draw.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://exports/webpack/bootstrap","webpack://exports/./src/draw.js","webpack://exports/external \"sketch/dom\""],"names":["drawConnection","firstObjectID","secondObjectID","style","type","localDirection","conditionID","condition","firstObject","document","getLayerWithID","secondObject","connectionPos","getConnectionPos","connection","line","Settings","settingForKey","drawAngledLine","firstLayerPosX","firstLayerPosY","middlePosX","middlePosY","secondLayerPosX","secondLayerPosY","drawStraightLine","drawCurvedLine","updateCondition","addCondition","styleLine","addToArrowsGroup","direction","firstObjectAbsPos","frame","changeBasis","from","parent","to","currentParentGroup","secondObjectAbsPos","currentGroup","checkForGroup","diffX","diffY","x","y","width","height","path","NSBezierPath","bezierPath","moveToPoint","NSMakePoint","lineToPoint","MSShapeGroup","layerWithPath","MSPath","pathWithBezierPath","points","layers","cornerRadius","setName","curveMode","hasCurveFrom","hasCurveTo","curveFrom","curveTo","keyword","libraries","sketch","getLibraries","libraryObject","symbolReferences","symbol","g","length","getImportableSymbolReferencesForDocument","i","name","includes","UI","alert","symbolMaster","import","createNewInstance","addToConditionGroup","conGroup","arGroup","arGroupX","arGroupY","fixGeometryWithOptions","Group","require","group","moveToBack","adjustToFit","id","localStyle","getLayerStyles","ownStyle","sharedStyle","border","addStylePartOfType","color","MSColor","colorWithRGBADictionary","r","b","a","thickness","endMarkerType","context","command","valueForKey_onLayer_forPluginIdentifier","docData","pluginKey","allStyles","allLayerStyles","styles","count","push","addLayers","locked","groupName"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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YAAM,EAAEE,kBADY;AAEpBwC,UAAI,EAAE,QAFc;AAGpB4C,YAAM,EAAE,IAHY;AAIpB/D,YAAM,EAAE,CAAC5C,IAAD;AAJY,KAAV,CAAZ;AAMA8E,SAAK,CAACC,UAAN;AACAD,SAAK,CAACE,WAAN;AACD;AACJ;;AAED,SAAStD,aAAT,CAAuBkF,SAAvB,EAAkC;AAAE;AAChC,MAAInF,YAAY,GAAG,IAAnB,CAD8B,CAG9B;;AACA,OAAI,IAAIqC,CAAC,GAAG,CAAZ,EAAeA,CAAC,GAAGvC,kBAAkB,CAACqB,MAAnB,GAA4B4D,KAA5B,EAAnB,EAAwD1C,CAAC,EAAzD,EAA4D;AAC1D,QAAGvC,kBAAkB,CAACqB,MAAnB,GAA4BkB,CAA5B,EAA+BC,IAA/B,MAAyC6C,SAA5C,EAAuD;AACrDnF,kBAAY,GAAGF,kBAAkB,CAACqB,MAAnB,GAA4BkB,CAA5B,CAAf;AACD;AACF;;AAED,SAAOrC,YAAP;AACH,C;;;;;;;;;;;ACreD,uC","file":"draw.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/draw.js\");\n","// Main Function\n\nexport function drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, condition){ // Refactored\n // Process of creating new connection \n let firstObject = document.getLayerWithID(firstObjectID);\n let secondObject = document.getLayerWithID(secondObjectID);\n let connectionPos = getConnectionPos(firstObject, secondObject, localDirection);\n let connection = {\n line: [], \n conditionID: [],\n type: [],\n style: []\n }\n\n // Type \n connection.type = type == null ? Settings.settingForKey(\"arrowType\") : type;\n if(connection.type == \"Angled\" || connection.type == null){ connection.line = drawAngledLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.middlePosX, connectionPos.middlePosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n if(connection.type == \"Straight\"){ connection.line = drawStraightLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n if(connection.type == \"Curved\"){ connection.line = drawCurvedLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n\n // Condition\n if(condition == true){\n if(conditionID != null){\n connection.conditionID = updateCondition(conditionID, connectionPos.middlePosX, connectionPos.middlePosY);\n } else {\n connection.conditionID = addCondition(\"#con\", connectionPos.middlePosX, connectionPos.middlePosY);\n }\n } else {\n connection.conditionID = null;\n }\n // connection.conditionID = condition != false ? connection.conditionID = addCondition(\"#con\", connectionPos.middlePosX, connectionPos.middlePosY) : connection.conditionID = null\n\n // Style\n connection.style = styleLine(connection.line, style);\n\n // Add to group\n addToArrowsGroup(connection.line);\n \n return connection\n}\n\n// Positions\n\nfunction getConnectionPos(firstObject, secondObject, direction){ // Refactored\n\n let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup});\n let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup});\n let currentGroup = checkForGroup(\"Arrows\");\n let diffX, diffY;\n \n if(currentGroup){\n diffX = currentGroup.frame().x();\n diffY = currentGroup.frame().y();\n } else {\n diffX = 0;\n diffY = 0;\n }\n \n let connectionPos = {\n firstLayerPosX: null,\n firstLayerPosY: null, \n secondLayerPosX: null, \n secondLayerPosY: null, \n middlePosX: null, \n middlePosY: null\n }\n \n // Getting all the positions\n if(direction == \"Up\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Right\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Down\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Left\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n return connectionPos\n}\n\n// Drawing Types\n\nfunction drawAngledLine(firstLayerPosX, firstLayerPosY, middlePosX, middlePosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n \n if(direction == \"Up\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Right\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Down\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Left\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n let points = line.layers().firstObject().points();\n points[1].cornerRadius = 20;\n points[2].cornerRadius = 20;\n line.setName(\"Angled Arrow\");\n \n return line;\n}\n\nfunction drawStraightLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n \n if(direction == \"Up\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Right\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Down\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Left\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n line.setName(\"Straight Arrow\");\n \n return line;\n}\n\nfunction drawCurvedLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n let line;\n \n if(direction == \"Up\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n \n // Painting the line\n line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n let points = line.layers().firstObject().points();\n \n points[0].curveMode = 4;\n points[1].curveMode = 4;\n points[0].hasCurveFrom = true;\n points[1].hasCurveTo = true;\n \n if(firstLayerPosX Connection Arrows -> Get Free Library. Conditions are taken from the library based on their names. Make sure to name symbol as \"#condition\" so it will be added here');\n } else {\n let symbolMaster = libraryObject.import();\n symbol = symbolMaster.createNewInstance();\n symbol = addToConditionGroup(symbol, x, y);\n }\n \n return symbol;\n}\n\nfunction addToConditionGroup(condition, x, y){ // Refactored\n let conGroup = checkForGroup(\"Conditions\");\n let arGroup = checkForGroup(\"Arrows\");\n let arGroupX = arGroup != null ? arGroup.frame().x() : 0;\n let arGroupY = arGroup != null ? arGroup.frame().y() : 0;\n \n if(conGroup){\n condition.frame.x = x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX);\n condition.frame.y = y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY);\n condition.parent = conGroup;\n conGroup.fixGeometryWithOptions(1);\n } else {\n condition.frame.x = x - condition.frame.width / 2;\n condition.frame.y = y - condition.frame.height / 2;\n let Group = require('sketch/dom').Group;\n let group = new Group({\n parent: currentParentGroup,\n name: 'Conditions',\n layers: [condition]\n });\n group.moveToBack();\n group.adjustToFit();\n }\n return condition.id;\n}\n\nfunction updateCondition(conditionID, x, y){ // Refactored\nlet condition = document.getLayerWithID(conditionID);\n// log (condition)\nlet conGroup = checkForGroup(\"Conditions\") ;\nlet arGroup = checkForGroup(\"Arrows\");\nlet arGroupX = arGroup != null ? arGroup.frame().x() : 0;\nlet arGroupY = arGroup != null ? arGroup.frame().y() : 0;\n\nif(conGroup){\n condition.frame.x = x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX);\n condition.frame.y = y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY);\n conGroup.fixGeometryWithOptions(1);\n} else {\n condition.frame.x = x - condition.frame.width / 2;\n condition.frame.y = y - condition.frame.height / 2;\n}\nreturn condition.id;\n}\n\n// Style\n\nfunction styleLine(line, style){ // Refactored\n let localStyle;\n \n if(style != null){ \n // For updates\n if(getLayerStyles(style) != null && style != \"Default Style\"){\n // If style is specified\n localStyle = style;\n let ownStyle = getLayerStyles(style);\n line.sharedStyle = ownStyle[0];\n } else {\n // if there is no specific style\n localStyle = \"Default Style\";\n let border = line.style().addStylePartOfType(1);\n border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1});\n border.thickness = 2;\n line.style().endMarkerType = 2;\n }\n } else {\n // For creating new\n if(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey) != null && context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey) != \"Default Style\"){\n // we have settins almost all the time and it's not default\n localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey));\n line.sharedStyle = localStyle[0];\n localStyle = localStyle[0].name();\n } else {\n localStyle = \"Default Style\";\n let border = line.style().addStylePartOfType(1);\n border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1});\n border.thickness = 2;\n line.style().endMarkerType = 2;\n } \n }\n \n return localStyle;\n}\n\nfunction getLayerStyles(name) { // Refactored\n let allStyles = docData.allLayerStyles();\n let keyword = \"$arrow\";\n let styles = [];\n \n for(let i = 0; i < allStyles.count(); i++){\n if(name == null) {\n if(allStyles[i].name().includes(keyword)){styles.push(allStyles[i]);}\n } else {\n if(allStyles[i].name() == name){styles.push(allStyles[i]);}\n }\n }\n return styles;\n}\n \n// Groups\n\nfunction addToArrowsGroup(line){\n let currentGroup = checkForGroup(\"Arrows\");\n if(currentGroup){\n currentGroup.addLayers([line]);\n currentGroup.fixGeometryWithOptions(1);\n } else {\n let Group = require('sketch/dom').Group;\n let group = new Group({\n parent: currentParentGroup,\n name: 'Arrows',\n locked: true,\n layers: [line]\n });\n group.moveToBack();\n group.adjustToFit();\n }\n}\n\nfunction checkForGroup(groupName) { // refactored\n let currentGroup = null;\n \n // Checking all the groups that we have\n for(let i = 0; i < currentParentGroup.layers().count(); i++){\n if(currentParentGroup.layers()[i].name() == groupName) {\n currentGroup = currentParentGroup.layers()[i];\n } \n }\n \n return currentGroup;\n}","module.exports = require(\"sketch/dom\");"],"sourceRoot":""} \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/links.js b/arrows.sketchplugin/Contents/Sketch/links.js index aa00d24..c644930 100644 --- a/arrows.sketchplugin/Contents/Sketch/links.js +++ b/arrows.sketchplugin/Contents/Sketch/links.js @@ -1,126 +1,5 @@ -var that = this; -function __skpm_run (key, context) { - that.context = context; - -var exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/links.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./src/links.js": -/*!**********************!*\ - !*** ./src/links.js ***! - \**********************/ -/*! exports provided: default, getLibrary, joinCommunity */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLibrary", function() { return getLibrary; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "joinCommunity", function() { return joinCommunity; }); -/* harmony default export */ __webpack_exports__["default"] = (function (context) {}); -function getLibrary(context) { - NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://github.com/faridsabitov/Sketch-Interactions")); -} -function joinCommunity(context) { - NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://spectrum.chat/sketch-arrows")); -} - -/***/ }) - -/******/ }); - if (key === 'default' && typeof exports === 'function') { - exports(context); - } else { - exports[key](context); - } -} -that['getLibrary'] = __skpm_run.bind(this, 'getLibrary'); -that['onRun'] = __skpm_run.bind(this, 'default'); -that['joinCommunity'] = __skpm_run.bind(this, 'joinCommunity') - -//# sourceMappingURL=links.js.map \ No newline at end of file +var that=this;function __skpm_run(t,n){that.context=n;var e=function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s="./src/utilities/links.js")}({"./src/utilities/links.js": +/*!********************************!*\ + !*** ./src/utilities/links.js ***! + \********************************/ +/*! exports provided: getLibrary, joinCommunity */function(t,n,e){"use strict";function r(t){NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://github.com/faridsabitov/Sketch-Interactions"))}function i(t){NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://spectrum.chat/sketch-arrows"))}e.r(n),e.d(n,"getLibrary",function(){return r}),e.d(n,"joinCommunity",function(){return i})}});"default"===t&&"function"==typeof e?e(n):e[t](n)}that.getLibrary=__skpm_run.bind(this,"getLibrary"),that.onRun=__skpm_run.bind(this,"default"),that.joinCommunity=__skpm_run.bind(this,"joinCommunity"); \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/links.js.map b/arrows.sketchplugin/Contents/Sketch/links.js.map index 045fe75..a0e28e8 100644 --- a/arrows.sketchplugin/Contents/Sketch/links.js.map +++ b/arrows.sketchplugin/Contents/Sketch/links.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://exports/webpack/bootstrap","webpack://exports/./src/links.js"],"names":["context","getLibrary","NSWorkspace","sharedWorkspace","openURL","NSURL","URLWithString","joinCommunity"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAe,yEAASA,OAAT,EAAkB,CAAE;AAE5B,SAASC,UAAT,CAAoBD,OAApB,EAA6B;AAClCE,aAAW,CAACC,eAAZ,GAA8BC,OAA9B,CAAsCC,KAAK,CAACC,aAAN,CAAoB,qDAApB,CAAtC;AACD;AAEM,SAASC,aAAT,CAAuBP,OAAvB,EAAgC;AACrCE,aAAW,CAACC,eAAZ,GAA8BC,OAA9B,CAAsCC,KAAK,CAACC,aAAN,CAAoB,qCAApB,CAAtC;AACD,C","file":"links.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/links.js\");\n","export default function(context) {}\n\nexport function getLibrary(context) {\n NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString(\"https://github.com/faridsabitov/Sketch-Interactions\"))\n}\n\nexport function joinCommunity(context) {\n NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString(\"https://spectrum.chat/sketch-arrows\"))\n}"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://exports/webpack/bootstrap","webpack://exports/./src/utilities/links.js"],"names":["getLibrary","context","NSWorkspace","sharedWorkspace","openURL","NSURL","URLWithString","joinCommunity"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAO,SAASA,UAAT,CAAoBC,OAApB,EAA6B;AAClCC,aAAW,CAACC,eAAZ,GAA8BC,OAA9B,CAAsCC,KAAK,CAACC,aAAN,CAAoB,qDAApB,CAAtC;AACD;AAEM,SAASC,aAAT,CAAuBN,OAAvB,EAAgC;AACrCC,aAAW,CAACC,eAAZ,GAA8BC,OAA9B,CAAsCC,KAAK,CAACC,aAAN,CAAoB,qCAApB,CAAtC;AACD,C","file":"links.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/utilities/links.js\");\n","export function getLibrary(context) {\n NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString(\"https://github.com/faridsabitov/Sketch-Interactions\"));\n}\n\nexport function joinCommunity(context) {\n NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString(\"https://spectrum.chat/sketch-arrows\"));\n}"],"sourceRoot":""} \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/manifest.json b/arrows.sketchplugin/Contents/Sketch/manifest.json index 2dbdf99..5a035f1 100644 --- a/arrows.sketchplugin/Contents/Sketch/manifest.json +++ b/arrows.sketchplugin/Contents/Sketch/manifest.json @@ -2,7 +2,6 @@ "compatibleVersion": 3, "bundleVersion": 1, "identifier": "me.sabitov.sketch.connectionFlowArrows", - "version": "2.7.1", "icon": "icon.png", "authorEmail": "farid.sabitov.design@gmail.com", "appcast": "https://raw.githubusercontent.com/faridsabitov/Sketch-Connection-Flow-Arrows/master/.appcast.xml", @@ -57,6 +56,42 @@ "script": "script.js", "handler": "createUpArrow" }, + { + "name": "Arrow to the Right with Condition", + "description": "Select more than one layer, to create a link between first object and others", + "identifier": "createRightArrowWithCondition", + "icon": "icon.png", + "shortcut": "command control shift →", + "script": "script.js", + "handler": "createRightArrowWithCondition" + }, + { + "name": "Arrow to the Bottom with Condition", + "description": "Select more than one layer, to create a link between first object and others", + "identifier": "createDownArrowWithCondition", + "icon": "icon.png", + "shortcut": "command control shift ↓", + "script": "script.js", + "handler": "createDownArrowWithCondition" + }, + { + "name": "Arrow to the Left with Condition", + "description": "Select more than one layer, to create a link between first object and others", + "identifier": "createLeftArrowWithCondition", + "icon": "icon.png", + "shortcut": "command control shift ←", + "script": "script.js", + "handler": "createLeftArrowWithCondition" + }, + { + "name": "Arrow to the Top with Condition", + "description": "Select more than one layer, to create a link between first object and others", + "identifier": "createUpArrowWithCondition", + "icon": "icon.png", + "shortcut": "command control shift ↑", + "script": "script.js", + "handler": "createUpArrowWithCondition" + }, { "name": "Update arrows between selected", "description": "Update connection between selected layers", @@ -66,6 +101,17 @@ "icon": "icon.png", "handler": "updateSelectedArrows" }, + { + "name": "Auto update arrows between selected", + "script": "autoUpdate.js", + "handlers": { + "actions": { + "LayersMoved.finish": "autoUpdateSelectedArrows", + "LayersResized.finish": "autoUpdateSelectedArrows" + } + }, + "identifier": "autoUpdateSelectedArrows" + }, { "name": "Update arrows from the selected artboard", "description": "Update all the arrows from selected artboard", @@ -113,7 +159,7 @@ "name": "Settings", "description": "Provide settings for the arrows", "identifier": "settings", - "script": "script.js", + "script": "settings.js", "icon": "icon.png", "handler": "settings" }, @@ -153,23 +199,12 @@ "createRightArrow", "createDownArrow", "createLeftArrow", - "createUpArrow" - ] - }, - { - "title": "Update Connection Positions", - "items": [ - "updateSelectedArrows", - "updateArtboardArrows", - "updateAllArrows" - ] - }, - { - "title": "Delete Connection", - "items": [ - "deleteSelectedArrows", - "deleteArtboardArrows", - "deleteAllArrows" + "createUpArrow", + "-", + "createRightArrowWithCondition", + "createDownArrowWithCondition", + "createLeftArrowWithCondition", + "createUpArrowWithCondition" ] }, "settings", @@ -178,6 +213,7 @@ "joinCommunity" ] }, + "version": "3.0.0", "name": "arrows", "disableCocoaScriptPreprocessor": true } \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/script.js b/arrows.sketchplugin/Contents/Sketch/script.js index 599e1f9..911c5b6 100644 --- a/arrows.sketchplugin/Contents/Sketch/script.js +++ b/arrows.sketchplugin/Contents/Sketch/script.js @@ -1,1655 +1,57 @@ -var that = this; -function __skpm_run (key, context) { - that.context = context; - -var exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/script.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./src/script.js": +var that=this;function __skpm_run(e,t){that.context=t;var r=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./src/script.js")}({"./src/createArrow.js": +/*!****************************!*\ + !*** ./src/createArrow.js ***! + \****************************/ +/*! exports provided: createArrow */function(e,t,r){"use strict";r.r(t),r.d(t,"createArrow",function(){return i});r(/*! sketch */"sketch");var o=r(/*! ./draw.js */"./src/draw.js"),n=r(/*! sketch/settings */"sketch/settings");function i(e,t,r,i,a,s,c,u,d){var l="Auto"==a?function(e,t,r){var o,n=r.getLayerWithID(e),i=r.getLayerWithID(t),a=n.frame.x+n.frame.width/2,s=n.frame.y+n.frame.height/2,c=i.frame.x+i.frame.width/2,u=i.frame.y+i.frame.height/2,d=a-c,l=s-u,f=Math.abs(d),h=Math.abs(l);o=c>a?u>s?d>l?"Down":"Right":f>h?"Right":"Up":u>s?f>h?"Left":"Down":d>l?"Left":"Up";return o}(e,t,u):a;!function(e,t,r,o){var i=o.getLayerWithID(e),a=o.getLayerWithID(t);if(n.settingForKey("arrowSpacing")&&0!=n.settingForKey("arrowSpacing")){var s=n.settingForKey("arrowSpacing");"Right"==r&&(a.frame.x=i.frame.x+i.frame.width+s),"Down"==r&&(a.frame.y=i.frame.y+i.frame.height+s),"Left"==r&&(a.frame.x=i.frame.x-a.frame.width-s),"Up"==r&&(a.frame.y=i.frame.y-a.frame.height-s)}}(e,t,l,u),function(e,t,r,o){var i,a,s,c,u,d=o.getLayerWithID(e),l=o.getLayerWithID(t);n.settingForKey("autoAlign")&&1==n.settingForKey("autoAlign")&&("Right"!=r&&"Left"!=r||(i=d.frame.y+d.frame.height/2,a=l.frame.y+l.frame.height/2,(u=i-a)>-6&&u<6&&(l.frame.y=l.frame.y+u)),"Down"!=r&&"Up"!=r||(s=d.frame.x+d.frame.width/2,c=l.frame.x+l.frame.width/2,(u=s-c)>-6&&u<6&&(l.frame.x=l.frame.x+u)))}(e,t,l,u);var f=Object(o.drawConnection)(e,t,r,i,l,s,c,u,d);return{firstObject:e,secondObject:t,style:f.style,condition:f.conditionID,isCondition:c,type:f.type,direction:l,line:f.line.objectID()}}},"./src/draw.js": +/*!*********************!*\ + !*** ./src/draw.js ***! + \*********************/ +/*! exports provided: drawConnection */function(e,t,r){"use strict";r.r(t),r.d(t,"drawConnection",function(){return s});r(/*! sketch */"sketch");var o=r(/*! ./utilities/styling.js */"./src/utilities/styling.js"),n=r(/*! ./utilities/conditions.js */"./src/utilities/conditions.js"),i=r(/*! ./utilities/groups.js */"./src/utilities/groups.js"),a=r(/*! sketch/settings */"sketch/settings");r(/*! sketch/ui */"sketch/ui");function s(e,t,r,s,c,u,d,l,f){var h=f.currentPage().currentArtboard()||f.currentPage(),y=function(e,t,r,o){var n,a,s=e.frame.changeBasis({from:e.parent,to:o}),c=t.frame.changeBasis({from:t.parent,to:o}),u=Object(i.checkForGroup)("Arrows",o);u?(n=u.frame().x(),a=u.frame().y()):(n=0,a=0);var d={firstLayerPosX:null,firstLayerPosY:null,secondLayerPosX:null,secondLayerPosY:null,middlePosX:null,middlePosY:null};"Up"==r&&(d.firstLayerPosX=s.x+s.width/2-n,d.firstLayerPosY=s.y-a,d.secondLayerPosX=c.x+c.width/2-n,d.secondLayerPosY=c.y+c.height-a,d.middlePosX=(d.firstLayerPosX+d.secondLayerPosX)/2,d.middlePosY=(d.firstLayerPosY+d.secondLayerPosY)/2);"Right"==r&&(d.firstLayerPosX=s.x+s.width-n,d.firstLayerPosY=s.y+s.height/2-a,d.secondLayerPosX=c.x-n,d.secondLayerPosY=c.y+c.height/2-a,d.middlePosX=(d.firstLayerPosX+d.secondLayerPosX)/2,d.middlePosY=(d.firstLayerPosY+d.secondLayerPosY)/2);"Down"==r&&(d.firstLayerPosX=s.x+s.width/2-n,d.firstLayerPosY=s.y+s.height-a,d.secondLayerPosX=c.x+c.width/2-n,d.secondLayerPosY=c.y-a,d.middlePosX=(d.firstLayerPosX+d.secondLayerPosX)/2,d.middlePosY=(d.firstLayerPosY+d.secondLayerPosY)/2);"Left"==r&&(d.firstLayerPosX=s.x-n,d.firstLayerPosY=s.y+s.height/2-a,d.secondLayerPosX=c.x+c.width-n,d.secondLayerPosY=c.y+c.height/2-a,d.middlePosX=(d.firstLayerPosX+d.secondLayerPosX)/2,d.middlePosY=(d.firstLayerPosY+d.secondLayerPosY)/2);return d}(l.getLayerWithID(e),l.getLayerWithID(t),c,h),m={line:[],conditionID:[],type:[],style:[]};return m.type=null==s?a.settingForKey("arrowType"):s,"Angled"!=m.type&&null!=m.type||(m.line=function(e,t,r,o,n,i,a){var s=NSBezierPath.bezierPath();"Up"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(e,o)),s.lineToPoint(NSMakePoint(n,o)),s.lineToPoint(NSMakePoint(n,i)));"Right"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(r,t)),s.lineToPoint(NSMakePoint(r,i)),s.lineToPoint(NSMakePoint(n,i)));"Down"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(e,o)),s.lineToPoint(NSMakePoint(n,o)),s.lineToPoint(NSMakePoint(n,i)));"Left"==a&&(s.moveToPoint(NSMakePoint(e,t)),s.lineToPoint(NSMakePoint(r,t)),s.lineToPoint(NSMakePoint(r,i)),s.lineToPoint(NSMakePoint(n,i)));var c=MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(s)),u=c.layers().firstObject().points();return u[1].cornerRadius=20,u[2].cornerRadius=20,c.setName("Angled Arrow"),c}(y.firstLayerPosX,y.firstLayerPosY,y.middlePosX,y.middlePosY,y.secondLayerPosX,y.secondLayerPosY,c)),"Straight"==m.type&&(m.line=function(e,t,r,o,n){var i=NSBezierPath.bezierPath();"Up"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));"Right"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));"Down"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));"Left"==n&&(i.moveToPoint(NSMakePoint(e,t)),i.lineToPoint(NSMakePoint(r,o)));var a=MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(i));return a.setName("Straight Arrow"),a}(y.firstLayerPosX,y.firstLayerPosY,y.secondLayerPosX,y.secondLayerPosY,c)),"Curved"==m.type&&(m.line=function(e,t,r,o,n){var i,a=NSBezierPath.bezierPath();if("Up"==n){a.moveToPoint(NSMakePoint(e,t)),a.lineToPoint(NSMakePoint(r,o));var s=(i=MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(a))).layers().firstObject().points();s[0].curveMode=4,s[1].curveMode=4,s[0].hasCurveFrom=!0,s[1].hasCurveTo=!0,e 1) { - // Need to find source object by ID first - // let sourceObjectID = getSourceObjectFromSelection(selection) - var currentConnectionsData = newConnectionsData; - - for (var g = 0; g < selection.count(); g++) { - if (selection[g].objectID() != selection[0].objectID()) { - // Then need to create or update connection arrow with each selection - var connectionIndex = findConnectionData(selection[0].objectID(), selection[g].objectID(), currentConnectionsData); - - if (connectionIndex != null) { - updateArrow(currentConnectionsData[connectionIndex].firstObject, currentConnectionsData[connectionIndex].secondObject, currentConnectionsData[connectionIndex].style, currentConnectionsData[connectionIndex].type, currentConnectionsData[connectionIndex].direction, currentConnectionsData[connectionIndex].line, connectionIndex); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("Current connection is updated 🚀"); - } else { - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("There is no connection between selected layers on the plugin data"); - } - } - } - - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey); - } else { - // When user didn't select anything - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("Please select more than two layers"); - } -} -function updateArtboardArrows(context) { - // TODO: Need to show amount of updated arrows and deleted ones - var selection = context.selection; - var connections = getConnectionsData(); - var firstObjectArtboard; - var secondObjectArtboard; - - if (connections.length > 0) { - // We have connections in database - var updateArrowsCounter = connections.length; - - for (var i = 0; i < updateArrowsCounter; i++) { - // Need to check if the element is selected globally or from the artboard - firstObjectArtboard = document.getLayerWithID(connections[i].firstObject); - firstObjectArtboard = firstObjectArtboard.sketchObject.parentArtboard().objectID(); - secondObjectArtboard = document.getLayerWithID(connections[i].secondObject); - secondObjectArtboard = secondObjectArtboard.sketchObject.parentArtboard().objectID(); - - if (selection.count() == 1 && selection[0].class() == "MSArtboardGroup") { - // Need to go through each connection and update arrow position for specific artboard - if (firstObjectArtboard == selection[0].objectID()) { - if (secondObjectArtboard == selection[0].objectID()) { - updateArrow(connections[i].firstObject, connections[i].secondObject, connections[i].style, connections[i].type, connections[i].direction, connections[i].line, i); - } else { - newConnectionsData.push(connections[i]); - } - } else { - // If not just saving it - newConnectionsData.push(connections[i]); - } - } - } - - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("All arrows are updated 🚀"); - } else { - // We don't have any connections to update - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("There is nothing to update"); - } -} -function updateAllArrows(context) { - // TODO - // TODO: Need to show amount of updated arrows and deleted ones - var currentConnectionsData = newConnectionsData; - - if (currentConnectionsData.length > 0) { - // We have connections in database - var updateArrowsCounter = currentConnectionsData.length; - - for (var i = 0; i < updateArrowsCounter; i++) { - // Need to go through each connection and update arrow position without artboards - // Need to check if current object don't have the parrent - updateArrow(currentConnectionsData[i].firstObject, currentConnectionsData[i].secondObject, currentConnectionsData[i].style, currentConnectionsData[i].type, currentConnectionsData[i].direction, currentConnectionsData[i].line, i); - } - - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("All arrows are updated 🚀"); - } else { - // We don't have any connections to update - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("There is nothing to update"); - } -} -function deleteAllArrows(context) { - if (newConnectionsData.length > 0) { - // We have connections in database - for (var i = 0; i < newConnectionsData.length; i++) { - // Need to go through each connection and update arrow position - deleteLine(newConnectionsData[i].line); - } - - context.command.setValue_forKey_onLayer_forPluginIdentifier(null, "arrowConnections", docData, pluginKey); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("All arrows are deleted"); - } else { - // We don't have any connections to update - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("There is nothing to delete"); - } -} -function deleteArtboardArrows(context) { - var selection = context.selection; - var firstObject, secondObject; // Need to delete all the arrows only from selected artboard - - if (selection.count() == 1 && selection[0].class() == "MSArtboardGroup") { - var connections = getConnectionsData(); - - if (connections.length > 0) { - // We have connections in database - var updateArrowsCounter = connections.length; - - for (var i = 0; i < updateArrowsCounter; i++) { - // Need to go through each connection and check if it placed on selected artboard - firstObject = document.getLayerWithID(connections[i].firstObject); - secondObject = document.getLayerWithID(connections[i].secondObject); - - if (firstObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()) { - if (secondObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()) { - deleteLine(connections[i].line); - newConnectionsData = deleteConnectionFromData(i); - } - } - } - - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("All arrows from selected artboard are deleted"); - } else { - // We don't have any connections to update - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("There is nothing to delete"); - } - } else { - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("Please select one artboard"); - } -} -function deleteSelectedArrows(context) { - var selection = context.selection; - var firstObject, secondObject; // Need to delete all the arrows only from selected artboard - - if (selection.count() == 2) { - for (var g = 0; g < selection.count(); g++) { - if (selection[g].objectID() != selection[0].objectID()) { - // It will never check 3rd connection - var connections = getConnectionsData(); - var connectionIndex = findConnectionData(selection[0].objectID(), selection[g].objectID(), connections); - - if (connectionIndex != null) { - // We have connections in database - deleteLine(connections[connectionIndex].line); - newConnectionsData = deleteConnectionFromData(connectionIndex); - var updateArrowsCounter = connections.length; - - for (var i = 0; i < updateArrowsCounter; i++) { - // Need to go through each connection and check if it placed on selected artboard - firstObject = document.getLayerWithID(connections[i].firstObject); - secondObject = document.getLayerWithID(connections[i].secondObject); - - if (firstObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()) { - if (secondObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()) { - deleteLine(connections[i].line); - newConnectionsData = deleteConnectionFromData(i); - } - } - } - - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("All arrows from selected layers are deleted ✌️"); - } - } - } - } else { - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("Select two layers, please 🧐"); - } -} -function settings(context) { - var alert = COSAlertWindow.new(); - var viewWidth = 300; - var viewHeight = 450; // Alert window settings - - alert = alertSetup(alert, viewWidth, viewHeight); - var view = NSView.alloc().initWithFrame(NSMakeRect(0, 0, viewWidth, viewHeight)); - alert.addAccessoryView(view); // Label: Arrow Style - - var arrowStyleLabel = alertLabel("Arrow Style", true, -1, viewHeight - 40, 280, 40); - view.addSubview(arrowStyleLabel); // Select: Arrow Style - - var arrowStylingField = NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 40, 300, 20)); - setActiveStyleSetting(arrowStylingField); - view.addSubview(arrowStylingField); // Label: Arrow Style Info - - var arrowStyleInfoLabel = alertLabel("Add layer style to your document that will contain $arrow name and you will be able to specify it here ", false, -1, viewHeight - 80, 300, 40); - view.addSubview(arrowStyleInfoLabel); // Label: Arrow Type - - var arrowTypeLabel = alertLabel("Arrow Type", true, -1, viewHeight - 130, 280, 40); - view.addSubview(arrowTypeLabel); // Select: Arrow Type - - var arrowTypeField = NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 130, 300, 20)); - setActiveTypeSetting(arrowTypeField); - view.addSubview(arrowTypeField); // Label: Arrow Type Info - - var arrowTypeInfoLabel = alertLabel("Select one of the arrow types. Angled is used by default", false, -1, viewHeight - 170, 300, 40); - view.addSubview(arrowTypeInfoLabel); // Label: Arrow Spacing - - var arrowSpacingLabel = alertLabel("Arrow Spacing", true, -1, viewHeight - 200, 330, 20); - view.addSubview(arrowSpacingLabel); // Label: Arrow Spacing PX - - var arrowSpacingPxLabel = alertLabel("px", true, 90, viewHeight - 220, 330, 20); - view.addSubview(arrowSpacingPxLabel); // Input: Arrow Spacing - - var arrowSpacingField = NSTextField.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 220, 80, 20)); - var formatter = NSNumberFormatter.alloc().init().autorelease(); - arrowSpacingField.setStringValue(String(Settings.settingForKey("arrowSpacing"))); - arrowSpacingField.setFormatter(formatter); - view.addSubview(arrowSpacingField); // Stepper: Arrow Spacing - - var arrowSpacingStepper = NSStepper.alloc().initWithFrame(NSMakeRect(70, viewHeight - 220, 20, 20)); - arrowSpacingStepper.setMaxValue(1000); - arrowSpacingStepper.setMinValue(0); - arrowSpacingStepper.setValueWraps(false); - arrowSpacingStepper.setAutorepeat(true); - arrowSpacingStepper.setCOSJSTargetFunction(function (sender) { - var value = 0 + sender.integerValue(); - arrowSpacingField.setStringValue(String(value)); - }); - view.addSubview(arrowSpacingStepper); // view.addSubview(formatter) - // Label: Auto Spacing Info - - var arrowSpacingInfoLabel = alertLabel("The second layer will be moved closer based on the value provided here. Keep it 0 if you don't want to have auto spacing feature ", false, -1, viewHeight - 285, 300, 60); - view.addSubview(arrowSpacingInfoLabel); // Label: Other Settings - - var otherSettingsLabel = alertLabel("Other Settings", true, -1, viewHeight - 330, 280, 40); - view.addSubview(otherSettingsLabel); // Checkbox: Auto-Align - - var checkbox = alertCheckbox("Second layer auto-align", false, -1, viewHeight - 340, 260, 40); - view.addSubview(checkbox); // Label: Auto-Align Info - - var autoAlignInfoLabel = alertLabel("Align the second layer for 5px misalignment with the first one", false, -1, viewHeight - 370, 280, 40); - view.addSubview(autoAlignInfoLabel); // Label: Plugin Info - - var pluginInfoLabel = alertLabel("Made by @faridSabitov with the support of EPAM.com ❤️", true, -1, viewHeight - 420, 280, 40); - view.addSubview(pluginInfoLabel); // Need to check if style is still available - // Show modal and get the results - - var modalResponse = alert.runModal(); - - if (modalResponse == NSAlertFirstButtonReturn) { - // When user clicks on "Update Settings" - // Need to save all this results into the Plugin Settings - context.command.setValue_forKey_onLayer_forPluginIdentifier(alert.views()[0].subviews()[1].title(), "arrowStyle", docData, pluginKey); - Settings.setSettingForKey("arrowType", alert.views()[0].subviews()[4].title()); - Settings.setSettingForKey("arrowSpacing", alert.views()[0].subviews()[8].intValue()); - Settings.setSettingForKey("autoAlign", alert.views()[0].subviews()[12].state()); - UI.message("Settings are updated 🚀"); - } -} -function onLayersMoved(context) { - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("Please select more than two layers"); - var action = context.actionContext; -} -function panel(context) { - var ControlBar; - ControlBar = NSPanel.alloc().init(); - ControlBar.setStyleMask(NSTitledWindowMask + NSFullSizeContentViewWindowMask); // ControlBar.setBackgroundColor(NSColor.colorWithRed_green_blue_alpha(0.99, 0.99, 0.99, 1)); - - ControlBar.setTitleVisibility(NSWindowTitleHidden); - ControlBar.setTitlebarAppearsTransparent(true); - ControlBar.setFrame_display(NSMakeRect(0, 0, 720, 50), false); - ControlBar.setMovableByWindowBackground(true); - ControlBar.setHasShadow(true); - ControlBar.setLevel(NSFloatingWindowLevel); // contentView.addSubview(closeButton) - - ControlBar.center(); - ControlBar.makeKeyAndOrderFront(nil); // getImage = function(size, name){ - // var isRetinaDisplay = (NSScreen.mainScreen().backingScaleFactor() > 1)? true: false; - // suffix = (isRetinaDisplay)? "@2x": "", - // imageURL = NSURL.fileURLWithPath(self.pluginResources + "/icons/" + name + suffix + ".png"), - // image = NSImage.alloc().initWithContentsOfURL(imageURL); - // return image - // }, - // addButton = function(rect, name, callAction){ - // var button = NSButton.alloc().initWithFrame(rect), - // image = getImage(rect.size, name); - // button.setImage(image); - // button.setBordered(false); - // button.sizeToFit(); - // button.setButtonType(NSMomentaryChangeButton); - // button.setCOSJSTargetFunction(callAction); - // button.setAction("callAction:"); - // return button; - // }, - // addImage = function(rect, name){ - // var view = NSImageView.alloc().initWithFrame(rect), - // image = getImage(rect.size, name); - // view.setImage(image); - // return view; - // }, - // closeButton = addButton( NSMakeRect(20, 10, 30, 30), "close-control", - // function(sender){ - // coscript.setShouldKeepAround(false); - // threadDictionary.removeObjectForKey(identifier); - // ControlBar.close(); - // }), -} // -// Functions -// - -function updateArrow(firstObjectID, secondObjectID, style, type, direction, lineID, connectionIndex) { - // There might be a situation, when user deleted current group or current group stays on another artboard => In that case need to create another group - // Need to check if we have the layers with such IDs - var firstObject = document.getLayerWithID(firstObjectID); - var secondObject = document.getLayerWithID(secondObjectID); // Need to delete data first, because we will have a new line - - deleteLine(lineID); - newConnectionsData = deleteConnectionFromData(connectionIndex); - - if (firstObject && secondObject) { - // If we have all the objects, we can recreate the line - createArrow(firstObjectID, secondObjectID, style, type, direction); - } -} - -function createArrow(firstObjectID, secondObjectID, style, type, direction) { - // Process of creating new connection - var localDirection, localStyle, localType; - - if (direction == "Auto") { - // If direction is auto, we need to specify direction ourselves - localDirection = getDirection(firstObjectID, secondObjectID); - } else { - localDirection = direction; - } - - if (type == null) { - localType = Settings.settingForKey("arrowType"); - } else { - localType = type; - } // log(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)) - - - localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)); - - if (style != null) { - // if we updating connection with previously created objects - if (getLayerStyles(style) != null && style != "Default Style") { - localStyle = style; - } else { - localStyle = "Default Style"; - } - } else { - // We don't have any data from the plugin data - if (context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)) { - localStyle = context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey); - } else { - localStyle = "Default Style"; - } - } - - updateSpacing(firstObjectID, secondObjectID, localDirection); - autoAlignLayer(firstObjectID, secondObjectID, localDirection); - var currentGroup = checkForArrowGroup(); - var line = drawLine(firstObjectID, secondObjectID, localStyle, localType, localDirection, currentGroup); - addToArrowsGroup(line, currentGroup); // if(localStyle != "Default Style"){ - // localStyle = localStyle[0].name() - // } - // Storage for current connection - - var connection = { - firstObject: firstObjectID, - secondObject: secondObjectID, - style: localStyle, - type: localType, - direction: localDirection, - line: line.objectID() // Need to save this data to the global array - - }; - newConnectionsData.push(connection); -} - -function checkForArrowGroup() { - var currentGroup = null; // Checking all the groups that we have - - for (var i = 0; i < currentParentGroup.layers().count(); i++) { - if (currentParentGroup.layers()[i].name() == "Arrows") { - // If we already have "Arrow" group we need to save it's folder - currentGroup = currentParentGroup.layers()[i]; - refactorLines(currentGroup); - } - } - - return currentGroup; -} - -function getDirection(firstObjectID, secondObjectID) { - // Get direction from the source object - var firstObject = document.getLayerWithID(firstObjectID); - var secondObject = document.getLayerWithID(secondObjectID); - var firstObjectMidX = firstObject.frame.x + firstObject.frame.width / 2; - var firstObjectMidY = firstObject.frame.y + firstObject.frame.height / 2; - var secondObjectMidX = secondObject.frame.x + secondObject.frame.width / 2; - var secondObjectMidY = secondObject.frame.y + secondObject.frame.height / 2; - var diffX = firstObjectMidX - secondObjectMidX; - var diffY = firstObjectMidY - secondObjectMidY; - var absDiffX = Math.abs(diffX); - var absDiffY = Math.abs(diffY); - var direction; - - if (secondObjectMidX > firstObjectMidX) { - // Right Half - if (secondObjectMidY > firstObjectMidY) { - // Bottom quarter - if (diffX > diffY) { - direction = "Down"; - } else { - direction = "Right"; - } - } else { - // Top quarter - if (absDiffX > absDiffY) { - direction = "Right"; - } else { - direction = "Up"; - } - } - } else { - // Left Half - if (secondObjectMidY > firstObjectMidY) { - // Bottom quarter - if (absDiffX > absDiffY) { - direction = "Left"; - } else { - direction = "Down"; - } - } else { - // Top quarter - if (diffX > diffY) { - direction = "Left"; - } else { - direction = "Up"; - } - } - } - - return direction; -} - -function drawLine(firstObjectID, secondObjectID, style, type, direction, currentGroup) { - var firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, middlePosX, middlePosY, diffX, diffY, line; - var firstObject = document.getLayerWithID(firstObjectID); - var secondObject = document.getLayerWithID(secondObjectID); - var firstObjectAbsPos = firstObject.frame.changeBasis({ - from: firstObject.parent, - to: currentParentGroup - }); - var secondObjectAbsPos = secondObject.frame.changeBasis({ - from: secondObject.parent, - to: currentParentGroup - }); - - if (currentGroup) { - //if we already have a group, need to specify the difference - diffX = currentGroup.frame().x(); - diffY = currentGroup.frame().y(); - } else { - diffX = 0; - diffY = 0; - } // Drawing a line - - - var path = NSBezierPath.bezierPath(); - - if (type == "Angled" || type == null) { - // Based on direction, we need to specify connection points - if (direction == "Up") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; - firstLayerPosY = firstObjectAbsPos.y - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } - - if (direction == "Right") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } - - if (direction == "Down") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; - secondLayerPosY = secondObjectAbsPos.y - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } - - if (direction == "Left") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } //TODO: Provide a separate file with all the stylings - // Painting the line - - - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); // Making middle points rounded - - var points = line.layers().firstObject().points(); - points[1].cornerRadius = 20; - points[2].cornerRadius = 20; // Providing Settings for the arrow - - line.setName("Arrow"); - } - - if (type == "Straight") { - // Based on direction, we need to specify connection points - if (direction == "Up") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; - firstLayerPosY = firstObjectAbsPos.y - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } - - if (direction == "Right") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } - - if (direction == "Down") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; - secondLayerPosY = secondObjectAbsPos.y - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } - - if (direction == "Left") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); - } // Painting the line - - - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); // Providing Settings for the arrow - - line.setName("Arrow"); - } - - if (type == "Curved") { - // Based on direction, we need to specify connection points - if (direction == "Up") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; - firstLayerPosY = firstObjectAbsPos.y - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line - - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); - - var _points = line.layers().firstObject().points(); - - _points[0].curveMode = _points[1].curveMode = 4; - _points[0].hasCurveFrom = _points[1].hasCurveTo = true; - - if (firstLayerPosX < secondLayerPosX) { - _points[0].curveFrom = { - x: 0, - y: 0.5 - }; - _points[0].curveTo = { - x: -0.5, - y: 1 - }; - _points[1].curveFrom = { - x: 1, - y: 1 - }; - _points[1].curveTo = { - x: 1, - y: 0.5 - }; - } else { - _points[0].curveFrom = { - x: 1, - y: 0.5 - }; - _points[0].curveTo = { - x: -0.5, - y: 1 - }; - _points[1].curveFrom = { - x: 1, - y: 1 - }; - _points[1].curveTo = { - x: 0, - y: 0.5 - }; - } - } - - if (direction == "Right") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line - - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); - - var _points2 = line.layers().firstObject().points(); - - _points2[0].curveMode = _points2[1].curveMode = 4; - _points2[0].hasCurveFrom = _points2[1].hasCurveTo = true; - - if (firstLayerPosY < secondLayerPosY) { - _points2[0].curveFrom = { - x: 0.5, - y: 0 - }; - _points2[0].curveTo = { - x: -0.5, - y: 1 - }; - _points2[1].curveFrom = { - x: 1, - y: 1 - }; - _points2[1].curveTo = { - x: 0.5, - y: 1 - }; - } else { - _points2[0].curveFrom = { - x: 0.5, - y: 1 - }; - _points2[0].curveTo = { - x: -0.5, - y: 1 - }; - _points2[1].curveFrom = { - x: 1, - y: 1 - }; - _points2[1].curveTo = { - x: 0.5, - y: 0 - }; - } - } - - if (direction == "Down") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x + firstObjectAbsPos.width / 2 - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width / 2 - diffX; - secondLayerPosY = secondObjectAbsPos.y - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line - - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); - - var _points3 = line.layers().firstObject().points(); - - _points3[0].curveMode = _points3[1].curveMode = 4; - _points3[0].hasCurveFrom = _points3[1].hasCurveTo = true; - - if (firstLayerPosX < secondLayerPosX) { - _points3[0].curveFrom = { - x: 0, - y: 0.5 - }; - _points3[0].curveTo = { - x: -0.5, - y: 1 - }; - _points3[1].curveFrom = { - x: 1, - y: 1 - }; - _points3[1].curveTo = { - x: 1, - y: 0.5 - }; - } else { - _points3[0].curveFrom = { - x: 1, - y: 0.5 - }; - _points3[0].curveTo = { - x: -0.5, - y: 1 - }; - _points3[1].curveFrom = { - x: 1, - y: 1 - }; - _points3[1].curveTo = { - x: 0, - y: 0.5 - }; - } - } - - if (direction == "Left") { - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x - diffX; - firstLayerPosY = firstObjectAbsPos.y + firstObjectAbsPos.height / 2 - diffY; // Second Layer Position End Point Position - - secondLayerPosX = secondObjectAbsPos.x + secondObjectAbsPos.width - diffX; - secondLayerPosY = secondObjectAbsPos.y + secondObjectAbsPos.height / 2 - diffY; // Middle Points - - middlePosX = (firstLayerPosX + secondLayerPosX) / 2; - middlePosY = (firstLayerPosY + secondLayerPosY) / 2; // Connecting points - - path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); - path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); // Painting the line - - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); - - var _points4 = line.layers().firstObject().points(); - - _points4[0].curveMode = _points4[1].curveMode = 4; - _points4[0].hasCurveFrom = _points4[1].hasCurveTo = true; - - if (firstLayerPosY < secondLayerPosY) { - _points4[0].curveFrom = { - x: 0.5, - y: 0 - }; - _points4[0].curveTo = { - x: -0.5, - y: 1 - }; - _points4[1].curveFrom = { - x: 1, - y: 1 - }; - _points4[1].curveTo = { - x: 0.5, - y: 1 - }; - } else { - _points4[0].curveFrom = { - x: 0.5, - y: 1 - }; - _points4[0].curveTo = { - x: -0.5, - y: 1 - }; - _points4[1].curveFrom = { - x: 1, - y: 1 - }; - _points4[1].curveTo = { - x: 0.5, - y: 0 - }; - } - } // Providing Settings for the arrow - - - line.setName("Arrows"); - } // Style Start - - - if (style == null) { - // that means we are creating new arrow - if (context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)) { - // if we have specified options - // TODO: Need to refactor here. Local Style is not used at all - var _style = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)); - - if (_style[0] == null) { - // Default Arrow Style - var border = line.style().addStylePartOfType(1); - border.color = MSColor.colorWithRGBADictionary({ - r: 0.89, - g: 0.89, - b: 0.89, - a: 1 - }); - border.thickness = 2; - line.style().endMarkerType = 2; - } else { - line.sharedStyle = _style[0]; - } - } else { - // Default Arrow Style - var _border = line.style().addStylePartOfType(1); - - _border.color = MSColor.colorWithRGBADictionary({ - r: 0.89, - g: 0.89, - b: 0.89, - a: 1 - }); - _border.thickness = 2; - line.style().endMarkerType = 2; - } - } else { - // arrow style already provided - if (style == "Default Style") { - // Default Arrow Style - var _border2 = line.style().addStylePartOfType(1); - - _border2.color = MSColor.colorWithRGBADictionary({ - r: 0.89, - g: 0.89, - b: 0.89, - a: 1 - }); - _border2.thickness = 2; - line.style().endMarkerType = 2; - } else { - // User provided own style - var ownStyle = getLayerStyles(style); - line.sharedStyle = ownStyle[0]; - } - } // Style End - - - return line; -} - -function addToArrowsGroup(line, currentGroup) { - if (currentGroup) { - currentGroup.addLayers([line]); - currentGroup.fixGeometryWithOptions(1); - } else { - // If we don't have a group - var Group = __webpack_require__(/*! sketch/dom */ "sketch/dom").Group; - - var group = new Group({ - parent: currentParentGroup, - name: 'Arrows', - locked: true, - layers: [line] - }); // Moving this group to the bottom of the page - - group.moveToBack(); - currentGroup = checkForArrowGroup(); - currentGroup.fixGeometryWithOptions(1); - } -} - -function getConnectionsData() { - var dataArray = []; - var pluginDataConnections = []; - - if (pluginData) { - pluginDataConnections = context.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections", docData, pluginKey); - - for (var i = 0; i < pluginDataConnections.length; i++) { - dataArray.push(pluginDataConnections[i]); - } - } - - return dataArray; -} - -function findConnectionData(firstObjectID, secondObjectID, data) { - var arrayNumber = null; - firstObjectID = String(firstObjectID); - secondObjectID = String(secondObjectID); - - if (pluginData) { - // If we have database, need to check for connections - for (var y = 0; y < data.length; y++) { - if (firstObjectID == data[y].firstObject || firstObjectID == data[y].secondObject) { - // if we found that we have this object in connection database already - if (secondObjectID == data[y].firstObject || secondObjectID == data[y].secondObject) { - // if we found that we have this object in connection database already - arrayNumber = y; - } - } - } - } - - return arrayNumber; -} - -function setActiveDirectionSetting(arrowDirectionField) { - var currentDirection = "Auto"; - - if (Settings.settingForKey("arrowDirection")) { - // if there is data in settings - currentDirection = Settings.settingForKey("arrowDirection"); - - if (currentDirection == "Auto") { - arrowDirectionField.addItemWithTitle("Auto"); - arrowDirectionField.lastItem().setState(1); - arrowDirectionField.addItemWithTitle("Right"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Down"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Left"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Up"); - arrowDirectionField.lastItem().setState(0); - } - - if (currentDirection == "Right") { - arrowDirectionField.addItemWithTitle("Right"); - arrowDirectionField.lastItem().setState(1); - arrowDirectionField.addItemWithTitle("Down"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Left"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Up"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Auto"); - arrowDirectionField.lastItem().setState(0); - } - - if (currentDirection == "Down") { - arrowDirectionField.addItemWithTitle("Down"); - arrowDirectionField.lastItem().setState(1); - arrowDirectionField.addItemWithTitle("Left"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Up"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Auto"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Right"); - arrowDirectionField.lastItem().setState(0); - } - - if (currentDirection == "Left") { - arrowDirectionField.addItemWithTitle("Left"); - arrowDirectionField.lastItem().setState(1); - arrowDirectionField.addItemWithTitle("Up"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Auto"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Right"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Down"); - arrowDirectionField.lastItem().setState(0); - } - - if (currentDirection == "Up") { - arrowDirectionField.addItemWithTitle("Up"); - arrowDirectionField.lastItem().setState(1); - arrowDirectionField.addItemWithTitle("Auto"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Right"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Down"); - arrowDirectionField.lastItem().setState(0); - arrowDirectionField.addItemWithTitle("Left"); - arrowDirectionField.lastItem().setState(0); - } - } else { - // Show default - arrowDirectionField.addItemWithTitle("Auto"); - arrowDirectionField.addItemWithTitle("Right"); - arrowDirectionField.addItemWithTitle("Down"); - arrowDirectionField.addItemWithTitle("Left"); - arrowDirectionField.addItemWithTitle("Up"); - } -} - -function setActiveStyleSetting(arrowStylingField) { - var docSettings = context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey); - var styles = getLayerStyles(null); - - if (docSettings) { - // We have info about the settings in the current document - if (docSettings != "Default Style") { - // if user specified own option - arrowStylingField.addItemWithTitle(docSettings); - arrowStylingField.addItemWithTitle("Default Style"); - - for (var i = 0; i < styles.length; i++) { - if (styles[i].name() != docSettings) { - arrowStylingField.addItemWithTitle(styles[i].name()); - } - } - } else { - // Need to show the default first - arrowStylingField.addItemWithTitle("Default Style"); - - for (var _i = 0; _i < styles.length; _i++) { - arrowStylingField.addItemWithTitle(styles[_i].name()); - } - } - } else { - arrowStylingField.addItemWithTitle("Default Style"); - - for (var _i2 = 0; _i2 < styles.length; _i2++) { - arrowStylingField.addItemWithTitle(styles[_i2].name()); - } - } -} - -function setActiveTypeSetting(arrowTypeField) { - var docTypeSettings = Settings.settingForKey("arrowType"); - - if (docTypeSettings) { - // We have info about the settings in the current document - if (docTypeSettings == "Angled") { - arrowTypeField.addItemWithTitle("Angled"); - arrowTypeField.lastItem().setState(1); - arrowTypeField.addItemWithTitle("Curved"); - arrowTypeField.lastItem().setState(0); - arrowTypeField.addItemWithTitle("Straight"); - arrowTypeField.lastItem().setState(0); - } - - if (docTypeSettings == "Curved") { - arrowTypeField.addItemWithTitle("Curved"); - arrowTypeField.lastItem().setState(1); - arrowTypeField.addItemWithTitle("Straight"); - arrowTypeField.lastItem().setState(0); - arrowTypeField.addItemWithTitle("Angled"); - arrowTypeField.lastItem().setState(0); - } - - if (docTypeSettings == "Straight") { - arrowTypeField.addItemWithTitle("Straight"); - arrowTypeField.lastItem().setState(1); - arrowTypeField.addItemWithTitle("Angled"); - arrowTypeField.lastItem().setState(0); - arrowTypeField.addItemWithTitle("Curved"); - arrowTypeField.lastItem().setState(0); - } - } else { - // Show default - arrowTypeField.addItemWithTitle("Angled"); - arrowTypeField.addItemWithTitle("Curved"); - arrowTypeField.addItemWithTitle("Straight"); - } -} - -function deleteConnectionFromData(arrayNumber) { - var newConnections = []; - - if (pluginData) { - // If we have database - var connections = context.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections", docData, pluginKey); - - for (var i = 0; i < connections.length; i++) { - // Updating all connections without deleted one - if (i != arrayNumber) { - newConnections.push(connections[i]); - } - } - } - - return newConnections; -} - -function refactorLines(group) { - // Need to finish - for (var i = 0; i < group.layers().length; i++) {// Here we need to go through each data in our database and delete line if there is no data - } -} - -function deleteLine(lineID) { - var lineObject = document.getLayerWithID(lineID); - var selectedGroup; - - if (lineObject) { - selectedGroup = lineObject.parent; - lineObject.remove(); - - if (selectedGroup.layers.length == 0) { - selectedGroup.remove(); - } - } -} - -function updateSpacing(sourceObjectID, childObjectID, direction) { - var sourceObject = document.getLayerWithID(sourceObjectID); - var childObject = document.getLayerWithID(childObjectID); - - if (Settings.settingForKey("arrowSpacing") && Settings.settingForKey("arrowSpacing") != 0) { - var currentSpacing = Settings.settingForKey("arrowSpacing"); - - if (direction == "Right") { - childObject.frame.x = sourceObject.frame.x + sourceObject.frame.width + currentSpacing; - } - - if (direction == "Down") { - childObject.frame.y = sourceObject.frame.y + sourceObject.frame.height + currentSpacing; - } - - if (direction == "Left") { - childObject.frame.x = sourceObject.frame.x - childObject.frame.width - currentSpacing; - } - - if (direction == "Up") { - childObject.frame.y = sourceObject.frame.y - childObject.frame.height - currentSpacing; - } - } -} - -function autoAlignLayer(sourceObjectID, childObjectID, direction) { - var sourceObject = document.getLayerWithID(sourceObjectID); - var childObject = document.getLayerWithID(childObjectID); - var sourceMidY, childMidY, sourceMidX, childMidX, diff; - - if (Settings.settingForKey("autoAlign")) { - if (Settings.settingForKey("autoAlign") == true) { - // If user turned on Auto-Align settings - if (direction == "Right" || direction == "Left") { - sourceMidY = sourceObject.frame.y + sourceObject.frame.height / 2; - childMidY = childObject.frame.y + childObject.frame.height / 2; - diff = sourceMidY - childMidY; - - if (diff > -6 && diff < 6) { - childObject.frame.y = childObject.frame.y + diff; - } - } - - if (direction == "Down" || direction == "Up") { - sourceMidX = sourceObject.frame.x + sourceObject.frame.width / 2; - childMidX = childObject.frame.x + childObject.frame.width / 2; - diff = sourceMidX - childMidX; - - if (diff > -6 && diff < 6) { - childObject.frame.x = childObject.frame.x + diff; - } - } - } - } -} - -function defineSourceObject(firstObjectID, secondObjectID, direction) { - var firstObject = document.getLayerWithID(firstObjectID); - var secondObject = document.getLayerWithID(secondObjectID); - var sourceObjectID; - - if (direction == "Auto") { - sourceObjectID = firstObject.id; - } - - if (direction == "Right") { - if (firstObject.frame.x <= secondObject.frame.x) { - sourceObjectID = firstObject.id; - } else { - sourceObjectID = secondObject.id; - } - } - - if (direction == "Down") { - if (firstObject.frame.y <= secondObject.frame.y) { - sourceObjectID = firstObject.id; - } else { - sourceObjectID = secondObject.id; - } - } - - if (direction == "Left") { - if (firstObject.frame.x <= secondObject.frame.x) { - sourceObjectID = secondObject.id; - } else { - sourceObjectID = firstObject.id; - } - } - - if (direction == "Up") { - if (firstObject.frame.y <= secondObject.frame.y) { - sourceObjectID = secondObject.id; - } else { - sourceObjectID = firstObject.id; - } - } - - return sourceObjectID; -} - -function getSourceObjectFromSelection(selection, direction) { - var sourceObjectID = selection.firstObject().objectID(); - - if (direction != "Auto") { - for (var g = 0; g < selection.count(); g++) { - sourceObjectID = defineSourceObject(sourceObjectID, selection[g].objectID(), direction); - } - } else { - sourceObjectID = defineSourceObject(sourceObjectID, selection[0].objectID(), direction); - } - - return sourceObjectID; -} - -function confirmationAlert(alert, message) { - // Title - alert.setMessageText("Would you like to delete all the arrows from " + message); // Creating dialog buttons - - alert.addButtonWithTitle("Delete Arrows"); - alert.addButtonWithTitle("Cancel"); // Creating the view - - var viewWidth = 300; - var viewHeight = 40; - var view = NSView.alloc().initWithFrame(NSMakeRect(0, 0, viewWidth, viewHeight)); - alert.addAccessoryView(view); // Label - - var infoLabel = NSTextField.alloc().initWithFrame(NSMakeRect(-1, viewHeight - 40, 330, 40)); - infoLabel.setStringValue("ℹ️ You can select layers, artboards to delete all the arrows from selected one only"); - infoLabel.setSelectable(false); - infoLabel.setDrawsBackground(false); - infoLabel.setBezeled(false); - view.addSubview(infoLabel); - return alert; -} - -function alertSetup(alert, viewWidth, viewHeight) { - // Title - alert.setMessageText("Arrow Plugin Settings"); // Creating dialog buttons - - alert.addButtonWithTitle("Update Settings"); - alert.addButtonWithTitle("Cancel"); - return alert; -} - -function alertLabel(message, state, x, y, width, height) { - var infoLabel = NSTextField.alloc().initWithFrame(NSMakeRect(x, y, width, height)); - infoLabel.setStringValue(message); - infoLabel.setSelectable(false); - infoLabel.setDrawsBackground(false); - infoLabel.setBezeled(false); - - if (state == false) { - infoLabel.textColor = NSColor.disabledControlTextColor(); - } - - return infoLabel; -} - -function alertCheckbox(message, state, x, y, width, height) { - var checkbox = NSButton.alloc().initWithFrame(NSMakeRect(x, y, width, height)); - checkbox.setButtonType(NSSwitchButton); - checkbox.setBezelStyle(0); - checkbox.setTitle(message); - - if (Settings.settingForKey("autoAlign")) { - var currentState = Settings.settingForKey("autoAlign"); - checkbox.setState(currentState); - } else { - checkbox.setState(state); - } - - return checkbox; -} - -function getLayerStyles(name) { - var allStyles = docData.allLayerStyles(); - var keyword = "$arrow"; - var styles = []; - - if (name == null) { - for (var i = 0; i < allStyles.count(); i++) { - if (allStyles[i].name().includes(keyword)) { - styles.push(allStyles[i]); - } - } - } else { - // Searching only for name - for (var _i3 = 0; _i3 < allStyles.count(); _i3++) { - if (allStyles[_i3].name() == name) { - styles.push(allStyles[_i3]); - } - } - } - - return styles; -} - -function start(context, direction) { - var selection = context.selection; - var localDirection; - - if (direction == null) { - localDirection = arrowDirectionSetting; - } else { - localDirection = direction; - } - - if (selection.count() > 1) { - // Need to find source object by ID first - var sourceObjectID = getSourceObjectFromSelection(selection, direction); - var currentConnectionsData = newConnectionsData; - - for (var g = 0; g < selection.count(); g++) { - if (selection[g].objectID() != sourceObjectID) { - // Then need to create or update connection arrow with each selection - var connectionIndex = findConnectionData(sourceObjectID, selection[g].objectID(), currentConnectionsData); - - if (connectionIndex != null) { - // Because this is creating flow, we need to take the direction from user settings - updateArrow(sourceObjectID, selection[g].objectID(), null, null, localDirection, currentConnectionsData[connectionIndex].line, connectionIndex); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("Current connection is updated 🚀"); - } else { - // There is no connection with this two objects in our database - createArrow(sourceObjectID, selection[g].objectID(), null, null, localDirection); - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("New connection is created 🚀"); - } - } - } - - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey); - } else { - // When user didn't select anything - sketch__WEBPACK_IMPORTED_MODULE_0___default.a.UI.message("Please select more than two layers"); - } -} // { -// "script": "./script.js", -// "name" : "onLayersMoved", -// "handlers" : { -// "actions": { -// "LayersMoved.finish": "onLayersMoved" -// } -// }, -// "identifier" : "onLayersMoved" -// } - -/***/ }), - -/***/ "sketch": +/*! exports provided: createAutoArrow, createRightArrow, createDownArrow, createLeftArrow, createUpArrow, createRightArrowWithCondition, createDownArrowWithCondition, createLeftArrowWithCondition, createUpArrowWithCondition, updateSelectedArrows, updateArtboardArrows, updateAllArrows, deleteSelectedArrows, deleteArtboardArrows, deleteAllArrows, update */function(e,r,o){"use strict";o.r(r),o.d(r,"createAutoArrow",function(){return p}),o.d(r,"createRightArrow",function(){return g}),o.d(r,"createDownArrow",function(){return v}),o.d(r,"createLeftArrow",function(){return w}),o.d(r,"createUpArrow",function(){return b}),o.d(r,"createRightArrowWithCondition",function(){return A}),o.d(r,"createDownArrowWithCondition",function(){return L}),o.d(r,"createLeftArrowWithCondition",function(){return k}),o.d(r,"createUpArrowWithCondition",function(){return S}),o.d(r,"updateSelectedArrows",function(){return x}),o.d(r,"updateArtboardArrows",function(){return _}),o.d(r,"updateAllArrows",function(){return T}),o.d(r,"deleteSelectedArrows",function(){return M}),o.d(r,"deleteArtboardArrows",function(){return D}),o.d(r,"deleteAllArrows",function(){return O}),o.d(r,"update",function(){return C});var n=o(/*! sketch */"sketch"),a=o.n(n),s=o(/*! ./createArrow.js */"./src/createArrow.js"),c=o(/*! ./updateArrow.js */"./src/updateArrow.js"),u=o(/*! ./utilities/getSourceObject.js */"./src/utilities/getSourceObject.js"),d=o(/*! ./utilities/data.js */"./src/utilities/data.js"),l=o(/*! ./utilities/lines.js */"./src/utilities/lines.js"),f=o(/*! ./utilities/conditions.js */"./src/utilities/conditions.js"),h=(o(/*! sketch/ui */"sketch/ui"),o(/*! sketch/settings */"sketch/settings"),"flowArrows"),y=a.a.fromNative(t.document),m=t.document.documentData(),P=Object(d.getConnectionsData)(m);function p(e){j(e,"Auto",!1)}function g(e){j(e,"Right",!1)}function v(e){j(e,"Down",!1)}function w(e){j(e,"Left",!1)}function b(e){j(e,"Up",!1)}function A(e){j(e,"Right",!0)}function L(e){j(e,"Down",!0)}function k(e){j(e,"Left",!0)}function S(e){j(e,"Up",!0)}function j(e,t,r){var o=e.selection;if(o.count()>1&&"MSArtboardGroup"!=o[0].class()){for(var n=Object(u.getSourceObjectFromSelection)(o,t),i=[],c=0;c0)for(var b=0;b0&&(P=Object(d.deleteConnectionFromData)(i,P)),e.command.setValue_forKey_onLayer_forPluginIdentifier(P,"arrowConnections",m,h)}else a.a.UI.message("Please select more than two layers. Artboards are coming soon 🥳")}function x(e){C(e,1,!0)}function _(e){C(e,2,!0)}function T(e){C(e,3,!0)}function M(e){C(e,1,!1)}function D(e){C(e,2,!1)}function O(e){C(e,3,!1)}function C(e,t,r){var o=[],n=e.selection;if(P.length>0){if(3==t)if(r)o=Object(c.updateArrow)(P[i].firstObject,P[i].secondObject,P[i].style,P[i].type,P[i].direction,P[i].line,P[i].condition,i),a.a.UI.message("All arrows are updated");else for(var s=0;s Connection Arrows -> Get Free Library. Conditions are taken from the library based on their names. Make sure to name symbol as "#condition" so it will be added here')):(d=c.import().createNewInstance(),d=Object(i.addToConditionGroup)(d,t,r,f));return d}function c(e,t,r,o,n){var a=n.currentPage().currentArtboard()||n.currentPage(),s=o.getLayerWithID(e),c=Object(i.checkForGroup)("Conditions",a),u=Object(i.checkForGroup)("Arrows",a),d=null!=u?u.frame().x():0,l=null!=u?u.frame().y():0;return c?(s.frame.x=t-s.frame.width/2-(c.frame().x()-d),s.frame.y=r-s.frame.height/2-(c.frame().y()-l),c.fixGeometryWithOptions(1)):(s.frame.x=t-s.frame.width/2,s.frame.y=r-s.frame.height/2),s.id}function u(e,t){var r,o=t.getLayerWithID(e);o&&(r=o.parent,o.remove(),0==r.layers.length&&r.remove())}},"./src/utilities/data.js": +/*!*******************************!*\ + !*** ./src/utilities/data.js ***! + \*******************************/ +/*! exports provided: getConnectionsData, deleteConnectionFromData */function(e,r,o){"use strict";o.r(r),o.d(r,"getConnectionsData",function(){return i}),o.d(r,"deleteConnectionFromData",function(){return a});o(/*! sketch */"sketch"),o(/*! sketch/ui */"sketch/ui"),o(/*! sketch/settings */"sketch/settings");var n="flowArrows";function i(e){var r=t.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections",e,n),o=[];if(r)for(var i=0;i=0;r--)t.splice(e[r],1);return t}},"./src/utilities/getSourceObject.js": +/*!******************************************!*\ + !*** ./src/utilities/getSourceObject.js ***! + \******************************************/ +/*! exports provided: getSourceObjectFromSelection */function(e,r,o){"use strict";o.r(r),o.d(r,"getSourceObjectFromSelection",function(){return c});var n=o(/*! sketch */"sketch"),i=o.n(n).a.fromNative(t.document),a=t.document.documentData(),s=a.currentPage().currentArtboard()||a.currentPage();function c(e,t){var r=e.firstObject().objectID();if("Auto"!=t)for(var o=0;o 1){\n // Need to find source object by ID first\n // let sourceObjectID = getSourceObjectFromSelection(selection)\n let currentConnectionsData = newConnectionsData\n\n for(let g = 0; g < selection.count(); g++) {\n if(selection[g].objectID() != selection[0].objectID()){\n // Then need to create or update connection arrow with each selection\n let connectionIndex = findConnectionData(selection[0].objectID(), selection[g].objectID(), currentConnectionsData)\n\n if(connectionIndex != null){\n updateArrow(currentConnectionsData[connectionIndex].firstObject, currentConnectionsData[connectionIndex].secondObject, currentConnectionsData[connectionIndex].style, currentConnectionsData[connectionIndex].type, currentConnectionsData[connectionIndex].direction, currentConnectionsData[connectionIndex].line, connectionIndex)\n sketch.UI.message(\"Current connection is updated 🚀\")\n } else {\n sketch.UI.message(\"There is no connection between selected layers on the plugin data\")\n }\n }\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, \"arrowConnections\", docData, pluginKey)\n } else {\n // When user didn't select anything\n sketch.UI.message(\"Please select more than two layers\")\n }\n}\n\nexport function updateArtboardArrows(context) {\n // TODO: Need to show amount of updated arrows and deleted ones\n let selection = context.selection\n let connections = getConnectionsData()\n let firstObjectArtboard\n let secondObjectArtboard\n \n if(connections.length > 0){\n // We have connections in database\n const updateArrowsCounter = connections.length\n for (let i = 0; i < updateArrowsCounter; i ++) {\n // Need to check if the element is selected globally or from the artboard\n firstObjectArtboard = document.getLayerWithID(connections[i].firstObject)\n firstObjectArtboard = firstObjectArtboard.sketchObject.parentArtboard().objectID()\n\n secondObjectArtboard = document.getLayerWithID(connections[i].secondObject)\n secondObjectArtboard = secondObjectArtboard.sketchObject.parentArtboard().objectID()\n\n if(selection.count() == 1 && selection[0].class() == \"MSArtboardGroup\"){\n // Need to go through each connection and update arrow position for specific artboard\n \n if (firstObjectArtboard == selection[0].objectID()){\n if (secondObjectArtboard == selection[0].objectID()){\n updateArrow(connections[i].firstObject, connections[i].secondObject, connections[i].style, connections[i].type, connections[i].direction, connections[i].line, i)\n } else {newConnectionsData.push(connections[i])}\n } else {\n // If not just saving it\n newConnectionsData.push(connections[i])\n }\n }\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, \"arrowConnections\", docData, pluginKey)\n sketch.UI.message(\"All arrows are updated 🚀\")\n } else {\n // We don't have any connections to update\n sketch.UI.message(\"There is nothing to update\")\n }\n}\n\nexport function updateAllArrows(context) { // TODO\n // TODO: Need to show amount of updated arrows and deleted ones\n let currentConnectionsData = newConnectionsData\n if(currentConnectionsData.length > 0){\n // We have connections in database\n const updateArrowsCounter = currentConnectionsData.length\n for (let i = 0; i < updateArrowsCounter; i ++) {\n // Need to go through each connection and update arrow position without artboards\n // Need to check if current object don't have the parrent\n updateArrow(currentConnectionsData[i].firstObject, currentConnectionsData[i].secondObject, currentConnectionsData[i].style, currentConnectionsData[i].type, currentConnectionsData[i].direction, currentConnectionsData[i].line, i)\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, \"arrowConnections\", docData, pluginKey)\n sketch.UI.message(\"All arrows are updated 🚀\")\n } else {\n // We don't have any connections to update\n sketch.UI.message(\"There is nothing to update\")\n }\n}\n\nexport function deleteAllArrows(context) {\n\n if(newConnectionsData.length > 0){\n // We have connections in database\n for (let i = 0; i < newConnectionsData.length; i ++) {\n // Need to go through each connection and update arrow position\n deleteLine(newConnectionsData[i].line)\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(null, \"arrowConnections\", docData, pluginKey)\n sketch.UI.message(\"All arrows are deleted\")\n } else {\n // We don't have any connections to update\n sketch.UI.message(\"There is nothing to delete\")\n }\n}\n\nexport function deleteArtboardArrows(context) {\n let selection = context.selection\n let firstObject, secondObject\n\n // Need to delete all the arrows only from selected artboard\n if(selection.count() == 1 && selection[0].class() == \"MSArtboardGroup\"){\n let connections = getConnectionsData()\n \n if(connections.length > 0){\n // We have connections in database\n const updateArrowsCounter = connections.length\n for (let i = 0; i < updateArrowsCounter; i ++) {\n // Need to go through each connection and check if it placed on selected artboard\n firstObject = document.getLayerWithID(connections[i].firstObject)\n secondObject = document.getLayerWithID(connections[i].secondObject)\n if (firstObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){\n if (secondObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){\n deleteLine(connections[i].line)\n newConnectionsData = deleteConnectionFromData(i)\n }\n }\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, \"arrowConnections\", docData, pluginKey)\n sketch.UI.message(\"All arrows from selected artboard are deleted\")\n } else {\n // We don't have any connections to update\n sketch.UI.message(\"There is nothing to delete\")\n }\n } else {\n sketch.UI.message(\"Please select one artboard\")\n }\n}\n\nexport function deleteSelectedArrows(context) {\n let selection = context.selection\n let firstObject, secondObject\n\n // Need to delete all the arrows only from selected artboard\n if(selection.count() == 2){\n\n for(let g = 0; g < selection.count(); g++) {\n\n if(selection[g].objectID() != selection[0].objectID()){ // It will never check 3rd connection\n let connections = getConnectionsData()\n \n let connectionIndex = findConnectionData(selection[0].objectID(), selection[g].objectID(), connections)\n \n if(connectionIndex != null){\n // We have connections in database\n deleteLine(connections[connectionIndex].line)\n newConnectionsData = deleteConnectionFromData(connectionIndex)\n const updateArrowsCounter = connections.length\n for (let i = 0; i < updateArrowsCounter; i ++) {\n // Need to go through each connection and check if it placed on selected artboard\n firstObject = document.getLayerWithID(connections[i].firstObject)\n secondObject = document.getLayerWithID(connections[i].secondObject)\n if(firstObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){\n if(secondObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){\n deleteLine(connections[i].line)\n newConnectionsData = deleteConnectionFromData(i)\n }\n }\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, \"arrowConnections\", docData, pluginKey)\n sketch.UI.message(\"All arrows from selected layers are deleted ✌️\")\n }\n }\n }\n } else {\n sketch.UI.message(\"Select two layers, please 🧐\")\n }\n}\n\nexport function settings(context) {\n let alert = COSAlertWindow.new()\n const viewWidth = 300\n const viewHeight = 450\n \n // Alert window settings\n alert = alertSetup(alert, viewWidth, viewHeight)\n let view = NSView.alloc().initWithFrame(NSMakeRect(0, 0, viewWidth, viewHeight))\n alert.addAccessoryView(view)\n\n // Label: Arrow Style\n let arrowStyleLabel = alertLabel(\"Arrow Style\", true, -1, viewHeight-40, 280, 40)\n view.addSubview(arrowStyleLabel)\n\n // Select: Arrow Style\n let arrowStylingField = NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 40, 300, 20));\n setActiveStyleSetting(arrowStylingField)\n view.addSubview(arrowStylingField)\n\n // Label: Arrow Style Info\n let arrowStyleInfoLabel = alertLabel(\"Add layer style to your document that will contain $arrow name and you will be able to specify it here \", false, -1, viewHeight-80, 300, 40)\n view.addSubview(arrowStyleInfoLabel)\n\n\n // Label: Arrow Type\n let arrowTypeLabel = alertLabel(\"Arrow Type\", true, -1, viewHeight-130, 280, 40)\n view.addSubview(arrowTypeLabel)\n\n // Select: Arrow Type\n let arrowTypeField = NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 130, 300, 20));\n setActiveTypeSetting(arrowTypeField)\n view.addSubview(arrowTypeField)\n\n // Label: Arrow Type Info\n let arrowTypeInfoLabel = alertLabel(\"Select one of the arrow types. Angled is used by default\", false, -1, viewHeight-170, 300, 40)\n view.addSubview(arrowTypeInfoLabel)\n\n\n // Label: Arrow Spacing\n let arrowSpacingLabel = alertLabel(\"Arrow Spacing\", true, -1, viewHeight - 200, 330, 20)\n view.addSubview(arrowSpacingLabel)\n\n // Label: Arrow Spacing PX\n let arrowSpacingPxLabel = alertLabel(\"px\", true, 90, viewHeight - 220, 330, 20)\n view.addSubview(arrowSpacingPxLabel)\n\n // Input: Arrow Spacing\n let arrowSpacingField = NSTextField.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 220, 80, 20))\n var formatter = NSNumberFormatter.alloc().init().autorelease()\n arrowSpacingField.setStringValue(String(Settings.settingForKey(\"arrowSpacing\")))\n arrowSpacingField.setFormatter(formatter)\n view.addSubview(arrowSpacingField)\n\n // Stepper: Arrow Spacing\n let arrowSpacingStepper = NSStepper.alloc().initWithFrame(NSMakeRect(70, viewHeight - 220, 20, 20));\n arrowSpacingStepper.setMaxValue(1000)\n arrowSpacingStepper.setMinValue(0)\n arrowSpacingStepper.setValueWraps(false)\n arrowSpacingStepper.setAutorepeat(true)\n arrowSpacingStepper.setCOSJSTargetFunction(function(sender){\n var value = 0 + sender.integerValue()\n arrowSpacingField.setStringValue(String(value))\n })\n \n view.addSubview(arrowSpacingStepper)\n // view.addSubview(formatter)\n \n // Label: Auto Spacing Info\n let arrowSpacingInfoLabel = alertLabel(\"The second layer will be moved closer based on the value provided here. Keep it 0 if you don't want to have auto spacing feature \", false, -1, viewHeight-285, 300, 60)\n view.addSubview(arrowSpacingInfoLabel)\n\n // Label: Other Settings\n let otherSettingsLabel = alertLabel(\"Other Settings\", true, -1, viewHeight-330, 280, 40)\n view.addSubview(otherSettingsLabel)\n\n // Checkbox: Auto-Align\n let checkbox = alertCheckbox(\"Second layer auto-align\", false, -1, viewHeight-340, 260, 40)\n view.addSubview(checkbox)\n\n // Label: Auto-Align Info\n let autoAlignInfoLabel = alertLabel(\"Align the second layer for 5px misalignment with the first one\", false, -1, viewHeight-370, 280, 40)\n view.addSubview(autoAlignInfoLabel)\n\n // Label: Plugin Info\n let pluginInfoLabel = alertLabel(\"Made by @faridSabitov with the support of EPAM.com ❤️\", true, -1, viewHeight-420, 280, 40)\n view.addSubview(pluginInfoLabel)\n\n\n // Need to check if style is still available\n\n // Show modal and get the results\n let modalResponse = alert.runModal()\n\n if(modalResponse == NSAlertFirstButtonReturn){\n // When user clicks on \"Update Settings\"\n // Need to save all this results into the Plugin Settings\n context.command.setValue_forKey_onLayer_forPluginIdentifier(alert.views()[0].subviews()[1].title(), \"arrowStyle\", docData, pluginKey)\n Settings.setSettingForKey(\"arrowType\", alert.views()[0].subviews()[4].title())\n Settings.setSettingForKey(\"arrowSpacing\", alert.views()[0].subviews()[8].intValue())\n Settings.setSettingForKey(\"autoAlign\", alert.views()[0].subviews()[12].state())\n UI.message(\"Settings are updated 🚀\")\n }\n}\n\nexport function onLayersMoved(context) {\n sketch.UI.message(\"Please select more than two layers\")\n const action = context.actionContext \n}\n\nexport function panel(context) {\n let ControlBar\n ControlBar = NSPanel.alloc().init();\n ControlBar.setStyleMask(NSTitledWindowMask + NSFullSizeContentViewWindowMask);\n // ControlBar.setBackgroundColor(NSColor.colorWithRed_green_blue_alpha(0.99, 0.99, 0.99, 1));\n ControlBar.setTitleVisibility(NSWindowTitleHidden);\n ControlBar.setTitlebarAppearsTransparent(true);\n ControlBar.setFrame_display(NSMakeRect(0, 0, 720, 50), false);\n ControlBar.setMovableByWindowBackground(true);\n ControlBar.setHasShadow(true);\n ControlBar.setLevel(NSFloatingWindowLevel);\n\n // contentView.addSubview(closeButton)\n ControlBar.center();\n ControlBar.makeKeyAndOrderFront(nil);\n\n// getImage = function(size, name){\n// var isRetinaDisplay = (NSScreen.mainScreen().backingScaleFactor() > 1)? true: false;\n// suffix = (isRetinaDisplay)? \"@2x\": \"\",\n// imageURL = NSURL.fileURLWithPath(self.pluginResources + \"/icons/\" + name + suffix + \".png\"),\n// image = NSImage.alloc().initWithContentsOfURL(imageURL);\n// return image\n// },\n// addButton = function(rect, name, callAction){\n// var button = NSButton.alloc().initWithFrame(rect),\n// image = getImage(rect.size, name);\n\n// button.setImage(image);\n// button.setBordered(false);\n// button.sizeToFit();\n// button.setButtonType(NSMomentaryChangeButton);\n// button.setCOSJSTargetFunction(callAction);\n// button.setAction(\"callAction:\");\n// return button;\n// },\n// addImage = function(rect, name){\n// var view = NSImageView.alloc().initWithFrame(rect),\n// image = getImage(rect.size, name);\n// view.setImage(image);\n// return view;\n// },\n\n// closeButton = addButton( NSMakeRect(20, 10, 30, 30), \"close-control\",\n// function(sender){\n// coscript.setShouldKeepAround(false);\n// threadDictionary.removeObjectForKey(identifier);\n// ControlBar.close();\n// }),\n\n\n\n}\n\n//\n// Functions\n//\n\nfunction updateArrow(firstObjectID, secondObjectID, style, type, direction, lineID, connectionIndex) {\n // There might be a situation, when user deleted current group or current group stays on another artboard => In that case need to create another group\n // Need to check if we have the layers with such IDs\n let firstObject = document.getLayerWithID(firstObjectID)\n let secondObject = document.getLayerWithID(secondObjectID)\n\n // Need to delete data first, because we will have a new line\n deleteLine(lineID)\n newConnectionsData = deleteConnectionFromData(connectionIndex)\n\n if(firstObject && secondObject){\n // If we have all the objects, we can recreate the line\n createArrow(firstObjectID, secondObjectID, style, type, direction)\n } \n}\n\nfunction createArrow(firstObjectID, secondObjectID, style, type, direction) {\n // Process of creating new connection \n let localDirection, localStyle, localType\n if(direction == \"Auto\"){\n // If direction is auto, we need to specify direction ourselves\n localDirection = getDirection(firstObjectID, secondObjectID)\n } else {\n localDirection = direction\n }\n\n if(type == null){\n localType = Settings.settingForKey(\"arrowType\") \n } else {\n localType = type\n }\n \n // log(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey))\n localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey))\n \n if(style != null){\n // if we updating connection with previously created objects\n if(getLayerStyles(style) != null && style != \"Default Style\"){\n localStyle = style\n } else {\n localStyle = \"Default Style\"\n }\n } else {\n // We don't have any data from the plugin data\n if(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey)){\n localStyle = context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey)\n } else {\n localStyle = \"Default Style\"\n }\n \n }\n \n \n updateSpacing(firstObjectID, secondObjectID, localDirection)\n autoAlignLayer(firstObjectID, secondObjectID, localDirection)\n let currentGroup = checkForArrowGroup()\n let line = drawLine(firstObjectID, secondObjectID, localStyle, localType, localDirection, currentGroup)\n addToArrowsGroup(line, currentGroup)\n\n\n // if(localStyle != \"Default Style\"){\n // localStyle = localStyle[0].name()\n // }\n\n // Storage for current connection\n let connection = {\n firstObject : firstObjectID,\n secondObject : secondObjectID,\n style : localStyle,\n type : localType,\n direction: localDirection,\n line : line.objectID()\n }\n // Need to save this data to the global array\n newConnectionsData.push(connection)\n}\n\nfunction checkForArrowGroup() {\n let currentGroup = null\n // Checking all the groups that we have\n for(let i = 0; i < currentParentGroup.layers().count(); i++){\n if(currentParentGroup.layers()[i].name() == \"Arrows\") {\n // If we already have \"Arrow\" group we need to save it's folder\n currentGroup = currentParentGroup.layers()[i]\n refactorLines(currentGroup)\n } \n }\n return currentGroup\n}\n\nfunction getDirection(firstObjectID, secondObjectID){\n // Get direction from the source object\n const firstObject = document.getLayerWithID(firstObjectID)\n const secondObject = document.getLayerWithID(secondObjectID)\n const firstObjectMidX = firstObject.frame.x+firstObject.frame.width/2\n const firstObjectMidY = firstObject.frame.y+firstObject.frame.height/2\n const secondObjectMidX = secondObject.frame.x+secondObject.frame.width/2\n const secondObjectMidY = secondObject.frame.y+secondObject.frame.height/2\n\n const diffX = firstObjectMidX - secondObjectMidX\n const diffY = firstObjectMidY - secondObjectMidY\n const absDiffX = Math.abs(diffX) \n const absDiffY = Math.abs(diffY)\n let direction\n\n if(secondObjectMidX > firstObjectMidX){\n // Right Half\n if(secondObjectMidY > firstObjectMidY){\n // Bottom quarter\n if(diffX > diffY) {\n direction = \"Down\"\n } else {\n direction = \"Right\"\n }\n } else {\n // Top quarter\n if(absDiffX > absDiffY) {\n direction = \"Right\"\n } else {\n direction = \"Up\"\n }\n }\n } else {\n // Left Half\n if(secondObjectMidY > firstObjectMidY){\n // Bottom quarter\n if(absDiffX > absDiffY) {\n direction = \"Left\"\n } else {\n direction = \"Down\"\n }\n } else {\n // Top quarter\n if(diffX > diffY) {\n direction = \"Left\"\n } else {\n direction = \"Up\"\n }\n }\n }\n return direction\n}\n\nfunction drawLine(firstObjectID, secondObjectID, style, type, direction, currentGroup){\n let firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, middlePosX, middlePosY, diffX, diffY, line\n let firstObject = document.getLayerWithID(firstObjectID)\n let secondObject = document.getLayerWithID(secondObjectID)\n\n let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup})\n let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup})\n\n if(currentGroup){\n //if we already have a group, need to specify the difference\n diffX = currentGroup.frame().x()\n diffY = currentGroup.frame().y()\n } else {\n diffX = 0\n diffY = 0\n }\n\n // Drawing a line\n let path = NSBezierPath.bezierPath()\n\n if(type == \"Angled\" || type == null){\n // Based on direction, we need to specify connection points\n \n if(direction == \"Up\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX\n firstLayerPosY = firstObjectAbsPos.y-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX\n secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY\n\n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(firstLayerPosX,middlePosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,middlePosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n if(direction == \"Right\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX\n firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x-diffX\n secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY\n \n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(middlePosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(middlePosX,secondLayerPosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n if(direction == \"Down\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX\n firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX\n secondLayerPosY = secondObjectAbsPos.y-diffY\n\n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n \n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(firstLayerPosX,middlePosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,middlePosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n if(direction == \"Left\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x-diffX\n firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX\n secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY\n\n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(middlePosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(middlePosX,secondLayerPosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n //TODO: Provide a separate file with all the stylings\n\n // Painting the line\n line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path))\n\n\n // Making middle points rounded\n let points = line.layers().firstObject().points()\n points[1].cornerRadius = 20\n points[2].cornerRadius = 20\n\n // Providing Settings for the arrow\n line.setName(\"Arrow\")\n }\n\n if(type == \"Straight\"){\n // Based on direction, we need to specify connection points\n if(direction == \"Up\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX\n firstLayerPosY = firstObjectAbsPos.y-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX\n secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY\n\n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n if(direction == \"Right\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX\n firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x-diffX\n secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY\n \n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n if(direction == \"Down\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX\n firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX\n secondLayerPosY = secondObjectAbsPos.y-diffY\n\n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n \n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n if(direction == \"Left\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x-diffX\n firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX\n secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY\n\n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n }\n\n // Painting the line\n line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path))\n \n // Providing Settings for the arrow\n line.setName(\"Arrow\")\n }\n\n if(type == \"Curved\"){\n // Based on direction, we need to specify connection points\n if(direction == \"Up\"){\n // First Layer Position Start Point Position\n firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX\n firstLayerPosY = firstObjectAbsPos.y-diffY\n\n // Second Layer Position End Point Position\n secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX\n secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY\n\n // Middle Points\n middlePosX = (firstLayerPosX + secondLayerPosX)/2\n middlePosY = (firstLayerPosY + secondLayerPosY)/2\n\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY))\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY))\n\n // Painting the line\n line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path))\n let points = line.layers().firstObject().points()\n\n points[0].curveMode = points[1].curveMode = 4\n points[0].hasCurveFrom = points[1].hasCurveTo = true\n\n if(firstLayerPosX -6 && diff < 6){childObject.frame.y = childObject.frame.y + diff}\n }\n \n if(direction == \"Down\" || direction == \"Up\"){\n sourceMidX = sourceObject.frame.x + sourceObject.frame.width/2\n childMidX = childObject.frame.x + childObject.frame.width/2\n diff = sourceMidX - childMidX\n if(diff > -6 && diff < 6){childObject.frame.x = childObject.frame.x + diff}\n }\n }\n }\n}\n\nfunction defineSourceObject(firstObjectID, secondObjectID, direction){\n let firstObject = document.getLayerWithID(firstObjectID)\n let secondObject = document.getLayerWithID(secondObjectID)\n let sourceObjectID\n\n if(direction == \"Auto\"){\n sourceObjectID = firstObject.id\n }\n\n if(direction == \"Right\"){\n if(firstObject.frame.x <= secondObject.frame.x){\n sourceObjectID = firstObject.id\n } else {\n sourceObjectID = secondObject.id\n }\n }\n\n if(direction == \"Down\"){\n if(firstObject.frame.y <= secondObject.frame.y){\n sourceObjectID = firstObject.id\n } else {\n sourceObjectID = secondObject.id\n }\n }\n\n if(direction == \"Left\"){\n if(firstObject.frame.x <= secondObject.frame.x){\n sourceObjectID = secondObject.id\n } else {\n sourceObjectID = firstObject.id\n }\n }\n\n if(direction == \"Up\"){\n if(firstObject.frame.y <= secondObject.frame.y){\n sourceObjectID = secondObject.id\n } else {\n sourceObjectID = firstObject.id\n }\n }\n\n return sourceObjectID\n}\n\nfunction getSourceObjectFromSelection(selection, direction){\n let sourceObjectID = selection.firstObject().objectID()\n \n if(direction != \"Auto\"){\n for(let g = 0; g < selection.count(); g++) {\n sourceObjectID = defineSourceObject(sourceObjectID, selection[g].objectID(), direction)\n }\n } else {\n sourceObjectID = defineSourceObject(sourceObjectID, selection[0].objectID(), direction)\n }\n \n return sourceObjectID\n}\n\nfunction confirmationAlert(alert, message) {\n // Title\n alert.setMessageText(\"Would you like to delete all the arrows from \"+message)\n\n // Creating dialog buttons\n alert.addButtonWithTitle(\"Delete Arrows\")\n alert.addButtonWithTitle(\"Cancel\")\n \n // Creating the view\n const viewWidth = 300\n const viewHeight = 40\n \n let view = NSView.alloc().initWithFrame(NSMakeRect(0, 0, viewWidth, viewHeight))\n alert.addAccessoryView(view)\n \n // Label\n var infoLabel = NSTextField.alloc().initWithFrame(NSMakeRect(-1, viewHeight - 40, 330, 40))\n \n infoLabel.setStringValue(\"ℹ️ You can select layers, artboards to delete all the arrows from selected one only\")\n infoLabel.setSelectable(false)\n infoLabel.setDrawsBackground(false)\n infoLabel.setBezeled(false)\n \n view.addSubview(infoLabel)\n\n return alert\n}\n\nfunction alertSetup(alert, viewWidth, viewHeight){\n // Title\n alert.setMessageText(\"Arrow Plugin Settings\")\n \n // Creating dialog buttons\n alert.addButtonWithTitle(\"Update Settings\")\n alert.addButtonWithTitle(\"Cancel\")\n \n return alert\n}\n\nfunction alertLabel(message, state, x, y, width, height){\n let infoLabel = NSTextField.alloc().initWithFrame(NSMakeRect(x, y, width, height))\n\n infoLabel.setStringValue(message)\n infoLabel.setSelectable(false)\n infoLabel.setDrawsBackground(false)\n infoLabel.setBezeled(false)\n\n if(state == false){\n infoLabel.textColor = NSColor.disabledControlTextColor()\n }\n\n return infoLabel\n}\n\nfunction alertCheckbox(message, state, x, y, width, height){\n let checkbox = NSButton.alloc().initWithFrame(NSMakeRect(x, y, width, height))\n\n checkbox.setButtonType(NSSwitchButton)\n checkbox.setBezelStyle(0)\n checkbox.setTitle(message)\n if(Settings.settingForKey(\"autoAlign\")){\n let currentState = Settings.settingForKey(\"autoAlign\") \n checkbox.setState(currentState)\n } else {\n checkbox.setState(state)\n }\n\n return checkbox\n}\n\nfunction getLayerStyles(name) {\n let allStyles = docData.allLayerStyles()\n let keyword = \"$arrow\"\n let styles = []\n if(name == null) {\n for(let i = 0; i < allStyles.count(); i++){\n if(allStyles[i].name().includes(keyword)){\n styles.push(allStyles[i]);\n }\n }\n } else {\n // Searching only for name\n for(let i = 0; i < allStyles.count(); i++){\n if(allStyles[i].name() == name){\n styles.push(allStyles[i]);\n }\n }\n }\n\treturn styles\n}\n\nfunction start(context, direction){\n let selection = context.selection\n let localDirection\n if(direction == null){localDirection = arrowDirectionSetting} else {localDirection = direction}\n\n if(selection.count() > 1){\n // Need to find source object by ID first\n let sourceObjectID = getSourceObjectFromSelection(selection, direction)\n let currentConnectionsData = newConnectionsData\n\n for(let g = 0; g < selection.count(); g++) {\n if(selection[g].objectID() != sourceObjectID){\n // Then need to create or update connection arrow with each selection\n let connectionIndex = findConnectionData(sourceObjectID, selection[g].objectID(), currentConnectionsData)\n if(connectionIndex != null){\n // Because this is creating flow, we need to take the direction from user settings\n updateArrow(sourceObjectID, selection[g].objectID(), null, null, localDirection, currentConnectionsData[connectionIndex].line, connectionIndex)\n sketch.UI.message(\"Current connection is updated 🚀\")\n } else {\n // There is no connection with this two objects in our database\n createArrow(sourceObjectID, selection[g].objectID(), null, null, localDirection)\n sketch.UI.message(\"New connection is created 🚀\")\n }\n }\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, \"arrowConnections\", docData, pluginKey)\n } else {\n // When user didn't select anything\n sketch.UI.message(\"Please select more than two layers\")\n }\n}\n\n// {\n// \"script\": \"./script.js\",\n// \"name\" : \"onLayersMoved\",\n// \"handlers\" : {\n// \"actions\": {\n// \"LayersMoved.finish\": \"onLayersMoved\"\n// }\n// },\n// \"identifier\" : \"onLayersMoved\"\n// }\n","module.exports = require(\"sketch\");","module.exports = require(\"sketch/dom\");","module.exports = require(\"sketch/settings\");","module.exports = require(\"sketch/ui\");"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://exports/webpack/bootstrap","webpack://exports/./src/createArrow.js","webpack://exports/./src/draw.js","webpack://exports/./src/script.js","webpack://exports/./src/updateArrow.js","webpack://exports/./src/utilities/conditions.js","webpack://exports/./src/utilities/data.js","webpack://exports/./src/utilities/getSourceObject.js","webpack://exports/./src/utilities/groups.js","webpack://exports/./src/utilities/lines.js","webpack://exports/./src/utilities/styling.js","webpack://exports/external \"sketch\"","webpack://exports/external \"sketch/dom\"","webpack://exports/external \"sketch/settings\"","webpack://exports/external \"sketch/ui\""],"names":["Settings","require","createArrow","firstObjectID","secondObjectID","style","type","direction","conditionID","isCondition","document","docData","localDirection","getDirection","updateSpacing","autoAlignLayer","arrow","drawConnection","connection","firstObject","secondObject","condition","line","objectID","getLayerWithID","firstObjectMidX","frame","x","width","firstObjectMidY","y","height","secondObjectMidX","secondObjectMidY","diffX","diffY","absDiffX","Math","abs","absDiffY","sourceObjectID","childObjectID","sourceObject","childObject","settingForKey","currentSpacing","sourceMidY","childMidY","sourceMidX","childMidX","diff","UI","currentParentGroup","currentPage","currentArtboard","connectionPos","getConnectionPos","drawAngledLine","firstLayerPosX","firstLayerPosY","middlePosX","middlePosY","secondLayerPosX","secondLayerPosY","drawStraightLine","drawCurvedLine","updateCondition","addCondition","styleLine","addToArrowsGroup","firstObjectAbsPos","changeBasis","from","parent","to","secondObjectAbsPos","currentGroup","checkForGroup","path","NSBezierPath","bezierPath","moveToPoint","NSMakePoint","lineToPoint","MSShapeGroup","layerWithPath","MSPath","pathWithBezierPath","points","layers","cornerRadius","setName","curveMode","hasCurveFrom","hasCurveTo","curveFrom","curveTo","pluginKey","sketch","fromNative","context","documentData","connectionsData","getConnectionsData","createAutoArrow","create","createRightArrow","createDownArrow","createLeftArrow","createUpArrow","createRightArrowWithCondition","createDownArrowWithCondition","createLeftArrowWithCondition","createUpArrowWithCondition","selection","count","class","getSourceObjectFromSelection","connectionIndex","g","String","index","length","push","message","deleteLine","deleteCondition","deleteConnectionFromData","command","setValue_forKey_onLayer_forPluginIdentifier","updateSelectedArrows","update","updateArtboardArrows","updateAllArrows","deleteSelectedArrows","deleteArtboardArrows","deleteAllArrows","level","isUpdate","newConnectionsData","firstObjectArtboard","secondObjectArtboard","updateArrow","i","sketchObject","parentArtboard","log","pluginData","valueForKey_onLayer_forPluginIdentifier","lineID","conditionObject","remove","keyword","libraries","getLibraries","libraryObject","symbolReferences","symbol","getImportableSymbolReferencesForDocument","name","includes","alert","symbolMaster","import","createNewInstance","addToConditionGroup","conGroup","arGroup","arGroupX","arGroupY","fixGeometryWithOptions","id","selectedGroup","dataArray","connectionIndexArray","data","splice","defineSourceObject","groupName","addLayers","Group","group","locked","moveToBack","adjustToFit","lineObject","localStyle","getLayerStyles","ownStyle","sharedStyle","border","addStylePartOfType","color","MSColor","colorWithRGBADictionary","r","b","a","thickness","endMarkerType","allStyles","allLayerStyles","styles"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA,IAAIA,QAAQ,GAAGC,mBAAO,CAAC,wCAAD,CAAtB,C,CAGA;;;AAEO,SAASC,WAAT,CAAqBC,aAArB,EAAoCC,cAApC,EAAoDC,KAApD,EAA2DC,IAA3D,EAAiEC,SAAjE,EAA4EC,WAA5E,EAAyFC,WAAzF,EAAsGC,QAAtG,EAAgHC,OAAhH,EAAyH;AAAG;AACjI,MA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Modules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/script.js\");\n","import sketch from 'sketch';\nimport { drawConnection } from \"./draw.js\";\n\nvar Settings = require('sketch/settings');\n\n\n// Main Function\n\nexport function createArrow(firstObjectID, secondObjectID, style, type, direction, conditionID, isCondition, document, docData) { // Refactored\n let localDirection = direction == \"Auto\" ? getDirection(firstObjectID, secondObjectID, document) : direction;\n\n // Main Operations based on the settings\n updateSpacing(firstObjectID, secondObjectID, localDirection, document);\n autoAlignLayer(firstObjectID, secondObjectID, localDirection, document);\n\n // Making an Arrow \n let arrow = drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, isCondition, document, docData);\n \n // Storage for current connection\n let connection = {\n firstObject : firstObjectID,\n secondObject : secondObjectID,\n style : arrow.style,\n condition : arrow.conditionID,\n isCondition : isCondition,\n type : arrow.type,\n direction: localDirection,\n line : arrow.line.objectID()\n }\n return connection;\n}\n\nfunction getDirection(firstObjectID, secondObjectID, document){ // Refactored\n // Get direction from the source object\n const firstObject = document.getLayerWithID(firstObjectID);\n const secondObject = document.getLayerWithID(secondObjectID);\n const firstObjectMidX = firstObject.frame.x+firstObject.frame.width/2;\n const firstObjectMidY = firstObject.frame.y+firstObject.frame.height/2;\n const secondObjectMidX = secondObject.frame.x+secondObject.frame.width/2;\n const secondObjectMidY = secondObject.frame.y+secondObject.frame.height/2;\n\n const diffX = firstObjectMidX - secondObjectMidX;\n const diffY = firstObjectMidY - secondObjectMidY;\n const absDiffX = Math.abs(diffX);\n const absDiffY = Math.abs(diffY);\n let direction;\n\n if(secondObjectMidX > firstObjectMidX){\n // Right Half\n if(secondObjectMidY > firstObjectMidY){\n // Bottom quarter\n direction = diffX > diffY ? \"Down\" : \"Right\";\n } else {\n // Top quarter\n direction = absDiffX > absDiffY ? \"Right\" : \"Up\";\n }\n } else {\n // Left Half\n if(secondObjectMidY > firstObjectMidY){\n // Bottom quarter\n direction = absDiffX > absDiffY ? \"Left\" : \"Down\";\n } else {\n // Top quarter\n direction = diffX > diffY ? \"Left\" : \"Up\";\n }\n }\n\n return direction;\n}\n\nfunction updateSpacing(sourceObjectID, childObjectID, direction, document){\n let sourceObject = document.getLayerWithID(sourceObjectID);\n let childObject = document.getLayerWithID(childObjectID);\n\n if(Settings.settingForKey(\"arrowSpacing\") && Settings.settingForKey(\"arrowSpacing\") != 0){\n let currentSpacing = Settings.settingForKey(\"arrowSpacing\");\n \n if(direction == \"Right\"){\n childObject.frame.x = sourceObject.frame.x + sourceObject.frame.width + currentSpacing;\n }\n \n if(direction == \"Down\"){\n childObject.frame.y = sourceObject.frame.y + sourceObject.frame.height + currentSpacing;\n }\n \n if(direction == \"Left\"){\n childObject.frame.x = sourceObject.frame.x - childObject.frame.width - currentSpacing;\n }\n \n if(direction == \"Up\"){\n childObject.frame.y = sourceObject.frame.y - childObject.frame.height - currentSpacing;\n }\n }\n}\n\nfunction autoAlignLayer(sourceObjectID, childObjectID, direction, document){\n let sourceObject = document.getLayerWithID(sourceObjectID);\n let childObject = document.getLayerWithID(childObjectID);\n let sourceMidY, childMidY, sourceMidX, childMidX, diff;\n\n if(Settings.settingForKey(\"autoAlign\")){\n if(Settings.settingForKey(\"autoAlign\") == true){\n // If user turned on Auto-Align settings\n \n if(direction == \"Right\" || direction == \"Left\"){\n sourceMidY = sourceObject.frame.y + sourceObject.frame.height/2;\n childMidY = childObject.frame.y + childObject.frame.height/2;\n diff = sourceMidY - childMidY;\n if(diff > -6 && diff < 6){childObject.frame.y = childObject.frame.y + diff;}\n }\n \n if(direction == \"Down\" || direction == \"Up\"){\n sourceMidX = sourceObject.frame.x + sourceObject.frame.width/2;\n childMidX = childObject.frame.x + childObject.frame.width/2;\n diff = sourceMidX - childMidX;\n if(diff > -6 && diff < 6){childObject.frame.x = childObject.frame.x + diff;}\n }\n }\n }\n}","import sketch from 'sketch';\nimport { styleLine } from \"./utilities/styling.js\";\nimport { addCondition, updateCondition } from \"./utilities/conditions.js\";\nimport { checkForGroup, addToArrowsGroup } from \"./utilities/groups.js\";\nlet Settings = require('sketch/settings');\nlet UI = require('sketch/ui') ;\n\n// let document = sketch.fromNative(context.document);\n// let docData = context.document.documentData();\n// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n\n\n// Main Function\n\nexport function drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, isCondition, document, docData){ // Refactored\n // Process of creating new connection \n let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n let firstObject = document.getLayerWithID(firstObjectID);\n let secondObject = document.getLayerWithID(secondObjectID);\n let connectionPos = getConnectionPos(firstObject, secondObject, localDirection, currentParentGroup);\n let connection = {\n line: [], \n conditionID: [],\n type: [],\n style: []\n }\n\n // Type \n connection.type = type == null ? Settings.settingForKey(\"arrowType\") : type;\n if(connection.type == \"Angled\" || connection.type == null){ connection.line = drawAngledLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.middlePosX, connectionPos.middlePosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n if(connection.type == \"Straight\"){ connection.line = drawStraightLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n if(connection.type == \"Curved\"){ connection.line = drawCurvedLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);}\n\n\n // Condition\n if(isCondition == true){\n if(document.getLayerWithID(conditionID)){\n connection.conditionID = updateCondition(conditionID, connectionPos.middlePosX, connectionPos.middlePosY, document, docData);\n } else {\n connection.conditionID = addCondition(\"#con\", connectionPos.middlePosX, connectionPos.middlePosY, document, docData);\n }\n } else {\n connection.conditionID = null;\n }\n \n // Style\n connection.style = styleLine(connection.line, style, docData);\n\n // Add to group\n addToArrowsGroup(connection.line, currentParentGroup);\n \n return connection\n}\n\n// Positions\n\nfunction getConnectionPos(firstObject, secondObject, direction, currentParentGroup){ // Refactored\n\n let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup});\n let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup});\n let currentGroup = checkForGroup(\"Arrows\", currentParentGroup);\n let diffX, diffY;\n \n if(currentGroup){\n diffX = currentGroup.frame().x();\n diffY = currentGroup.frame().y();\n } else {\n diffX = 0;\n diffY = 0;\n }\n \n let connectionPos = {\n firstLayerPosX: null,\n firstLayerPosY: null, \n secondLayerPosX: null, \n secondLayerPosY: null, \n middlePosX: null, \n middlePosY: null\n }\n \n // Getting all the positions\n if(direction == \"Up\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Right\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Down\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n \n if(direction == \"Left\"){\n // First Layer Position Start Point Position\n connectionPos.firstLayerPosX = firstObjectAbsPos.x-diffX;\n connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY;\n \n // Second Layer Position End Point Position\n connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX;\n connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY;\n \n // Middle Points\n connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2;\n connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2;\n }\n\n return connectionPos\n}\n\n// Drawing Types\n\nfunction drawAngledLine(firstLayerPosX, firstLayerPosY, middlePosX, middlePosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n \n if(direction == \"Up\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Right\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Down\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n if(direction == \"Left\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY));\n path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY));\n }\n \n let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n let points = line.layers().firstObject().points();\n points[1].cornerRadius = 20;\n points[2].cornerRadius = 20;\n line.setName(\"Angled Arrow\");\n \n return line;\n}\n\nfunction drawStraightLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n \n if(direction == \"Up\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Right\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Down\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n if(direction == \"Left\"){\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n }\n \n let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n line.setName(\"Straight Arrow\");\n \n return line;\n}\n\nfunction drawCurvedLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored\n let path = NSBezierPath.bezierPath();\n let line;\n \n if(direction == \"Up\"){\n // Connecting points\n path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY));\n path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY));\n \n // Painting the line\n line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path));\n let points = line.layers().firstObject().points();\n \n points[0].curveMode = 4;\n points[1].curveMode = 4;\n points[0].hasCurveFrom = true;\n points[1].hasCurveTo = true;\n \n if(firstLayerPosX 1 && selection[0].class() != \"MSArtboardGroup\"){\n let sourceObjectID = getSourceObjectFromSelection(selection, direction);\n let connectionIndex = []\n for(let g = 0; g < selection.count(); g++) {\n if(selection[g].objectID() != sourceObjectID){\n\n let firstObjectID = String(sourceObjectID);\n let secondObjectID = String(selection[g].objectID());\n let create = true\n let index\n\n if(connectionsData.length > 0){\n for (let y = 0; y < connectionsData.length; y++) {\n if ((firstObjectID == connectionsData[y].firstObject || firstObjectID == connectionsData[y].secondObject) && (secondObjectID == connectionsData[y].firstObject || secondObjectID == connectionsData[y].secondObject)) {\n // We have this connection and need to update\n create = false;\n index = y;\n connectionIndex.push(y);\n }\n }\n } \n \n if(create){\n // Create\n let connection = createArrow(firstObjectID, secondObjectID, null, null, direction, null, isCondition, document, docData);\n connectionsData.push(connection);\n sketch.UI.message(\"New connection is created 🚀\");\n } else {\n // Update\n deleteLine(connectionsData[index].line, document);\n if (!isCondition) { \n deleteCondition(connectionsData[index].condition, document) \n }\n\n let connection = createArrow(firstObjectID, secondObjectID, null, null, direction, connectionsData[index].condition, isCondition, document, docData);\n connectionsData.push(connection);\n sketch.UI.message(\"Current connection is updated 🤘\");\n }\n }\n }\n if(connectionIndex.length > 0){\n // Update data if there was changes\n connectionsData = deleteConnectionFromData(connectionIndex, connectionsData);\n }\n context.command.setValue_forKey_onLayer_forPluginIdentifier(connectionsData, \"arrowConnections\", docData, pluginKey);\n } else {\n // When user didn't select anything\n sketch.UI.message(\"Please select more than two layers. Artboards are coming soon 🥳\");\n }\n}\n\n \n//\n// Plugin Incoming Commands - Update and Delete\n//\n\nexport function updateSelectedArrows(context) {update(context, 1, true);}\nexport function updateArtboardArrows(context) {update(context, 2, true);}\nexport function updateAllArrows(context) {update(context, 3, true);}\nexport function deleteSelectedArrows(context) {update(context, 1, false);}\nexport function deleteArtboardArrows(context) {update(context, 2, false);}\nexport function deleteAllArrows(context) {update(context, 3, false);}\n\nexport function update(context, level, isUpdate) {\n // 1 - selection level\n // 2 - artboard level\n // 3 - document level\n let newConnectionsData = [];\n let selection = context.selection;\n let firstObjectArtboard;\n let secondObjectArtboard;\n\n\n if (connectionsData.length > 0) {\n \n if (level == 3) {\n if(isUpdate){\n newConnectionsData = updateArrow(connectionsData[i].firstObject, connectionsData[i].secondObject, connectionsData[i].style, connectionsData[i].type, connectionsData[i].direction, connectionsData[i].line, connectionsData[i].condition, i);\n sketch.UI.message(\"All arrows are updated\");\n } else {\n for (let i = 0; i < connectionsData.length; i++) {\n deleteLine(connectionsData[i].line, document);\n deleteCondition(connectionsData[i].condition, document) \n newConnectionsData = null;\n }\n }\n }\n if (level == 2) {\n\n\n if(isUpdate){\n // Need to update\n } else {\n for (let i = 0; i < connectionsData.length; i++) {\n if(selection[0].class() == \"MSArtboardGroup\") {\n firstObjectArtboard = document.getLayerWithID(connectionsData[i].firstObject);\n firstObjectArtboard = firstObjectArtboard.sketchObject.parentArtboard().objectID();\n if(firstObjectArtboard == selection[0].objectID()){\n deleteLine(connectionsData[i].line, document);\n deleteCondition(connectionsData[i].condition, document);\n } else {\n newConnectionsData.push(connectionsData[i]);\n }\n } else {\n sketch.UI.message(\"Please select an artboard\");\n }\n }\n }\n }\n if (level == 1) {\n if(isUpdate){\n // updateArrow(connectionsData[i].firstObject, connectionsData[i].secondObject, connectionsData[i].style, connectionsData[i].type, connectionsData[i].direction, connectionsData[i].line, connectionsData[i].condition, i);\n // sketch.UI.message(\"All arrows are updated\");\n } else {\n for (let i = 0; i < connectionsData.length; i++) {\n if(selection[0].objectID() == connectionsData[i].firstObject) {\n log(\"here\")\n deleteLine(connectionsData[i].line, document);\n deleteCondition(connectionsData[i].condition, document);\n } else {\n newConnectionsData.push(connectionsData[i]);\n }\n }\n newConnectionsData = null\n sketch.UI.message(\"All arrows are deleted\");\n }\n }\n sketch.UI.message(\"All arrows are updated 🚀\");\n \n \n // let connection = createArrow(sourceObjectID, selection[g].objectID(), null, null, direction, null, isCondition, document, docData);\n // connectionsData.push(connection);\n context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, \"arrowConnections\", docData, pluginKey);\n } else {\n sketch.UI.message(\"There is no arrows\");\n }\n}\n\n// const track = require(\"sketch-module-google-analytics\")\n// track(\"UA-138226597-1\", \"event\", {\n// ec: \"command\", \n// ea: \"create\", \n// ev: \"my-command\"\n// });\n\n\n\n\n\n","import sketch from 'sketch';\nimport { getConnectionsData, deleteConnectionFromData} from \"./utilities/data.js\"\nimport { deleteLine } from \"./utilities/lines.js\"\n\nlet UI = require('sketch/ui') ;\nvar Settings = require('sketch/settings');\nconst pluginKey = \"flowArrows\";\nlet document = sketch.fromNative(context.document);\nlet docData = context.document.documentData();\nlet pluginData = context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowConnections\", docData, pluginKey);\nlet currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); // TODO: Might be a problem for multiple artboards\nlet connectionsData = getConnectionsData(docData);\n\n\n\nexport function updateArrow(firstObjectID, secondObjectID, style, type, direction, lineID, conditionID, isCondition, connectionIndex) {\n let firstObject = document.getLayerWithID(firstObjectID);\n let secondObject = document.getLayerWithID(secondObjectID);\n let conditionObject = document.getLayerWithID(conditionID);\n let connection = [];\n\n deleteLine(lineID);\n\n if(conditionID && !isCondition){\n if(conditionObject){conditionObject.remove();}\n }\n \n connectionsData = deleteConnectionFromData(connectionIndex);\n\n if(firstObject && secondObject){\n connection = createArrow(\n connectionsData[connectionIndex[x]].firstObject, \n connectionsData[connectionIndex[x]].secondObject, \n connectionsData[connectionIndex[x]].style,\n connectionsData[connectionIndex[x]].type, \n connectionsData[connectionIndex[x]].direction, \n connectionsData[connectionIndex[x]].condition, \n connectionsData[connectionIndex[x]].isCondition,\n document, \n docData\n );\n }\n\n return connection;\n}","import sketch from 'sketch';\nimport { addToConditionGroup, checkForGroup } from \"./groups.js\";\nlet Settings = require('sketch/settings');\nlet UI = require('sketch/ui') ;\n\n// let docData = context.document.documentData();\n// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n\nexport function addCondition(keyword, x, y, document, docData) {\n let libraries = sketch.getLibraries();\n let libraryObject, symbolReferences, symbol;\n let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n\n for (let g = 0; g < libraries.length; g++) {\n symbolReferences = libraries[g].getImportableSymbolReferencesForDocument(\n document\n );\n for (let i = 0; i < symbolReferences.length; i++) {\n if (symbolReferences[i].name.includes(keyword)) {\n libraryObject = symbolReferences[i];\n }\n }\n }\n\n if (libraryObject == null) {\n symbol = null;\n UI.alert(\n \"Condition symbol is not found\",\n 'If you would like to add arrows with specific conditions, you need to specify them in your libraries. You can download the library that works well with the plugin by going into Plugins -> Connection Arrows -> Get Free Library. Conditions are taken from the library based on their names. Make sure to name symbol as \"#condition\" so it will be added here'\n );\n } else {\n let symbolMaster = libraryObject.import();\n symbol = symbolMaster.createNewInstance();\n symbol = addToConditionGroup(symbol, x, y, currentParentGroup);\n }\n return symbol;\n}\n\nexport function updateCondition(conditionID, x, y, document, docData) {\n let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n let condition = document.getLayerWithID(conditionID);\n let conGroup = checkForGroup(\"Conditions\", currentParentGroup);\n let arGroup = checkForGroup(\"Arrows\", currentParentGroup);\n let arGroupX = arGroup != null ? arGroup.frame().x() : 0;\n let arGroupY = arGroup != null ? arGroup.frame().y() : 0;\n\n if (conGroup) {\n condition.frame.x =\n x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX);\n condition.frame.y =\n y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY);\n conGroup.fixGeometryWithOptions(1);\n } else {\n condition.frame.x = x - condition.frame.width / 2;\n condition.frame.y = y - condition.frame.height / 2;\n }\n return condition.id;\n}\n\nexport function deleteCondition(conditionID, document) {\n let conditionObject = document.getLayerWithID(conditionID);\n let selectedGroup;\n if(conditionObject){\n selectedGroup = conditionObject.parent;\n conditionObject.remove();\n if(selectedGroup.layers.length == 0){\n selectedGroup.remove();\n }\n }\n }\n \n","import sketch from 'sketch';\n\nlet UI = require('sketch/ui') ;\nvar Settings = require('sketch/settings');\n\nconst pluginKey = \"flowArrows\";\n\n\nexport function getConnectionsData(docData) {\n let pluginData = context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowConnections\", docData, pluginKey);\n let dataArray = [];\n\n if (pluginData) {\n for (let i = 0; i < pluginData.length; i++) {\n dataArray.push(pluginData[i]);\n }\n }\n return dataArray;\n}\n\nexport function deleteConnectionFromData(connectionIndexArray, data){\n if(data){\n for (let i = connectionIndexArray.length -1; i >= 0; i--) {\n data.splice(connectionIndexArray[i],1);\n }\n }\n return data;\n}\n","import sketch from 'sketch';\nlet document = sketch.fromNative(context.document);\nlet docData = context.document.documentData();\nlet currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n\n\nexport function getSourceObjectFromSelection(selection, direction){\n let sourceObjectID = selection.firstObject().objectID();\n \n if(direction != \"Auto\"){\n for(let g = 0; g < selection.count(); g++) {\n sourceObjectID = defineSourceObject(sourceObjectID, selection[g].objectID(), direction);\n }\n }\n return sourceObjectID;\n}\n\nfunction defineSourceObject(firstObjectID, secondObjectID, direction){\n \n let firstObject = document.getLayerWithID(firstObjectID);\n let secondObject = document.getLayerWithID(secondObjectID);\n let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup});\n let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup});\n let sourceObjectID;\n\n if(direction == \"Right\"){\n if(firstObjectAbsPos.x <= secondObjectAbsPos.x){ // We need to get the doc position\n sourceObjectID = firstObject.id;\n } else {\n sourceObjectID = secondObject.id;\n }\n }\n\n if(direction == \"Down\"){\n if(firstObject.y <= secondObjectAbsPos.y){\n sourceObjectID = firstObject.id;\n } else {\n sourceObjectID = secondObject.id;\n }\n }\n\n if(direction == \"Left\"){\n if(firstObjectAbsPos.x <= secondObjectAbsPos.x){\n sourceObjectID = secondObject.id;\n } else {\n sourceObjectID = firstObject.id;\n }\n }\n\n if(direction == \"Up\"){\n if(firstObjectAbsPos.y <= secondObjectAbsPos.y){\n sourceObjectID = secondObject.id;\n } else {\n sourceObjectID = firstObject.id;\n }\n }\n\n return sourceObjectID;\n}","import sketch from 'sketch';\nlet Settings = require('sketch/settings');\nlet UI = require('sketch/ui') ;\n\n// let document = sketch.fromNative(context.document);\n// let docData = context.document.documentData();\n// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage();\n\n\nexport function checkForGroup(groupName, currentParentGroup) { // refactored\n let currentGroup = null;\n \n // Checking all the groups that we have\n for(let i = 0; i < currentParentGroup.layers().count(); i++){\n if(currentParentGroup.layers()[i].name() == groupName) {\n currentGroup = currentParentGroup.layers()[i];\n } \n }\n\n return currentGroup;\n}\n\nexport function addToArrowsGroup(line, currentParentGroup){\n let currentGroup = checkForGroup(\"Arrows\", currentParentGroup);\n if(currentGroup){\n currentGroup.addLayers([line]);\n currentGroup.fixGeometryWithOptions(1);\n } else {\n let Group = require('sketch/dom').Group;\n let group = new Group({\n parent: currentParentGroup,\n name: 'Arrows',\n locked: true,\n layers: [line]\n });\n group.moveToBack();\n group.adjustToFit();\n }\n}\n\nexport function addToConditionGroup(condition, x, y, currentParentGroup) {\n let conGroup = checkForGroup(\"Conditions\", currentParentGroup);\n let arGroup = checkForGroup(\"Arrows\", currentParentGroup);\n \n let arGroupX = arGroup != null ? arGroup.frame().x() : 0;\n let arGroupY = arGroup != null ? arGroup.frame().y() : 0;\n\n if (conGroup) {\n condition.frame.x =\n x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX);\n condition.frame.y =\n y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY);\n condition.parent = conGroup;\n conGroup.fixGeometryWithOptions(1);\n } else {\n condition.frame.x = x - condition.frame.width / 2 + arGroupX;\n condition.frame.y = y - condition.frame.height / 2 + arGroupY;\n let Group = require(\"sketch/dom\").Group;\n let group = new Group({\n parent: currentParentGroup,\n name: \"Conditions\",\n layers: [condition]\n });\n group.moveToBack();\n group.adjustToFit();\n }\n return condition.id;\n }","import sketch from 'sketch';\nlet UI = require('sketch/ui');\n\nexport function deleteLine(lineID, document){\n let lineObject = document.getLayerWithID(lineID);\n let selectedGroup;\n if(lineObject){\n selectedGroup = lineObject.parent;\n lineObject.remove();\n if(selectedGroup.layers.length == 0){\n selectedGroup.remove();\n }\n }\n}\n","import sketch from 'sketch';\nconst pluginKey = \"flowArrows\";\n// let document = sketch.fromNative(context.document);\n// let docData = context.document.documentData();\n\nexport function styleLine(line, style, docData){ // Refactored\n let localStyle;\n \n if(style != null){ \n // For updates\n if(getLayerStyles(style, docData) != null && style != \"Default Style\"){\n // If style is specified\n localStyle = style;\n let ownStyle = getLayerStyles(style, docData);\n line.sharedStyle = ownStyle[0];\n } else {\n // if there is no specific style\n localStyle = \"Default Style\";\n let border = line.style().addStylePartOfType(1);\n border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1});\n border.thickness = 2;\n line.style().endMarkerType = 2;\n }\n } else {\n // For creating new\n if(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey) != null && context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey) != \"Default Style\"){\n // we have settins almost all the time and it's not default\n localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier(\"arrowStyle\", docData, pluginKey), docData);\n line.sharedStyle = localStyle[0];\n localStyle = localStyle[0].name();\n } else {\n localStyle = \"Default Style\";\n let border = line.style().addStylePartOfType(1);\n border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1});\n border.thickness = 2;\n line.style().endMarkerType = 2;\n } \n }\n \n return localStyle;\n}\n\nexport function getLayerStyles(name, docData) { // Refactored\n let allStyles = docData.allLayerStyles();\n let keyword = \"$arrow\";\n let styles = [];\n \n for(let i = 0; i < allStyles.count(); i++){\n if(name == null) {\n if(allStyles[i].name().includes(keyword)){styles.push(allStyles[i]);}\n } else {\n if(allStyles[i].name() == name){styles.push(allStyles[i]);}\n }\n }\n return styles;\n}","module.exports = require(\"sketch\");","module.exports = require(\"sketch/dom\");","module.exports = require(\"sketch/settings\");","module.exports = require(\"sketch/ui\");"],"sourceRoot":""} \ No newline at end of file diff --git a/arrows.sketchplugin/Contents/Sketch/settings.js b/arrows.sketchplugin/Contents/Sketch/settings.js new file mode 100644 index 0000000..f557bee --- /dev/null +++ b/arrows.sketchplugin/Contents/Sketch/settings.js @@ -0,0 +1,21 @@ +var that=this;function __skpm_run(e,t){that.context=t;var r=function(e){var t={};function r(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(a,i,function(t){return e[t]}.bind(null,i));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./src/settings.js")}({"./src/settings.js": +/*!*************************!*\ + !*** ./src/settings.js ***! + \*************************/ +/*! exports provided: settings */function(e,r,a){"use strict";a.r(r),a.d(r,"settings",function(){return c});var i=a(/*! sketch */"sketch"),n=a.n(i),l=a(/*! ./utilities/styling.js */"./src/utilities/styling.js"),o=a(/*! sketch/ui */"sketch/ui"),s=a(/*! sketch/settings */"sketch/settings"),u="flowArrows",d=(n.a.fromNative(t.document),t.document.documentData());function c(e){var t=COSAlertWindow.new();t=function(e,t,r){return e.setMessageText("Arrow Plugin Settings"),e.addButtonWithTitle("Update Settings"),e.addButtonWithTitle("Cancel"),e}(t);var r=NSView.alloc().initWithFrame(NSMakeRect(0,0,300,500));t.addAccessoryView(r);var a=f("Arrow Style",!0,-1,460,280,40);r.addSubview(a);var i=NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2,460,300,20));S(i),r.addSubview(i);var n=f("Add layer style to your document that will contain $arrow name and you will be able to specify it here ",!1,-1,420,300,40);r.addSubview(n);var l=f("Arrow Type",!0,-1,370,280,40);r.addSubview(l);var c=NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2,370,300,20));!function(e){var t=s.settingForKey("arrowType");t?("Angled"==t&&(e.addItemWithTitle("Angled"),e.lastItem().setState(1),e.addItemWithTitle("Curved"),e.lastItem().setState(0),e.addItemWithTitle("Straight"),e.lastItem().setState(0)),"Curved"==t&&(e.addItemWithTitle("Curved"),e.lastItem().setState(1),e.addItemWithTitle("Straight"),e.lastItem().setState(0),e.addItemWithTitle("Angled"),e.lastItem().setState(0)),"Straight"==t&&(e.addItemWithTitle("Straight"),e.lastItem().setState(1),e.addItemWithTitle("Angled"),e.lastItem().setState(0),e.addItemWithTitle("Curved"),e.lastItem().setState(0))):(e.addItemWithTitle("Angled"),e.addItemWithTitle("Curved"),e.addItemWithTitle("Straight"))}(c),r.addSubview(c);var y=f("Select one of the arrow types. Angled is used by default",!1,-1,330,300,40);r.addSubview(y);var h=f("Arrow Spacing",!0,-1,300,330,20);r.addSubview(h);var m=f("px",!0,90,280,330,20);r.addSubview(m);var g=NSTextField.alloc().initWithFrame(NSMakeRect(-2,280,80,20)),w=NSNumberFormatter.alloc().init().autorelease();g.setStringValue(String(s.settingForKey("arrowSpacing"))),g.setFormatter(w),r.addSubview(g);var p=NSStepper.alloc().initWithFrame(NSMakeRect(70,280,20,20));p.setMaxValue(1e3),p.setMinValue(0),p.setValueWraps(!1),p.setAutorepeat(!0),p.setCOSJSTargetFunction(function(e){var t=0+e.integerValue();g.setStringValue(String(t))}),r.addSubview(p);var b=f("The second layer will be moved closer based on the value provided here. Keep it 0 if you don't want to have auto spacing feature ",!1,-1,215,300,60);r.addSubview(b);var T=f("Other Settings",!0,-1,170,280,40);r.addSubview(T);var I=v("Second layer auto-align","autoAlign",-1,160,260,40);r.addSubview(I);var W=f("Align the second layer for 5px misalignment with the first one",!1,-1,130,280,40);r.addSubview(W);var _=v("Redraw arrows after moving/resizing layers","autoDraw",-1,90,300,40);r.addSubview(_);var k=f("If you have performance issues, try to turn this option off",!1,-1,60,280,40);r.addSubview(k);var F=f("Made by @faridSabitov with the support of EPAM.com ❤️",!0,-1,10,280,40);r.addSubview(F),t.runModal()==NSAlertFirstButtonReturn&&(e.command.setValue_forKey_onLayer_forPluginIdentifier(t.views()[0].subviews()[1].title(),"arrowStyle",d,u),s.setSettingForKey("arrowType",t.views()[0].subviews()[4].title()),s.setSettingForKey("arrowSpacing",t.views()[0].subviews()[8].intValue()),s.setSettingForKey("autoAlign",t.views()[0].subviews()[12].state()),s.setSettingForKey("autoDraw",t.views()[0].subviews()[14].state()),o.message("Settings are updated 🚀"))}function S(e){var r=t.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle",d,u),a=Object(l.getLayerStyles)(null,d);if(r)if("Default Style"!=r){e.addItemWithTitle(r),e.addItemWithTitle("Default Style");for(var i=0;i=0.3.0 <0.4" + } + }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1577,24 +2171,23 @@ } }, "chokidar": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", - "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", + "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", "dev": true, "requires": { "anymatch": "^2.0.0", - "async-each": "^1.0.0", - "braces": "^2.3.0", - "fsevents": "^1.2.2", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", - "inherits": "^2.0.1", + "inherits": "^2.0.3", "is-binary-path": "^1.0.0", "is-glob": "^4.0.0", - "lodash.debounce": "^4.0.8", - "normalize-path": "^2.1.1", + "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0", - "upath": "^1.0.5" + "readdirp": "^2.2.1", + "upath": "^1.1.1" } }, "chownr": { @@ -1656,6 +2249,14 @@ "wrap-ansi": "^2.0.0" } }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "requires": { + "mimic-response": "^1.0.0" + } + }, "cocoascript-class": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/cocoascript-class/-/cocoascript-class-0.1.2.tgz", @@ -1682,7 +2283,6 @@ "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" } @@ -1690,14 +2290,12 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "commander": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==" }, "commondir": { "version": "1.0.1", @@ -1714,8 +2312,7 @@ "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 + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", @@ -1748,7 +2345,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -1773,11 +2369,42 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, + "core-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.1.tgz", + "integrity": "sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==", + "dev": true + }, + "core-js-compat": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.0.1.tgz", + "integrity": "sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g==", + "dev": true, + "requires": { + "browserslist": "^4.5.4", + "core-js": "3.0.1", + "core-js-pure": "3.0.1", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "dev": true + } + } + }, + "core-js-pure": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.1.tgz", + "integrity": "sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g==", + "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 + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "coscript": { "version": "1.0.0", @@ -1797,7 +2424,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -1810,7 +2437,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -1854,6 +2481,14 @@ "randomfill": "^1.0.3" } }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "requires": { + "array-find-index": "^1.0.1" + } + }, "cyclist": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", @@ -1867,9 +2502,9 @@ "dev": true }, "debug": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", - "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "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" @@ -1878,14 +2513,30 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "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 + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "deepmerge": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz", + "integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ==" }, "define-properties": { "version": "1.1.3", @@ -1947,9 +2598,17 @@ "minimalistic-assert": "^1.0.0" } }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "requires": { + "repeating": "^2.0.0" + } + }, "diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -1968,16 +2627,26 @@ "path-type": "^3.0.0" } }, + "dom-walk": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=" + }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, "duplexify": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz", - "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { "end-of-stream": "^1.0.0", @@ -1987,9 +2656,9 @@ } }, "electron-to-chromium": { - "version": "1.3.88", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.88.tgz", - "integrity": "sha512-UPV4NuQMKeUh1S0OWRvwg0PI8ASHN9kBC8yDTk1ROXLC85W5GnhTRu/MZu3Teqx3JjlQYuckuHYXSUSgtb3J+A==", + "version": "1.3.124", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.124.tgz", + "integrity": "sha512-glecGr/kFdfeXUHOHAWvGcXrxNU+1wSO/t5B23tT1dtlvYB26GY8aHzZSWD7HqhqC800Lr+w/hQul6C5AF542w==", "dev": true }, "elliptic": { @@ -2042,17 +2711,26 @@ "prr": "~1.0.1" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", "dev": true, "requires": { - "es-to-primitive": "^1.1.1", + "es-to-primitive": "^1.2.0", "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" } }, "es-to-primitive": { @@ -2069,13 +2747,12 @@ "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 + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -2106,13 +2783,12 @@ "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "events": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", "dev": true }, "evp_bytestokey": { @@ -2126,13 +2802,13 @@ } }, "execa": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", - "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { "cross-spawn": "^6.0.0", - "get-stream": "^3.0.0", + "get-stream": "^4.0.0", "is-stream": "^1.1.0", "npm-run-path": "^2.0.0", "p-finally": "^1.0.0", @@ -2283,9 +2959,9 @@ "dev": true }, "fast-glob": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.4.tgz", - "integrity": "sha512-FjK2nCGI/McyzgNtTESqaWP3trPvHyRyoyY70hxjc3oKPNmDe8taohLZpoVKoUjW85tbU5txaYUZCNtVzygl1g==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.6.tgz", + "integrity": "sha512-0BvMaZc1k9F+MeWWMe8pL6YltFzZYcJsYU7D4JyDA6PAczaXvxqQQ/z+mDF7/4Mw01DeUc+i3CTKajnkANkV4w==", "dev": true, "requires": { "@mrmlnc/readdir-enhanced": "^2.2.1", @@ -2332,33 +3008,33 @@ } }, "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" } }, "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "locate-path": "^3.0.0" } }, "flush-write-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", - "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", "dev": true, "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" } }, "for-in": { @@ -2380,7 +3056,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" @@ -2405,9 +3080,9 @@ "dev": true }, "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", + "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", "dev": true, "optional": true, "requires": { @@ -2434,7 +3109,7 @@ "optional": true }, "are-we-there-yet": { - "version": "1.1.4", + "version": "1.1.5", "bundled": true, "dev": true, "optional": true, @@ -2460,7 +3135,7 @@ } }, "chownr": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true, "dev": true, "optional": true @@ -2499,7 +3174,7 @@ } }, "deep-extend": { - "version": "0.5.1", + "version": "0.6.0", "bundled": true, "dev": true, "optional": true @@ -2548,7 +3223,7 @@ } }, "glob": { - "version": "7.1.2", + "version": "7.1.3", "bundled": true, "dev": true, "optional": true, @@ -2568,12 +3243,12 @@ "optional": true }, "iconv-lite": { - "version": "0.4.21", + "version": "0.4.24", "bundled": true, "dev": true, "optional": true, "requires": { - "safer-buffer": "^2.1.0" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore-walk": { @@ -2638,17 +3313,17 @@ "optional": true }, "minipass": { - "version": "2.2.4", + "version": "2.3.5", "bundled": true, "dev": true, "optional": true, "requires": { - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.0" } }, "minizlib": { - "version": "1.1.0", + "version": "1.2.1", "bundled": true, "dev": true, "optional": true, @@ -2672,7 +3347,7 @@ "optional": true }, "needle": { - "version": "2.2.0", + "version": "2.2.4", "bundled": true, "dev": true, "optional": true, @@ -2683,18 +3358,18 @@ } }, "node-pre-gyp": { - "version": "0.10.0", + "version": "0.10.3", "bundled": true, "dev": true, "optional": true, "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", - "needle": "^2.2.0", + "needle": "^2.2.1", "nopt": "^4.0.1", "npm-packlist": "^1.1.6", "npmlog": "^4.0.2", - "rc": "^1.1.7", + "rc": "^1.2.7", "rimraf": "^2.6.1", "semver": "^5.3.0", "tar": "^4" @@ -2711,13 +3386,13 @@ } }, "npm-bundled": { - "version": "1.0.3", + "version": "1.0.5", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.1.10", + "version": "1.2.0", "bundled": true, "dev": true, "optional": true, @@ -2794,12 +3469,12 @@ "optional": true }, "rc": { - "version": "1.2.7", + "version": "1.2.8", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "^0.5.1", + "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" @@ -2829,16 +3504,16 @@ } }, "rimraf": { - "version": "2.6.2", + "version": "2.6.3", "bundled": true, "dev": true, "optional": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "safe-buffer": { - "version": "5.1.1", + "version": "5.1.2", "bundled": true, "dev": true, "optional": true @@ -2856,7 +3531,7 @@ "optional": true }, "semver": { - "version": "5.5.0", + "version": "5.6.0", "bundled": true, "dev": true, "optional": true @@ -2909,17 +3584,17 @@ "optional": true }, "tar": { - "version": "4.4.1", + "version": "4.4.8", "bundled": true, "dev": true, "optional": true, "requires": { - "chownr": "^1.0.1", + "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.2" } }, @@ -2930,12 +3605,12 @@ "optional": true }, "wide-align": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true, "requires": { - "string-width": "^1.0.2" + "string-width": "^1.0.2 || 2" } }, "wrappy": { @@ -2945,7 +3620,7 @@ "optional": true }, "yallist": { - "version": "3.0.2", + "version": "3.0.3", "bundled": true, "dev": true, "optional": true @@ -2964,11 +3639,31 @@ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" + }, "get-stream": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + }, + "dependencies": { + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } }, "get-value": { "version": "2.0.6", @@ -3017,32 +3712,84 @@ "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", "dev": true }, + "global": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", + "requires": { + "min-document": "^2.19.0", + "process": "^0.11.10" + } + }, "globals": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", - "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, "globby": { - "version": "8.0.1", - "resolved": "http://registry.npmjs.org/globby/-/globby-8.0.1.tgz", - "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.2.tgz", + "integrity": "sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w==", "dev": true, "requires": { "array-union": "^1.0.1", - "dir-glob": "^2.0.0", + "dir-glob": "2.0.0", "fast-glob": "^2.0.2", "glob": "^7.1.2", "ignore": "^3.3.5", "pify": "^3.0.0", "slash": "^1.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "got": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "requires": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + } } }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, "has": { "version": "1.0.3", @@ -3053,11 +3800,30 @@ "function-bind": "^1.1.1" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + } + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" }, "has-symbols": { "version": "1.0.0", @@ -3065,6 +3831,14 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -3113,8 +3887,16 @@ "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hashish": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/hashish/-/hashish-0.0.4.tgz", + "integrity": "sha1-bWC8b/r3Ebav1g5CbQd5iAFOZVQ=", + "requires": { + "traverse": ">=0.2.4" } }, "hmac-drbg": { @@ -3128,6 +3910,25 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==" + }, "https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", @@ -3135,9 +3936,9 @@ "dev": true }, "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", "dev": true }, "iferr": { @@ -3158,6 +3959,14 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "requires": { + "repeating": "^2.0.0" + } + }, "indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", @@ -3177,14 +3986,33 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "into-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "requires": { + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" + }, + "dependencies": { + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + } + } }, "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" } @@ -3215,6 +4043,11 @@ } } }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, "is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", @@ -3293,16 +4126,23 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "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, "requires": { "is-extglob": "^2.1.1" @@ -3328,6 +4168,16 @@ } } }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -3346,6 +4196,19 @@ "has": "^1.0.1" } }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" + }, + "is-scoped": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-scoped/-/is-scoped-1.0.0.tgz", + "integrity": "sha1-RJypgpnnEwOCViieyytUDcQ3yzA=", + "requires": { + "scoped-regex": "^1.0.0" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -3361,6 +4224,11 @@ "has-symbols": "^1.0.0" } }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -3370,8 +4238,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { "version": "2.0.0", @@ -3385,33 +4252,68 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, "js-levenshtein": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.4.tgz", - "integrity": "sha512-PxfGzSs0ztShKrUYPIn5r0MtyAhYcCwmndozzpz8YObbPnD1jFxzlBGbRnX2mIu6Z13xN6+PTu05TQFnZFlzow==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", "dev": 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 + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" } }, + "js2flowchart": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/js2flowchart/-/js2flowchart-1.1.7.tgz", + "integrity": "sha512-F/lH3KZs9/5Z0l/78bd6DhDq0NEk/cTACMTNjnSvFZOAAtsixE3vruSPRVhbFMAtLtQUmFCyEx24SgN21fcKLQ==", + "requires": { + "babel-core": "^6.26.3", + "babel-generator": "7.0.0-beta.3", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.23.0", + "babel-traverse": "7.0.0-beta.3", + "babel-types": "^6.25.0", + "babylon": "7.0.0-beta.42", + "commander": "^2.12.1", + "deepmerge": "^1.5.1", + "global": "^4.3.2", + "npm-name-cli": "^1.2.0", + "remove": "^0.1.5", + "string-width": "^2.1.1", + "xml-escape": "^1.1.0" + } + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, "json-parse-better-errors": { "version": "1.0.2", @@ -3434,6 +4336,14 @@ "minimist": "^1.2.0" } }, + "keyv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "requires": { + "json-buffer": "3.0.0" + } + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -3449,62 +4359,140 @@ "invert-kv": "^2.0.0" } }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, "loader-runner": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.1.tgz", - "integrity": "sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", "dev": true }, "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", "dev": true, "requires": { - "big.js": "^3.1.3", + "big.js": "^5.2.2", "emojis-list": "^2.0.0", - "json5": "^0.5.0" + "json5": "^1.0.1" }, "dependencies": { "json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } } } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "p-locate": "^2.0.0", + "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true + "lodash.zip": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz", + "integrity": "sha1-7GZi5IlkCO1KtsVCo5kLcswIACA=" + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "requires": { + "chalk": "^1.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } }, "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" } }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" + }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -3516,14 +4504,21 @@ } }, "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "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": "^3.0.0" + "pify": "^4.0.1", + "semver": "^5.6.0" } }, + "mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", + "dev": true + }, "map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", @@ -3539,6 +4534,11 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -3560,14 +4560,14 @@ } }, "mem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", - "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" } }, "memory-fs": { @@ -3580,6 +4580,23 @@ "readable-stream": "^2.0.1" } }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, "merge2": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", @@ -3618,11 +4635,24 @@ } }, "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "requires": { + "dom-walk": "^0.1.0" + } + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -3639,16 +4669,14 @@ "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.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "mississippi": { "version": "2.0.0", @@ -3691,18 +4719,16 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" }, "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } }, @@ -3723,13 +4749,12 @@ "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" }, "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", "dev": true, "optional": true }, @@ -3765,9 +4790,9 @@ "dev": true }, "node-libs-browser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", - "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.0.tgz", + "integrity": "sha512-5MQunG/oyOaBdttrL40dA7bUfPORLRWMUJLQtMg7nluxUvk5XwnLdL9twQHFAjRx/y7mIMkLKT9++qPbbk6BZA==", "dev": true, "requires": { "assert": "^1.1.1", @@ -3777,7 +4802,7 @@ "constants-browserify": "^1.0.0", "crypto-browserify": "^3.11.0", "domain-browser": "^1.1.1", - "events": "^1.0.0", + "events": "^3.0.0", "https-browserify": "^1.0.0", "os-browserify": "^0.3.0", "path-browserify": "0.0.0", @@ -3791,7 +4816,7 @@ "timers-browserify": "^2.0.4", "tty-browserify": "0.0.0", "url": "^0.11.0", - "util": "^0.10.3", + "util": "^0.11.0", "vm-browserify": "0.0.4" }, "dependencies": { @@ -3804,21 +4829,98 @@ } }, "node-releases": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.0.tgz", - "integrity": "sha512-+qV91QMDBvARuPxUEfI/mRF/BY+UAkTIn3pvmvM2iOLIRvv6RNYklFXBgrkky6P1wXUqQW1P3qKlWxxy4JZbfg==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.14.tgz", + "integrity": "sha512-d58EpVZRhQE60kWiWUaaPlK9dyC4zg3ZoMcHcky2d4hDksyQj0rUozwInOl0C66mBsqo01Tuns8AvxnL5S7PKg==", "dev": true, "requires": { "semver": "^5.3.0" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "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, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "requires": { + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" + } + }, + "npm-name": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/npm-name/-/npm-name-3.2.0.tgz", + "integrity": "sha512-9Z9/fOMDbH4oUN1sjALYKEa7n60VzFfeKoHz4v9eMhf5Omi7uf0nq0xzpfSF0Spdyn6jKBwRSMXNExEYFmpLWA==", + "requires": { + "got": "^8.3.0", + "is-scoped": "^1.0.0", + "lodash.zip": "^4.0.0", + "registry-url": "^3.0.0" + } + }, + "npm-name-cli": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/npm-name-cli/-/npm-name-cli-1.2.0.tgz", + "integrity": "sha1-/kWuNEL1AJJXRAfbd1On1KgA0qw=", "requires": { - "remove-trailing-separator": "^1.0.1" + "chalk": "^1.1.1", + "log-symbols": "^1.0.2", + "meow": "^3.4.2", + "npm-name": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } } }, "npm-run-path": { @@ -3833,14 +4935,12 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-copy": { "version": "0.1.0", @@ -3874,9 +4974,9 @@ } }, "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "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": { @@ -3922,17 +5022,32 @@ "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, "os-locale": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", - "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { - "execa": "^0.10.0", + "execa": "^1.0.0", "lcid": "^2.0.0", "mem": "^4.0.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "p-cancelable": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==" + }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -3942,43 +5057,50 @@ "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, "p-is-promise": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { - "p-try": "^1.0.0" + "p-try": "^2.0.0" } }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "p-limit": "^1.1.0" + "p-limit": "^2.0.0" + } + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "requires": { + "p-finally": "^1.0.0" } }, "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "pako": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.7.tgz", - "integrity": "sha512-3HNK5tW4x8o5mO8RuHZp3Ydw9icZXx0RANAOMzlMzx7LVXhMJ4mo3MOBpzyd7r/+RUu8BmndP47LXT+vzjtWcQ==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", "dev": true }, "parallel-transform": { @@ -3993,16 +5115,17 @@ } }, "parse-asn1": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", "dev": true, "requires": { "asn1.js": "^4.0.0", "browserify-aes": "^1.0.0", "create-hash": "^1.1.0", "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" } }, "parse-author": { @@ -4014,6 +5137,14 @@ "author-regex": "^1.0.0" } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -4022,7 +5153,7 @@ }, "path-browserify": { "version": "0.0.0", - "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, @@ -4040,9 +5171,8 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "2.0.1", @@ -4053,8 +5183,7 @@ "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 + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-type": { "version": "3.0.0", @@ -4063,6 +5192,14 @@ "dev": true, "requires": { "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "pbkdf2": { @@ -4079,18 +5216,31 @@ } }, "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { - "find-up": "^2.1.0" + "find-up": "^3.0.0" } }, "posix-character-classes": { @@ -4099,23 +5249,25 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "promise-inflight": { "version": "1.0.1", @@ -4182,6 +5334,16 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -4195,9 +5357,9 @@ "dev": true }, "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "^5.1.0" @@ -4209,15 +5371,80 @@ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, + "dependencies": { + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + } } }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -4239,6 +5466,15 @@ "readable-stream": "^2.0.2" } }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -4246,18 +5482,23 @@ "dev": true }, "regenerate-unicode-properties": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz", - "integrity": "sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz", + "integrity": "sha512-SbA/iNrBUf6Pv2zU8Ekv1Qbhv92yxL4hiDa2siuxs4KKn4oOoMDHXjAf7+Nz9qinUQ46B1LcWEi/PhJfPWpZWQ==", "dev": true, "requires": { "regenerate": "^1.4.0" } }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, "regenerator-transform": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.3.tgz", - "integrity": "sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA==", + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", + "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", "dev": true, "requires": { "private": "^0.1.6" @@ -4273,18 +5514,32 @@ "safe-regex": "^1.1.0" } }, + "regexp-tree": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.5.tgz", + "integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==", + "dev": true + }, "regexpu-core": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.4.0.tgz", - "integrity": "sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", "dev": true, "requires": { "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^7.0.0", + "regenerate-unicode-properties": "^8.0.2", "regjsgen": "^0.5.0", "regjsparser": "^0.6.0", "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.0.2" + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "requires": { + "rc": "^1.0.1" } }, "regjsgen": { @@ -4304,12 +5559,20 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } } }, + "remove": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/remove/-/remove-0.1.5.tgz", + "integrity": "sha1-CV/9gn1lyfQa2X0z5BanWBEHmVU=", + "requires": { + "seq": ">= 0.3.5" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -4328,6 +5591,14 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "requires": { + "is-finite": "^1.0.0" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4341,12 +5612,11 @@ "dev": true }, "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", - "dev": true, + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", "requires": { - "path-parse": "^1.0.5" + "path-parse": "^1.0.6" } }, "resolve-url": { @@ -4355,6 +5625,14 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -4362,12 +5640,12 @@ "dev": true }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "ripemd160": { @@ -4401,12 +5679,11 @@ "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 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -4423,16 +5700,29 @@ "ajv-keywords": "^3.1.0" } }, + "scoped-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/scoped-regex/-/scoped-regex-1.0.0.tgz", + "integrity": "sha1-o0a7Gs1CB65wvXwMfKnlZra63bg=" + }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + }, + "seq": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/seq/-/seq-0.3.5.tgz", + "integrity": "sha1-rgKvOkJHk9jMvyEtaRdODFTf/jg=", + "requires": { + "chainsaw": ">=0.0.7 <0.1", + "hashish": ">=0.0.2 <0.1" + } }, "serialize-javascript": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", - "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz", + "integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==", "dev": true }, "set-blocking": { @@ -4472,7 +5762,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -4498,8 +5788,12 @@ "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sketch-module-google-analytics": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/sketch-module-google-analytics/-/sketch-module-google-analytics-0.2.1.tgz", + "integrity": "sha512-/zSu4gTBoUidSCsXgkhoAf11XKaYHcyOZwZzZCHhnBaH2vstFjzlWTooZ6SbcN3Qabmd++tAVoBNRUY4w8YnFg==" }, "sketch-polyfill-fetch": { "version": "0.4.3", @@ -4513,8 +5807,7 @@ "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" }, "snapdragon": { "version": "0.8.2", @@ -4638,6 +5931,14 @@ } } }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "requires": { + "is-plain-obj": "^1.0.0" + } + }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -4647,8 +5948,7 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, "source-map-resolve": { "version": "0.5.2", @@ -4664,9 +5964,9 @@ } }, "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -4687,6 +5987,34 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==" + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -4698,7 +6026,7 @@ }, "sprintf-js": { "version": "1.0.3", - "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, @@ -4733,9 +6061,9 @@ } }, "stream-browserify": { - "version": "2.0.1", - "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", "dev": true, "requires": { "inherits": "~2.0.1", @@ -4771,11 +6099,15 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -4783,9 +6115,8 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, "requires": { "safe-buffer": "~5.1.0" } @@ -4794,47 +6125,66 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, "requires": { "ansi-regex": "^3.0.0" } }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "requires": { + "get-stdin": "^4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, "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" } }, "tapable": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz", - "integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "dev": true }, "terser": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-3.11.0.tgz", - "integrity": "sha512-5iLMdhEPIq3zFWskpmbzmKwMQixKmTYwY3Ox9pjtSklBLnHiuQ0GKJLhL1HSYtyffHM3/lDIFBnb82m9D7ewwQ==", + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz", + "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==", "dev": true, "requires": { - "commander": "~2.17.1", + "commander": "^2.19.0", "source-map": "~0.6.1", - "source-map-support": "~0.5.6" + "source-map-support": "~0.5.10" }, "dependencies": { "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, "source-map": { @@ -4846,9 +6196,9 @@ } }, "terser-webpack-plugin": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz", - "integrity": "sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.2.3.tgz", + "integrity": "sha512-GOK7q85oAb/5kE12fMuLdn2btOS9OBZn4VsecpHDywoUC/jLhSAKOiYo0ezx7ss2EXPMzyEWFoE0s1WLE+4+oA==", "dev": true, "requires": { "cacache": "^11.0.2", @@ -4856,61 +6206,40 @@ "schema-utils": "^1.0.0", "serialize-javascript": "^1.4.0", "source-map": "^0.6.1", - "terser": "^3.8.1", + "terser": "^3.16.1", "webpack-sources": "^1.1.0", "worker-farm": "^1.5.2" }, "dependencies": { "cacache": { - "version": "11.3.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.1.tgz", - "integrity": "sha512-2PEw4cRRDu+iQvBTTuttQifacYjLPhET+SYO/gEFMy8uhi+jlJREDAjSF5FWSdV/Aw5h18caHA7vMTw2c+wDzA==", + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz", + "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==", "dev": true, "requires": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "figgy-pudding": "^3.1.0", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.3", + "bluebird": "^3.5.3", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "lru-cache": "^5.1.1", "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", "rimraf": "^2.6.2", - "ssri": "^6.0.0", - "unique-filename": "^1.1.0", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", "y18n": "^4.0.0" } }, - "find-cache-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz", - "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "yallist": "^3.0.2" } }, "mississippi": { @@ -4931,39 +6260,6 @@ "through2": "^2.0.0" } }, - "p-limit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", - "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -4999,6 +6295,12 @@ "requires": { "figgy-pudding": "^3.5.1" } + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true } } }, @@ -5012,6 +6314,11 @@ "xtend": "~4.0.1" } }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" + }, "timers-browserify": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", @@ -5030,8 +6337,7 @@ "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 + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, "to-object-path": { "version": "0.3.0", @@ -5075,11 +6381,20 @@ "repeat-string": "^1.6.1" } }, + "traverse": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", + "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=" + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" }, "tslib": { "version": "1.9.3", @@ -5089,7 +6404,7 @@ }, "tty-browserify": { "version": "0.0.0", - "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, @@ -5133,6 +6448,84 @@ "worker-farm": "^1.5.2" }, "dependencies": { + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5158,15 +6551,15 @@ } }, "unicode-match-property-value-ecmascript": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz", - "integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", "dev": true }, "unicode-property-aliases-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz", - "integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", "dev": true }, "union-value": { @@ -5263,9 +6656,9 @@ } }, "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", "dev": true }, "uri-js": { @@ -5301,6 +6694,19 @@ } } }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "requires": { + "prepend-http": "^2.0.0" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -5308,9 +6714,9 @@ "dev": true }, "util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", "dev": true, "requires": { "inherits": "2.0.3" @@ -5319,8 +6725,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "util.promisify": { "version": "1.0.0", @@ -5332,9 +6737,18 @@ "object.getownpropertydescriptors": "^2.0.3" } }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "vm-browserify": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", "dev": true, "requires": { @@ -5353,17 +6767,17 @@ } }, "webpack": { - "version": "4.27.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.27.1.tgz", - "integrity": "sha512-WArHiLvHrlfyRM8i7f+2SFbr/XbQ0bXqTkPF8JpHOzub5482Y3wx7rEO8stuLGOKOgZJcqcisLhD7LrM/+fVMw==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.30.0.tgz", + "integrity": "sha512-4hgvO2YbAFUhyTdlR4FNyt2+YaYBYHavyzjCMbZzgglo02rlKi/pcsEzwCuCpsn1ryzIl1cq/u8ArIKu8JBYMg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.7.11", - "@webassemblyjs/helper-module-context": "1.7.11", - "@webassemblyjs/wasm-edit": "1.7.11", - "@webassemblyjs/wasm-parser": "1.7.11", - "acorn": "^5.6.2", - "acorn-dynamic-import": "^3.0.0", + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/wasm-edit": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "acorn": "^6.0.5", + "acorn-dynamic-import": "^4.0.0", "ajv": "^6.1.0", "ajv-keywords": "^3.1.0", "chrome-trace-event": "^1.0.0", @@ -5377,17 +6791,30 @@ "mkdirp": "~0.5.0", "neo-async": "^2.5.0", "node-libs-browser": "^2.0.0", - "schema-utils": "^0.4.4", + "schema-utils": "^1.0.0", "tapable": "^1.1.0", "terser-webpack-plugin": "^1.1.0", "watchpack": "^1.5.0", "webpack-sources": "^1.3.0" + }, + "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } } }, "webpack-merge": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.1.5.tgz", - "integrity": "sha512-sVcM+MMJv6DO0C0GLLltx8mUlGMKXE0zBsuMqZ9jz2X9gsekALw6Rs0cAfTWc97VuWS6NpVUa78959zANnMMLQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.1.tgz", + "integrity": "sha512-4p8WQyS98bUJcCvFMbdGZyZmsKuWjWVnVHnAS3FFg0HDaRVrPbkivx2RYCre8UiemD67RsiFFLfn4JhLAin8Vw==", "dev": true, "requires": { "lodash": "^4.17.5" @@ -5437,7 +6864,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { @@ -5473,7 +6900,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -5488,6 +6915,11 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "xml-escape": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.1.0.tgz", + "integrity": "sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ=" + }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -5524,51 +6956,6 @@ "which-module": "^2.0.0", "y18n": "^3.2.1 || ^4.0.0", "yargs-parser": "^11.1.1" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", - "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true - } } }, "yargs-parser": { @@ -5583,7 +6970,7 @@ }, "yesno": { "version": "0.0.1", - "resolved": "http://registry.npmjs.org/yesno/-/yesno-0.0.1.tgz", + "resolved": "https://registry.npmjs.org/yesno/-/yesno-0.0.1.tgz", "integrity": "sha1-/7wE/z1vmdrST3RjE06bkq5BvvY=", "dev": true } diff --git a/package.json b/package.json index e30d588..e3628c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arrows", - "version": "2.7.1", + "version": "3.0.0", "engines": { "sketch": ">=3.0" }, @@ -26,5 +26,9 @@ "devDependencies": { "@skpm/builder": "0.5.14" }, - "author": "Farid Sabitov " + "author": "Farid Sabitov ", + "dependencies": { + "js2flowchart": "^1.1.7", + "sketch-module-google-analytics": "^0.2.1" + } } diff --git a/src/autoUpdate.js b/src/autoUpdate.js new file mode 100644 index 0000000..e91ce46 --- /dev/null +++ b/src/autoUpdate.js @@ -0,0 +1,60 @@ +import sketch from 'sketch'; +let UI = require('sketch/ui'); +const pluginKey = "flowArrows"; +import { deleteLine } from "./utilities/lines.js" +import { createArrow } from "./createArrow.js"; +import { getConnectionsData, deleteConnectionFromData } from "./utilities/data.js" +var Settings = require('sketch/settings'); + + + +export function autoUpdateSelectedArrows(context) { + if(Settings.settingForKey("autoDraw") != false) { + let document = sketch.fromNative(context.actionContext.document) + let action = context.actionContext + let docData = action.document.documentData(); + + let connectionsData = getConnectionsData(docData); + + + const movedLayers = Array.from(context.actionContext.layers).map(layer => sketch.fromNative(layer)) + let firstObjectID = String(movedLayers[0].id); + let connectionIndex = [] + + connectionIndex = getIndex(connectionsData, firstObjectID); + + if(connectionIndex.length > 0){ + for (let x = 0; x < connectionIndex.length; x++) { + deleteLine(connectionsData[connectionIndex[x]].line, document); + let connection = createArrow( + connectionsData[connectionIndex[x]].firstObject, + connectionsData[connectionIndex[x]].secondObject, + connectionsData[connectionIndex[x]].style, + connectionsData[connectionIndex[x]].type, + connectionsData[connectionIndex[x]].direction, + connectionsData[connectionIndex[x]].condition, + connectionsData[connectionIndex[x]].isCondition, + document, + docData + ); + connectionsData.push(connection); + } + connectionsData = deleteConnectionFromData(connectionIndex, connectionsData); + } + + context.command.setValue_forKey_onLayer_forPluginIdentifier(connectionsData, "arrowConnections", docData, pluginKey); + } +} + +function getIndex(connectionsData, firstObjectID){ + let connectionIndex = []; + if(connectionsData.length > 0){ + for (let y = 0; y < connectionsData.length; y++) { + if (firstObjectID == connectionsData[y].firstObject || firstObjectID == connectionsData[y].secondObject) { + connectionIndex.push(y); + } + } + } + + return connectionIndex; +} \ No newline at end of file diff --git a/src/createArrow.js b/src/createArrow.js new file mode 100644 index 0000000..9dff698 --- /dev/null +++ b/src/createArrow.js @@ -0,0 +1,120 @@ +import sketch from 'sketch'; +import { drawConnection } from "./draw.js"; + +var Settings = require('sketch/settings'); + + +// Main Function + +export function createArrow(firstObjectID, secondObjectID, style, type, direction, conditionID, isCondition, document, docData) { // Refactored + let localDirection = direction == "Auto" ? getDirection(firstObjectID, secondObjectID, document) : direction; + + // Main Operations based on the settings + updateSpacing(firstObjectID, secondObjectID, localDirection, document); + autoAlignLayer(firstObjectID, secondObjectID, localDirection, document); + + // Making an Arrow + let arrow = drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, isCondition, document, docData); + + // Storage for current connection + let connection = { + firstObject : firstObjectID, + secondObject : secondObjectID, + style : arrow.style, + condition : arrow.conditionID, + isCondition : isCondition, + type : arrow.type, + direction: localDirection, + line : arrow.line.objectID() + } + return connection; +} + +function getDirection(firstObjectID, secondObjectID, document){ // Refactored + // Get direction from the source object + const firstObject = document.getLayerWithID(firstObjectID); + const secondObject = document.getLayerWithID(secondObjectID); + const firstObjectMidX = firstObject.frame.x+firstObject.frame.width/2; + const firstObjectMidY = firstObject.frame.y+firstObject.frame.height/2; + const secondObjectMidX = secondObject.frame.x+secondObject.frame.width/2; + const secondObjectMidY = secondObject.frame.y+secondObject.frame.height/2; + + const diffX = firstObjectMidX - secondObjectMidX; + const diffY = firstObjectMidY - secondObjectMidY; + const absDiffX = Math.abs(diffX); + const absDiffY = Math.abs(diffY); + let direction; + + if(secondObjectMidX > firstObjectMidX){ + // Right Half + if(secondObjectMidY > firstObjectMidY){ + // Bottom quarter + direction = diffX > diffY ? "Down" : "Right"; + } else { + // Top quarter + direction = absDiffX > absDiffY ? "Right" : "Up"; + } + } else { + // Left Half + if(secondObjectMidY > firstObjectMidY){ + // Bottom quarter + direction = absDiffX > absDiffY ? "Left" : "Down"; + } else { + // Top quarter + direction = diffX > diffY ? "Left" : "Up"; + } + } + + return direction; +} + +function updateSpacing(sourceObjectID, childObjectID, direction, document){ + let sourceObject = document.getLayerWithID(sourceObjectID); + let childObject = document.getLayerWithID(childObjectID); + + if(Settings.settingForKey("arrowSpacing") && Settings.settingForKey("arrowSpacing") != 0){ + let currentSpacing = Settings.settingForKey("arrowSpacing"); + + if(direction == "Right"){ + childObject.frame.x = sourceObject.frame.x + sourceObject.frame.width + currentSpacing; + } + + if(direction == "Down"){ + childObject.frame.y = sourceObject.frame.y + sourceObject.frame.height + currentSpacing; + } + + if(direction == "Left"){ + childObject.frame.x = sourceObject.frame.x - childObject.frame.width - currentSpacing; + } + + if(direction == "Up"){ + childObject.frame.y = sourceObject.frame.y - childObject.frame.height - currentSpacing; + } + } +} + +function autoAlignLayer(sourceObjectID, childObjectID, direction, document){ + let sourceObject = document.getLayerWithID(sourceObjectID); + let childObject = document.getLayerWithID(childObjectID); + let sourceMidY, childMidY, sourceMidX, childMidX, diff; + + if(Settings.settingForKey("autoAlign")){ + if(Settings.settingForKey("autoAlign") == true){ + // If user turned on Auto-Align settings + + if(direction == "Right" || direction == "Left"){ + sourceMidY = sourceObject.frame.y + sourceObject.frame.height/2; + childMidY = childObject.frame.y + childObject.frame.height/2; + diff = sourceMidY - childMidY; + if(diff > -6 && diff < 6){childObject.frame.y = childObject.frame.y + diff;} + } + + if(direction == "Down" || direction == "Up"){ + sourceMidX = sourceObject.frame.x + sourceObject.frame.width/2; + childMidX = childObject.frame.x + childObject.frame.width/2; + diff = sourceMidX - childMidX; + if(diff > -6 && diff < 6){childObject.frame.x = childObject.frame.x + diff;} + } + } + } +} \ No newline at end of file diff --git a/src/draw.js b/src/draw.js new file mode 100644 index 0000000..acd3a45 --- /dev/null +++ b/src/draw.js @@ -0,0 +1,340 @@ +import sketch from 'sketch'; +import { styleLine } from "./utilities/styling.js"; +import { addCondition, updateCondition } from "./utilities/conditions.js"; +import { checkForGroup, addToArrowsGroup } from "./utilities/groups.js"; +let Settings = require('sketch/settings'); +let UI = require('sketch/ui') ; + +// let document = sketch.fromNative(context.document); +// let docData = context.document.documentData(); +// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); + + +// Main Function + +export function drawConnection(firstObjectID, secondObjectID, style, type, localDirection, conditionID, isCondition, document, docData){ // Refactored + // Process of creating new connection + let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); + let firstObject = document.getLayerWithID(firstObjectID); + let secondObject = document.getLayerWithID(secondObjectID); + let connectionPos = getConnectionPos(firstObject, secondObject, localDirection, currentParentGroup); + let connection = { + line: [], + conditionID: [], + type: [], + style: [] + } + + // Type + connection.type = type == null ? Settings.settingForKey("arrowType") : type; + if(connection.type == "Angled" || connection.type == null){ connection.line = drawAngledLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.middlePosX, connectionPos.middlePosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);} + if(connection.type == "Straight"){ connection.line = drawStraightLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);} + if(connection.type == "Curved"){ connection.line = drawCurvedLine(connectionPos.firstLayerPosX, connectionPos.firstLayerPosY, connectionPos.secondLayerPosX, connectionPos.secondLayerPosY, localDirection);} + + + // Condition + if(isCondition == true){ + if(document.getLayerWithID(conditionID)){ + connection.conditionID = updateCondition(conditionID, connectionPos.middlePosX, connectionPos.middlePosY, document, docData); + } else { + connection.conditionID = addCondition("#con", connectionPos.middlePosX, connectionPos.middlePosY, document, docData); + } + } else { + connection.conditionID = null; + } + + // Style + connection.style = styleLine(connection.line, style, docData); + + // Add to group + addToArrowsGroup(connection.line, currentParentGroup); + + return connection +} + +// Positions + +function getConnectionPos(firstObject, secondObject, direction, currentParentGroup){ // Refactored + + let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup}); + let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup}); + let currentGroup = checkForGroup("Arrows", currentParentGroup); + let diffX, diffY; + + if(currentGroup){ + diffX = currentGroup.frame().x(); + diffY = currentGroup.frame().y(); + } else { + diffX = 0; + diffY = 0; + } + + let connectionPos = { + firstLayerPosX: null, + firstLayerPosY: null, + secondLayerPosX: null, + secondLayerPosY: null, + middlePosX: null, + middlePosY: null + } + + // Getting all the positions + if(direction == "Up"){ + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y-diffY; + + // Second Layer Position End Point Position + connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY; + + // Middle Points + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2; + } + + if(direction == "Right"){ + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY; + + // Second Layer Position End Point Position + connectionPos.secondLayerPosX = secondObjectAbsPos.x-diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY; + + // Middle Points + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2; + } + + if(direction == "Down"){ + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY; + + // Second Layer Position End Point Position + connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y-diffY; + + // Middle Points + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2; + } + + if(direction == "Left"){ + // First Layer Position Start Point Position + connectionPos.firstLayerPosX = firstObjectAbsPos.x-diffX; + connectionPos.firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY; + + // Second Layer Position End Point Position + connectionPos.secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX; + connectionPos.secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY; + + // Middle Points + connectionPos.middlePosX = (connectionPos.firstLayerPosX + connectionPos.secondLayerPosX)/2; + connectionPos.middlePosY = (connectionPos.firstLayerPosY + connectionPos.secondLayerPosY)/2; + } + + return connectionPos +} + +// Drawing Types + +function drawAngledLine(firstLayerPosX, firstLayerPosY, middlePosX, middlePosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored + let path = NSBezierPath.bezierPath(); + + if(direction == "Up"){ + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if(direction == "Right"){ + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if(direction == "Down"){ + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(firstLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, middlePosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + if(direction == "Left"){ + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, firstLayerPosY)); + path.lineToPoint(NSMakePoint(middlePosX, secondLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX, secondLayerPosY)); + } + + let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + let points = line.layers().firstObject().points(); + points[1].cornerRadius = 20; + points[2].cornerRadius = 20; + line.setName("Angled Arrow"); + + return line; +} + +function drawStraightLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored + let path = NSBezierPath.bezierPath(); + + if(direction == "Up"){ + path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)); + } + + if(direction == "Right"){ + path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)); + } + + if(direction == "Down"){ + path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)); + } + + if(direction == "Left"){ + path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)); + } + + let line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + line.setName("Straight Arrow"); + + return line; +} + +function drawCurvedLine(firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, direction){ // Refactored + let path = NSBezierPath.bezierPath(); + let line; + + if(direction == "Up"){ + // Connecting points + path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)); + path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)); + + // Painting the line + line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)); + let points = line.layers().firstObject().points(); + + points[0].curveMode = 4; + points[1].curveMode = 4; + points[0].hasCurveFrom = true; + points[1].hasCurveTo = true; + + if(firstLayerPosX 1)? true: false; +// suffix = (isRetinaDisplay)? "@2x": "", +// imageURL = NSURL.fileURLWithPath(self.pluginResources + "/icons/" + name + suffix + ".png"), +// image = NSImage.alloc().initWithContentsOfURL(imageURL); +// return image +// }, +// addButton = function(rect, name, callAction){ +// var button = NSButton.alloc().initWithFrame(rect), +// image = getImage(rect.size, name); + +// button.setImage(image); +// button.setBordered(false); +// button.sizeToFit(); +// button.setButtonType(NSMomentaryChangeButton); +// button.setCOSJSTargetFunction(callAction); +// button.setAction("callAction:"); +// return button; +// }, +// addImage = function(rect, name){ +// var view = NSImageView.alloc().initWithFrame(rect), +// image = getImage(rect.size, name); +// view.setImage(image); +// return view; +// }, + +// closeButton = addButton( NSMakeRect(20, 10, 30, 30), "close-control", +// function(sender){ +// coscript.setShouldKeepAround(false); +// threadDictionary.removeObjectForKey(identifier); +// ControlBar.close(); +// }), + + + +} \ No newline at end of file diff --git a/src/script.js b/src/script.js index bcd1b52..e6ce127 100644 --- a/src/script.js +++ b/src/script.js @@ -1,1423 +1,192 @@ -import sketch from 'sketch' -// const { toArray } = require('util') - // // Variables // -let UI = require('sketch/ui') -var SharedStyle = require('sketch/dom').SharedStyle +import sketch from 'sketch'; +import { createArrow } from "./createArrow.js"; +import { updateArrow } from "./updateArrow.js"; +import { getSourceObjectFromSelection } from "./utilities/getSourceObject.js" +import { getConnectionsData, deleteConnectionFromData } from "./utilities/data.js" +import { deleteLine } from "./utilities/lines.js" +import { deleteCondition } from "./utilities/conditions.js"; -const pluginKey = "flowArrows" -const document = sketch.fromNative(context.document) -let docData = context.document.documentData() -let pluginData = context.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections", docData, pluginKey) // TODO: Need to refactor -let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage() // TODO: Might be a problem for multiple artboards -let newConnectionsData = getConnectionsData() +let UI = require('sketch/ui') ; +var Settings = require('sketch/settings'); -// Settings -var Settings = require('sketch/settings') -let arrowDirectionSetting +const pluginKey = "flowArrows"; -if(Settings.settingForKey("arrowDirection")) { - arrowDirectionSetting = Settings.settingForKey('arrowDirection') -} else { - arrowDirectionSetting = "Auto" -} - -// -// Create Connection Function -// +let document = sketch.fromNative(context.document); +let docData = context.document.documentData(); +// let pluginData = context.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections", docData, pluginKey); +// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); +let connectionsData = getConnectionsData(docData); -export default function(context) {} -export function createDefaultArrow(context){start(context, null)} -export function createAutoArrow(context){start(context, "Auto")} -export function createRightArrow(context){start(context, "Right")} -export function createDownArrow(context){start(context, "Down")} -export function createLeftArrow(context){start(context, "Left")} -export function createUpArrow(context){start(context, "Up")} + // -// Plugin Commands +// Plugin Incoming Commands - Create // -export function updateSelectedArrows(context) { +export function createAutoArrow(context){create(context, "Auto", false);} +export function createRightArrow(context){create(context, "Right", false);} +export function createDownArrow(context){create(context, "Down", false);} +export function createLeftArrow(context){create(context, "Left", false);} +export function createUpArrow(context){create(context, "Up", false);} - let selection = context.selection +export function createRightArrowWithCondition(context){create(context, "Right", true);} +export function createDownArrowWithCondition(context){create(context, "Down", true);} +export function createLeftArrowWithCondition(context){create(context, "Left", true);} +export function createUpArrowWithCondition(context){create(context, "Up", true);} - if(selection.count() > 1){ - // Need to find source object by ID first - // let sourceObjectID = getSourceObjectFromSelection(selection) - let currentConnectionsData = newConnectionsData +function create(context, direction, isCondition){ + let selection = context.selection; + if(selection.count() > 1 && selection[0].class() != "MSArtboardGroup"){ + let sourceObjectID = getSourceObjectFromSelection(selection, direction); + let connectionIndex = [] for(let g = 0; g < selection.count(); g++) { - if(selection[g].objectID() != selection[0].objectID()){ - // Then need to create or update connection arrow with each selection - let connectionIndex = findConnectionData(selection[0].objectID(), selection[g].objectID(), currentConnectionsData) - - if(connectionIndex != null){ - updateArrow(currentConnectionsData[connectionIndex].firstObject, currentConnectionsData[connectionIndex].secondObject, currentConnectionsData[connectionIndex].style, currentConnectionsData[connectionIndex].type, currentConnectionsData[connectionIndex].direction, currentConnectionsData[connectionIndex].line, connectionIndex) - sketch.UI.message("Current connection is updated 🚀") - } else { - sketch.UI.message("There is no connection between selected layers on the plugin data") - } - } - } - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey) - } else { - // When user didn't select anything - sketch.UI.message("Please select more than two layers") - } -} + if(selection[g].objectID() != sourceObjectID){ -export function updateArtboardArrows(context) { - // TODO: Need to show amount of updated arrows and deleted ones - let selection = context.selection - let connections = getConnectionsData() - let firstObjectArtboard - let secondObjectArtboard + let firstObjectID = String(sourceObjectID); + let secondObjectID = String(selection[g].objectID()); + let create = true + let index + + if(connectionsData.length > 0){ + for (let y = 0; y < connectionsData.length; y++) { + if ((firstObjectID == connectionsData[y].firstObject || firstObjectID == connectionsData[y].secondObject) && (secondObjectID == connectionsData[y].firstObject || secondObjectID == connectionsData[y].secondObject)) { + // We have this connection and need to update + create = false; + index = y; + connectionIndex.push(y); + } + } + } - if(connections.length > 0){ - // We have connections in database - const updateArrowsCounter = connections.length - for (let i = 0; i < updateArrowsCounter; i ++) { - // Need to check if the element is selected globally or from the artboard - firstObjectArtboard = document.getLayerWithID(connections[i].firstObject) - firstObjectArtboard = firstObjectArtboard.sketchObject.parentArtboard().objectID() - - secondObjectArtboard = document.getLayerWithID(connections[i].secondObject) - secondObjectArtboard = secondObjectArtboard.sketchObject.parentArtboard().objectID() - - if(selection.count() == 1 && selection[0].class() == "MSArtboardGroup"){ - // Need to go through each connection and update arrow position for specific artboard - - if (firstObjectArtboard == selection[0].objectID()){ - if (secondObjectArtboard == selection[0].objectID()){ - updateArrow(connections[i].firstObject, connections[i].secondObject, connections[i].style, connections[i].type, connections[i].direction, connections[i].line, i) - } else {newConnectionsData.push(connections[i])} + if(create){ + // Create + let connection = createArrow(firstObjectID, secondObjectID, null, null, direction, null, isCondition, document, docData); + connectionsData.push(connection); + sketch.UI.message("New connection is created 🚀"); } else { - // If not just saving it - newConnectionsData.push(connections[i]) - } - } - } - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey) - sketch.UI.message("All arrows are updated 🚀") - } else { - // We don't have any connections to update - sketch.UI.message("There is nothing to update") - } -} - -export function updateAllArrows(context) { // TODO - // TODO: Need to show amount of updated arrows and deleted ones - let currentConnectionsData = newConnectionsData - if(currentConnectionsData.length > 0){ - // We have connections in database - const updateArrowsCounter = currentConnectionsData.length - for (let i = 0; i < updateArrowsCounter; i ++) { - // Need to go through each connection and update arrow position without artboards - // Need to check if current object don't have the parrent - updateArrow(currentConnectionsData[i].firstObject, currentConnectionsData[i].secondObject, currentConnectionsData[i].style, currentConnectionsData[i].type, currentConnectionsData[i].direction, currentConnectionsData[i].line, i) - } - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey) - sketch.UI.message("All arrows are updated 🚀") - } else { - // We don't have any connections to update - sketch.UI.message("There is nothing to update") - } -} - -export function deleteAllArrows(context) { - - if(newConnectionsData.length > 0){ - // We have connections in database - for (let i = 0; i < newConnectionsData.length; i ++) { - // Need to go through each connection and update arrow position - deleteLine(newConnectionsData[i].line) - } - context.command.setValue_forKey_onLayer_forPluginIdentifier(null, "arrowConnections", docData, pluginKey) - sketch.UI.message("All arrows are deleted") - } else { - // We don't have any connections to update - sketch.UI.message("There is nothing to delete") - } -} - -export function deleteArtboardArrows(context) { - let selection = context.selection - let firstObject, secondObject - - // Need to delete all the arrows only from selected artboard - if(selection.count() == 1 && selection[0].class() == "MSArtboardGroup"){ - let connections = getConnectionsData() - - if(connections.length > 0){ - // We have connections in database - const updateArrowsCounter = connections.length - for (let i = 0; i < updateArrowsCounter; i ++) { - // Need to go through each connection and check if it placed on selected artboard - firstObject = document.getLayerWithID(connections[i].firstObject) - secondObject = document.getLayerWithID(connections[i].secondObject) - if (firstObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){ - if (secondObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){ - deleteLine(connections[i].line) - newConnectionsData = deleteConnectionFromData(i) + // Update + deleteLine(connectionsData[index].line, document); + if (!isCondition) { + deleteCondition(connectionsData[index].condition, document) } - } - } - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey) - sketch.UI.message("All arrows from selected artboard are deleted") - } else { - // We don't have any connections to update - sketch.UI.message("There is nothing to delete") - } - } else { - sketch.UI.message("Please select one artboard") - } -} - -export function deleteSelectedArrows(context) { - let selection = context.selection - let firstObject, secondObject - - // Need to delete all the arrows only from selected artboard - if(selection.count() == 2){ - for(let g = 0; g < selection.count(); g++) { - - if(selection[g].objectID() != selection[0].objectID()){ // It will never check 3rd connection - let connections = getConnectionsData() - - let connectionIndex = findConnectionData(selection[0].objectID(), selection[g].objectID(), connections) - - if(connectionIndex != null){ - // We have connections in database - deleteLine(connections[connectionIndex].line) - newConnectionsData = deleteConnectionFromData(connectionIndex) - const updateArrowsCounter = connections.length - for (let i = 0; i < updateArrowsCounter; i ++) { - // Need to go through each connection and check if it placed on selected artboard - firstObject = document.getLayerWithID(connections[i].firstObject) - secondObject = document.getLayerWithID(connections[i].secondObject) - if(firstObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){ - if(secondObject.sketchObject.parentArtboard().objectID() == selection[0].objectID()){ - deleteLine(connections[i].line) - newConnectionsData = deleteConnectionFromData(i) - } - } - } - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey) - sketch.UI.message("All arrows from selected layers are deleted ✌️") + let connection = createArrow(firstObjectID, secondObjectID, null, null, direction, connectionsData[index].condition, isCondition, document, docData); + connectionsData.push(connection); + sketch.UI.message("Current connection is updated 🤘"); } } } + if(connectionIndex.length > 0){ + // Update data if there was changes + connectionsData = deleteConnectionFromData(connectionIndex, connectionsData); + } + context.command.setValue_forKey_onLayer_forPluginIdentifier(connectionsData, "arrowConnections", docData, pluginKey); } else { - sketch.UI.message("Select two layers, please 🧐") + // When user didn't select anything + sketch.UI.message("Please select more than two layers. Artboards are coming soon 🥳"); } } -export function settings(context) { - let alert = COSAlertWindow.new() - const viewWidth = 300 - const viewHeight = 450 - // Alert window settings - alert = alertSetup(alert, viewWidth, viewHeight) - let view = NSView.alloc().initWithFrame(NSMakeRect(0, 0, viewWidth, viewHeight)) - alert.addAccessoryView(view) - - // Label: Arrow Style - let arrowStyleLabel = alertLabel("Arrow Style", true, -1, viewHeight-40, 280, 40) - view.addSubview(arrowStyleLabel) - - // Select: Arrow Style - let arrowStylingField = NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 40, 300, 20)); - setActiveStyleSetting(arrowStylingField) - view.addSubview(arrowStylingField) - - // Label: Arrow Style Info - let arrowStyleInfoLabel = alertLabel("Add layer style to your document that will contain $arrow name and you will be able to specify it here ", false, -1, viewHeight-80, 300, 40) - view.addSubview(arrowStyleInfoLabel) - - - // Label: Arrow Type - let arrowTypeLabel = alertLabel("Arrow Type", true, -1, viewHeight-130, 280, 40) - view.addSubview(arrowTypeLabel) - - // Select: Arrow Type - let arrowTypeField = NSPopUpButton.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 130, 300, 20)); - setActiveTypeSetting(arrowTypeField) - view.addSubview(arrowTypeField) - - // Label: Arrow Type Info - let arrowTypeInfoLabel = alertLabel("Select one of the arrow types. Angled is used by default", false, -1, viewHeight-170, 300, 40) - view.addSubview(arrowTypeInfoLabel) - - - // Label: Arrow Spacing - let arrowSpacingLabel = alertLabel("Arrow Spacing", true, -1, viewHeight - 200, 330, 20) - view.addSubview(arrowSpacingLabel) - - // Label: Arrow Spacing PX - let arrowSpacingPxLabel = alertLabel("px", true, 90, viewHeight - 220, 330, 20) - view.addSubview(arrowSpacingPxLabel) - - // Input: Arrow Spacing - let arrowSpacingField = NSTextField.alloc().initWithFrame(NSMakeRect(-2, viewHeight - 220, 80, 20)) - var formatter = NSNumberFormatter.alloc().init().autorelease() - arrowSpacingField.setStringValue(String(Settings.settingForKey("arrowSpacing"))) - arrowSpacingField.setFormatter(formatter) - view.addSubview(arrowSpacingField) - - // Stepper: Arrow Spacing - let arrowSpacingStepper = NSStepper.alloc().initWithFrame(NSMakeRect(70, viewHeight - 220, 20, 20)); - arrowSpacingStepper.setMaxValue(1000) - arrowSpacingStepper.setMinValue(0) - arrowSpacingStepper.setValueWraps(false) - arrowSpacingStepper.setAutorepeat(true) - arrowSpacingStepper.setCOSJSTargetFunction(function(sender){ - var value = 0 + sender.integerValue() - arrowSpacingField.setStringValue(String(value)) - }) - - view.addSubview(arrowSpacingStepper) - // view.addSubview(formatter) - - // Label: Auto Spacing Info - let arrowSpacingInfoLabel = alertLabel("The second layer will be moved closer based on the value provided here. Keep it 0 if you don't want to have auto spacing feature ", false, -1, viewHeight-285, 300, 60) - view.addSubview(arrowSpacingInfoLabel) - - // Label: Other Settings - let otherSettingsLabel = alertLabel("Other Settings", true, -1, viewHeight-330, 280, 40) - view.addSubview(otherSettingsLabel) - - // Checkbox: Auto-Align - let checkbox = alertCheckbox("Second layer auto-align", false, -1, viewHeight-340, 260, 40) - view.addSubview(checkbox) - - // Label: Auto-Align Info - let autoAlignInfoLabel = alertLabel("Align the second layer for 5px misalignment with the first one", false, -1, viewHeight-370, 280, 40) - view.addSubview(autoAlignInfoLabel) - - // Label: Plugin Info - let pluginInfoLabel = alertLabel("Made by @faridSabitov with the support of EPAM.com ❤️", true, -1, viewHeight-420, 280, 40) - view.addSubview(pluginInfoLabel) - - - // Need to check if style is still available - - // Show modal and get the results - let modalResponse = alert.runModal() - - if(modalResponse == NSAlertFirstButtonReturn){ - // When user clicks on "Update Settings" - // Need to save all this results into the Plugin Settings - context.command.setValue_forKey_onLayer_forPluginIdentifier(alert.views()[0].subviews()[1].title(), "arrowStyle", docData, pluginKey) - Settings.setSettingForKey("arrowType", alert.views()[0].subviews()[4].title()) - Settings.setSettingForKey("arrowSpacing", alert.views()[0].subviews()[8].intValue()) - Settings.setSettingForKey("autoAlign", alert.views()[0].subviews()[12].state()) - UI.message("Settings are updated 🚀") - } -} - -export function onLayersMoved(context) { - sketch.UI.message("Please select more than two layers") - const action = context.actionContext -} - -export function panel(context) { - let ControlBar - ControlBar = NSPanel.alloc().init(); - ControlBar.setStyleMask(NSTitledWindowMask + NSFullSizeContentViewWindowMask); - // ControlBar.setBackgroundColor(NSColor.colorWithRed_green_blue_alpha(0.99, 0.99, 0.99, 1)); - ControlBar.setTitleVisibility(NSWindowTitleHidden); - ControlBar.setTitlebarAppearsTransparent(true); - ControlBar.setFrame_display(NSMakeRect(0, 0, 720, 50), false); - ControlBar.setMovableByWindowBackground(true); - ControlBar.setHasShadow(true); - ControlBar.setLevel(NSFloatingWindowLevel); - - // contentView.addSubview(closeButton) - ControlBar.center(); - ControlBar.makeKeyAndOrderFront(nil); - -// getImage = function(size, name){ -// var isRetinaDisplay = (NSScreen.mainScreen().backingScaleFactor() > 1)? true: false; -// suffix = (isRetinaDisplay)? "@2x": "", -// imageURL = NSURL.fileURLWithPath(self.pluginResources + "/icons/" + name + suffix + ".png"), -// image = NSImage.alloc().initWithContentsOfURL(imageURL); -// return image -// }, -// addButton = function(rect, name, callAction){ -// var button = NSButton.alloc().initWithFrame(rect), -// image = getImage(rect.size, name); - -// button.setImage(image); -// button.setBordered(false); -// button.sizeToFit(); -// button.setButtonType(NSMomentaryChangeButton); -// button.setCOSJSTargetFunction(callAction); -// button.setAction("callAction:"); -// return button; -// }, -// addImage = function(rect, name){ -// var view = NSImageView.alloc().initWithFrame(rect), -// image = getImage(rect.size, name); -// view.setImage(image); -// return view; -// }, - -// closeButton = addButton( NSMakeRect(20, 10, 30, 30), "close-control", -// function(sender){ -// coscript.setShouldKeepAround(false); -// threadDictionary.removeObjectForKey(identifier); -// ControlBar.close(); -// }), - - - -} - // -// Functions +// Plugin Incoming Commands - Update and Delete // -function updateArrow(firstObjectID, secondObjectID, style, type, direction, lineID, connectionIndex) { - // There might be a situation, when user deleted current group or current group stays on another artboard => In that case need to create another group - // Need to check if we have the layers with such IDs - let firstObject = document.getLayerWithID(firstObjectID) - let secondObject = document.getLayerWithID(secondObjectID) - - // Need to delete data first, because we will have a new line - deleteLine(lineID) - newConnectionsData = deleteConnectionFromData(connectionIndex) - - if(firstObject && secondObject){ - // If we have all the objects, we can recreate the line - createArrow(firstObjectID, secondObjectID, style, type, direction) - } -} - -function createArrow(firstObjectID, secondObjectID, style, type, direction) { - // Process of creating new connection - let localDirection, localStyle, localType - if(direction == "Auto"){ - // If direction is auto, we need to specify direction ourselves - localDirection = getDirection(firstObjectID, secondObjectID) - } else { - localDirection = direction - } - - if(type == null){ - localType = Settings.settingForKey("arrowType") - } else { - localType = type - } - - // log(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)) - localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)) - - if(style != null){ - // if we updating connection with previously created objects - if(getLayerStyles(style) != null && style != "Default Style"){ - localStyle = style - } else { - localStyle = "Default Style" - } - } else { - // We don't have any data from the plugin data - if(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey)){ - localStyle = context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey) - } else { - localStyle = "Default Style" - } - - } - - - updateSpacing(firstObjectID, secondObjectID, localDirection) - autoAlignLayer(firstObjectID, secondObjectID, localDirection) - let currentGroup = checkForArrowGroup() - let line = drawLine(firstObjectID, secondObjectID, localStyle, localType, localDirection, currentGroup) - addToArrowsGroup(line, currentGroup) - - - // if(localStyle != "Default Style"){ - // localStyle = localStyle[0].name() - // } - - // Storage for current connection - let connection = { - firstObject : firstObjectID, - secondObject : secondObjectID, - style : localStyle, - type : localType, - direction: localDirection, - line : line.objectID() - } - // Need to save this data to the global array - newConnectionsData.push(connection) -} - -function checkForArrowGroup() { - let currentGroup = null - // Checking all the groups that we have - for(let i = 0; i < currentParentGroup.layers().count(); i++){ - if(currentParentGroup.layers()[i].name() == "Arrows") { - // If we already have "Arrow" group we need to save it's folder - currentGroup = currentParentGroup.layers()[i] - refactorLines(currentGroup) - } - } - return currentGroup -} - -function getDirection(firstObjectID, secondObjectID){ - // Get direction from the source object - const firstObject = document.getLayerWithID(firstObjectID) - const secondObject = document.getLayerWithID(secondObjectID) - const firstObjectMidX = firstObject.frame.x+firstObject.frame.width/2 - const firstObjectMidY = firstObject.frame.y+firstObject.frame.height/2 - const secondObjectMidX = secondObject.frame.x+secondObject.frame.width/2 - const secondObjectMidY = secondObject.frame.y+secondObject.frame.height/2 - - const diffX = firstObjectMidX - secondObjectMidX - const diffY = firstObjectMidY - secondObjectMidY - const absDiffX = Math.abs(diffX) - const absDiffY = Math.abs(diffY) - let direction - - if(secondObjectMidX > firstObjectMidX){ - // Right Half - if(secondObjectMidY > firstObjectMidY){ - // Bottom quarter - if(diffX > diffY) { - direction = "Down" - } else { - direction = "Right" - } - } else { - // Top quarter - if(absDiffX > absDiffY) { - direction = "Right" - } else { - direction = "Up" - } - } - } else { - // Left Half - if(secondObjectMidY > firstObjectMidY){ - // Bottom quarter - if(absDiffX > absDiffY) { - direction = "Left" - } else { - direction = "Down" - } - } else { - // Top quarter - if(diffX > diffY) { - direction = "Left" - } else { - direction = "Up" - } - } - } - return direction -} - -function drawLine(firstObjectID, secondObjectID, style, type, direction, currentGroup){ - let firstLayerPosX, firstLayerPosY, secondLayerPosX, secondLayerPosY, middlePosX, middlePosY, diffX, diffY, line - let firstObject = document.getLayerWithID(firstObjectID) - let secondObject = document.getLayerWithID(secondObjectID) - - let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup}) - let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup}) - - if(currentGroup){ - //if we already have a group, need to specify the difference - diffX = currentGroup.frame().x() - diffY = currentGroup.frame().y() - } else { - diffX = 0 - diffY = 0 - } - - // Drawing a line - let path = NSBezierPath.bezierPath() - - if(type == "Angled" || type == null){ - // Based on direction, we need to specify connection points - - if(direction == "Up"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX - firstLayerPosY = firstObjectAbsPos.y-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(firstLayerPosX,middlePosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,middlePosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - if(direction == "Right"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX - firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(middlePosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(middlePosX,secondLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - if(direction == "Down"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX - firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX - secondLayerPosY = secondObjectAbsPos.y-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(firstLayerPosX,middlePosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,middlePosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - if(direction == "Left"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x-diffX - firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(middlePosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(middlePosX,secondLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - //TODO: Provide a separate file with all the stylings - - // Painting the line - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)) - - - // Making middle points rounded - let points = line.layers().firstObject().points() - points[1].cornerRadius = 20 - points[2].cornerRadius = 20 - - // Providing Settings for the arrow - line.setName("Arrow") - } - - if(type == "Straight"){ - // Based on direction, we need to specify connection points - if(direction == "Up"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX - firstLayerPosY = firstObjectAbsPos.y-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - if(direction == "Right"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX - firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - if(direction == "Down"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX - firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX - secondLayerPosY = secondObjectAbsPos.y-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - if(direction == "Left"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x-diffX - firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - } - - // Painting the line - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)) - - // Providing Settings for the arrow - line.setName("Arrow") - } - - if(type == "Curved"){ - // Based on direction, we need to specify connection points - if(direction == "Up"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width/2-diffX - firstLayerPosY = firstObjectAbsPos.y-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x+secondObjectAbsPos.width/2-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - - // Painting the line - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)) - let points = line.layers().firstObject().points() - - points[0].curveMode = points[1].curveMode = 4 - points[0].hasCurveFrom = points[1].hasCurveTo = true - - if(firstLayerPosX 0) { + + if (level == 3) { + if(isUpdate){ + newConnectionsData = updateArrow(connectionsData[i].firstObject, connectionsData[i].secondObject, connectionsData[i].style, connectionsData[i].type, connectionsData[i].direction, connectionsData[i].line, connectionsData[i].condition, i); + sketch.UI.message("All arrows are updated"); } else { - points[0].curveFrom = {x: 1, y: 0.5} - points[0].curveTo = {x: -0.5,y:1} - - points[1].curveFrom = {x: 1,y: 1} - points[1].curveTo = {x: 0,y: 0.5} - } - } - - if(direction == "Right"){ - // First Layer Position Start Point Position - firstLayerPosX = firstObjectAbsPos.x+firstObjectAbsPos.width-diffX - firstLayerPosY = firstObjectAbsPos.y+firstObjectAbsPos.height/2-diffY - - // Second Layer Position End Point Position - secondLayerPosX = secondObjectAbsPos.x-diffX - secondLayerPosY = secondObjectAbsPos.y+secondObjectAbsPos.height/2-diffY - - // Middle Points - middlePosX = (firstLayerPosX + secondLayerPosX)/2 - middlePosY = (firstLayerPosY + secondLayerPosY)/2 - - // Connecting points - path.moveToPoint(NSMakePoint(firstLayerPosX,firstLayerPosY)) - path.lineToPoint(NSMakePoint(secondLayerPosX,secondLayerPosY)) - - // Painting the line - line = MSShapeGroup.layerWithPath(MSPath.pathWithBezierPath(path)) - let points = line.layers().firstObject().points() - - points[0].curveMode = points[1].curveMode = 4 - points[0].hasCurveFrom = points[1].hasCurveTo = true - - if(firstLayerPosY -6 && diff < 6){childObject.frame.y = childObject.frame.y + diff} - } - if(direction == "Down" || direction == "Up"){ - sourceMidX = sourceObject.frame.x + sourceObject.frame.width/2 - childMidX = childObject.frame.x + childObject.frame.width/2 - diff = sourceMidX - childMidX - if(diff > -6 && diff < 6){childObject.frame.x = childObject.frame.x + diff} - } - } - } -} - -function defineSourceObject(firstObjectID, secondObjectID, direction){ - let firstObject = document.getLayerWithID(firstObjectID) - let secondObject = document.getLayerWithID(secondObjectID) - let sourceObjectID - - if(direction == "Auto"){ - sourceObjectID = firstObject.id - } - - if(direction == "Right"){ - if(firstObject.frame.x <= secondObject.frame.x){ - sourceObjectID = firstObject.id - } else { - sourceObjectID = secondObject.id - } - } - - if(direction == "Down"){ - if(firstObject.frame.y <= secondObject.frame.y){ - sourceObjectID = firstObject.id - } else { - sourceObjectID = secondObject.id - } - } - - if(direction == "Left"){ - if(firstObject.frame.x <= secondObject.frame.x){ - sourceObjectID = secondObject.id - } else { - sourceObjectID = firstObject.id - } - } - - if(direction == "Up"){ - if(firstObject.frame.y <= secondObject.frame.y){ - sourceObjectID = secondObject.id - } else { - sourceObjectID = firstObject.id - } - } - - return sourceObjectID -} - -function getSourceObjectFromSelection(selection, direction){ - let sourceObjectID = selection.firstObject().objectID() - - if(direction != "Auto"){ - for(let g = 0; g < selection.count(); g++) { - sourceObjectID = defineSourceObject(sourceObjectID, selection[g].objectID(), direction) - } + // let connection = createArrow(sourceObjectID, selection[g].objectID(), null, null, direction, null, isCondition, document, docData); + // connectionsData.push(connection); + context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey); } else { - sourceObjectID = defineSourceObject(sourceObjectID, selection[0].objectID(), direction) - } - - return sourceObjectID -} - -function confirmationAlert(alert, message) { - // Title - alert.setMessageText("Would you like to delete all the arrows from "+message) - - // Creating dialog buttons - alert.addButtonWithTitle("Delete Arrows") - alert.addButtonWithTitle("Cancel") - - // Creating the view - const viewWidth = 300 - const viewHeight = 40 - - let view = NSView.alloc().initWithFrame(NSMakeRect(0, 0, viewWidth, viewHeight)) - alert.addAccessoryView(view) - - // Label - var infoLabel = NSTextField.alloc().initWithFrame(NSMakeRect(-1, viewHeight - 40, 330, 40)) - - infoLabel.setStringValue("ℹ️ You can select layers, artboards to delete all the arrows from selected one only") - infoLabel.setSelectable(false) - infoLabel.setDrawsBackground(false) - infoLabel.setBezeled(false) - - view.addSubview(infoLabel) - - return alert -} - -function alertSetup(alert, viewWidth, viewHeight){ - // Title - alert.setMessageText("Arrow Plugin Settings") - - // Creating dialog buttons - alert.addButtonWithTitle("Update Settings") - alert.addButtonWithTitle("Cancel") - - return alert -} - -function alertLabel(message, state, x, y, width, height){ - let infoLabel = NSTextField.alloc().initWithFrame(NSMakeRect(x, y, width, height)) - - infoLabel.setStringValue(message) - infoLabel.setSelectable(false) - infoLabel.setDrawsBackground(false) - infoLabel.setBezeled(false) - - if(state == false){ - infoLabel.textColor = NSColor.disabledControlTextColor() + sketch.UI.message("There is no arrows"); } - - return infoLabel } -function alertCheckbox(message, state, x, y, width, height){ - let checkbox = NSButton.alloc().initWithFrame(NSMakeRect(x, y, width, height)) - - checkbox.setButtonType(NSSwitchButton) - checkbox.setBezelStyle(0) - checkbox.setTitle(message) - if(Settings.settingForKey("autoAlign")){ - let currentState = Settings.settingForKey("autoAlign") - checkbox.setState(currentState) - } else { - checkbox.setState(state) - } - - return checkbox -} +// const track = require("sketch-module-google-analytics") +// track("UA-138226597-1", "event", { +// ec: "command", +// ea: "create", +// ev: "my-command" +// }); -function getLayerStyles(name) { - let allStyles = docData.allLayerStyles() - let keyword = "$arrow" - let styles = [] - if(name == null) { - for(let i = 0; i < allStyles.count(); i++){ - if(allStyles[i].name().includes(keyword)){ - styles.push(allStyles[i]); - } - } - } else { - // Searching only for name - for(let i = 0; i < allStyles.count(); i++){ - if(allStyles[i].name() == name){ - styles.push(allStyles[i]); - } - } - } - return styles -} -function start(context, direction){ - let selection = context.selection - let localDirection - if(direction == null){localDirection = arrowDirectionSetting} else {localDirection = direction} - if(selection.count() > 1){ - // Need to find source object by ID first - let sourceObjectID = getSourceObjectFromSelection(selection, direction) - let currentConnectionsData = newConnectionsData - for(let g = 0; g < selection.count(); g++) { - if(selection[g].objectID() != sourceObjectID){ - // Then need to create or update connection arrow with each selection - let connectionIndex = findConnectionData(sourceObjectID, selection[g].objectID(), currentConnectionsData) - if(connectionIndex != null){ - // Because this is creating flow, we need to take the direction from user settings - updateArrow(sourceObjectID, selection[g].objectID(), null, null, localDirection, currentConnectionsData[connectionIndex].line, connectionIndex) - sketch.UI.message("Current connection is updated 🚀") - } else { - // There is no connection with this two objects in our database - createArrow(sourceObjectID, selection[g].objectID(), null, null, localDirection) - sketch.UI.message("New connection is created 🚀") - } - } - } - context.command.setValue_forKey_onLayer_forPluginIdentifier(newConnectionsData, "arrowConnections", docData, pluginKey) - } else { - // When user didn't select anything - sketch.UI.message("Please select more than two layers") - } -} -// { -// "script": "./script.js", -// "name" : "onLayersMoved", -// "handlers" : { -// "actions": { -// "LayersMoved.finish": "onLayersMoved" -// } -// }, -// "identifier" : "onLayersMoved" -// } diff --git a/src/settings.js b/src/settings.js new file mode 100644 index 0000000..73f0632 --- /dev/null +++ b/src/settings.js @@ -0,0 +1,378 @@ +import sketch from "sketch"; +import { getLayerStyles } from "./utilities/styling.js"; + + +let UI = require('sketch/ui') ; +let Settings = require("sketch/settings"); +const pluginKey = "flowArrows"; +let document = sketch.fromNative(context.document); +let docData = context.document.documentData(); + +export function settings(context) { + let alert = COSAlertWindow.new(); + const viewWidth = 300; + const viewHeight = 500; + + // Alert window settings + alert = alertSetup(alert, viewWidth, viewHeight); + let view = NSView.alloc().initWithFrame( + NSMakeRect(0, 0, viewWidth, viewHeight) + ); + alert.addAccessoryView(view); + + // Label: Arrow Style + let arrowStyleLabel = alertLabel( + "Arrow Style", + true, + -1, + viewHeight - 40, + 280, + 40 + ); + view.addSubview(arrowStyleLabel); + + // Select: Arrow Style + let arrowStylingField = NSPopUpButton.alloc().initWithFrame( + NSMakeRect(-2, viewHeight - 40, 300, 20) + ); + setActiveStyleSetting(arrowStylingField); + view.addSubview(arrowStylingField); + + // Label: Arrow Style Info + let arrowStyleInfoLabel = alertLabel( + "Add layer style to your document that will contain $arrow name and you will be able to specify it here ", + false, + -1, + viewHeight - 80, + 300, + 40 + ); + view.addSubview(arrowStyleInfoLabel); + + // Label: Arrow Type + let arrowTypeLabel = alertLabel( + "Arrow Type", + true, + -1, + viewHeight - 130, + 280, + 40 + ); + view.addSubview(arrowTypeLabel); + + // Select: Arrow Type + let arrowTypeField = NSPopUpButton.alloc().initWithFrame( + NSMakeRect(-2, viewHeight - 130, 300, 20) + ); + setActiveTypeSetting(arrowTypeField); + view.addSubview(arrowTypeField); + + // Label: Arrow Type Info + let arrowTypeInfoLabel = alertLabel( + "Select one of the arrow types. Angled is used by default", + false, + -1, + viewHeight - 170, + 300, + 40 + ); + view.addSubview(arrowTypeInfoLabel); + + // Label: Arrow Spacing + let arrowSpacingLabel = alertLabel( + "Arrow Spacing", + true, + -1, + viewHeight - 200, + 330, + 20 + ); + view.addSubview(arrowSpacingLabel); + + // Label: Arrow Spacing PX + let arrowSpacingPxLabel = alertLabel( + "px", + true, + 90, + viewHeight - 220, + 330, + 20 + ); + view.addSubview(arrowSpacingPxLabel); + + // Input: Arrow Spacing + let arrowSpacingField = NSTextField.alloc().initWithFrame( + NSMakeRect(-2, viewHeight - 220, 80, 20) + ); + var formatter = NSNumberFormatter.alloc() + .init() + .autorelease(); + arrowSpacingField.setStringValue( + String(Settings.settingForKey("arrowSpacing")) + ); + arrowSpacingField.setFormatter(formatter); + view.addSubview(arrowSpacingField); + + // Stepper: Arrow Spacing + let arrowSpacingStepper = NSStepper.alloc().initWithFrame( + NSMakeRect(70, viewHeight - 220, 20, 20) + ); + arrowSpacingStepper.setMaxValue(1000); + arrowSpacingStepper.setMinValue(0); + arrowSpacingStepper.setValueWraps(false); + arrowSpacingStepper.setAutorepeat(true); + arrowSpacingStepper.setCOSJSTargetFunction(function(sender) { + var value = 0 + sender.integerValue(); + arrowSpacingField.setStringValue(String(value)); + }); + + view.addSubview(arrowSpacingStepper); + // view.addSubview(formatter) + + // Label: Auto Spacing Info + let arrowSpacingInfoLabel = alertLabel( + "The second layer will be moved closer based on the value provided here. Keep it 0 if you don't want to have auto spacing feature ", + false, + -1, + viewHeight - 285, + 300, + 60 + ); + view.addSubview(arrowSpacingInfoLabel); + + // Label: Other Settings + let otherSettingsLabel = alertLabel( + "Other Settings", + true, + -1, + viewHeight - 330, + 280, + 40 + ); + view.addSubview(otherSettingsLabel); + + // Checkbox: Auto-Align + let checkAutoAlign = alertCheckbox( + "Second layer auto-align", + "autoAlign", + -1, + viewHeight - 340, + 260, + 40 + ); + view.addSubview(checkAutoAlign); + + // Label: Auto-Align Info + let autoAlignInfoLabel = alertLabel( + "Align the second layer for 5px misalignment with the first one", + false, + -1, + viewHeight - 370, + 280, + 40 + ); + view.addSubview(autoAlignInfoLabel); + + // Checkbox: Auto-Draw + let checkAutoDraw = alertCheckbox( + "Redraw arrows after moving/resizing layers", + "autoDraw", + -1, + viewHeight - 410, + 300, + 40 + ); + view.addSubview(checkAutoDraw); + + // Label: Auto-Draw Info + let autoDrawInfoLabel = alertLabel( + "If you have performance issues, try to turn this option off", + false, + -1, + viewHeight - 440, + 280, + 40 + ); + view.addSubview(autoDrawInfoLabel); + + // Label: Plugin Info + let pluginInfoLabel = alertLabel( + "Made by @faridSabitov with the support of EPAM.com ❤️", + true, + -1, + viewHeight - 490, + 280, + 40 + ); + view.addSubview(pluginInfoLabel); + + // Need to check if style is still available + + // Show modal and get the results + let modalResponse = alert.runModal(); + + if (modalResponse == NSAlertFirstButtonReturn) { + // When user clicks on "Update Settings" + // Need to save all this results into the Plugin Settings + context.command.setValue_forKey_onLayer_forPluginIdentifier( + alert + .views()[0] + .subviews()[1] + .title(), + "arrowStyle", + docData, + pluginKey + ); + Settings.setSettingForKey( + "arrowType", + alert + .views()[0] + .subviews()[4] + .title() + ); + Settings.setSettingForKey( + "arrowSpacing", + alert + .views()[0] + .subviews()[8] + .intValue() + ); + Settings.setSettingForKey( + "autoAlign", + alert + .views()[0] + .subviews()[12] + .state() + ); + Settings.setSettingForKey( + "autoDraw", + alert + .views()[0] + .subviews()[14] + .state() + ); + UI.message("Settings are updated 🚀"); + } +} + +// Functions + +function setActiveStyleSetting(arrowStylingField) { + let docSettings = context.command.valueForKey_onLayer_forPluginIdentifier( + "arrowStyle", + docData, + pluginKey + ); + let styles = getLayerStyles(null, docData); + + if (docSettings) { + // We have info about the settings in the current document + + if (docSettings != "Default Style") { + // if user specified own option + arrowStylingField.addItemWithTitle(docSettings); + arrowStylingField.addItemWithTitle("Default Style"); + for (let i = 0; i < styles.length; i++) { + if (styles[i].name() != docSettings) { + arrowStylingField.addItemWithTitle(styles[i].name()); + } + } + } else { + // Need to show the default first + arrowStylingField.addItemWithTitle("Default Style"); + for (let i = 0; i < styles.length; i++) { + arrowStylingField.addItemWithTitle(styles[i].name()); + } + } + } else { + arrowStylingField.addItemWithTitle("Default Style"); + for (let i = 0; i < styles.length; i++) { + arrowStylingField.addItemWithTitle(styles[i].name()); + } + } +} + +function setActiveTypeSetting(arrowTypeField) { + let docTypeSettings = Settings.settingForKey("arrowType"); + + if (docTypeSettings) { + // We have info about the settings in the current document + + if (docTypeSettings == "Angled") { + arrowTypeField.addItemWithTitle("Angled"); + arrowTypeField.lastItem().setState(1); + arrowTypeField.addItemWithTitle("Curved"); + arrowTypeField.lastItem().setState(0); + arrowTypeField.addItemWithTitle("Straight"); + arrowTypeField.lastItem().setState(0); + } + + if (docTypeSettings == "Curved") { + arrowTypeField.addItemWithTitle("Curved"); + arrowTypeField.lastItem().setState(1); + arrowTypeField.addItemWithTitle("Straight"); + arrowTypeField.lastItem().setState(0); + arrowTypeField.addItemWithTitle("Angled"); + arrowTypeField.lastItem().setState(0); + } + + if (docTypeSettings == "Straight") { + arrowTypeField.addItemWithTitle("Straight"); + arrowTypeField.lastItem().setState(1); + arrowTypeField.addItemWithTitle("Angled"); + arrowTypeField.lastItem().setState(0); + arrowTypeField.addItemWithTitle("Curved"); + arrowTypeField.lastItem().setState(0); + } + } else { + // Show default + arrowTypeField.addItemWithTitle("Angled"); + arrowTypeField.addItemWithTitle("Curved"); + arrowTypeField.addItemWithTitle("Straight"); + } +} + +function alertSetup(alert, viewWidth, viewHeight) { + // Title + alert.setMessageText("Arrow Plugin Settings"); + + // Creating dialog buttons + alert.addButtonWithTitle("Update Settings"); + alert.addButtonWithTitle("Cancel"); + + return alert; +} + +function alertLabel(message, state, x, y, width, height) { + let infoLabel = NSTextField.alloc().initWithFrame( + NSMakeRect(x, y, width, height) + ); + + infoLabel.setStringValue(message); + infoLabel.setSelectable(false); + infoLabel.setDrawsBackground(false); + infoLabel.setBezeled(false); + + if (state == false) { + infoLabel.textColor = NSColor.disabledControlTextColor(); + } + + return infoLabel; +} + +function alertCheckbox(message, state, x, y, width, height) { + let checkbox = NSButton.alloc().initWithFrame( + NSMakeRect(x, y, width, height) + ); + + checkbox.setButtonType(NSSwitchButton); + checkbox.setBezelStyle(0); + checkbox.setTitle(message); + + let currentState = Settings.settingForKey(state); + checkbox.setState(currentState); + + return checkbox; +} + + diff --git a/src/updateArrow.js b/src/updateArrow.js new file mode 100644 index 0000000..6c2a41a --- /dev/null +++ b/src/updateArrow.js @@ -0,0 +1,45 @@ +import sketch from 'sketch'; +import { getConnectionsData, deleteConnectionFromData} from "./utilities/data.js" +import { deleteLine } from "./utilities/lines.js" + +let UI = require('sketch/ui') ; +var Settings = require('sketch/settings'); +const pluginKey = "flowArrows"; +let document = sketch.fromNative(context.document); +let docData = context.document.documentData(); +let pluginData = context.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections", docData, pluginKey); +let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); // TODO: Might be a problem for multiple artboards +let connectionsData = getConnectionsData(docData); + + + +export function updateArrow(firstObjectID, secondObjectID, style, type, direction, lineID, conditionID, isCondition, connectionIndex) { + let firstObject = document.getLayerWithID(firstObjectID); + let secondObject = document.getLayerWithID(secondObjectID); + let conditionObject = document.getLayerWithID(conditionID); + let connection = []; + + deleteLine(lineID); + + if(conditionID && !isCondition){ + if(conditionObject){conditionObject.remove();} + } + + connectionsData = deleteConnectionFromData(connectionIndex); + + if(firstObject && secondObject){ + connection = createArrow( + connectionsData[connectionIndex[x]].firstObject, + connectionsData[connectionIndex[x]].secondObject, + connectionsData[connectionIndex[x]].style, + connectionsData[connectionIndex[x]].type, + connectionsData[connectionIndex[x]].direction, + connectionsData[connectionIndex[x]].condition, + connectionsData[connectionIndex[x]].isCondition, + document, + docData + ); + } + + return connection; +} \ No newline at end of file diff --git a/src/utilities/conditions.js b/src/utilities/conditions.js new file mode 100644 index 0000000..b708489 --- /dev/null +++ b/src/utilities/conditions.js @@ -0,0 +1,71 @@ +import sketch from 'sketch'; +import { addToConditionGroup, checkForGroup } from "./groups.js"; +let Settings = require('sketch/settings'); +let UI = require('sketch/ui') ; + +// let docData = context.document.documentData(); +// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); + +export function addCondition(keyword, x, y, document, docData) { + let libraries = sketch.getLibraries(); + let libraryObject, symbolReferences, symbol; + let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); + + for (let g = 0; g < libraries.length; g++) { + symbolReferences = libraries[g].getImportableSymbolReferencesForDocument( + document + ); + for (let i = 0; i < symbolReferences.length; i++) { + if (symbolReferences[i].name.includes(keyword)) { + libraryObject = symbolReferences[i]; + } + } + } + + if (libraryObject == null) { + symbol = null; + UI.alert( + "Condition symbol is not found", + 'If you would like to add arrows with specific conditions, you need to specify them in your libraries. You can download the library that works well with the plugin by going into Plugins -> Connection Arrows -> Get Free Library. Conditions are taken from the library based on their names. Make sure to name symbol as "#condition" so it will be added here' + ); + } else { + let symbolMaster = libraryObject.import(); + symbol = symbolMaster.createNewInstance(); + symbol = addToConditionGroup(symbol, x, y, currentParentGroup); + } + return symbol; +} + +export function updateCondition(conditionID, x, y, document, docData) { + let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); + let condition = document.getLayerWithID(conditionID); + let conGroup = checkForGroup("Conditions", currentParentGroup); + let arGroup = checkForGroup("Arrows", currentParentGroup); + let arGroupX = arGroup != null ? arGroup.frame().x() : 0; + let arGroupY = arGroup != null ? arGroup.frame().y() : 0; + + if (conGroup) { + condition.frame.x = + x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX); + condition.frame.y = + y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY); + conGroup.fixGeometryWithOptions(1); + } else { + condition.frame.x = x - condition.frame.width / 2; + condition.frame.y = y - condition.frame.height / 2; + } + return condition.id; +} + +export function deleteCondition(conditionID, document) { + let conditionObject = document.getLayerWithID(conditionID); + let selectedGroup; + if(conditionObject){ + selectedGroup = conditionObject.parent; + conditionObject.remove(); + if(selectedGroup.layers.length == 0){ + selectedGroup.remove(); + } + } + } + diff --git a/src/utilities/data.js b/src/utilities/data.js new file mode 100644 index 0000000..adc5754 --- /dev/null +++ b/src/utilities/data.js @@ -0,0 +1,28 @@ +import sketch from 'sketch'; + +let UI = require('sketch/ui') ; +var Settings = require('sketch/settings'); + +const pluginKey = "flowArrows"; + + +export function getConnectionsData(docData) { + let pluginData = context.command.valueForKey_onLayer_forPluginIdentifier("arrowConnections", docData, pluginKey); + let dataArray = []; + + if (pluginData) { + for (let i = 0; i < pluginData.length; i++) { + dataArray.push(pluginData[i]); + } + } + return dataArray; +} + +export function deleteConnectionFromData(connectionIndexArray, data){ + if(data){ + for (let i = connectionIndexArray.length -1; i >= 0; i--) { + data.splice(connectionIndexArray[i],1); + } + } + return data; +} diff --git a/src/utilities/getSourceObject.js b/src/utilities/getSourceObject.js new file mode 100644 index 0000000..58f703a --- /dev/null +++ b/src/utilities/getSourceObject.js @@ -0,0 +1,59 @@ +import sketch from 'sketch'; +let document = sketch.fromNative(context.document); +let docData = context.document.documentData(); +let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); + + +export function getSourceObjectFromSelection(selection, direction){ + let sourceObjectID = selection.firstObject().objectID(); + + if(direction != "Auto"){ + for(let g = 0; g < selection.count(); g++) { + sourceObjectID = defineSourceObject(sourceObjectID, selection[g].objectID(), direction); + } + } + return sourceObjectID; +} + +function defineSourceObject(firstObjectID, secondObjectID, direction){ + + let firstObject = document.getLayerWithID(firstObjectID); + let secondObject = document.getLayerWithID(secondObjectID); + let firstObjectAbsPos = firstObject.frame.changeBasis({from: firstObject.parent, to: currentParentGroup}); + let secondObjectAbsPos = secondObject.frame.changeBasis({from: secondObject.parent, to: currentParentGroup}); + let sourceObjectID; + + if(direction == "Right"){ + if(firstObjectAbsPos.x <= secondObjectAbsPos.x){ // We need to get the doc position + sourceObjectID = firstObject.id; + } else { + sourceObjectID = secondObject.id; + } + } + + if(direction == "Down"){ + if(firstObject.y <= secondObjectAbsPos.y){ + sourceObjectID = firstObject.id; + } else { + sourceObjectID = secondObject.id; + } + } + + if(direction == "Left"){ + if(firstObjectAbsPos.x <= secondObjectAbsPos.x){ + sourceObjectID = secondObject.id; + } else { + sourceObjectID = firstObject.id; + } + } + + if(direction == "Up"){ + if(firstObjectAbsPos.y <= secondObjectAbsPos.y){ + sourceObjectID = secondObject.id; + } else { + sourceObjectID = firstObject.id; + } + } + + return sourceObjectID; +} \ No newline at end of file diff --git a/src/utilities/groups.js b/src/utilities/groups.js new file mode 100644 index 0000000..04048fa --- /dev/null +++ b/src/utilities/groups.js @@ -0,0 +1,68 @@ +import sketch from 'sketch'; +let Settings = require('sketch/settings'); +let UI = require('sketch/ui') ; + +// let document = sketch.fromNative(context.document); +// let docData = context.document.documentData(); +// let currentParentGroup = docData.currentPage().currentArtboard() || docData.currentPage(); + + +export function checkForGroup(groupName, currentParentGroup) { // refactored + let currentGroup = null; + + // Checking all the groups that we have + for(let i = 0; i < currentParentGroup.layers().count(); i++){ + if(currentParentGroup.layers()[i].name() == groupName) { + currentGroup = currentParentGroup.layers()[i]; + } + } + + return currentGroup; +} + +export function addToArrowsGroup(line, currentParentGroup){ + let currentGroup = checkForGroup("Arrows", currentParentGroup); + if(currentGroup){ + currentGroup.addLayers([line]); + currentGroup.fixGeometryWithOptions(1); + } else { + let Group = require('sketch/dom').Group; + let group = new Group({ + parent: currentParentGroup, + name: 'Arrows', + locked: true, + layers: [line] + }); + group.moveToBack(); + group.adjustToFit(); + } +} + +export function addToConditionGroup(condition, x, y, currentParentGroup) { + let conGroup = checkForGroup("Conditions", currentParentGroup); + let arGroup = checkForGroup("Arrows", currentParentGroup); + + let arGroupX = arGroup != null ? arGroup.frame().x() : 0; + let arGroupY = arGroup != null ? arGroup.frame().y() : 0; + + if (conGroup) { + condition.frame.x = + x - condition.frame.width / 2 - (conGroup.frame().x() - arGroupX); + condition.frame.y = + y - condition.frame.height / 2 - (conGroup.frame().y() - arGroupY); + condition.parent = conGroup; + conGroup.fixGeometryWithOptions(1); + } else { + condition.frame.x = x - condition.frame.width / 2 + arGroupX; + condition.frame.y = y - condition.frame.height / 2 + arGroupY; + let Group = require("sketch/dom").Group; + let group = new Group({ + parent: currentParentGroup, + name: "Conditions", + layers: [condition] + }); + group.moveToBack(); + group.adjustToFit(); + } + return condition.id; + } \ No newline at end of file diff --git a/src/utilities/lines.js b/src/utilities/lines.js new file mode 100644 index 0000000..99c8efb --- /dev/null +++ b/src/utilities/lines.js @@ -0,0 +1,14 @@ +import sketch from 'sketch'; +let UI = require('sketch/ui'); + +export function deleteLine(lineID, document){ + let lineObject = document.getLayerWithID(lineID); + let selectedGroup; + if(lineObject){ + selectedGroup = lineObject.parent; + lineObject.remove(); + if(selectedGroup.layers.length == 0){ + selectedGroup.remove(); + } + } +} diff --git a/src/links.js b/src/utilities/links.js similarity index 62% rename from src/links.js rename to src/utilities/links.js index c0d7f93..df3d7ba 100644 --- a/src/links.js +++ b/src/utilities/links.js @@ -1,9 +1,7 @@ -export default function(context) {} - export function getLibrary(context) { - NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://github.com/faridsabitov/Sketch-Interactions")) + NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://github.com/faridsabitov/Sketch-Interactions")); } export function joinCommunity(context) { - NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://spectrum.chat/sketch-arrows")) + NSWorkspace.sharedWorkspace().openURL(NSURL.URLWithString("https://spectrum.chat/sketch-arrows")); } \ No newline at end of file diff --git a/src/utilities/styling.js b/src/utilities/styling.js new file mode 100644 index 0000000..3c78376 --- /dev/null +++ b/src/utilities/styling.js @@ -0,0 +1,56 @@ +import sketch from 'sketch'; +const pluginKey = "flowArrows"; +// let document = sketch.fromNative(context.document); +// let docData = context.document.documentData(); + +export function styleLine(line, style, docData){ // Refactored + let localStyle; + + if(style != null){ + // For updates + if(getLayerStyles(style, docData) != null && style != "Default Style"){ + // If style is specified + localStyle = style; + let ownStyle = getLayerStyles(style, docData); + line.sharedStyle = ownStyle[0]; + } else { + // if there is no specific style + localStyle = "Default Style"; + let border = line.style().addStylePartOfType(1); + border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1}); + border.thickness = 2; + line.style().endMarkerType = 2; + } + } else { + // For creating new + if(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey) != null && context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey) != "Default Style"){ + // we have settins almost all the time and it's not default + localStyle = getLayerStyles(context.command.valueForKey_onLayer_forPluginIdentifier("arrowStyle", docData, pluginKey), docData); + line.sharedStyle = localStyle[0]; + localStyle = localStyle[0].name(); + } else { + localStyle = "Default Style"; + let border = line.style().addStylePartOfType(1); + border.color = MSColor.colorWithRGBADictionary({r: 0.89, g: 0.89, b: 0.89, a: 1}); + border.thickness = 2; + line.style().endMarkerType = 2; + } + } + + return localStyle; +} + +export function getLayerStyles(name, docData) { // Refactored + let allStyles = docData.allLayerStyles(); + let keyword = "$arrow"; + let styles = []; + + for(let i = 0; i < allStyles.count(); i++){ + if(name == null) { + if(allStyles[i].name().includes(keyword)){styles.push(allStyles[i]);} + } else { + if(allStyles[i].name() == name){styles.push(allStyles[i]);} + } + } + return styles; +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index f801db0..1ac6dd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -588,6 +588,11 @@ version "1.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" +"@sindresorhus/is@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" + integrity sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow== + "@skpm/babel-preset@0.2.1": version "0.2.1" resolved "https://registry.yarnpkg.com/@skpm/babel-preset/-/babel-preset-0.2.1.tgz#1e0404e058514d72adebe98163b69b0bb1d737e4" @@ -817,6 +822,11 @@ ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -859,6 +869,11 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -907,6 +922,99 @@ author-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/author-regex/-/author-regex-1.0.0.tgz#d08885be6b9bbf9439fe087c76287245f0a81450" +babel-code-frame@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-beta.3.tgz#1614a91b2ba0e3848559f410bbacd030726899c9" + integrity sha512-flMsJ9eSpShupt2Gwpka84DoMePvE4HlDObzdEc+1iNkacv3+NHlsJ7dMKmbnVA/AT22UhcGEBHwbJLoXWBO6Q== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.26.0, babel-core@^6.26.3: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-7.0.0-beta.3.tgz#afa85e34c50ef52ccd0ef37f4c4b5e1df65cac04" + integrity sha512-Bok77tKwQZUVaLBRnDGDEaMZ4xEeyvzsgnCRxlVgfKmgn+vPxuka//ug3nrMmmgZ8TAMVPoXzeaAcs47lExrPg== + dependencies: + babel-types "7.0.0-beta.3" + jsesc "^2.5.1" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-function-name@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-beta.3.tgz#e86dd2eb2c09e06e392e79e203fc02427b24c871" + integrity sha512-iMWYqwDarQOVlEGcK1MfbtK9vrFGs5Z4UQsdASJUHdhBp918EM5kndwriiIbhUX8gr2B/CEV/udJkFTrHsjdMQ== + dependencies: + babel-helper-get-function-arity "7.0.0-beta.3" + babel-template "7.0.0-beta.3" + babel-traverse "7.0.0-beta.3" + babel-types "7.0.0-beta.3" + +babel-helper-get-function-arity@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-beta.3.tgz#61a47709318a31bc2db872f4be9b4c8447198be8" + integrity sha512-ZkYFRMWKx1c9fUW72YNM3eieBG701CMbLjmLLWmJTTPc0F0kddS9Fwok26EAmndUAgD6kFdh7ms3PH94MdGuGQ== + dependencies: + babel-types "7.0.0-beta.3" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-loader@^8.0.4: version "8.0.5" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33" @@ -916,6 +1024,151 @@ babel-loader@^8.0.4: mkdirp "^0.5.1" util.promisify "^1.0.0" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-add-module-exports@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25" + integrity sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU= + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= + +babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-beta.3.tgz#ebb877b6070ce9912b0d0c22fcad3372165913a8" + integrity sha512-urJduLja89kSDGqY8ryw8iIwQnMl30IvhMtMNmDD7vBX0l0oylaLgK+7df/9ODX9vR/PhXuif6HYl5HlzAKXMg== + dependencies: + babel-code-frame "7.0.0-beta.3" + babel-traverse "7.0.0-beta.3" + babel-types "7.0.0-beta.3" + babylon "7.0.0-beta.27" + lodash "^4.2.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-beta.3.tgz#3cf0a45d53d934d85275d8770775d7944fc7c199" + integrity sha512-xyh/aPYuedMAfQlSj2kjHjsEmY5/Dpxs576L05DySAVMrV+ADX6l4mTOLysAEGwJfkePJlDLhFuS6SKaxv1V7w== + dependencies: + babel-code-frame "7.0.0-beta.3" + babel-helper-function-name "7.0.0-beta.3" + babel-types "7.0.0-beta.3" + babylon "7.0.0-beta.27" + debug "^3.0.1" + globals "^10.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@7.0.0-beta.3: + version "7.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-beta.3.tgz#cd927ca70e0ae8ab05f4aab83778cfb3e6eb20b4" + integrity sha512-36k8J+byAe181OmCMawGhw+DtKO7AwexPVtsPXoMfAkjtZgoCX3bEuHWfdE5sYxRM8dojvtG/+O08M0Z/YDC6w== + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + +babel-types@^6.25.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@7.0.0-beta.27: + version "7.0.0-beta.27" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.27.tgz#b6edd30ef30619e2f630eb52585fdda84e6542cd" + integrity sha512-ksRx+r8eFIfdt63MCgLc9VxGL7W3jcyveQvMpNMVHgW+eb9mq3Xbm45FLCNkw8h92RvoNp4uuiwzcCEwxjDBZg== + +babylon@7.0.0-beta.42: + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.42.tgz#67cfabcd4f3ec82999d29031ccdea89d0ba99657" + integrity sha512-h6E/OkkvcBw/JimbL0p8dIaxrcuQn3QmIYGC/GtJlRYif5LTKBYPHXYwqluJpfS/kOXoz0go+9mkmOVC0M+zWw== + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -1110,10 +1363,36 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-request@^2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" + integrity sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0= + dependencies: + clone-response "1.0.2" + get-stream "3.0.0" + http-cache-semantics "3.8.1" + keyv "3.0.0" + lowercase-keys "1.0.0" + normalize-url "2.0.1" + responselike "1.0.2" + call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + integrity sha1-MIvur/3ygRkFHvodkyITyRuPkuc= + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + camelcase@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" @@ -1122,6 +1401,24 @@ caniuse-lite@^1.0.30000929: version "1.0.30000938" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000938.tgz#b64bf1427438df40183fce910fe24e34feda7a3f" +"chainsaw@>=0.0.7 <0.1": + version "0.0.9" + resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.0.9.tgz#11a05102d1c4c785b6d0415d336d5a3a1612913e" + integrity sha1-EaBRAtHEx4W20EFdM21aOhYSkT4= + dependencies: + traverse ">=0.3.0 <0.4" + +chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + chalk@^2.0.0, chalk@^2.4.1: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1191,6 +1488,13 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +clone-response@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + cocoascript-class@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/cocoascript-class/-/cocoascript-class-0.1.2.tgz#dab25f20389946d9986c1812b88ac3783eec42d3" @@ -1220,6 +1524,11 @@ colors@^1.1.2: version "1.3.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" +commander@^2.12.1: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" @@ -1263,7 +1572,7 @@ constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" -convert-source-map@^1.1.0: +convert-source-map@^1.1.0, convert-source-map@^1.5.1: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" dependencies: @@ -1284,6 +1593,11 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.9" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" + integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1346,6 +1660,13 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= + dependencies: + array-find-index "^1.0.1" + cyclist@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" @@ -1354,19 +1675,26 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" +debug@^3.0.1: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + debug@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" dependencies: ms "^2.1.1" -decamelize@^1.2.0: +decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1374,10 +1702,22 @@ decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" +deepmerge@^1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753" + integrity sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ== + define-properties@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" @@ -1414,6 +1754,13 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" @@ -1433,10 +1780,20 @@ dir-glob@2.0.0: arrify "^1.0.1" path-type "^3.0.0" +dom-walk@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" + integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= + domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + duplexify@^3.4.2, duplexify@^3.6.0: version "3.7.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" @@ -1486,6 +1843,13 @@ errno@^0.1.3, errno@~0.1.7: dependencies: prr "~1.0.1" +error-ex@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + es-abstract@^1.5.1: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" @@ -1505,7 +1869,7 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" -escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1643,6 +2007,14 @@ find-cache-dir@^2.0.0: make-dir "^1.0.0" pkg-dir "^3.0.0" +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" @@ -1672,7 +2044,7 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -from2@^2.1.0: +from2@^2.1.0, from2@^2.1.1: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" dependencies: @@ -1726,6 +2098,16 @@ get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= + +get-stream@3.0.0, get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -1758,10 +2140,28 @@ glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +global@^4.3.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" + integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== + dependencies: + min-document "^2.19.0" + process "^0.11.10" + +globals@^10.0.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-10.4.0.tgz#5c477388b128a9e4c5c5d01c7a2aca68c68b2da7" + integrity sha512-uNUtxIZpGyuaq+5BqGGQHsL4wUlJAXRqOm6g3Y48/CWNGTLONgBibI0lh6lGxjR2HljFYUfszb+mk4WkgMntsA== + globals@^11.1.0: version "11.11.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.11.0.tgz#dcf93757fa2de5486fbeed7118538adf789e9c2e" +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + globby@^8.0.1: version "8.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" @@ -1774,18 +2174,60 @@ globby@^8.0.1: pify "^3.0.0" slash "^1.0.0" +got@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/got/-/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937" + integrity sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw== + dependencies: + "@sindresorhus/is" "^0.7.0" + cacheable-request "^2.1.1" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + into-stream "^3.1.0" + is-retry-allowed "^1.1.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + mimic-response "^1.0.0" + p-cancelable "^0.4.0" + p-timeout "^2.0.1" + pify "^3.0.0" + safe-buffer "^5.1.1" + timed-out "^4.0.1" + url-parse-lax "^3.0.0" + url-to-options "^1.0.1" + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: version "4.1.15" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== + has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== + dependencies: + has-symbol-support-x "^1.4.1" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -1837,6 +2279,13 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" +"hashish@>=0.0.2 <0.1": + version "0.0.4" + resolved "https://registry.yarnpkg.com/hashish/-/hashish-0.0.4.tgz#6d60bc6ffaf711b6afd60e426d077988014e6554" + integrity sha1-bWC8b/r3Ebav1g5CbQd5iAFOZVQ= + dependencies: + traverse ">=0.2.4" + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -1845,6 +2294,24 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +http-cache-semantics@3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== + https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -1877,6 +2344,13 @@ imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + integrity sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= + dependencies: + repeating "^2.0.0" + indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" @@ -1900,7 +2374,15 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -invariant@^2.2.2: +into-stream@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" + integrity sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY= + dependencies: + from2 "^2.1.1" + p-is-promise "^1.1.0" + +invariant@^2.2.0, invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: @@ -1922,6 +2404,11 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" @@ -1982,6 +2469,13 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -2010,6 +2504,16 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" + integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= + +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -2022,6 +2526,18 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-retry-allowed@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= + +is-scoped@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-scoped/-/is-scoped-1.0.0.tgz#449ca98299e713038256289ecb2b540dc437cb30" + integrity sha1-RJypgpnnEwOCViieyytUDcQ3yzA= + dependencies: + scoped-regex "^1.0.0" + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2032,6 +2548,11 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -2054,10 +2575,23 @@ isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + js-levenshtein@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -2069,6 +2603,33 @@ js-yaml@^3.10.0: argparse "^1.0.7" esprima "^4.0.0" +js2flowchart@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/js2flowchart/-/js2flowchart-1.1.7.tgz#fe3952e3c409edf780dfc2b1bf6ec6d272915995" + integrity sha512-F/lH3KZs9/5Z0l/78bd6DhDq0NEk/cTACMTNjnSvFZOAAtsixE3vruSPRVhbFMAtLtQUmFCyEx24SgN21fcKLQ== + dependencies: + babel-core "^6.26.3" + babel-generator "7.0.0-beta.3" + babel-plugin-add-module-exports "^0.2.1" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-object-rest-spread "^6.23.0" + babel-traverse "7.0.0-beta.3" + babel-types "^6.25.0" + babylon "7.0.0-beta.42" + commander "^2.12.1" + deepmerge "^1.5.1" + global "^4.3.2" + npm-name-cli "^1.2.0" + remove "^0.1.5" + string-width "^2.1.1" + xml-escape "^1.1.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -2077,6 +2638,11 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -2085,6 +2651,11 @@ json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -2097,6 +2668,13 @@ json5@^2.1.0: dependencies: minimist "^1.2.0" +keyv@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" + integrity sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA== + dependencies: + json-buffer "3.0.0" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -2123,6 +2701,17 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + loader-runner@^2.3.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -2149,10 +2738,22 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lodash@^4.17.10, lodash@^4.17.5: +lodash.zip@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" + integrity sha1-7GZi5IlkCO1KtsVCo5kLcswIACA= + +lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= + dependencies: + chalk "^1.0.0" + "long@git://github.com/dcodeIO/long.js.git#8181a6b50a2a230f0b2a1e4c4093f9b9d19c8b69": version "4.0.1" resolved "git://github.com/dcodeIO/long.js.git#8181a6b50a2a230f0b2a1e4c4093f9b9d19c8b69" @@ -2163,6 +2764,24 @@ loose-envify@^1.0.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lowercase-keys@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + integrity sha1-TjNms55/VFfjXxMkvfb4jQv8cwY= + +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + lru-cache@^4.1.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -2192,6 +2811,11 @@ map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" @@ -2221,6 +2845,22 @@ memory-fs@^0.4.0, memory-fs@~0.4.1: errno "^0.1.3" readable-stream "^2.0.1" +meow@^3.4.2: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + merge2@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" @@ -2254,6 +2894,18 @@ mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= + dependencies: + dom-walk "^0.1.0" + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -2272,7 +2924,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.2.0: +minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -2443,6 +3095,16 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -2453,10 +3115,39 @@ normalize-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" +normalize-url@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" + integrity sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw== + dependencies: + prepend-http "^2.0.0" + query-string "^5.0.1" + sort-keys "^2.0.0" + npm-bundled@^1.0.1: version "1.0.6" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" +npm-name-cli@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/npm-name-cli/-/npm-name-cli-1.2.0.tgz#fe45ae3442f50092574407db7753a7d4a800d2ac" + integrity sha1-/kWuNEL1AJJXRAfbd1On1KgA0qw= + dependencies: + chalk "^1.1.1" + log-symbols "^1.0.2" + meow "^3.4.2" + npm-name "^3.0.0" + +npm-name@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/npm-name/-/npm-name-3.2.0.tgz#3cd1b88b87ebbbb0327854ef09b6dfa157c6183b" + integrity sha512-9Z9/fOMDbH4oUN1sjALYKEa7n60VzFfeKoHz4v9eMhf5Omi7uf0nq0xzpfSF0Spdyn6jKBwRSMXNExEYFmpLWA== + dependencies: + got "^8.3.0" + is-scoped "^1.0.0" + lodash.zip "^4.0.0" + registry-url "^3.0.0" + npm-packlist@^1.1.6: version "1.3.0" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.3.0.tgz#7f01e8e44408341379ca98cfd756e7b29bd2626c" @@ -2483,7 +3174,7 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -object-assign@*, object-assign@^4.1.0: +object-assign@*, object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2540,7 +3231,7 @@ os-locale@^3.0.0: lcid "^2.0.0" mem "^4.0.0" -os-tmpdir@^1.0.0: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -2551,6 +3242,11 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-cancelable@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.4.1.tgz#35f363d67d52081c8d9585e37bcceb7e0bbcb2a0" + integrity sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ== + p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" @@ -2559,6 +3255,11 @@ p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + integrity sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4= + p-is-promise@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.0.0.tgz#7554e3d572109a87e1f3f53f6a7d85d1b194f4c5" @@ -2587,6 +3288,13 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" +p-timeout@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" + integrity sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA== + dependencies: + p-finally "^1.0.0" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -2624,6 +3332,13 @@ parse-author@2.0.0: dependencies: author-regex "^1.0.0" +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" @@ -2636,11 +3351,18 @@ path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -2652,6 +3374,15 @@ path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -2668,10 +3399,27 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -2688,7 +3436,12 @@ posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" -private@^0.1.6: +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + +private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -2761,6 +3514,15 @@ punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -2782,7 +3544,7 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -rc@^1.2.7: +rc@^1.0.1, rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" dependencies: @@ -2791,6 +3553,23 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + "readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -2811,6 +3590,14 @@ readdirp@^2.2.1: micromatch "^3.1.10" readable-stream "^2.0.2" +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + integrity sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + regenerate-unicode-properties@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" @@ -2821,6 +3608,11 @@ regenerate@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + regenerator-transform@^0.13.3: version "0.13.3" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" @@ -2853,6 +3645,13 @@ regexpu-core@^4.1.3, regexpu-core@^4.2.0: unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.0.2" +registry-url@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= + dependencies: + rc "^1.0.1" + regjsgen@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" @@ -2867,6 +3666,13 @@ remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" +remove@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/remove/-/remove-0.1.5.tgz#095ffd827d65c9f41ad97d33e416a75811079955" + integrity sha1-CV/9gn1lyfQa2X0z5BanWBEHmVU= + dependencies: + seq ">= 0.3.5" + repeat-element@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" @@ -2875,6 +3681,13 @@ repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -2887,12 +3700,26 @@ resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" +resolve@^1.10.0: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== + dependencies: + path-parse "^1.0.6" + resolve@^1.3.2: version "1.10.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" dependencies: path-parse "^1.0.6" +responselike@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -2955,10 +3782,28 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" +scoped-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/scoped-regex/-/scoped-regex-1.0.0.tgz#a346bb1acd4207ae70bd7c0c7ca9e566b6baddb8" + integrity sha1-o0a7Gs1CB65wvXwMfKnlZra63bg= + +"semver@2 || 3 || 4 || 5": + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" +"seq@>= 0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/seq/-/seq-0.3.5.tgz#ae02af3a424793d8ccbf212d69174e0c54dffe38" + integrity sha1-rgKvOkJHk9jMvyEtaRdODFTf/jg= + dependencies: + chainsaw ">=0.0.7 <0.1" + hashish ">=0.0.2 <0.1" + serialize-javascript@^1.4.0: version "1.6.1" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.6.1.tgz#4d1f697ec49429a847ca6f442a2a755126c4d879" @@ -3010,6 +3855,11 @@ signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +sketch-module-google-analytics@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/sketch-module-google-analytics/-/sketch-module-google-analytics-0.2.1.tgz#0763562d4179acb86d5d21c3aa1a9c3158e80914" + integrity sha512-/zSu4gTBoUidSCsXgkhoAf11XKaYHcyOZwZzZCHhnBaH2vstFjzlWTooZ6SbcN3Qabmd++tAVoBNRUY4w8YnFg== + sketch-polyfill-fetch@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/sketch-polyfill-fetch/-/sketch-polyfill-fetch-0.4.3.tgz#6c05b80762ba14cd07185f1520290ccb8654c969" @@ -3047,6 +3897,13 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + integrity sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= + dependencies: + is-plain-obj "^1.0.0" + source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -3061,6 +3918,13 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== + dependencies: + source-map "^0.5.6" + source-map-support@~0.5.9: version "0.5.10" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" @@ -3072,7 +3936,7 @@ source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" -source-map@^0.5.0, source-map@^0.5.6: +source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -3080,6 +3944,32 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -3137,6 +4027,11 @@ stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3176,14 +4071,33 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + dependencies: + is-utf8 "^0.2.0" + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + integrity sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI= + dependencies: + get-stdin "^4.0.1" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -3234,6 +4148,11 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" +timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + timers-browserify@^2.0.4: version "2.0.10" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" @@ -3244,6 +4163,11 @@ to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -3270,6 +4194,21 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +traverse@>=0.2.4: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc= + +"traverse@>=0.3.0 <0.4": + version "0.3.9" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" + integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk= + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= + trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" @@ -3367,6 +4306,18 @@ urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= + url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" @@ -3401,6 +4352,14 @@ util@^0.11.0: dependencies: inherits "2.0.3" +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" @@ -3490,6 +4449,11 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +xml-escape@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xml-escape/-/xml-escape-1.1.0.tgz#3904c143fa8eb3a0030ec646d2902a2f1b706c44" + integrity sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ= + xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"