Skip to content

Commit cf36167

Browse files
committed
Merge remote-tracking branch 'origin/master' into claude/awesome-gates-nj49yn
2 parents aa4c14f + c4ef7d3 commit cf36167

82 files changed

Lines changed: 30734 additions & 3571 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎lib/src/api/mixins.dart‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,16 @@ mixin BlendMixin on BaseNode {
289289
late bool isMask;
290290

291291
/// List of effects applied to the node.
292+
@FlutterProp(
293+
'effects',
294+
type: 'array',
295+
group: 'Effects',
296+
control: 'list',
297+
flutterParam: false,
298+
a2ui: false,
299+
note:
300+
'Serialized node effects; individual shadow fields live in list items.',
301+
)
292302
late List<Effect> effects;
293303

294304
/// Whether to use ink well on this node, along with its properties.
@@ -664,13 +674,40 @@ mixin GeometryMixin on BaseNode {
664674
/// A list of fills applied to the node. This can be a solid color or a
665675
/// gradient or an image. Refer [PaintModel.type] for more info on supported
666676
/// types of fill.
677+
@FlutterProp(
678+
'fills',
679+
type: 'array',
680+
group: 'Fill',
681+
control: 'list',
682+
flutterParam: false,
683+
a2ui: false,
684+
note: 'Serialized paints; image crop/transform fields live in list items.',
685+
)
667686
late List<PaintModel> fills;
668687

669688
/// A list of strokes applied to the node. Only solid color type of fill is
670689
/// supported at the moment.
690+
@FlutterProp(
691+
'strokes',
692+
type: 'array',
693+
group: 'Stroke',
694+
control: 'list',
695+
flutterParam: false,
696+
a2ui: false,
697+
note: 'Serialized stroke paints; item color is not a top-level field.',
698+
)
671699
List<PaintModel> strokes = [];
672700

673701
/// Thickness/weight of the stroke.
702+
@FlutterProp(
703+
'strokeWeight',
704+
type: 'number',
705+
group: 'Stroke',
706+
control: 'number',
707+
flutterParam: false,
708+
a2ui: false,
709+
note: 'Codelessly node stroke width, not a Flutter constructor argument.',
710+
)
674711
double strokeWeight = 0;
675712

676713
/// The limit for miters to be drawn on segments for given stroke join.
@@ -685,6 +722,15 @@ mixin GeometryMixin on BaseNode {
685722

686723
/// The pattern of dashes and gaps to apply to the stroke in case of dashed
687724
/// stroke.
725+
@FlutterProp(
726+
'dashPattern',
727+
type: 'array',
728+
group: 'Stroke',
729+
control: 'list',
730+
flutterParam: false,
731+
a2ui: false,
732+
note: 'Codelessly stroke dash/gap sequence, serialized as a number array.',
733+
)
688734
late List<double> dashPattern;
689735

690736
/// Side of the shape to apply the stroke to.
@@ -852,12 +898,42 @@ mixin ShapeBorderMixin {
852898
late CShapeBorder shape;
853899

854900
/// Radius of the corners of the border.
901+
@FlutterProp(
902+
'cornerRadius',
903+
type: 'object',
904+
group: 'Appearance',
905+
control: 'radius',
906+
field: 'properties.cornerRadius',
907+
flutterParam: false,
908+
a2ui: false,
909+
note: 'Persisted property border corner-radius object.',
910+
)
855911
late CornerRadius cornerRadius;
856912

857913
/// Thickness of the border.
914+
@FlutterProp(
915+
'borderWidth',
916+
type: 'number',
917+
group: 'Appearance',
918+
control: 'number',
919+
field: 'properties.borderWidth',
920+
flutterParam: false,
921+
a2ui: false,
922+
note: 'Optional persisted property border width.',
923+
)
858924
double? borderWidth;
859925

860926
/// Color of the border.
927+
@FlutterProp(
928+
'borderColor',
929+
type: 'object',
930+
group: 'Appearance',
931+
control: 'color',
932+
field: 'properties.borderColor',
933+
flutterParam: false,
934+
a2ui: false,
935+
note: 'Optional persisted property border color.',
936+
)
861937
ColorRGBA? borderColor;
862938

863939
/// Sets the properties of this mixin.
@@ -913,9 +989,28 @@ mixin ShapeBorderMixin {
913989
/// rounded corners.
914990
mixin CornerMixin on BaseNode {
915991
/// Level of pixel smoothing applied to the corners.
992+
@FlutterProp(
993+
'cornerSmoothing',
994+
type: 'number',
995+
group: 'Corners',
996+
control: 'number',
997+
flutterParam: false,
998+
a2ui: false,
999+
note: 'Codelessly corner smoothing of the serialized node.',
1000+
)
9161001
late double cornerSmoothing;
9171002

9181003
/// Radius of the corners of the node.
1004+
@FlutterProp(
1005+
'cornerRadius',
1006+
type: 'object',
1007+
group: 'Corners',
1008+
control: 'radius',
1009+
flutterParam: false,
1010+
a2ui: false,
1011+
note:
1012+
'Node corner-radius object; corner subfields are not top-level fields.',
1013+
)
9191014
late CornerRadius cornerRadius;
9201015

9211016
/// Sets the properties of this mixin.

‎lib/src/api/models/paint.dart‎

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:json_annotation/json_annotation.dart';
44
import 'package:equatable/equatable.dart';
55

66
import '../../../codelessly_api.dart';
7+
import '../../schema/flutter_prop.dart';
78

89
part 'paint.g.dart';
910

@@ -130,6 +131,15 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
130131
/// translation, rotation, and skew.
131132
///
132133
/// The identity transform is [[1, 0, 0], [0, 1, 0]].
134+
@FlutterProp(
135+
'imageTransform',
136+
type: 'array',
137+
group: 'Image Fill',
138+
control: 'matrix',
139+
flutterParam: false,
140+
a2ui: false,
141+
note: 'Optional persisted affine image transform in a paint item.',
142+
)
133143
final List<List<num>>? imageTransform;
134144

135145
/// Memory bytes to load the image.
@@ -153,17 +163,55 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
153163

154164
/// The sizing behavior the image will use to fit inside its view.
155165
/// This is 1-1 with Flutter's [BoxFit].
166+
@FlutterProp(
167+
'fit',
168+
type: 'string',
169+
group: 'Image Fill',
170+
control: 'select',
171+
flutterParam: false,
172+
a2ui: false,
173+
note: 'Persisted image fill fit mode in a paint item.',
174+
)
156175
final Fit fit;
157176

158177
/// The alignment positioning of the image relative to its view.
159178
/// [-1, -1] being the top left corner of the view and [1, 1] being the bottom
160179
/// right corner of the view, and [0, 0] being the center of the view.
161180
///
162181
/// This corresponds to Flutter's [Alignment].
182+
@FlutterProp(
183+
'alignment',
184+
type: 'object',
185+
group: 'Image Fill',
186+
control: 'alignment',
187+
flutterParam: false,
188+
a2ui: false,
189+
note: 'Persisted image alignment object in a paint item.',
190+
)
163191
final AlignmentModel alignment;
164192

165193
/// The image scale per-axis.
166-
final double scaleX, scaleY;
194+
@FlutterProp(
195+
'scaleX',
196+
type: 'number',
197+
group: 'Image Fill',
198+
control: 'number',
199+
flutterParam: false,
200+
a2ui: false,
201+
note: 'Persisted horizontal image scale or flip sign in a paint item.',
202+
)
203+
final double scaleX;
204+
205+
@FlutterProp(
206+
'scaleY',
207+
type: 'number',
208+
group: 'Image Fill',
209+
control: 'number',
210+
flutterParam: false,
211+
a2ui: false,
212+
note: 'Persisted vertical image scale or flip sign in a paint item.',
213+
)
214+
final double scaleY;
167215

168216
/// Image scale.
169217
double get scale => min(scaleX, scaleY);
@@ -184,6 +232,15 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
184232
bool get isNonUniformScale => scaleX.abs() != scaleY.abs();
185233

186234
/// Stores information about the crop of an image.
235+
@FlutterProp(
236+
'cropData',
237+
type: 'object',
238+
group: 'Image Fill',
239+
control: 'crop',
240+
flutterParam: false,
241+
a2ui: false,
242+
note: 'Optional persisted crop object in a paint item.',
243+
)
187244
final CropData? cropData;
188245

189246
/// URL of the cropped image.
@@ -199,6 +256,15 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
199256
final double? sourceHeight;
200257

201258
/// Tile mode for image fill.
259+
@FlutterProp(
260+
'imageRepeat',
261+
type: 'string',
262+
group: 'Image Fill',
263+
control: 'select',
264+
flutterParam: false,
265+
a2ui: false,
266+
note: 'Persisted repeat mode for an image paint item.',
267+
)
202268
final ImageRepeatEnum imageRepeat;
203269

204270
/// Color saturation of an image fill: 1 keeps the image's colors, 0 makes

‎lib/src/api/models/pins_model.dart‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
22
import 'package:equatable/equatable.dart';
33

44
import '../../../codelessly_api.dart';
5+
import '../../schema/flutter_prop.dart';
56

67
part 'pins_model.g.dart';
78

@@ -71,18 +72,54 @@ enum EdgePin {
7172
class EdgePinsModel with Equatable, SerializableMixin {
7273
/// Distance between node's left edge and its parent's left edge. Setting a
7374
/// non-null value pins the node to the left edge of its parent.
75+
@FlutterProp(
76+
'left',
77+
type: 'number',
78+
group: 'Position',
79+
control: 'number',
80+
flutterParam: false,
81+
a2ui: false,
82+
note: 'Nullable distance from the parent left edge.',
83+
)
7484
final double? left;
7585

7686
/// Distance between node's top edge and its parent's top edge. Setting a
7787
/// non-null value pins the node to the top edge of its parent.
88+
@FlutterProp(
89+
'top',
90+
type: 'number',
91+
group: 'Position',
92+
control: 'number',
93+
flutterParam: false,
94+
a2ui: false,
95+
note: 'Nullable distance from the parent top edge.',
96+
)
7897
final double? top;
7998

8099
/// Distance between node's right edge and its parent's right edge. Setting a
81100
/// non-null value pins the node to the right edge of its parent.
101+
@FlutterProp(
102+
'right',
103+
type: 'number',
104+
group: 'Position',
105+
control: 'number',
106+
flutterParam: false,
107+
a2ui: false,
108+
note: 'Nullable distance from the parent right edge.',
109+
)
82110
final double? right;
83111

84112
/// Distance between node's bottom edge and its parent's bottom edge. Setting a
85113
/// non-null value pins the node to the bottom edge of its parent.
114+
@FlutterProp(
115+
'bottom',
116+
type: 'number',
117+
group: 'Position',
118+
control: 'number',
119+
flutterParam: false,
120+
a2ui: false,
121+
note: 'Nullable distance from the parent bottom edge.',
122+
)
86123
final double? bottom;
87124

88125
/// Creates a new [EdgePinsModel] with the given [left], [top], [right], and

0 commit comments

Comments
 (0)