1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00

update components readme

This commit is contained in:
Ian Storm Taylor
2016-07-06 15:59:16 -07:00
parent bee2a6d9be
commit 28e6753f3b

View File

@@ -1,12 +1,11 @@
This directory contains the React components that Slate renders. The only one that is publicly accessible is the `Editor`, which composes the others. But here's what they all do:
#### Editor
The `Editor` is the highest-level component that you render from inside your application. Its goal is to present a very clean API for the user, and to encapsulate all of the plugin-level logic.
Many of the properties passed into the editor are combined to create a plugin of its own, that is given the highest priority. This makes overriding core logic super simple, without having to write a separate plugin.
- [Content](#content)
- [Editor](#editor)
- [Leaf](#leaf)
- [Text](#text)
- [Void](#void)
#### Content
@@ -18,6 +17,13 @@ Many of the properties passed into the editor are combined to create a plugin of
You'll notice there are **no** `Block` or `Inline` components. That's because those rendering components are provided by the user, and rendered directly by the `Content` component. You can find the default renderers in the [`Core`](../plugins/core.js) plugin's logic.
#### Editor
The `Editor` is the highest-level component that you render from inside your application. Its goal is to present a very clean API for the user, and to encapsulate all of the plugin-level logic.
Many of the properties passed into the editor are combined to create a plugin of its own, that is given the highest priority. This makes overriding core logic super simple, without having to write a separate plugin.
#### Text
A `Text` component is rendered for each [`Text`](../models) model in the document tree. This component handles grouping the characters of the text node into ranges that have the same set of [`Marks`](../models), and then delegates rendering each range to...