提交 4df08912 编写于 作者: A Adam Barth

Organize sky/framework a bit

- Removed out-of-date README.md
- Moved fling-curve into the animation directory because it's part of the
  animation behavior of the system.
- Moved view-configuration into the theme directory because it's a collection
  of constants similar in flavor to the colors and the shadows. Eventually
  we'll want to make the theme configurable and have these all together will
  hopefully make that easier.
- Moved dom-serializer into tests/resources because it is used only by tests.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980423002
上级 19a84413
library widgets;
import '../lib/fn.dart';
import '../../../framework/fling-curve.dart';
import '../../../framework/animation/curves.dart';
import '../../../framework/animation/fling-curve.dart';
import '../../../framework/theme/colors.dart';
import '../../../framework/theme/shadows.dart';
import 'dart:collection';
......
SkyElement
===
SkyElement is the framework for creating...yup...Sky Elements. It take heavy
inspriation from [Polymer](www.polymer-project.org) and isn't very fully
featured...yet
Declaring an element
--------
```HTML
<import src="../path/to/sky-element.sky" as="SkyElement" />
<template>
<my-other-element>Hello, {{ place }}</my-other-element>
</template>
<script>
// SkyElement takes a single object as it's only parameter
SkyElement({
name: 'my-element', // required. The element's tag-name
attached: function() {
this.place = 'World';
}, // optional
detached: function() {}, // optional
attributeChanged: function(attrName, newValue, oldValue) {} // optional
});
</script>
```
Note that an element's declared ShadowDOM is the previous `<template>`
element to the `<script>` element which defines the element.
Databinding
--------
SkyElement's databinding support is derived from Polymer's. At the moment,
there are some key differences:
There is not yet support for
* Declarative event handlers
* Inline expressions
* Self-observation (e.g. `fooChanged()` gets invoked when `this.foo` is changed)
* Computed properties (e.g. the computed block)
* Conditional attributes (e.g. `<my-foo checked?="{{ val }}"`)
Also, because there are so few built-in elements in Sky, the default behavior
of HTMLElement with bindings is to assign to the property. e.g.
```HTML
<my-foo bar="{{ bas }}">
```
Will not `setAttribute` on the `my-foo`, instead it will assign to the `bar`
property of `my-foo`. There are two exceptions to this: `class` & `style` --
those still`setAttribute`.
......@@ -37,8 +37,8 @@
<script>
import "dart:math" as math;
import "dart:sky";
import "fling-curve.dart";
import "view-configuration.dart" as config;
import "animation/fling-curve.dart";
import "theme/view-configuration.dart" as config;
@Tagname('sky-scrollable')
class SkyScrollable extends SkyElement {
......
<import src="/sky/framework/dom-serializer.sky" as="DomSerializer"/>
<import src="dom-serializer.sky" as="DomSerializer"/>
<script>
import "dart:sky";
import "dart:sky.internals" as internals;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册