Skip to content

Commit e5909d1

Browse files
committed
Add program classes and widgets, update dependencies
1 parent 7273b4e commit e5909d1

File tree

23 files changed

+2812
-2195
lines changed

23 files changed

+2812
-2195
lines changed

.github/workflows/build.yml

Lines changed: 286 additions & 178 deletions
Large diffs are not rendered by default.

api/lib/api.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ library;
55

66
export 'models/command.dart';
77
export 'models/context.dart';
8+
export 'models/evaluator.dart';
9+
export 'models/parser.dart';
10+
export 'models/program.dart';
11+
export 'models/view.dart';

api/lib/models/parser.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class DslGrammarDefinition extends GrammarDefinition<VulpineDSL> {
152152
ref0(execCommand),
153153
ref0(argCommand),
154154
ref0(ifCommand),
155-
failure<VulpineDSLCommand>('value expected'),
155+
failure<VulpineDSLCommand>(message: 'value expected'),
156156
].toChoiceParser();
157157

158158
// SET command now uses ref0(interpolatedString)
@@ -231,7 +231,7 @@ class DslGrammarDefinition extends GrammarDefinition<VulpineDSL> {
231231
ref0(comparisonCondition),
232232
ref0(logicalCondition),
233233
ref0(notCondition),
234-
failure<VulpineDSLCondition>('condition expected'),
234+
failure<VulpineDSLCondition>(message: 'condition expected'),
235235
].toChoiceParser(),
236236
char(')'),
237237
).map3((_, condition, _) => condition);

api/lib/models/program.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import 'package:dart_mappable/dart_mappable.dart';
2+
3+
part 'program.mapper.dart';
4+
5+
@MappableClass()
6+
sealed class VulpineProgram with VulpineProgramMappable {
7+
const VulpineProgram();
8+
}
9+
10+
@MappableClass()
11+
final class VulpineLinkProgram extends VulpineProgram
12+
with VulpineLinkProgramMappable {
13+
final Uri url;
14+
15+
const VulpineLinkProgram(this.url);
16+
}

api/lib/models/program.mapper.dart

Lines changed: 182 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/lib/models/view.dart

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import 'package:dart_leap/dart_leap.dart';
2+
import 'package:dart_mappable/dart_mappable.dart';
3+
import 'package:vulpine_api/models/program.dart';
4+
5+
part 'view.mapper.dart';
6+
7+
@MappableClass()
8+
final class ViewVulpine with ViewVulpineMappable {
9+
final String description;
10+
final List<ViewVulpineTile> tiles;
11+
12+
ViewVulpine({this.description = '', this.tiles = const []});
13+
}
14+
15+
@MappableClass()
16+
final class ViewVulpineTile with ViewVulpineTileMappable {
17+
final VulpineProgram? program;
18+
final int x, y, width, height;
19+
final Uri? icon;
20+
final String label;
21+
final SRGBColor? color;
22+
final String description;
23+
24+
ViewVulpineTile({
25+
required this.x,
26+
required this.y,
27+
this.program,
28+
this.width = 1,
29+
this.height = 1,
30+
this.icon,
31+
this.label = '',
32+
this.description = '',
33+
this.color,
34+
});
35+
}

0 commit comments

Comments
 (0)