From 666cea041b21f91946ce957b571e22a339b6f637 Mon Sep 17 00:00:00 2001 From: sonburn Date: Thu, 31 Mar 2022 17:23:13 -0500 Subject: [PATCH] Sketch 85 Compatibility --- .../Contents/Sketch/manifest.json | 2 +- UserFlows.sketchplugin/Contents/Sketch/script.js | 13 ++++++------- appcast.xml | 11 +++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/UserFlows.sketchplugin/Contents/Sketch/manifest.json b/UserFlows.sketchplugin/Contents/Sketch/manifest.json index 669f593..428da8c 100755 --- a/UserFlows.sketchplugin/Contents/Sketch/manifest.json +++ b/UserFlows.sketchplugin/Contents/Sketch/manifest.json @@ -241,7 +241,7 @@ "compatibleVersion" : "52" , "disableCocoaScriptPreprocessor" : true, "identifier" : "com.abynim.sketchplugins.userflows", - "version" : "2.3", + "version" : "2.3.1", "description" : "Generate user-flow diagrams from artboards in Sketch.", "homepage" : "https:\/\/abynim.github.io\/UserFlows", "authorEmail" : "abynimbalkar@gmail.com", diff --git a/UserFlows.sketchplugin/Contents/Sketch/script.js b/UserFlows.sketchplugin/Contents/Sketch/script.js index 8f8458b..9ffe744 100644 --- a/UserFlows.sketchplugin/Contents/Sketch/script.js +++ b/UserFlows.sketchplugin/Contents/Sketch/script.js @@ -625,7 +625,7 @@ var editConditionsForArtboard = function(currentArtboard, context, forceNewCondi conditionBorder.setThickness(2); conditionBoard.addLayers([conditionBox, conditionLabel]); - layersArray = MSLayerArray.arrayWithLayers([conditionBox, conditionLabel]); + layersArray = [conditionBox, conditionLabel]; conditionGroup = sketchVersion < sketchVersion52 ? MSLayerGroup.groupFromLayers(layersArray) : MSLayerGroup.groupWithLayers(layersArray); conditionGroup.setName(strings["addCondition-conditionGroupName"] + " " + count); @@ -1151,7 +1151,7 @@ var generateFlowWithSettings = function(context, settings, initialArtboard, sour } var sharedLayerStyles = sharedLayerStylesForContext(context); - var connectionLayers = MSLayerArray.arrayWithLayers(drawConnections(connections, sourcePage, exportScale, flowBackgroundColor, sharedLayerStyles)); + var connectionLayers = drawConnections(connections, sourcePage, exportScale, flowBackgroundColor, sharedLayerStyles); var connectionsGroup = sketchVersion < sketchVersion52 ? MSLayerGroup.groupFromLayers(connectionLayers) : MSLayerGroup.groupWithLayers(connectionLayers); connectionsGroup.setName(strings["generateFlow-connectionsGroupName"]); artboardBitmapLayers.push(connectionsGroup); @@ -1161,7 +1161,7 @@ var generateFlowWithSettings = function(context, settings, initialArtboard, sour for (var i = 0; i < artboardBitmapLayers.length; i++) { groupBounds = CGRectUnion(groupBounds, artboardBitmapLayers[i].absoluteRect().rect()); } - var layers = MSLayerArray.arrayWithLayers(artboardBitmapLayers); + var layers = artboardBitmapLayers; var newGroup = sketchVersion < sketchVersion52 ? MSLayerGroup.groupFromLayers(layers) : MSLayerGroup.groupWithLayers(layers); newGroup.setName(strings["generateFlow-flowGroupName"]); newGroup.resizeToFitChildrenWithOption(1); @@ -1450,7 +1450,7 @@ var sharedLayerStylesForContext = function(context) { var redrawConnections = function(context) { var doc = context.document || context.actionContext.document; - var selectedLayers = doc.selectedLayers().layers(); + var selectedLayers = doc.selectedLayers(); sketchVersion = getVersionNumberFromString(NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString")); @@ -1504,12 +1504,11 @@ var redrawConnections = function(context) { } var sharedLayerStyles = sharedLayerStylesForContext(context); - var connectionLayers = MSLayerArray.arrayWithLayers(drawConnections(connections, doc.currentPage(), 1, nil, sharedLayerStyles)); + var connectionLayers = drawConnections(connections, doc.currentPage(), 1, nil, sharedLayerStyles); connectionsGroup = sketchVersion < sketchVersion52 ? MSLayerGroup.groupFromLayers(connectionLayers) : MSLayerGroup.groupWithLayers(connectionLayers); connectionsGroup.setName("-Connections"); connectionsGroup.setIsLocked(1); - connectionsGroup.deselectLayerAndParent(); - context.command.setValue_forKey_onLayer_forPluginIdentifier(true, "isConnectionsContainer", connectionsGroup, kPluginDomain); + context.command.setValue_forKey_onLayer(true,"isConnectionsContainer",connectionsGroup); var loop = selectedLayers.objectEnumerator(), selectedLayer; while (selectedLayer = loop.nextObject()) { diff --git a/appcast.xml b/appcast.xml index d7b6830..d298c22 100644 --- a/appcast.xml +++ b/appcast.xml @@ -5,6 +5,17 @@ https://abynim.github.io/UserFlows Generate flow diagrams from Artboards in Sketch en + + UserFlows 2.3.1 + + +
  • Sketch 85 Compatibility
  • + + ]]> +
    + +
    UserFlows 2.3