From 9c5fa5c57e8d912be636cc1c72bd17e0545f6a4a Mon Sep 17 00:00:00 2001 From: Bryan Figueroa Date: Tue, 2 Mar 2021 16:29:20 -0700 Subject: [PATCH 01/11] Added getVariableName to provider --- .../middleware/state_management/provider_middleware.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generation/generators/middleware/state_management/provider_middleware.dart b/lib/generation/generators/middleware/state_management/provider_middleware.dart index dbdbb17d..175582f0 100644 --- a/lib/generation/generators/middleware/state_management/provider_middleware.dart +++ b/lib/generation/generators/middleware/state_management/provider_middleware.dart @@ -27,7 +27,7 @@ class ProviderMiddleware extends Middleware { node.currentContext.project.genProjectData .addDependencies(PACKAGE_NAME, PACKAGE_VERSION); managerData.addImport('package:provider/provider.dart'); - watcherName = node.name.snakeCase + '_notifier'; + watcherName = getVariableName(node.name.snakeCase + '_notifier'); var widgetName = node.functionCallName.camelCase; var watcher; From 67a54100a2507ad276d406e334a9688118d99dad Mon Sep 17 00:00:00 2001 From: Bryan Figueroa Date: Wed, 3 Mar 2021 17:06:37 -0700 Subject: [PATCH 02/11] Added check git script --- lib/generation/helperScripts/check-git.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 lib/generation/helperScripts/check-git.sh diff --git a/lib/generation/helperScripts/check-git.sh b/lib/generation/helperScripts/check-git.sh new file mode 100755 index 00000000..b774cf86 --- /dev/null +++ b/lib/generation/helperScripts/check-git.sh @@ -0,0 +1,17 @@ +# Script to verify that SAC is pointing to master + +cd SketchAssetConverter + +git fetch + +masterCom=`git rev-parse master` +# echo $masterCom +currentCom=`git rev-parse HEAD` +# echo $currentCom + +if [ $masterCom == $currentCom ] +then + echo "Sketch Asset Converter is up to date!" +else + echo "Sketch Asset Converter is behind master." +fi \ No newline at end of file From f0810e7ab1f22ebb494be43ca0d195fd696de376 Mon Sep 17 00:00:00 2001 From: Bryan Figueroa Date: Wed, 3 Mar 2021 17:06:50 -0700 Subject: [PATCH 03/11] Used check git script to give feedback to the user --- lib/main.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index b209838b..131ddcd6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -151,6 +151,19 @@ ${parser.usage} InputDesignService(path); if (!Platform.environment.containsKey('SAC_ENDPOINT')) { + var isSACupToDate = await Process.run( + './lib/generation/helperScripts/check-git.sh', + [], + workingDirectory: MainInfo().cwd.path, + ); + + if (isSACupToDate.stdout + .contains('Sketch Asset Converter is up to date!')) { + log.info(isSACupToDate.stdout); + } else { + log.warning(isSACupToDate.stdout); + } + process = await Process.start('npm', ['run', 'prod'], workingDirectory: MainInfo().cwd.path + '/SketchAssetConverter'); From 72275538abd3fb5f56954cde5bb9b6ccc404aa02 Mon Sep 17 00:00:00 2001 From: Bryan Figueroa Date: Wed, 3 Mar 2021 17:37:28 -0700 Subject: [PATCH 04/11] Switched if statement for warning and info --- lib/main.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 131ddcd6..d712051f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -158,10 +158,10 @@ ${parser.usage} ); if (isSACupToDate.stdout - .contains('Sketch Asset Converter is up to date!')) { - log.info(isSACupToDate.stdout); - } else { + .contains('Sketch Asset Converter is behind master.')) { log.warning(isSACupToDate.stdout); + } else { + log.info(isSACupToDate.stdout); } process = await Process.start('npm', ['run', 'prod'], From e30c73c5dd07d3a6a1c9b3dd6a0ffc95a826b61f Mon Sep 17 00:00:00 2001 From: Bryan Figueroa Date: Wed, 3 Mar 2021 17:37:52 -0700 Subject: [PATCH 05/11] Added a check where it ensures that the submodule is donwloaded --- lib/generation/helperScripts/check-git.sh | 30 +++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/generation/helperScripts/check-git.sh b/lib/generation/helperScripts/check-git.sh index b774cf86..be14bc2f 100755 --- a/lib/generation/helperScripts/check-git.sh +++ b/lib/generation/helperScripts/check-git.sh @@ -1,17 +1,31 @@ -# Script to verify that SAC is pointing to master +# Script to verify that SAC was pulled and pointing to master + +parentCom=`git rev-parse HEAD` cd SketchAssetConverter git fetch -masterCom=`git rev-parse master` -# echo $masterCom currentCom=`git rev-parse HEAD` -# echo $currentCom +# echo $currentComi -if [ $masterCom == $currentCom ] +if [ $parentCom == $currentCom ] then - echo "Sketch Asset Converter is up to date!" + cd .. + temp=`git submodule update --init` + temp2=`git pull --recurse-submodules` + cd SketchAssetConverter + git fetch + currentCom=`git rev-parse HEAD` + echo "Downloading submodule SketchAssetConverter" else - echo "Sketch Asset Converter is behind master." -fi \ No newline at end of file + masterCom=`git rev-parse @:./SketchAssetConverter` + # echo $masterCom + + if [ $masterCom == $currentCom ] + then + echo "Sketch Asset Converter is up to date!" + else + echo "Sketch Asset Converter is behind master." + fi +fi From 882a1da58a7d244aa0fe344ca53099406da3eb90 Mon Sep 17 00:00:00 2001 From: Bryan Figueroa Date: Fri, 5 Mar 2021 15:25:33 -0700 Subject: [PATCH 06/11] Moved script to pb-scripts --- SketchAssetConverter | 2 +- lib/main.dart | 2 +- {lib/generation/helperScripts => pb-scripts}/check-git.sh | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {lib/generation/helperScripts => pb-scripts}/check-git.sh (100%) diff --git a/SketchAssetConverter b/SketchAssetConverter index 8e424654..29bdd60e 160000 --- a/SketchAssetConverter +++ b/SketchAssetConverter @@ -1 +1 @@ -Subproject commit 8e424654c1228ffd3a767a9c36555840a4583e09 +Subproject commit 29bdd60e8ea3d2e55cd9b74ece1c69830bd171b4 diff --git a/lib/main.dart b/lib/main.dart index d712051f..9c2b00ed 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -152,7 +152,7 @@ ${parser.usage} if (!Platform.environment.containsKey('SAC_ENDPOINT')) { var isSACupToDate = await Process.run( - './lib/generation/helperScripts/check-git.sh', + './pb-scripts/check-git.sh', [], workingDirectory: MainInfo().cwd.path, ); diff --git a/lib/generation/helperScripts/check-git.sh b/pb-scripts/check-git.sh similarity index 100% rename from lib/generation/helperScripts/check-git.sh rename to pb-scripts/check-git.sh From 947b0e949d8d1a146a7319949fb128839b8703f3 Mon Sep 17 00:00:00 2001 From: Ivan Vigliante Date: Fri, 5 Mar 2021 15:27:50 -0700 Subject: [PATCH 07/11] Fix state management nodes having incorrect layout Fixed by only doing positional cleansing for non-state nodes --- lib/controllers/interpret.dart | 5 ++-- .../pb_visual_generation_service.dart | 26 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/controllers/interpret.dart b/lib/controllers/interpret.dart index 5643a037..c84d37f8 100644 --- a/lib/controllers/interpret.dart +++ b/lib/controllers/interpret.dart @@ -222,8 +222,9 @@ class Interpret { /// VisualGenerationService PBIntermediateNode node; try { - node = await PBVisualGenerationService(component, currentContext: context) - .getIntermediateTree(ignoreStates: ignoreStates); + node = await PBVisualGenerationService(component, + currentContext: context, ignoreStates: ignoreStates) + .getIntermediateTree(); } catch (e, stackTrace) { await MainInfo().sentry.captureException( exception: e, diff --git a/lib/interpret_and_optimize/services/pb_visual_generation_service.dart b/lib/interpret_and_optimize/services/pb_visual_generation_service.dart index b9bcab2a..3cf24849 100644 --- a/lib/interpret_and_optimize/services/pb_visual_generation_service.dart +++ b/lib/interpret_and_optimize/services/pb_visual_generation_service.dart @@ -29,18 +29,30 @@ class PBVisualGenerationService implements PBGenerationService { PBStateManagementHelper smHelper; + /// Boolean that is `true` if the [VisualGenerationService] + /// is currently processing a state management node + bool _ignoreStates; + /// Constructor for PBVisualGenerationService, must include the root SketchNode - PBVisualGenerationService(originalRoot, {this.currentContext}) { - _positionalCleansingService = PositionalCleansingService(); - this.originalRoot = - _positionalCleansingService.eliminateOffset(originalRoot); + PBVisualGenerationService(originalRoot, + {this.currentContext, bool ignoreStates = false}) { + _ignoreStates = ignoreStates; + // Only do positional cleansing for non-state nodes, since those nodes + // have already been through this service + if (!_ignoreStates) { + _positionalCleansingService = PositionalCleansingService(); + this.originalRoot = + _positionalCleansingService.eliminateOffset(originalRoot); + } else { + this.originalRoot = originalRoot; + } + smHelper = PBStateManagementHelper(); } /// Builds and returns intermediate tree by breadth depth first. /// @return Returns the root node of the intermediate tree. - Future getIntermediateTree( - {bool ignoreStates = false}) async { + Future getIntermediateTree() async { if (originalRoot == null) { return Future.value(null); } @@ -73,7 +85,7 @@ class PBVisualGenerationService implements PBGenerationService { } // Interpret state management node - if (!ignoreStates && + if (!_ignoreStates && smHelper.isValidStateNode(result.name) && (currentNode.designNode.name != currentNode.convertedParent?.name ?? From 53b1ffada6e3779621e22ef37149add5ce3dadca Mon Sep 17 00:00:00 2001 From: Ivan Vigliante Date: Fri, 5 Mar 2021 18:08:39 -0700 Subject: [PATCH 08/11] Added support for prototyping for Figma Added detection of homeScreen for Figma Co-authored-by: Bryan Figueroa --- SketchAssetConverter | 2 +- .../prototyping/pb_prototype_storage.dart | 2 +- .../entities/layers/boolean_operation.dart | 11 +- .../entities/layers/boolean_operation.g.dart | 8 +- lib/input/figma/entities/layers/canvas.dart | 15 ++- lib/input/figma/entities/layers/canvas.g.dart | 8 +- .../figma/entities/layers/component.dart | 10 +- .../figma/entities/layers/component.g.dart | 10 +- lib/input/figma/entities/layers/ellipse.dart | 6 ++ .../figma/entities/layers/ellipse.g.dart | 8 +- .../figma/entities/layers/figma_node.dart | 11 ++ lib/input/figma/entities/layers/frame.dart | 21 ++-- lib/input/figma/entities/layers/frame.g.dart | 10 +- lib/input/figma/entities/layers/group.dart | 98 ++++++++--------- lib/input/figma/entities/layers/group.g.dart | 10 +- lib/input/figma/entities/layers/instance.dart | 101 +++++++++--------- .../figma/entities/layers/instance.g.dart | 10 +- lib/input/figma/entities/layers/line.dart | 40 ++++--- lib/input/figma/entities/layers/line.g.dart | 8 +- .../figma/entities/layers/rectangle.dart | 46 ++++---- .../figma/entities/layers/rectangle.g.dart | 8 +- .../entities/layers/regular_polygon.dart | 6 ++ .../entities/layers/regular_polygon.g.dart | 8 +- lib/input/figma/entities/layers/slice.dart | 10 +- lib/input/figma/entities/layers/slice.g.dart | 8 +- lib/input/figma/entities/layers/star.dart | 6 ++ lib/input/figma/entities/layers/star.g.dart | 8 +- lib/input/figma/entities/layers/text.dart | 46 ++++---- lib/input/figma/entities/layers/text.g.dart | 8 +- lib/input/figma/entities/layers/vector.dart | 10 +- lib/input/figma/entities/layers/vector.g.dart | 8 +- lib/input/figma/helper/figma_project.dart | 3 + 32 files changed, 355 insertions(+), 209 deletions(-) diff --git a/SketchAssetConverter b/SketchAssetConverter index 29bdd60e..8e424654 160000 --- a/SketchAssetConverter +++ b/SketchAssetConverter @@ -1 +1 @@ -Subproject commit 29bdd60e8ea3d2e55cd9b74ece1c69830bd171b4 +Subproject commit 8e424654c1228ffd3a767a9c36555840a4583e09 diff --git a/lib/generation/prototyping/pb_prototype_storage.dart b/lib/generation/prototyping/pb_prototype_storage.dart index cd14981e..d5f14e83 100644 --- a/lib/generation/prototyping/pb_prototype_storage.dart +++ b/lib/generation/prototyping/pb_prototype_storage.dart @@ -28,7 +28,7 @@ class PBPrototypeStorage { if (_pbPrototypeInstanceNodes.containsKey(prototypeNode.UUID)) { return false; } - // await TODO: + await PBPrototypeAggregationService() .analyzeIntermediateNode(prototypeNode); _pbPrototypeInstanceNodes['${prototypeNode.UUID}'] = prototypeNode; diff --git a/lib/input/figma/entities/layers/boolean_operation.dart b/lib/input/figma/entities/layers/boolean_operation.dart index 618cb4c7..190248f6 100644 --- a/lib/input/figma/entities/layers/boolean_operation.dart +++ b/lib/input/figma/entities/layers/boolean_operation.dart @@ -36,10 +36,15 @@ class BooleanOperation extends FigmaVector FigmaStyle style, Frame this.boundaryRectangle, String UUID, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing, }) : super( - style: style, - UUID: UUID, - ) { + style: style, + UUID: UUID, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing) { log = Logger(runtimeType.toString()); pbdfType = 'boolean_operation'; } diff --git a/lib/input/figma/entities/layers/boolean_operation.g.dart b/lib/input/figma/entities/layers/boolean_operation.g.dart index 17247ab4..0d463cfe 100644 --- a/lib/input/figma/entities/layers/boolean_operation.g.dart +++ b/lib/input/figma/entities/layers/boolean_operation.g.dart @@ -21,6 +21,9 @@ BooleanOperation _$BooleanOperationFromJson(Map json) { ? null : Frame.fromJson(json['absoluteBoundingBox'] as Map), UUID: json['id'] as String, + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..name = json['name'] as String ..pluginData = json['pluginData'] @@ -28,7 +31,6 @@ BooleanOperation _$BooleanOperationFromJson(Map json) { ..isVisible = json['visible'] as bool ?? true ..layoutAlign = json['layoutAlign'] as String ..constraints = json['constraints'] - ..prototypeNodeUUID = json['transitionNodeID'] as String ..size = json['size'] ..strokes = json['strokes'] ..strokeWeight = (json['strokeWeight'] as num)?.toDouble() @@ -46,10 +48,12 @@ Map _$BooleanOperationToJson(BooleanOperation instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'style': instance.style, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'size': instance.size, 'strokes': instance.strokes, 'strokeWeight': instance.strokeWeight, diff --git a/lib/input/figma/entities/layers/canvas.dart b/lib/input/figma/entities/layers/canvas.dart index 47d95dbb..81bd7e62 100644 --- a/lib/input/figma/entities/layers/canvas.dart +++ b/lib/input/figma/entities/layers/canvas.dart @@ -13,6 +13,7 @@ part 'canvas.g.dart'; class Canvas extends FigmaNode implements FigmaNodeFactory, GroupNode { @override String type = 'CANVAS'; + Canvas({ this.name, this.type, @@ -21,7 +22,19 @@ class Canvas extends FigmaNode implements FigmaNodeFactory, GroupNode { this.prototypeStartNodeID, this.prototypeDevice, this.exportSettings, - }) : super(name, true, type, null, null) { + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing, + }) : super( + name, + true, + type, + null, + null, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, + ) { pbdfType = 'artboard'; } // Last two nulls are used for Figma plugins diff --git a/lib/input/figma/entities/layers/canvas.g.dart b/lib/input/figma/entities/layers/canvas.g.dart index 5fdec3bc..58686bf6 100644 --- a/lib/input/figma/entities/layers/canvas.g.dart +++ b/lib/input/figma/entities/layers/canvas.g.dart @@ -18,13 +18,15 @@ Canvas _$CanvasFromJson(Map json) { prototypeStartNodeID: json['prototypeStartNodeID'], prototypeDevice: json['prototypeDevice'], exportSettings: json['exportSettings'], + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String ..pluginData = json['pluginData'] ..sharedPluginData = json['sharedPluginData'] ..isVisible = json['visible'] as bool ?? true ..boundaryRectangle = json['boundaryRectangle'] - ..prototypeNodeUUID = json['prototypeNodeUUID'] as String ..pbdfType = json['pbdfType'] as String; } @@ -33,6 +35,8 @@ Map _$CanvasToJson(Canvas instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'type': instance.type, 'name': instance.name, 'children': instance.children, @@ -41,6 +45,6 @@ Map _$CanvasToJson(Canvas instance) => { 'prototypeDevice': instance.prototypeDevice, 'exportSettings': instance.exportSettings, 'boundaryRectangle': instance.boundaryRectangle, - 'prototypeNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeUUID': instance.prototypeNodeUUID, 'pbdfType': instance.pbdfType, }; diff --git a/lib/input/figma/entities/layers/component.dart b/lib/input/figma/entities/layers/component.dart index dec71e84..c751ccb8 100644 --- a/lib/input/figma/entities/layers/component.dart +++ b/lib/input/figma/entities/layers/component.dart @@ -5,9 +5,7 @@ import 'package:parabeac_core/input/figma/entities/abstract_figma_node_factory.d import 'package:parabeac_core/input/figma/entities/layers/figma_node.dart'; import 'package:parabeac_core/input/figma/entities/layers/frame.dart'; import 'package:parabeac_core/input/figma/entities/style/figma_color.dart'; -import 'package:parabeac_core/input/sketch/entities/layers/flow.dart'; import 'package:parabeac_core/input/sketch/entities/objects/frame.dart'; -import 'package:parabeac_core/input/sketch/entities/objects/override_property.dart'; import 'package:parabeac_core/input/sketch/helper/symbol_node_mixin.dart'; import 'package:parabeac_core/interpret_and_optimize/entities/pb_shared_master_node.dart'; import 'package:parabeac_core/interpret_and_optimize/entities/subclasses/pb_intermediate_node.dart'; @@ -41,12 +39,14 @@ class Component extends FigmaFrame horizontalPadding, verticalPadding, itemSpacing, - Flow flow, this.overrideProperties, List children, FigmaColor backgroundColor, this.symbolID, this.overriadableProperties, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing, }) : super( name: name, isVisible: isVisible, @@ -66,9 +66,11 @@ class Component extends FigmaFrame horizontalPadding: horizontalPadding, verticalPadding: verticalPadding, itemSpacing: itemSpacing, - flow: flow, children: children, backgroundColor: backgroundColor, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'symbol_master'; } diff --git a/lib/input/figma/entities/layers/component.g.dart b/lib/input/figma/entities/layers/component.g.dart index ebf811e2..03af3568 100644 --- a/lib/input/figma/entities/layers/component.g.dart +++ b/lib/input/figma/entities/layers/component.g.dart @@ -36,9 +36,12 @@ Component _$ComponentFromJson(Map json) { : FigmaColor.fromJson(json['backgroundColor'] as Map), symbolID: json['symbolID'] as String, overriadableProperties: json['overriadableProperties'] as List, + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String - ..prototypeNodeUUID = json['transitionNodeID'] as String + ..isHome = json['isHome'] as bool ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String @@ -51,8 +54,10 @@ Map _$ComponentToJson(Component instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, - 'transitionNodeID': instance.prototypeNodeUUID, 'children': instance.children, 'strokes': instance.strokes, 'strokeWeight': instance.strokeWeight, @@ -65,6 +70,7 @@ Map _$ComponentToJson(Component instance) => { 'verticalPadding': instance.verticalPadding, 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, + 'isHome': instance.isHome, 'fills': instance.fillsList, 'imageReference': instance.imageReference, 'type': instance.type, diff --git a/lib/input/figma/entities/layers/ellipse.dart b/lib/input/figma/entities/layers/ellipse.dart index d13b8012..d8c8b5a6 100644 --- a/lib/input/figma/entities/layers/ellipse.dart +++ b/lib/input/figma/entities/layers/ellipse.dart @@ -42,6 +42,9 @@ class FigmaEllipse extends FigmaVector strokeWeight, strokeAlign, styles, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing, }) : super( name: name, visible: visible, @@ -57,6 +60,9 @@ class FigmaEllipse extends FigmaVector strokeWeight: strokeWeight, strokeAlign: strokeAlign, styles: styles, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'oval'; log = Logger(runtimeType.toString()); diff --git a/lib/input/figma/entities/layers/ellipse.g.dart b/lib/input/figma/entities/layers/ellipse.g.dart index a5ff352a..dca6e9eb 100644 --- a/lib/input/figma/entities/layers/ellipse.g.dart +++ b/lib/input/figma/entities/layers/ellipse.g.dart @@ -23,10 +23,12 @@ FigmaEllipse _$FigmaEllipseFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String ..isVisible = json['visible'] as bool ?? true - ..prototypeNodeUUID = json['transitionNodeID'] as String ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String; @@ -39,10 +41,12 @@ Map _$FigmaEllipseToJson(FigmaEllipse instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'style': instance.style, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'strokes': instance.strokes, diff --git a/lib/input/figma/entities/layers/figma_node.dart b/lib/input/figma/entities/layers/figma_node.dart index 74cb00b9..bd639c61 100644 --- a/lib/input/figma/entities/layers/figma_node.dart +++ b/lib/input/figma/entities/layers/figma_node.dart @@ -25,6 +25,14 @@ abstract class FigmaNode implements DesignNode { @JsonKey(name: 'visible', defaultValue: true) bool isVisible; + @override + @JsonKey(name: 'transitionNodeUUID') + String prototypeNodeUUID; + @JsonKey(nullable: true) + num transitionDuration; + @JsonKey(nullable: true) + String transitionEasing; + FigmaNode( this.name, this.isVisible, @@ -32,6 +40,9 @@ abstract class FigmaNode implements DesignNode { this.pluginData, this.sharedPluginData, { this.UUID, + this.prototypeNodeUUID, + this.transitionDuration, + this.transitionEasing, }); @override Map toJson(); diff --git a/lib/input/figma/entities/layers/frame.dart b/lib/input/figma/entities/layers/frame.dart index 47818036..be54338a 100644 --- a/lib/input/figma/entities/layers/frame.dart +++ b/lib/input/figma/entities/layers/frame.dart @@ -9,7 +9,6 @@ import 'package:parabeac_core/input/figma/entities/layers/figma_node.dart'; import 'package:parabeac_core/input/figma/entities/layers/group.dart'; import 'package:parabeac_core/input/figma/entities/style/figma_color.dart'; import 'package:parabeac_core/input/figma/helper/style_extractor.dart'; -import 'package:parabeac_core/input/sketch/entities/layers/flow.dart'; import 'package:parabeac_core/interpret_and_optimize/entities/inherited_scaffold.dart'; import 'package:parabeac_core/interpret_and_optimize/helpers/pb_context.dart'; import 'package:parabeac_core/interpret_and_optimize/entities/subclasses/pb_intermediate_node.dart'; @@ -25,10 +24,6 @@ class FigmaFrame extends FigmaNode @JsonKey(name: 'absoluteBoundingBox') var boundaryRectangle; - @override - @JsonKey(name: 'transitionNodeID') - String prototypeNodeUUID; - @override @JsonKey(ignore: true) var style; @@ -68,6 +63,8 @@ class FigmaFrame extends FigmaNode @JsonKey(ignore: true) bool isScaffold = false; + bool isHome = false; + FigmaFrame({ name, isVisible, @@ -88,9 +85,12 @@ class FigmaFrame extends FigmaNode this.verticalPadding, this.itemSpacing, List this.children, - Flow flow, String UUID, FigmaColor this.backgroundColor, + String transitionNodeID, + num transitionDuration, + String transitionEasing, + String prototypeNodeUUID, }) : super( name, isVisible, @@ -98,6 +98,9 @@ class FigmaFrame extends FigmaNode pluginData, sharedPluginData, UUID: UUID, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'group'; } @@ -127,7 +130,7 @@ class FigmaFrame extends FigmaNode this, currentContext: currentContext, name: name, - isHomeScreen: false, + isHomeScreen: isHome, )); } else { var tempGroup = Group( @@ -149,10 +152,12 @@ class FigmaFrame extends FigmaNode horizontalPadding: horizontalPadding, verticalPadding: verticalPadding, itemSpacing: itemSpacing, - flow: null, children: children, UUID: UUID, backgroundColor: backgroundColor, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ); return Future.value(tempGroup.interpretNode(currentContext)); diff --git a/lib/input/figma/entities/layers/frame.g.dart b/lib/input/figma/entities/layers/frame.g.dart index fbaa57e4..fe38a37a 100644 --- a/lib/input/figma/entities/layers/frame.g.dart +++ b/lib/input/figma/entities/layers/frame.g.dart @@ -34,8 +34,11 @@ FigmaFrame _$FigmaFrameFromJson(Map json) { backgroundColor: json['backgroundColor'] == null ? null : FigmaColor.fromJson(json['backgroundColor'] as Map), + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, + prototypeNodeUUID: json['transitionNodeUUID'] as String, ) - ..prototypeNodeUUID = json['transitionNodeID'] as String + ..isHome = json['isHome'] as bool ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String @@ -49,8 +52,10 @@ Map _$FigmaFrameToJson(FigmaFrame instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, - 'transitionNodeID': instance.prototypeNodeUUID, 'children': instance.children, 'strokes': instance.strokes, 'strokeWeight': instance.strokeWeight, @@ -64,6 +69,7 @@ Map _$FigmaFrameToJson(FigmaFrame instance) => 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, 'type': instance.type, + 'isHome': instance.isHome, 'fills': instance.fillsList, 'imageReference': instance.imageReference, 'pbdfType': instance.pbdfType, diff --git a/lib/input/figma/entities/layers/group.dart b/lib/input/figma/entities/layers/group.dart index 9072dd52..e664925e 100644 --- a/lib/input/figma/entities/layers/group.dart +++ b/lib/input/figma/entities/layers/group.dart @@ -8,7 +8,6 @@ import 'package:parabeac_core/input/figma/entities/layers/text.dart'; import 'package:parabeac_core/input/figma/entities/layers/vector.dart'; import 'package:parabeac_core/input/figma/entities/style/figma_color.dart'; import 'package:parabeac_core/input/figma/helper/figma_asset_processor.dart'; -import 'package:parabeac_core/input/sketch/entities/layers/flow.dart'; import 'package:parabeac_core/input/sketch/entities/objects/frame.dart'; import 'package:parabeac_core/interpret_and_optimize/entities/inherited_bitmap.dart'; import 'package:parabeac_core/interpret_and_optimize/entities/layouts/temp_group_layout_node.dart'; @@ -33,53 +32,56 @@ class Group extends FigmaFrame implements AbstractFigmaNodeFactory, Image { @override String imageReference; - Group({ - name, - isVisible, - type, - pluginData, - sharedPluginData, - Frame boundaryRectangle, - style, - fills, - strokes, - strokeWeight, - strokeAlign, - cornerRadius, - constraints, - layoutAlign, - size, - horizontalPadding, - verticalPadding, - itemSpacing, - Flow flow, - List children, - String UUID, - FigmaColor backgroundColor, - }) : super( - name: name, - isVisible: isVisible, - type: type, - pluginData: pluginData, - sharedPluginData: sharedPluginData, - boundaryRectangle: boundaryRectangle, - style: style, - fills: fills, - strokes: strokes, - strokeWeight: strokeWeight, - strokeAlign: strokeAlign, - cornerRadius: cornerRadius, - constraints: constraints, - layoutAlign: layoutAlign, - size: size, - horizontalPadding: horizontalPadding, - verticalPadding: verticalPadding, - itemSpacing: itemSpacing, - flow: flow, - children: children, - UUID: UUID, - backgroundColor: backgroundColor, - ) { + Group( + {name, + isVisible, + type, + pluginData, + sharedPluginData, + Frame boundaryRectangle, + style, + fills, + strokes, + strokeWeight, + strokeAlign, + cornerRadius, + constraints, + layoutAlign, + size, + horizontalPadding, + verticalPadding, + itemSpacing, + List children, + String UUID, + FigmaColor backgroundColor, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing}) + : super( + name: name, + isVisible: isVisible, + type: type, + pluginData: pluginData, + sharedPluginData: sharedPluginData, + boundaryRectangle: boundaryRectangle, + style: style, + fills: fills, + strokes: strokes, + strokeWeight: strokeWeight, + strokeAlign: strokeAlign, + cornerRadius: cornerRadius, + constraints: constraints, + layoutAlign: layoutAlign, + size: size, + horizontalPadding: horizontalPadding, + verticalPadding: verticalPadding, + itemSpacing: itemSpacing, + children: children, + UUID: UUID, + backgroundColor: backgroundColor, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing) { if (areAllVectors()) { pbdfType = 'image'; } else { diff --git a/lib/input/figma/entities/layers/group.g.dart b/lib/input/figma/entities/layers/group.g.dart index 32bed318..fc3281f3 100644 --- a/lib/input/figma/entities/layers/group.g.dart +++ b/lib/input/figma/entities/layers/group.g.dart @@ -34,8 +34,11 @@ Group _$GroupFromJson(Map json) { backgroundColor: json['backgroundColor'] == null ? null : FigmaColor.fromJson(json['backgroundColor'] as Map), + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) - ..prototypeNodeUUID = json['transitionNodeID'] as String + ..isHome = json['isHome'] as bool ..fillsList = json['fills'] as List ..isFlowHome = json['isFlowHome'] ..imageReference = json['imageReference'] as String @@ -48,8 +51,10 @@ Map _$GroupToJson(Group instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, - 'transitionNodeID': instance.prototypeNodeUUID, 'children': instance.children, 'strokes': instance.strokes, 'strokeWeight': instance.strokeWeight, @@ -62,6 +67,7 @@ Map _$GroupToJson(Group instance) => { 'verticalPadding': instance.verticalPadding, 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, + 'isHome': instance.isHome, 'fills': instance.fillsList, 'isFlowHome': instance.isFlowHome, 'type': instance.type, diff --git a/lib/input/figma/entities/layers/instance.dart b/lib/input/figma/entities/layers/instance.dart index 11064dac..6c5d419b 100644 --- a/lib/input/figma/entities/layers/instance.dart +++ b/lib/input/figma/entities/layers/instance.dart @@ -4,8 +4,6 @@ import 'package:parabeac_core/input/figma/entities/abstract_figma_node_factory.d import 'package:parabeac_core/input/figma/entities/layers/figma_node.dart'; import 'package:parabeac_core/input/figma/entities/layers/frame.dart'; import 'package:parabeac_core/input/figma/entities/style/figma_color.dart'; -import 'package:parabeac_core/input/sketch/entities/layers/abstract_layer.dart'; -import 'package:parabeac_core/input/sketch/entities/layers/flow.dart'; import 'package:parabeac_core/input/sketch/entities/objects/frame.dart'; import 'package:parabeac_core/input/sketch/entities/objects/override_value.dart'; import 'package:parabeac_core/interpret_and_optimize/entities/pb_shared_instance.dart'; @@ -28,54 +26,57 @@ class Instance extends FigmaFrame @override List children; - Instance({ - name, - isVisible, - type, - pluginData, - sharedPluginData, - Frame boundaryRectangle, - style, - fills, - strokes, - strokeWeight, - strokeAlign, - cornerRadius, - constraints, - layoutAlign, - size, - horizontalPadding, - verticalPadding, - itemSpacing, - Flow flow, - this.componentId, - List this.children, - this.parameters, - this.symbolID, - FigmaColor backgroundColor, - }) : super( - name: name, - isVisible: isVisible, - type: type, - pluginData: pluginData, - sharedPluginData: sharedPluginData, - boundaryRectangle: boundaryRectangle, - style: style, - fills: fills, - strokes: strokes, - strokeWeight: strokeWeight, - strokeAlign: strokeAlign, - cornerRadius: cornerRadius, - constraints: constraints, - layoutAlign: layoutAlign, - size: size, - horizontalPadding: horizontalPadding, - verticalPadding: verticalPadding, - itemSpacing: itemSpacing, - flow: flow, - children: children, - backgroundColor: backgroundColor, - ) { + Instance( + {name, + isVisible, + type, + pluginData, + sharedPluginData, + Frame boundaryRectangle, + style, + fills, + strokes, + strokeWeight, + strokeAlign, + cornerRadius, + constraints, + layoutAlign, + size, + horizontalPadding, + verticalPadding, + itemSpacing, + this.componentId, + List this.children, + this.parameters, + this.symbolID, + FigmaColor backgroundColor, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing}) + : super( + name: name, + isVisible: isVisible, + type: type, + pluginData: pluginData, + sharedPluginData: sharedPluginData, + boundaryRectangle: boundaryRectangle, + style: style, + fills: fills, + strokes: strokes, + strokeWeight: strokeWeight, + strokeAlign: strokeAlign, + cornerRadius: cornerRadius, + constraints: constraints, + layoutAlign: layoutAlign, + size: size, + horizontalPadding: horizontalPadding, + verticalPadding: verticalPadding, + itemSpacing: itemSpacing, + children: children, + backgroundColor: backgroundColor, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing) { pbdfType = 'symbol_instance'; } diff --git a/lib/input/figma/entities/layers/instance.g.dart b/lib/input/figma/entities/layers/instance.g.dart index 886f6ce5..f4b3ab7c 100644 --- a/lib/input/figma/entities/layers/instance.g.dart +++ b/lib/input/figma/entities/layers/instance.g.dart @@ -36,9 +36,12 @@ Instance _$InstanceFromJson(Map json) { backgroundColor: json['backgroundColor'] == null ? null : FigmaColor.fromJson(json['backgroundColor'] as Map), + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String - ..prototypeNodeUUID = json['transitionNodeID'] as String + ..isHome = json['isHome'] as bool ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..isFlowHome = json['isFlowHome'] @@ -51,8 +54,10 @@ Map _$InstanceToJson(Instance instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, - 'transitionNodeID': instance.prototypeNodeUUID, 'strokes': instance.strokes, 'strokeWeight': instance.strokeWeight, 'strokeAlign': instance.strokeAlign, @@ -64,6 +69,7 @@ Map _$InstanceToJson(Instance instance) => { 'verticalPadding': instance.verticalPadding, 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, + 'isHome': instance.isHome, 'fills': instance.fillsList, 'imageReference': instance.imageReference, 'isFlowHome': instance.isFlowHome, diff --git a/lib/input/figma/entities/layers/line.dart b/lib/input/figma/entities/layers/line.dart index d1e41105..bb9867c3 100644 --- a/lib/input/figma/entities/layers/line.dart +++ b/lib/input/figma/entities/layers/line.dart @@ -14,23 +14,26 @@ part 'line.g.dart'; class FigmaLine extends FigmaVector implements AbstractFigmaNodeFactory { @override String type = 'LINE'; - FigmaLine({ - String name, - bool visible, - String type, - pluginData, - sharedPluginData, - style, - layoutAlign, - constraints, - Frame boundaryRectangle, - size, - fills, - strokes, - strokeWeight, - strokeAlign, - styles, - }) : super( + FigmaLine( + {String name, + bool visible, + String type, + pluginData, + sharedPluginData, + style, + layoutAlign, + constraints, + Frame boundaryRectangle, + size, + fills, + strokes, + strokeWeight, + strokeAlign, + styles, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing}) + : super( name: name, visible: visible, type: type, @@ -45,6 +48,9 @@ class FigmaLine extends FigmaVector implements AbstractFigmaNodeFactory { strokeWeight: strokeWeight, strokeAlign: strokeAlign, styles: styles, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'image'; } diff --git a/lib/input/figma/entities/layers/line.g.dart b/lib/input/figma/entities/layers/line.g.dart index 1ef913da..cc44d9e3 100644 --- a/lib/input/figma/entities/layers/line.g.dart +++ b/lib/input/figma/entities/layers/line.g.dart @@ -23,10 +23,12 @@ FigmaLine _$FigmaLineFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String ..isVisible = json['visible'] as bool ?? true - ..prototypeNodeUUID = json['transitionNodeID'] as String ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String; @@ -38,10 +40,12 @@ Map _$FigmaLineToJson(FigmaLine instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'style': instance.style, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'strokes': instance.strokes, diff --git a/lib/input/figma/entities/layers/rectangle.dart b/lib/input/figma/entities/layers/rectangle.dart index 59760be7..251aa9d9 100644 --- a/lib/input/figma/entities/layers/rectangle.dart +++ b/lib/input/figma/entities/layers/rectangle.dart @@ -23,26 +23,29 @@ class FigmaRectangle extends FigmaVector implements AbstractFigmaNodeFactory { @override String type = 'RECTANGLE'; - FigmaRectangle({ - String name, - bool isVisible, - type, - pluginData, - sharedPluginData, - style, - layoutAlign, - constraints, - Frame boundaryRectangle, - size, - strokes, - strokeWeight, - strokeAlign, - styles, - this.cornerRadius, - this.rectangleCornerRadii, - this.points, - List fillsList, - }) : super( + FigmaRectangle( + {String name, + bool isVisible, + type, + pluginData, + sharedPluginData, + style, + layoutAlign, + constraints, + Frame boundaryRectangle, + size, + strokes, + strokeWeight, + strokeAlign, + styles, + this.cornerRadius, + this.rectangleCornerRadii, + this.points, + List fillsList, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing}) + : super( name: name, visible: isVisible, type: type, @@ -58,6 +61,9 @@ class FigmaRectangle extends FigmaVector strokeAlign: strokeAlign, styles: styles, fillsList: fillsList, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'rectangle'; var fillsMap = diff --git a/lib/input/figma/entities/layers/rectangle.g.dart b/lib/input/figma/entities/layers/rectangle.g.dart index ecbf1b36..e4eeba3f 100644 --- a/lib/input/figma/entities/layers/rectangle.g.dart +++ b/lib/input/figma/entities/layers/rectangle.g.dart @@ -30,9 +30,11 @@ FigmaRectangle _$FigmaRectangleFromJson(Map json) { ?.toList(), points: json['points'] as List, fillsList: json['fills'] as List, + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String - ..prototypeNodeUUID = json['transitionNodeID'] as String ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String; } @@ -44,10 +46,12 @@ Map _$FigmaRectangleToJson(FigmaRectangle instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'style': instance.style, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'strokes': instance.strokes, diff --git a/lib/input/figma/entities/layers/regular_polygon.dart b/lib/input/figma/entities/layers/regular_polygon.dart index f0ccbdea..ff2a7b23 100644 --- a/lib/input/figma/entities/layers/regular_polygon.dart +++ b/lib/input/figma/entities/layers/regular_polygon.dart @@ -33,6 +33,9 @@ class FigmaRegularPolygon extends FigmaVector strokeWeight, strokeAlign, styles, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing, }) : super( name: name, visible: visible, @@ -48,6 +51,9 @@ class FigmaRegularPolygon extends FigmaVector strokeWeight: strokeWeight, strokeAlign: strokeAlign, styles: styles, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'polygon'; } diff --git a/lib/input/figma/entities/layers/regular_polygon.g.dart b/lib/input/figma/entities/layers/regular_polygon.g.dart index e96673a3..d7f108be 100644 --- a/lib/input/figma/entities/layers/regular_polygon.g.dart +++ b/lib/input/figma/entities/layers/regular_polygon.g.dart @@ -23,10 +23,12 @@ FigmaRegularPolygon _$FigmaRegularPolygonFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String ..isVisible = json['visible'] as bool ?? true - ..prototypeNodeUUID = json['transitionNodeID'] as String ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String; @@ -40,10 +42,12 @@ Map _$FigmaRegularPolygonToJson( 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'style': instance.style, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'strokes': instance.strokes, diff --git a/lib/input/figma/entities/layers/slice.dart b/lib/input/figma/entities/layers/slice.dart index 58a3a159..7590832d 100644 --- a/lib/input/figma/entities/layers/slice.dart +++ b/lib/input/figma/entities/layers/slice.dart @@ -24,10 +24,6 @@ class FigmaSlice extends FigmaNode implements FigmaNodeFactory { var constraints; - @override - @JsonKey(name: 'transitionNodeID') - String prototypeNodeUUID; - @override @JsonKey(name: 'absoluteBoundingBox') var boundaryRectangle; @@ -44,12 +40,18 @@ class FigmaSlice extends FigmaNode implements FigmaNodeFactory { this.constraints, Frame this.boundaryRectangle, this.size, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing, }) : super( name, visible, type, pluginData, sharedPluginData, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'image'; } diff --git a/lib/input/figma/entities/layers/slice.g.dart b/lib/input/figma/entities/layers/slice.g.dart index d2515266..7e017987 100644 --- a/lib/input/figma/entities/layers/slice.g.dart +++ b/lib/input/figma/entities/layers/slice.g.dart @@ -18,9 +18,11 @@ FigmaSlice _$FigmaSliceFromJson(Map json) { ? null : Frame.fromJson(json['absoluteBoundingBox'] as Map), size: json['size'], + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String - ..prototypeNodeUUID = json['transitionNodeID'] as String ..isVisible = json['visible'] as bool ?? true ..pbdfType = json['pbdfType'] as String; } @@ -31,10 +33,12 @@ Map _$FigmaSliceToJson(FigmaSlice instance) => 'name': instance.name, 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'type': instance.type, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'visible': instance.isVisible, diff --git a/lib/input/figma/entities/layers/star.dart b/lib/input/figma/entities/layers/star.dart index 762ea21e..bca40ba0 100644 --- a/lib/input/figma/entities/layers/star.dart +++ b/lib/input/figma/entities/layers/star.dart @@ -30,6 +30,9 @@ class FigmaStar extends FigmaVector implements AbstractFigmaNodeFactory { strokeWeight, strokeAlign, styles, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing, }) : super( name: name, visible: visible, @@ -45,6 +48,9 @@ class FigmaStar extends FigmaVector implements AbstractFigmaNodeFactory { strokeWeight: strokeWeight, strokeAlign: strokeAlign, styles: styles, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'star'; } diff --git a/lib/input/figma/entities/layers/star.g.dart b/lib/input/figma/entities/layers/star.g.dart index 14f439ff..5e8ee8b0 100644 --- a/lib/input/figma/entities/layers/star.g.dart +++ b/lib/input/figma/entities/layers/star.g.dart @@ -23,10 +23,12 @@ FigmaStar _$FigmaStarFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String ..isVisible = json['visible'] as bool ?? true - ..prototypeNodeUUID = json['transitionNodeID'] as String ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String; @@ -38,10 +40,12 @@ Map _$FigmaStarToJson(FigmaStar instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'style': instance.style, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'strokes': instance.strokes, diff --git a/lib/input/figma/entities/layers/text.dart b/lib/input/figma/entities/layers/text.dart index 6e2b06d1..9569e13d 100644 --- a/lib/input/figma/entities/layers/text.dart +++ b/lib/input/figma/entities/layers/text.dart @@ -21,26 +21,29 @@ part 'text.g.dart'; class FigmaText extends FigmaVector implements AbstractFigmaNodeFactory, Text { @override String type = 'TEXT'; - FigmaText({ - String name, - bool visible, - String type, - pluginData, - sharedPluginData, - FigmaStyle this.style, - layoutAlign, - constraints, - Frame boundaryRectangle, - size, - fills, - strokes, - strokeWeight, - strokeAlign, - styles, - this.content, - this.characterStyleOverrides, - this.styleOverrideTable, - }) : super( + FigmaText( + {String name, + bool visible, + String type, + pluginData, + sharedPluginData, + FigmaStyle this.style, + layoutAlign, + constraints, + Frame boundaryRectangle, + size, + fills, + strokes, + strokeWeight, + strokeAlign, + styles, + this.content, + this.characterStyleOverrides, + this.styleOverrideTable, + String prototypeNodeUUID, + num transitionDuration, + String transitionEasing}) + : super( name: name, visible: visible, type: type, @@ -55,6 +58,9 @@ class FigmaText extends FigmaVector implements AbstractFigmaNodeFactory, Text { strokeWeight: strokeWeight, strokeAlign: strokeAlign, styles: styles, + prototypeNodeUUID: prototypeNodeUUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, ) { pbdfType = 'text'; } diff --git a/lib/input/figma/entities/layers/text.g.dart b/lib/input/figma/entities/layers/text.g.dart index 192770cc..353b057d 100644 --- a/lib/input/figma/entities/layers/text.g.dart +++ b/lib/input/figma/entities/layers/text.g.dart @@ -30,10 +30,12 @@ FigmaText _$FigmaTextFromJson(Map json) { ?.map((e) => (e as num)?.toDouble()) ?.toList(), styleOverrideTable: json['styleOverrideTable'] as Map, + prototypeNodeUUID: json['transitionNodeUUID'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String ..isVisible = json['visible'] as bool ?? true - ..prototypeNodeUUID = json['transitionNodeID'] as String ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String @@ -52,9 +54,11 @@ Map _$FigmaTextToJson(FigmaText instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'strokes': instance.strokes, diff --git a/lib/input/figma/entities/layers/vector.dart b/lib/input/figma/entities/layers/vector.dart index dbeb3502..93383fbd 100644 --- a/lib/input/figma/entities/layers/vector.dart +++ b/lib/input/figma/entities/layers/vector.dart @@ -26,10 +26,6 @@ class FigmaVector extends FigmaNode implements FigmaNodeFactory, Image { var constraints; - @override - @JsonKey(name: 'transitionNodeID') - String prototypeNodeUUID; - @override @JsonKey(name: 'absoluteBoundingBox') var boundaryRectangle; @@ -66,6 +62,9 @@ class FigmaVector extends FigmaNode implements FigmaNodeFactory, Image { this.styles, this.fillsList, String UUID, + num transitionDuration, + String transitionEasing, + String prototypeNodeUUID, }) : super( name, visible, @@ -73,6 +72,9 @@ class FigmaVector extends FigmaNode implements FigmaNodeFactory, Image { pluginData, sharedPluginData, UUID: UUID, + transitionDuration: transitionDuration, + transitionEasing: transitionEasing, + prototypeNodeUUID: prototypeNodeUUID, ) { pbdfType = 'vector'; log = Logger(runtimeType.toString()); diff --git a/lib/input/figma/entities/layers/vector.g.dart b/lib/input/figma/entities/layers/vector.g.dart index 4882a58f..7f1bb9a0 100644 --- a/lib/input/figma/entities/layers/vector.g.dart +++ b/lib/input/figma/entities/layers/vector.g.dart @@ -27,9 +27,11 @@ FigmaVector _$FigmaVectorFromJson(Map json) { styles: json['styles'], fillsList: json['fills'] as List, UUID: json['id'] as String, + transitionDuration: json['transitionDuration'] as num, + transitionEasing: json['transitionEasing'] as String, + prototypeNodeUUID: json['transitionNodeUUID'] as String, ) ..isVisible = json['visible'] as bool ?? true - ..prototypeNodeUUID = json['transitionNodeID'] as String ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String; } @@ -41,10 +43,12 @@ Map _$FigmaVectorToJson(FigmaVector instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, + 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionDuration': instance.transitionDuration, + 'transitionEasing': instance.transitionEasing, 'style': instance.style, 'layoutAlign': instance.layoutAlign, 'constraints': instance.constraints, - 'transitionNodeID': instance.prototypeNodeUUID, 'absoluteBoundingBox': instance.boundaryRectangle, 'size': instance.size, 'strokes': instance.strokes, diff --git a/lib/input/figma/helper/figma_project.dart b/lib/input/figma/helper/figma_project.dart index 49a09eb2..d0d1e2e5 100644 --- a/lib/input/figma/helper/figma_project.dart +++ b/lib/input/figma/helper/figma_project.dart @@ -35,6 +35,9 @@ class FigmaProject extends DesignProject { var node = Canvas.fromJson(canvas); for (var layer in node.children) { + if (layer.UUID == node.prototypeStartNodeID) { + layer.isHome = true; + } pg.addScreen(FigmaScreen( layer, layer.UUID, From e8d473bbe5ec84520d8728809f166405d55c07de Mon Sep 17 00:00:00 2001 From: Ivan Vigliante Date: Fri, 5 Mar 2021 18:19:13 -0700 Subject: [PATCH 09/11] Removed redundant property and updated json serializable --- lib/input/figma/entities/layers/component.g.dart | 4 +--- lib/input/figma/entities/layers/frame.dart | 9 ++++----- lib/input/figma/entities/layers/frame.g.dart | 8 +++----- lib/input/figma/entities/layers/group.g.dart | 6 ++---- lib/input/figma/entities/layers/instance.g.dart | 6 ++---- lib/input/figma/helper/figma_project.dart | 2 +- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/lib/input/figma/entities/layers/component.g.dart b/lib/input/figma/entities/layers/component.g.dart index 03af3568..e1b7623b 100644 --- a/lib/input/figma/entities/layers/component.g.dart +++ b/lib/input/figma/entities/layers/component.g.dart @@ -41,11 +41,10 @@ Component _$ComponentFromJson(Map json) { transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String - ..isHome = json['isHome'] as bool ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String - ..isFlowHome = json['isFlowHome']; + ..isFlowHome = json['isFlowHome'] ?? false; } Map _$ComponentToJson(Component instance) => { @@ -70,7 +69,6 @@ Map _$ComponentToJson(Component instance) => { 'verticalPadding': instance.verticalPadding, 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, - 'isHome': instance.isHome, 'fills': instance.fillsList, 'imageReference': instance.imageReference, 'type': instance.type, diff --git a/lib/input/figma/entities/layers/frame.dart b/lib/input/figma/entities/layers/frame.dart index be54338a..4de96d9a 100644 --- a/lib/input/figma/entities/layers/frame.dart +++ b/lib/input/figma/entities/layers/frame.dart @@ -63,7 +63,9 @@ class FigmaFrame extends FigmaNode @JsonKey(ignore: true) bool isScaffold = false; - bool isHome = false; + @override + @JsonKey(nullable: true, defaultValue: false) + var isFlowHome = false; FigmaFrame({ name, @@ -130,7 +132,7 @@ class FigmaFrame extends FigmaNode this, currentContext: currentContext, name: name, - isHomeScreen: isHome, + isHomeScreen: isFlowHome, )); } else { var tempGroup = Group( @@ -184,7 +186,4 @@ class FigmaFrame extends FigmaNode // TODO: implement fromPBDF throw UnimplementedError(); } - - @override - var isFlowHome; } diff --git a/lib/input/figma/entities/layers/frame.g.dart b/lib/input/figma/entities/layers/frame.g.dart index fe38a37a..6313fbfb 100644 --- a/lib/input/figma/entities/layers/frame.g.dart +++ b/lib/input/figma/entities/layers/frame.g.dart @@ -38,11 +38,10 @@ FigmaFrame _$FigmaFrameFromJson(Map json) { transitionEasing: json['transitionEasing'] as String, prototypeNodeUUID: json['transitionNodeUUID'] as String, ) - ..isHome = json['isHome'] as bool + ..isFlowHome = json['isFlowHome'] ?? false ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String - ..pbdfType = json['pbdfType'] as String - ..isFlowHome = json['isFlowHome']; + ..pbdfType = json['pbdfType'] as String; } Map _$FigmaFrameToJson(FigmaFrame instance) => @@ -69,9 +68,8 @@ Map _$FigmaFrameToJson(FigmaFrame instance) => 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, 'type': instance.type, - 'isHome': instance.isHome, + 'isFlowHome': instance.isFlowHome, 'fills': instance.fillsList, 'imageReference': instance.imageReference, 'pbdfType': instance.pbdfType, - 'isFlowHome': instance.isFlowHome, }; diff --git a/lib/input/figma/entities/layers/group.g.dart b/lib/input/figma/entities/layers/group.g.dart index fc3281f3..1376b7d3 100644 --- a/lib/input/figma/entities/layers/group.g.dart +++ b/lib/input/figma/entities/layers/group.g.dart @@ -38,9 +38,8 @@ Group _$GroupFromJson(Map json) { transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) - ..isHome = json['isHome'] as bool + ..isFlowHome = json['isFlowHome'] ?? false ..fillsList = json['fills'] as List - ..isFlowHome = json['isFlowHome'] ..imageReference = json['imageReference'] as String ..pbdfType = json['pbdfType'] as String; } @@ -67,9 +66,8 @@ Map _$GroupToJson(Group instance) => { 'verticalPadding': instance.verticalPadding, 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, - 'isHome': instance.isHome, - 'fills': instance.fillsList, 'isFlowHome': instance.isFlowHome, + 'fills': instance.fillsList, 'type': instance.type, 'imageReference': instance.imageReference, 'pbdfType': instance.pbdfType, diff --git a/lib/input/figma/entities/layers/instance.g.dart b/lib/input/figma/entities/layers/instance.g.dart index f4b3ab7c..2420919b 100644 --- a/lib/input/figma/entities/layers/instance.g.dart +++ b/lib/input/figma/entities/layers/instance.g.dart @@ -41,10 +41,9 @@ Instance _$InstanceFromJson(Map json) { transitionEasing: json['transitionEasing'] as String, ) ..UUID = json['id'] as String - ..isHome = json['isHome'] as bool + ..isFlowHome = json['isFlowHome'] ?? false ..fillsList = json['fills'] as List ..imageReference = json['imageReference'] as String - ..isFlowHome = json['isFlowHome'] ..pbdfType = json['pbdfType'] as String; } @@ -69,10 +68,9 @@ Map _$InstanceToJson(Instance instance) => { 'verticalPadding': instance.verticalPadding, 'itemSpacing': instance.itemSpacing, 'backgroundColor': instance.backgroundColor, - 'isHome': instance.isHome, + 'isFlowHome': instance.isFlowHome, 'fills': instance.fillsList, 'imageReference': instance.imageReference, - 'isFlowHome': instance.isFlowHome, 'type': instance.type, 'parameters': instance.parameters, 'symbolID': instance.symbolID, diff --git a/lib/input/figma/helper/figma_project.dart b/lib/input/figma/helper/figma_project.dart index d0d1e2e5..097e706e 100644 --- a/lib/input/figma/helper/figma_project.dart +++ b/lib/input/figma/helper/figma_project.dart @@ -36,7 +36,7 @@ class FigmaProject extends DesignProject { for (var layer in node.children) { if (layer.UUID == node.prototypeStartNodeID) { - layer.isHome = true; + layer.isFlowHome = true; } pg.addScreen(FigmaScreen( layer, From a877baf754e09fbb3dd441bd324076006d698e4d Mon Sep 17 00:00:00 2001 From: Ivan Vigliante Date: Mon, 8 Mar 2021 18:23:39 -0700 Subject: [PATCH 10/11] Fixed json serializable property for prototyping --- lib/input/figma/entities/layers/boolean_operation.g.dart | 4 ++-- lib/input/figma/entities/layers/canvas.g.dart | 4 ++-- lib/input/figma/entities/layers/component.g.dart | 4 ++-- lib/input/figma/entities/layers/ellipse.g.dart | 4 ++-- lib/input/figma/entities/layers/figma_node.dart | 2 +- lib/input/figma/entities/layers/frame.g.dart | 4 ++-- lib/input/figma/entities/layers/group.g.dart | 4 ++-- lib/input/figma/entities/layers/instance.g.dart | 4 ++-- lib/input/figma/entities/layers/line.g.dart | 4 ++-- lib/input/figma/entities/layers/rectangle.g.dart | 4 ++-- lib/input/figma/entities/layers/regular_polygon.g.dart | 4 ++-- lib/input/figma/entities/layers/slice.g.dart | 4 ++-- lib/input/figma/entities/layers/star.g.dart | 4 ++-- lib/input/figma/entities/layers/text.g.dart | 4 ++-- lib/input/figma/entities/layers/vector.g.dart | 4 ++-- 15 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/input/figma/entities/layers/boolean_operation.g.dart b/lib/input/figma/entities/layers/boolean_operation.g.dart index 0d463cfe..fce0f57d 100644 --- a/lib/input/figma/entities/layers/boolean_operation.g.dart +++ b/lib/input/figma/entities/layers/boolean_operation.g.dart @@ -21,7 +21,7 @@ BooleanOperation _$BooleanOperationFromJson(Map json) { ? null : Frame.fromJson(json['absoluteBoundingBox'] as Map), UUID: json['id'] as String, - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -48,7 +48,7 @@ Map _$BooleanOperationToJson(BooleanOperation instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'style': instance.style, diff --git a/lib/input/figma/entities/layers/canvas.g.dart b/lib/input/figma/entities/layers/canvas.g.dart index 58686bf6..b453a1d1 100644 --- a/lib/input/figma/entities/layers/canvas.g.dart +++ b/lib/input/figma/entities/layers/canvas.g.dart @@ -18,7 +18,7 @@ Canvas _$CanvasFromJson(Map json) { prototypeStartNodeID: json['prototypeStartNodeID'], prototypeDevice: json['prototypeDevice'], exportSettings: json['exportSettings'], - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -45,6 +45,6 @@ Map _$CanvasToJson(Canvas instance) => { 'prototypeDevice': instance.prototypeDevice, 'exportSettings': instance.exportSettings, 'boundaryRectangle': instance.boundaryRectangle, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'pbdfType': instance.pbdfType, }; diff --git a/lib/input/figma/entities/layers/component.g.dart b/lib/input/figma/entities/layers/component.g.dart index e1b7623b..0a4bbc51 100644 --- a/lib/input/figma/entities/layers/component.g.dart +++ b/lib/input/figma/entities/layers/component.g.dart @@ -36,7 +36,7 @@ Component _$ComponentFromJson(Map json) { : FigmaColor.fromJson(json['backgroundColor'] as Map), symbolID: json['symbolID'] as String, overriadableProperties: json['overriadableProperties'] as List, - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -53,7 +53,7 @@ Map _$ComponentToJson(Component instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, diff --git a/lib/input/figma/entities/layers/ellipse.g.dart b/lib/input/figma/entities/layers/ellipse.g.dart index dca6e9eb..4b942289 100644 --- a/lib/input/figma/entities/layers/ellipse.g.dart +++ b/lib/input/figma/entities/layers/ellipse.g.dart @@ -23,7 +23,7 @@ FigmaEllipse _$FigmaEllipseFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -41,7 +41,7 @@ Map _$FigmaEllipseToJson(FigmaEllipse instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'style': instance.style, diff --git a/lib/input/figma/entities/layers/figma_node.dart b/lib/input/figma/entities/layers/figma_node.dart index bd639c61..9e1f7a9f 100644 --- a/lib/input/figma/entities/layers/figma_node.dart +++ b/lib/input/figma/entities/layers/figma_node.dart @@ -26,7 +26,7 @@ abstract class FigmaNode implements DesignNode { bool isVisible; @override - @JsonKey(name: 'transitionNodeUUID') + @JsonKey(name: 'transitionNodeID') String prototypeNodeUUID; @JsonKey(nullable: true) num transitionDuration; diff --git a/lib/input/figma/entities/layers/frame.g.dart b/lib/input/figma/entities/layers/frame.g.dart index 6313fbfb..f0538714 100644 --- a/lib/input/figma/entities/layers/frame.g.dart +++ b/lib/input/figma/entities/layers/frame.g.dart @@ -36,7 +36,7 @@ FigmaFrame _$FigmaFrameFromJson(Map json) { : FigmaColor.fromJson(json['backgroundColor'] as Map), transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, ) ..isFlowHome = json['isFlowHome'] ?? false ..fillsList = json['fills'] as List @@ -51,7 +51,7 @@ Map _$FigmaFrameToJson(FigmaFrame instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, diff --git a/lib/input/figma/entities/layers/group.g.dart b/lib/input/figma/entities/layers/group.g.dart index 1376b7d3..937aca41 100644 --- a/lib/input/figma/entities/layers/group.g.dart +++ b/lib/input/figma/entities/layers/group.g.dart @@ -34,7 +34,7 @@ Group _$GroupFromJson(Map json) { backgroundColor: json['backgroundColor'] == null ? null : FigmaColor.fromJson(json['backgroundColor'] as Map), - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -50,7 +50,7 @@ Map _$GroupToJson(Group instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, diff --git a/lib/input/figma/entities/layers/instance.g.dart b/lib/input/figma/entities/layers/instance.g.dart index 2420919b..2fe12f43 100644 --- a/lib/input/figma/entities/layers/instance.g.dart +++ b/lib/input/figma/entities/layers/instance.g.dart @@ -36,7 +36,7 @@ Instance _$InstanceFromJson(Map json) { backgroundColor: json['backgroundColor'] == null ? null : FigmaColor.fromJson(json['backgroundColor'] as Map), - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -53,7 +53,7 @@ Map _$InstanceToJson(Instance instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'absoluteBoundingBox': instance.boundaryRectangle, diff --git a/lib/input/figma/entities/layers/line.g.dart b/lib/input/figma/entities/layers/line.g.dart index cc44d9e3..0f2f39ed 100644 --- a/lib/input/figma/entities/layers/line.g.dart +++ b/lib/input/figma/entities/layers/line.g.dart @@ -23,7 +23,7 @@ FigmaLine _$FigmaLineFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -40,7 +40,7 @@ Map _$FigmaLineToJson(FigmaLine instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'style': instance.style, diff --git a/lib/input/figma/entities/layers/rectangle.g.dart b/lib/input/figma/entities/layers/rectangle.g.dart index e4eeba3f..213f9c09 100644 --- a/lib/input/figma/entities/layers/rectangle.g.dart +++ b/lib/input/figma/entities/layers/rectangle.g.dart @@ -30,7 +30,7 @@ FigmaRectangle _$FigmaRectangleFromJson(Map json) { ?.toList(), points: json['points'] as List, fillsList: json['fills'] as List, - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -46,7 +46,7 @@ Map _$FigmaRectangleToJson(FigmaRectangle instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'style': instance.style, diff --git a/lib/input/figma/entities/layers/regular_polygon.g.dart b/lib/input/figma/entities/layers/regular_polygon.g.dart index d7f108be..c5a51e3b 100644 --- a/lib/input/figma/entities/layers/regular_polygon.g.dart +++ b/lib/input/figma/entities/layers/regular_polygon.g.dart @@ -23,7 +23,7 @@ FigmaRegularPolygon _$FigmaRegularPolygonFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -42,7 +42,7 @@ Map _$FigmaRegularPolygonToJson( 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'style': instance.style, diff --git a/lib/input/figma/entities/layers/slice.g.dart b/lib/input/figma/entities/layers/slice.g.dart index 7e017987..5d831502 100644 --- a/lib/input/figma/entities/layers/slice.g.dart +++ b/lib/input/figma/entities/layers/slice.g.dart @@ -18,7 +18,7 @@ FigmaSlice _$FigmaSliceFromJson(Map json) { ? null : Frame.fromJson(json['absoluteBoundingBox'] as Map), size: json['size'], - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -33,7 +33,7 @@ Map _$FigmaSliceToJson(FigmaSlice instance) => 'name': instance.name, 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'type': instance.type, diff --git a/lib/input/figma/entities/layers/star.g.dart b/lib/input/figma/entities/layers/star.g.dart index 5e8ee8b0..c0b0ed5b 100644 --- a/lib/input/figma/entities/layers/star.g.dart +++ b/lib/input/figma/entities/layers/star.g.dart @@ -23,7 +23,7 @@ FigmaStar _$FigmaStarFromJson(Map json) { strokeWeight: json['strokeWeight'], strokeAlign: json['strokeAlign'], styles: json['styles'], - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -40,7 +40,7 @@ Map _$FigmaStarToJson(FigmaStar instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'style': instance.style, diff --git a/lib/input/figma/entities/layers/text.g.dart b/lib/input/figma/entities/layers/text.g.dart index 353b057d..0a881c62 100644 --- a/lib/input/figma/entities/layers/text.g.dart +++ b/lib/input/figma/entities/layers/text.g.dart @@ -30,7 +30,7 @@ FigmaText _$FigmaTextFromJson(Map json) { ?.map((e) => (e as num)?.toDouble()) ?.toList(), styleOverrideTable: json['styleOverrideTable'] as Map, - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, ) @@ -54,7 +54,7 @@ Map _$FigmaTextToJson(FigmaText instance) => { 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'layoutAlign': instance.layoutAlign, diff --git a/lib/input/figma/entities/layers/vector.g.dart b/lib/input/figma/entities/layers/vector.g.dart index 7f1bb9a0..c99195ba 100644 --- a/lib/input/figma/entities/layers/vector.g.dart +++ b/lib/input/figma/entities/layers/vector.g.dart @@ -29,7 +29,7 @@ FigmaVector _$FigmaVectorFromJson(Map json) { UUID: json['id'] as String, transitionDuration: json['transitionDuration'] as num, transitionEasing: json['transitionEasing'] as String, - prototypeNodeUUID: json['transitionNodeUUID'] as String, + prototypeNodeUUID: json['transitionNodeID'] as String, ) ..isVisible = json['visible'] as bool ?? true ..imageReference = json['imageReference'] as String @@ -43,7 +43,7 @@ Map _$FigmaVectorToJson(FigmaVector instance) => 'pluginData': instance.pluginData, 'sharedPluginData': instance.sharedPluginData, 'visible': instance.isVisible, - 'transitionNodeUUID': instance.prototypeNodeUUID, + 'transitionNodeID': instance.prototypeNodeUUID, 'transitionDuration': instance.transitionDuration, 'transitionEasing': instance.transitionEasing, 'style': instance.style, From c59683dbdfe9f737c7f33ce5ca6f807ca18ed647 Mon Sep 17 00:00:00 2001 From: Ivan Vigliante Date: Wed, 10 Mar 2021 09:35:20 -0700 Subject: [PATCH 11/11] Updated pubspec.yaml version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7b86f045..783ebe51 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: parabeac_core description: A starting point for Dart libraries or applications. -version: 1.3.3 +version: 1.4.0 # homepage: https://www.example.com environment: