Skip to content

Commit

Permalink
Merge remote-tracking branch 'ianstormtaylor/master'
Browse files Browse the repository at this point in the history
* ianstormtaylor/master:
  Clarifying insertTextByKey description (ianstormtaylor#778)
  Documenting node's 'getFirstText' & 'getLastText' (ianstormtaylor#779)
  0.19.22
  fix selection handling for changing tabs, and inside embedded inputs, closes ianstormtaylor#749
  fix to restrict window blur/focus handling, closes ianstormtaylor#773
  remove warn throwing since console.warn includes callsites now
  Update defining-custom-block-nodes.md (ianstormtaylor#776)
  0.19.21
  update table example to make scope clearer
  Fixed the link to comparisons, which was broken (ianstormtaylor#769)
  fix error when dragging void nodes without selection, closes ianstormtaylor#757
  fix to depend on prop-types for react 15.5
  fix to maintain focus on switching tabs, closes ianstormtaylor#756
  update issue template
  Add "data-key" to root div for the whole document (ianstormtaylor#759)
  add an issue template
  • Loading branch information
oyeanuj committed May 4, 2017
2 parents 68becf0 + 9250baa commit af04f23
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 129 deletions.
31 changes: 31 additions & 0 deletions .github/Issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

#### Do you want to request a *feature* or report a *bug*?

<!--
If you have a question, you might ask it in our Slack channel instead.
https://slate-slack.herokuapp.com/
-->

#### What's the current behavior?

<!--
For bugs, please create a JSFiddle that reproduces the issue using
our template, and include a GIF showing how to easily reproduce it.
And for bugs please include your OS, browser, Slate version and any
other bit of info that may track down why it's happening.
https://jsfiddle.net/2zokvrvt/7/
http://recordit.co/
-->

#### What's the expected behavior?

<!--
Researching how other editors handle this issue is super helpful!
https://draftjs.org/
http://prosemirror.net/
https://quilljs.com/
-->
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Here's how Slate compares to some of the existing editors out there:

- [**Quill**](http://quilljs.com/) — I never used Quill directly, so my hesitations about it are solely from considering it in early stages—and it has changed since then. The issues I see with it are: that the concept of "toolbars" is too coupled with the editor itself, that the configuration is too coupled to HTML classes and DOM nodes, that the idea of "formats" and "toolbars" being linked is limiting, and generally that too much "core" logic is given special privileges and is hard to customize.

For more opinionated, and potentially useless, comparisons check out the [Comparisons](./docs/comparisons.md) document._
For more opinionated, and potentially useless, comparisons check out the [Comparisons](./docs/general/comparisons.md) document._

Of course those are my own opinions, and if those libraries solve your needs, use them! But if you've tried using any of those libraries you might have run into similar problems. If so, you might like Slate. Which brings me to how Slate solves all of that...

Expand Down
16 changes: 14 additions & 2 deletions docs/reference/models/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [Methods](#methods)
- [`filterDescendants`](#filterdescendants)
- [`findDescendant`](#finddescendant)
- [`getBlocksAtRange`](#getblockatrange)
- [`getBlocksAtRange`](#getblocksatrange)
- [`getBlocks`](#getblocks)
- [`getCharactersAtRange`](#getcharactersatrange)
- [`getChild`](#getchild)
Expand All @@ -21,13 +21,15 @@
- [`getClosest`](#getclosest)
- [`getDepth`](#getdepth)
- [`getDescendant`](#getdescendant)
- [`getFirstText`](#getfirsttext)
- [`getFragmentAtRange`](#getfragmentatrange)
- [`getInlinesAtRange`](#getinlinesatrange)
- [`getLastText`](#getlasttext)
- [`getMarksAtRange`](#getmarksatrange)
- [`getNextBlock`](#getnextblock)
- [`getNextSibling`](#getnextsibling)
- [`getNextText`](#getnexttext)
- [`getParent`](#parent)
- [`getParent`](#getparent)
- [`getPreviousBlock`](#getpreviousblock)
- [`getPreviousSibling`](#getprevioussibling)
- [`getPreviousText`](#getprevioustext)
Expand Down Expand Up @@ -129,6 +131,11 @@ Get the depth of a descendant node by `key`.

Get a descendant node by `key`.

### `getFirstText`
`getFirstText() => Node || Void`

Get the first child text node inside a node.

### `getFragmentAtRange`
`getFragmentAtRange(range: Selection) => Document`

Expand All @@ -139,6 +146,11 @@ Get a document fragment of the nodes in a `range`.

Get all of the top-most [`Inline`](./inline.md) nodes in a `range`.

### `getLastText`
`getLastText() => Node || Void`

Get the last child text node inside a node.

### `getMarksAtRange`
`getMarksAtRange(range: Selection) => Set`

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/models/transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Insert a `node` at `index` inside a parent [`Node`](./node.md) by its `key`.
### `insertTextByKey`
`insertTextByKey(key: String, offset: Number, text: String, [marks: Set]) => Transform`

Insert `text` at an `offset` in a [`Node`](./node.md) with optional `marks`.
Insert `text` at an `offset` in a [`Text Node`](./text.md) with optional `marks`.

### `moveNodeByKey`
`moveNodeByKey(key: String, newKey: String, newIndex: Number) => Transform`
Expand Down
2 changes: 1 addition & 1 deletion docs/walkthroughs/defining-custom-block-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class App extends React.Component {

Now let's add "code blocks" to our editor.

The problem is, code blocks won't just be rendered as a plain paragraph, they'll need to be renderer differently. To make that happen, we need to define a "renderer" for `code` nodes
The problem is, code blocks won't just be rendered as a plain paragraph, they'll need to be rendered differently. To make that happen, we need to define a "renderer" for `code` nodes

Node renderers are just simple React components, like so:

Expand Down
2 changes: 1 addition & 1 deletion examples/tables/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
"nodes": [
{
"kind": "text",
"text": "This table is just a basic example, but you could augment it to add support for table headers, adding column and rows, or even formulas if you wanted to get really crazy..."
"text": "This table is just a basic example of rendering a table, and it doesn\'t have fancy functionality. But you could augment it to add support for navigating with arrow keys, displaying table headers, adding column and rows, or even formulas if you wanted to get really crazy!"
}
]
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slate",
"description": "A completely customizable framework for building rich text editors.",
"version": "0.19.20",
"version": "0.19.22",
"license": "MIT",
"repository": "git://github.com/ianstormtaylor/slate.git",
"main": "./lib/index.js",
Expand All @@ -15,7 +15,9 @@
"immutable": "^3.8.1",
"is-empty": "^1.0.0",
"is-in-browser": "^1.1.3",
"is-window": "^1.0.2",
"keycode": "^2.1.2",
"prop-types": "^15.5.8",
"react-portal": "^3.0.0",
"selection-is-backward": "^1.0.0",
"type-of": "^2.0.1"
Expand Down
Loading

0 comments on commit af04f23

Please sign in to comment.