Commit graph

270 commits

Author SHA1 Message Date
Simon Hausmann
7982325da4 Change Rectangle::background's type to be a brush
This also introduces the brush type in the compiler and generators. At the
moment only conversion from Color is implemented.
2021-02-03 12:49:44 +01:00
Simon Hausmann
e8b64be9bd Issue a warning when accessing a deprecated property through component scopes 2021-02-03 08:03:01 +01:00
Simon Hausmann
c771bcff45 Print a warning when trying to animate deprecated properties 2021-02-02 22:58:54 +01:00
Simon Hausmann
246398fcb3 Issue a warning when accessing deprecated properties through member lookups 2021-02-02 22:42:02 +01:00
Simon Hausmann
e61529976e Issue warnings when creating bindings against deprecated properties 2021-02-02 22:42:02 +01:00
Simon Hausmann
1f091cb1c0 Rename Rectangle.color to Rectangle.background
Add support for built-in property aliases and rename `color` to
`background` - in preparation for it also changing to type brush.

Right now the alias is silent, a deprecation and overall change
will come in a subsequent change.
2021-02-02 17:01:12 +01:00
Olivier Goffart
c479fd132d Fix panic when @children is in the last component
Throw an error instead

Fixes #148
2021-02-02 16:44:09 +01:00
Olivier Goffart
294cf9bbe3 Convert from literal 0 to any unit-like types
cc #68
2021-02-02 15:38:07 +01:00
Olivier Goffart
ad1e18764a Make angle its own type 2021-02-01 14:49:25 +01:00
Olivier Goffart
2d12e118ac Resolve linear gradients 2021-02-01 14:25:27 +01:00
Simon Hausmann
6a4f2aa572 Added the two missing path sub-elements for quadratic and cubic curves 2021-01-28 14:14:24 +01:00
Simon Hausmann
a6fbc4c05d Add missing MoveTo sub-element for Path 2021-01-28 13:16:25 +01:00
Olivier Goffart
0cc2a40085 Another fixup 2021-01-28 12:03:52 +01:00
Olivier Goffart
07df517473 Replace $children with @children 2021-01-28 11:55:08 +01:00
Olivier Goffart
23a511b380 Replace img!"..." by @image-url("...") 2021-01-28 11:49:24 +01:00
Simon Hausmann
6c517b04cf Fix expected error message 2021-01-28 09:12:06 +01:00
Simon Hausmann
ab25faa24f Add automatic creation of BoxShadow elements through drop-shadow properties on Rectangles 2021-01-27 19:02:23 +01:00
Olivier Goffart
397ccf518a Properly error when the return value of a signal is missing 2021-01-26 17:18:01 +01:00
Olivier Goffart
7ac219e6d2 Return statement: check that the return type is correct 2021-01-25 15:32:00 +01:00
Simon Hausmann
a69ce3a397 Remove the 'align-' prefix from TextHorizontal/TextVerticalAlignment 2021-01-25 10:59:18 +01:00
Simon Hausmann
7ef8a866d9 Add support for qualified enum lookups 2021-01-25 10:44:17 +01:00
Simon Hausmann
1bf5a56c39 Rename initial-focus to forward-focus 2021-01-20 15:52:58 +01:00
Simon Hausmann
f7ea2a9dce Forward focus() calls on items that have initial-focus defined
This also makes the focus() method available as a member function on any
item, but the resolve_element_reference_in_set_focus_calls() pass will
check if the elements are valid.

The check for `has-focus` to determine a focusable item was replaced
with an annotation on the built-in elements, so that `has-focus` can
later be implemented as a built-in function through the run-time,
without the need for a boolean property.
2021-01-20 14:31:01 +01:00
Olivier Goffart
78484a75e0 Add string tests I forgot to git add previously 2021-01-19 19:39:42 +01:00
Olivier Goffart
0d2d48be4f Rename "signal" to "callback" 2020-12-18 09:51:01 +01:00
Simon Hausmann
5f9f1ce047 Fix the build
Fix the remaining CompilerConfiguration uses that I missed :(
2020-12-10 16:13:17 +01:00
Olivier Goffart
a37a287a17 Limit the conversion from percentage to lenght for the width and height property 2020-12-04 11:20:09 +01:00
Simon Hausmann
6fba6aca56 Consistency fix for transitions API
Use "in" and "out" instead of "to" and "out".
2020-12-01 11:18:47 +01:00
Simon Hausmann
9360fc3c5a Don't silently drop fields in object literals inside arrays
This patch tries to improve the ability to convert different kinds of
object literals in an array into a common type. We used to take the
first entry as the "shape" of all elements, which meant that if the
first element was missing a field it would be silently dropped from all
future fields.

Instead, this patch merges the fields.
2020-12-01 10:57:47 +01:00
Olivier Goffart
957867d72a More work on popup 2020-11-30 15:20:51 +01:00
Olivier Goffart
852eeb1c11 WIP popup 2020-11-30 15:20:51 +01:00
Olivier Goffart
a4c538c615 Throw an error when using an element as a property type
We currently do not support that
2020-11-30 13:31:02 +01:00
Olivier Goffart
2fdf852289 Add the element name in the error when a property is not found 2020-11-30 13:01:39 +01:00
Olivier Goffart
865e6055f2 Work on transition: lower the transitions 2020-11-20 09:39:06 +01:00
Olivier Goffart
1eb57ae4a3 Add minmax tests 2020-11-13 15:55:42 +01:00
Olivier Goffart
d499e86640 Implement cubic-bezier 2020-11-13 13:36:32 +01:00
Olivier Goffart
decbe0ade5 Fix panic when exporting invalid types
And also still allow to export builtin component
2020-11-02 17:18:42 +01:00
Olivier Goffart
359f42c5f7 Prepare the compiler to be async
This will allow the online editor to load imports from URL asynchroniously later

Since currently the compiler is only working on a single thread, and that we
never await on a future that could block, it is allowed to use the spin_on executor
2020-10-30 15:00:04 +01:00
Olivier Goffart
2d55b2a51a Don't load document twice if they are imported twice
Also protect against cyclic imports
2020-10-30 10:14:27 +01:00
Simon Hausmann
ed714bd332 Fix type leak across imports
Given the test case

    import { SomeType } from "somewhere.60";
    import { Blah } from "foo.60";

and foo.60 trying to use "SomeType":

    export Blah := SomeType {}

then the lookup for "SomeType" in foo.60 should fail. Instead it leaked
through the populated type registry when processing the dependencies for
the outer file.

This is fixed by ensuring that the type registry for a file only has the
global type registry as parent. To ensure that the test reliably covers
this, the import dependencies are now processed in declaration order
(hence the switch to IndexMap that preserves insertion order).
2020-10-29 12:55:00 +01:00
Simon Hausmann
14ad99fed4 Add support for checking diagnostics in imported files 2020-10-29 12:51:36 +01:00
Olivier Goffart
49582d2342 Lookup globals before properties 2020-10-29 11:01:04 +01:00
Olivier Goffart
49db8e20c7 Lookup global components 2020-10-29 11:01:04 +01:00
Simon Hausmann
7eb3d48f42 Prospective fix for test failure on Windows
Remove the leading path separator as that differs between Unix and Windows.
2020-10-29 10:57:54 +01:00
Simon Hausmann
c805f9fca4 Add test coverage for errors generated during import processing
This covers all errors except for the one where File::read_to_string() fails.
2020-10-29 10:46:40 +01:00
Olivier Goffart
97166672c0 Semantic checks for the globals 2020-10-28 07:52:23 +01:00
Olivier Goffart
e85dbfb041 Parse global structure
for issue #96
2020-10-28 07:18:24 +01:00
Olivier Goffart
0a8c098779 Remove the component contextual keyword
It is not used
2020-10-27 16:09:05 +01:00
Olivier Goffart
a4671502ab Allow to speccify a fixed width/height in the layout by setting the height or width 2020-10-26 19:09:01 +01:00
Olivier Goffart
76b7f1aef6 Allow dashes in identifier
Currenly, dashes are normalized to '_'.
Dashes are not allowed at the begining of an identifier.
If an identifier with a dash is not found, we also look for identifier
without a dash and if that exist, we hint the user to use spaces.

Issue #52
2020-10-22 18:32:25 +02:00