mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-10 09:13:59 +02:00
rename master to main
This commit is contained in:
@@ -5,4 +5,4 @@ with multi-package repos, or single-package repos to help you version and publis
|
||||
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
||||
|
||||
We have a quick list of common questions to get you started engaging with this project in
|
||||
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
|
||||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
"commit": false,
|
||||
"linked": [["slate", "slate-history", "slate-hyperscript", "slate-react"]],
|
||||
"access": "public",
|
||||
"baseBranch": "master",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": [],
|
||||
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -3,7 +3,7 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
run:
|
||||
|
@@ -1335,7 +1335,7 @@ This is just an attempt to make dealing with normalization errors slightly more
|
||||
|
||||
###### BREAKING
|
||||
|
||||
**The `decorate` function of schema rules has changed.** Previously, in `decorate` you would receive a text node and the matched node, and you'd need to manually add any marks you wanted to the text node's characters. Now, "decorations" have changed to just be `Selection` objects with marks in the `selection.marks` property. Instead of applying the marks yourself, you simply return selection ranges with the marks to be applied, and Slate will apply them internally. This makes it possible to write much more complex decoration behaviors. Check out the revamped [`code-highlighting`](https://github.com/ianstormtaylor/slate/blob/master/examples/code-highlighting/index.js) example and the new [`search-highlighting`](https://github.com/ianstormtaylor/slate/blob/master/examples/search-highlighting/index.js) example to see this in action.
|
||||
**The `decorate` function of schema rules has changed.** Previously, in `decorate` you would receive a text node and the matched node, and you'd need to manually add any marks you wanted to the text node's characters. Now, "decorations" have changed to just be `Selection` objects with marks in the `selection.marks` property. Instead of applying the marks yourself, you simply return selection ranges with the marks to be applied, and Slate will apply them internally. This makes it possible to write much more complex decoration behaviors. Check out the revamped [`code-highlighting`](https://github.com/ianstormtaylor/slate/blob/main/examples/code-highlighting/index.js) example and the new [`search-highlighting`](https://github.com/ianstormtaylor/slate/blob/main/examples/search-highlighting/index.js) example to see this in action.
|
||||
|
||||
**The `set_data` operation type has been replaced by `set_state`.** With the new `state.decorations` property, it doesn't make sense to have a new operation type for every property of `State` objects. Instead, the new `set_state` operation more closely mimics the existing `set_mark` and `set_node` operations.
|
||||
|
||||
@@ -1343,7 +1343,7 @@ This is just an attempt to make dealing with normalization errors slightly more
|
||||
|
||||
###### NEW
|
||||
|
||||
**You can now set decorations based on external information.** Previously, the "decoration" logic in Slate was always based off of the text of a node, and would only re-render when that text changed. Now, there is a new `state.decorations` property that you can set via `change.setState({ decorations })`. You can use this to add presentation-only marks to arbitrary ranges of text in the document. Check out the new [`search-highlighting`](https://github.com/ianstormtaylor/slate/blob/master/examples/search-highlighting/index.js) example to see this in action.
|
||||
**You can now set decorations based on external information.** Previously, the "decoration" logic in Slate was always based off of the text of a node, and would only re-render when that text changed. Now, there is a new `state.decorations` property that you can set via `change.setState({ decorations })`. You can use this to add presentation-only marks to arbitrary ranges of text in the document. Check out the new [`search-highlighting`](https://github.com/ianstormtaylor/slate/blob/main/examples/search-highlighting/index.js) example to see this in action.
|
||||
|
||||
**The `setData` change method has been replaced by `setState`.** Previously you would call `change.setData(data)`. But as new `State` properties are introduced it doesn't make sense to need to add new change methods each time. Instead, the new `change.setState(properties)` more closesely mimics the existing `setMarkByKey` and `setNodeByKey`. To achieve the old behavior, you can do `change.setState({ data })`.
|
||||
|
||||
|
20
Readme.md
20
Readme.md
@@ -103,16 +103,16 @@ Check out the [**live demo**](http://slatejs.org) of all of the examples!
|
||||
|
||||
To get a sense for how you might use Slate, check out a few of the examples:
|
||||
|
||||
- [**Plain text**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/plaintext.tsx) — showing the most basic case: a glorified `<textarea>`.
|
||||
- [**Rich text**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/richtext.tsx) — showing the features you'd expect from a basic editor.
|
||||
- [**Markdown preview**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/markdown-preview.tsx) — showing how to add key handlers for Markdown-like shortcuts.
|
||||
- [**Links**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/links.tsx) — showing how wrap text in inline nodes with associated data.
|
||||
- [**Images**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/images.tsx) — showing how to use void (text-less) nodes to add images.
|
||||
- [**Hovering toolbar**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/hovering-toolbar.tsx) — showing how a hovering toolbar can be implemented.
|
||||
- [**Tables**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/tables.tsx) — showing how to nest blocks to render more advanced components.
|
||||
- [**Paste HTML**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/paste-html.tsx) — showing how to use an HTML serializer to handle pasted HTML.
|
||||
- [**Mentions**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/mentions.tsx) — showing how to use inline void nodes for simple @-mentions.
|
||||
- [**See all the examples...**](https://github.com/ianstormtaylor/slate/tree/master/site/examples/)
|
||||
- [**Plain text**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/plaintext.tsx) — showing the most basic case: a glorified `<textarea>`.
|
||||
- [**Rich text**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/richtext.tsx) — showing the features you'd expect from a basic editor.
|
||||
- [**Markdown preview**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/markdown-preview.tsx) — showing how to add key handlers for Markdown-like shortcuts.
|
||||
- [**Links**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/links.tsx) — showing how wrap text in inline nodes with associated data.
|
||||
- [**Images**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/images.tsx) — showing how to use void (text-less) nodes to add images.
|
||||
- [**Hovering toolbar**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/hovering-toolbar.tsx) — showing how a hovering toolbar can be implemented.
|
||||
- [**Tables**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/tables.tsx) — showing how to nest blocks to render more advanced components.
|
||||
- [**Paste HTML**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/paste-html.tsx) — showing how to use an HTML serializer to handle pasted HTML.
|
||||
- [**Mentions**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/mentions.tsx) — showing how to use inline void nodes for simple @-mentions.
|
||||
- [**See all the examples...**](https://github.com/ianstormtaylor/slate/tree/main/site/examples/)
|
||||
|
||||
If you have an idea for an example that shows a common use case, pull request it!
|
||||
|
||||
|
@@ -70,7 +70,7 @@ To get a sense for how you might use Slate, check out a few of the examples:
|
||||
- [**Paste HTML**](https://www.slatejs.org/examples/paste-html) — showing how to use an HTML serializer to handle pasted HTML.
|
||||
- [**Mentions**](https://www.slatejs.org/examples/mentions) — showing how to use inline void nodes for simple @-mentions.
|
||||
|
||||
Each example includes a **View Source** link to the code that implements it. And we have [other examples](https://github.com/ianstormtaylor/slate/tree/master/site/examples) too.
|
||||
Each example includes a **View Source** link to the code that implements it. And we have [other examples](https://github.com/ianstormtaylor/slate/tree/main/site/examples) too.
|
||||
|
||||
If you have an idea for an example that shows a common use case, pull request it!
|
||||
|
||||
@@ -83,7 +83,7 @@ If you're using Slate for the first time, check out the [Getting Started](http:/
|
||||
- [**FAQ**](http://docs.slatejs.org/general/faq)
|
||||
- [**Resources**](http://docs.slatejs.org/general/resources)
|
||||
|
||||
If even that's not enough, you can always [read the source itself](https://github.com/ianstormtaylor/slate/tree/master/packages), which is heavily commented.
|
||||
If even that's not enough, you can always [read the source itself](https://github.com/ianstormtaylor/slate/tree/main/packages), which is heavily commented.
|
||||
|
||||
There are also translations of the documentation into other languages:
|
||||
|
||||
|
@@ -297,7 +297,7 @@ const ExamplePage = ({ example }: { example: string }) => {
|
||||
<ExampleTitle>
|
||||
{name}
|
||||
<A
|
||||
href={`https://github.com/ianstormtaylor/slate/blob/master/site/examples/${path}.tsx`}
|
||||
href={`https://github.com/ianstormtaylor/slate/blob/main/site/examples/${path}.tsx`}
|
||||
>
|
||||
(View Source)
|
||||
</A>
|
||||
|
Reference in New Issue
Block a user