Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #303 from Parabeac/release/1.4.0
Browse files Browse the repository at this point in the history
Release/1.4.0
  • Loading branch information
ivan-015 committed Mar 12, 2021
2 parents 0641298 + 9d02585 commit 65020d4
Show file tree
Hide file tree
Showing 37 changed files with 424 additions and 231 deletions.
5 changes: 3 additions & 2 deletions lib/controllers/interpret.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion lib/generation/prototyping/pb_prototype_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PBPrototypeStorage {
if (_pbPrototypeInstanceNodes.containsKey(prototypeNode.UUID)) {
return false;
}
// await TODO:

await PBPrototypeAggregationService()
.analyzeIntermediateNode(prototypeNode);
_pbPrototypeInstanceNodes['${prototypeNode.UUID}'] = prototypeNode;
Expand Down
11 changes: 8 additions & 3 deletions lib/input/figma/entities/layers/boolean_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down
8 changes: 6 additions & 2 deletions lib/input/figma/entities/layers/boolean_operation.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion lib/input/figma/entities/layers/canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ part 'canvas.g.dart';
class Canvas extends FigmaNode implements FigmaNodeFactory, GroupNode {
@override
String type = 'CANVAS';

Canvas({
this.name,
this.type,
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lib/input/figma/entities/layers/canvas.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions lib/input/figma/entities/layers/component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -41,12 +39,14 @@ class Component extends FigmaFrame
horizontalPadding,
verticalPadding,
itemSpacing,
Flow flow,
this.overrideProperties,
List<FigmaNode> children,
FigmaColor backgroundColor,
this.symbolID,
this.overriadableProperties,
String prototypeNodeUUID,
num transitionDuration,
String transitionEasing,
}) : super(
name: name,
isVisible: isVisible,
Expand All @@ -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';
}
Expand Down
10 changes: 7 additions & 3 deletions lib/input/figma/entities/layers/component.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions lib/input/figma/entities/layers/ellipse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class FigmaEllipse extends FigmaVector
strokeWeight,
strokeAlign,
styles,
String prototypeNodeUUID,
num transitionDuration,
String transitionEasing,
}) : super(
name: name,
visible: visible,
Expand All @@ -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());
Expand Down
8 changes: 6 additions & 2 deletions lib/input/figma/entities/layers/ellipse.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions lib/input/figma/entities/layers/figma_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,24 @@ abstract class FigmaNode implements DesignNode {
@JsonKey(name: 'visible', defaultValue: true)
bool isVisible;

@override
@JsonKey(name: 'transitionNodeID')
String prototypeNodeUUID;
@JsonKey(nullable: true)
num transitionDuration;
@JsonKey(nullable: true)
String transitionEasing;

FigmaNode(
this.name,
this.isVisible,
this.type,
this.pluginData,
this.sharedPluginData, {
this.UUID,
this.prototypeNodeUUID,
this.transitionDuration,
this.transitionEasing,
});
@override
Map<String, dynamic> toJson();
Expand Down
26 changes: 15 additions & 11 deletions lib/input/figma/entities/layers/frame.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -68,6 +63,10 @@ class FigmaFrame extends FigmaNode
@JsonKey(ignore: true)
bool isScaffold = false;

@override
@JsonKey(nullable: true, defaultValue: false)
var isFlowHome = false;

FigmaFrame({
name,
isVisible,
Expand All @@ -88,16 +87,22 @@ class FigmaFrame extends FigmaNode
this.verticalPadding,
this.itemSpacing,
List<FigmaNode> this.children,
Flow flow,
String UUID,
FigmaColor this.backgroundColor,
String transitionNodeID,
num transitionDuration,
String transitionEasing,
String prototypeNodeUUID,
}) : super(
name,
isVisible,
type,
pluginData,
sharedPluginData,
UUID: UUID,
prototypeNodeUUID: prototypeNodeUUID,
transitionDuration: transitionDuration,
transitionEasing: transitionEasing,
) {
pbdfType = 'group';
}
Expand Down Expand Up @@ -127,7 +132,7 @@ class FigmaFrame extends FigmaNode
this,
currentContext: currentContext,
name: name,
isHomeScreen: false,
isHomeScreen: isFlowHome,
));
} else {
var tempGroup = Group(
Expand All @@ -149,10 +154,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));
Expand All @@ -179,7 +186,4 @@ class FigmaFrame extends FigmaNode
// TODO: implement fromPBDF
throw UnimplementedError();
}

@override
var isFlowHome;
}
Loading

0 comments on commit 65020d4

Please sign in to comment.