You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Text style={textStyle}>Here is some text below an image.</Text>
128
+
</Surface>
129
+
)
130
+
}
131
+
}
139
132
```
140
133
141
134
## Text sizing
142
135
143
136
React Canvas provides the `measureText` function for computing text metrics.
144
137
145
-
The [Page component](examples/timeline/components/Page.js) in the timeline example contains an example of using measureText to achieve precise multi-line ellipsized text.
146
-
147
138
Custom fonts are not currently supported but will be added in a future version.
148
139
149
140
## css-layout
@@ -154,43 +145,9 @@ Future versions may not support css-layout out of the box. The performance impli
154
145
155
146
See the [css-layout example](examples/css-layout).
156
147
157
-
## Accessibility
158
-
159
-
This area needs further exploration. Using fallback content (the canvas DOM sub-tree) should allow screen readers such as VoiceOver to interact with the content. We've seen mixed results with the iOS devices we've tested. Additionally there is a standard for [focus management](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#dom-context-2d-drawfocusring) that is not supported by browsers yet.
160
-
161
-
One approach that was raised by [Bespin](http://vimeo.com/3195079) in 2009 is to keep a [parallel DOM](http://robertnyman.com/2009/04/03/mozilla-labs-online-code-editor-bespin/#comment-560310) in sync with the elements rendered in canvas.
162
-
163
-
## Running the examples
148
+
## Running the examples (storybook)
164
149
165
150
```
166
-
npm install
167
-
npm start
151
+
yarn install --pure-lockfile
152
+
yarn storybook
168
153
```
169
-
170
-
This will start a live reloading server on port 8080. To override the default server and live reload ports, run `npm start` with PORT and/or RELOAD_PORT environment variables.
171
-
172
-
**A note on NODE_ENV and React**: running the examples with `NODE_ENV=production` will noticeably improve scrolling performance. This is because React skips propType validation in production mode.
173
-
174
-
175
-
## Using with webpack
176
-
177
-
The [brfs](https://github.com/substack/brfs) transform is required in order to use the project with webpack.
178
-
179
-
```bash
180
-
npm install -g brfs
181
-
npm install --save-dev transform-loader brfs
182
-
```
183
-
184
-
Then add the [brfs](https://github.com/substack/brfs) transform to your webpack config
185
-
186
-
```javascript
187
-
module: {
188
-
postLoaders: [
189
-
{ loader:"transform?brfs" }
190
-
]
191
-
}
192
-
```
193
-
194
-
## Contributing
195
-
196
-
We welcome pull requests for bug fixes, new features, and improvements to React Canvas. Contributors to the main repository must accept Flipboard's Apache-style [Individual Contributor License Agreement (CLA)](https://docs.google.com/forms/d/1gh9y6_i8xFn6pA15PqFeye19VqasuI9-bGp_e0owy74/viewform) before any changes can be merged.
0 commit comments