1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-19 14:27:07 +01:00

2918 Commits

Author SHA1 Message Date
Kamil Kamiński
88b7efa975 Change renderNode docs to renderBlock and renderInline (#3083) 2019-11-09 17:59:31 -05:00
whyour
91c2cb4e9e Fix when clear search text, all text split by blank (#3072)
in search-highlighting example, when search text is empty, no need to split text and addAnnotation
2019-11-09 17:58:53 -05:00
Entkenntnis
862e74a0cb fixing paste html example (#3070) 2019-11-09 17:56:46 -05:00
Stewart Sum
6fc0bc85e6 Update saving-and-loading-html-content.md (#3064)
Change the name of the first argument of the serialize function from 'object' to 'obj' in the description to match what is used in the code.
2019-11-09 17:56:18 -05:00
comerc
4c0be6d7ce Removed 404 links from Changelog.md (#3062)
* Removed 404 link of slate-dev-warning

* Removed 404 link of slate-simulator
2019-11-09 17:55:20 -05:00
Guillaume Racicot
d28f78c060 Mark some events as 'user actions' to prevent scrolling when a programatic selection tranformation is performed (#3019) 2019-10-06 09:22:00 -04:00
Stefan
7f5ad9c1fc tests, test organizaiton, and improvements for paste (#2589) 2019-10-06 09:13:11 -04:00
Yue
d134f64cd7 Added onMouseUp into available hooks. (#3047) 2019-10-06 09:08:25 -04:00
davidhoeller
8dce7538eb Fix unicode offset (#3044)
* Merges pr-2680

* Handle end/beginning of node/text: we have to return 1 in order not to break jumping to next/previous node

* Update emojis example to insert emojis as plain text with shift+click.

* Fix eslint issues
2019-10-06 09:07:53 -04:00
Sebastian Seilund
d71ea08fdf Fixed /placeholder link on Examples page (#3038)
The directory is at https://github.com/ianstormtaylor/slate/tree/master/examples/placeholder (without the last `s`)
2019-10-06 09:04:18 -04:00
Sebastian Seilund
7f201f139b Fixed typo in docs: addMarkAt_Ar_ange -> addMarkAt_R_ange (#3033) 2019-10-06 09:03:49 -04:00
Tim Saunders
549359d19e Capitalise references to Mark for consistency (#3031) 2019-10-06 09:03:29 -04:00
往日。
03ee011834 Correct the document mentioned by #3029 (#3035) 2019-09-30 09:25:59 -07:00
Ian Storm Taylor
cd945cd536 Publish
- slate-react@0.22.9
slate-react@0.22.9
2019-09-27 10:34:24 -04:00
kay delaney
6d637f37a2 Bugfix: Fixes issue where focusing on editor always placed caret at offset 0 (#2995)
* Revert "fix(firefox): fixed the bug that happens when changing the focus from one field to another (#2236)"

This reverts commit 6aba4260f84a4ffe6ccbe60078c95f7c39a8a6c0.

* Fixes issue where focusing on editor always placed caret at offset 0

* Inlines `selectionsEqual` logic and adds some comments
2019-09-27 10:30:29 -04:00
Akumatus
21d0f4a233 Replace deprecated findDOMNode with editor.findDOMNode in cloneFragment (#3018) 2019-09-21 13:48:25 -04:00
Akumatus
3fa6ff17e1 fix broken core-plugin link in doc and add one item to the products list (#3017) 2019-09-21 13:46:21 -04:00
Mitchell Donaldson
58b0f9f1a3 Remove range parameter from getTexts documentation (#3016) 2019-09-21 13:45:50 -04:00
Entkenntnis
1c29165661 fix cursor jumping to end in embeds example (#3014)
* fix cursor jumping to end in embeds example

* prettier

* prettier again
2019-09-21 13:44:57 -04:00
ibone
fb728f4754 FIX findPoint offset may be include zero width string (#2982)
* FIX point offset may be include zero width string

* fix prettier style

* FIX prettier style
2019-09-08 10:11:49 -07:00
Brent Farese
ca73f2a671 Update range.md (#2996)
It appears that references to point.normalize(document) should be range.normalize(document).
2019-09-08 10:07:24 -07:00
Justin Weiss
6269fcaa71 Drop dragged nodes into the correct place (#3001)
When drag-and-dropping nodes within the same editor, the removal of
the dragged nodes can cause paths and offsets to change. This is
really hard to compensate for.

Instead of compensating for it, rearranging the order things happen
mean we are always working with a document in a reasonable state.

Now, we:

1. Fire a MouseUp event on `event.target` (because we haven't done
   anything, it's guaranteed to exist)
2. Save the range we're dragging (for later)
3. Select the target range (because we haven't deleted anything, this
   is still valid)
4. Delete the range we're dragging (this will automatically adjust the
   editor's selection)
5. Insert the dragged fragment at the current range

No matter where we're dragging from or to, these should all be
pointing at places that both exist, and haven't changed.
2019-09-08 10:06:19 -07:00
Dragos Bulugean
8d0899fee9 Add Archbee to resources.md (#2994) 2019-09-08 10:04:36 -07:00
Sunny Hirai
7a6cd1ea2d
Improve data model docs (#2992)
* Improve data model docs

* Fix linting
2019-08-30 22:19:57 -07:00
Ian Storm Taylor
c42d84dbf6 Publish
- slate-base64-serializer@0.2.111
 - slate-html-serializer@0.8.10
 - slate-hyperscript@0.13.8
 - slate-plain-serializer@0.7.10
 - slate-prop-types@0.5.41
 - slate-react-placeholder@0.2.8
 - slate-react@0.22.8
 - slate@0.47.8
slate@0.47.8 slate-react@0.22.8 slate-react-placeholder@0.2.8 slate-prop-types@0.5.41 slate-plain-serializer@0.7.10 slate-hyperscript@0.13.8 slate-html-serializer@0.8.10 slate-base64-serializer@0.2.111
2019-08-27 10:31:30 -04:00
Stan Gurenkov
de376d79b8 Fix several undo/redo issues related to selection operation (#2948)
Should fix the following issues: #2891, #2729
2019-08-22 14:28:13 -04:00
Yue
6e56932ee4 fix React warnings on renderMark, renderBlock, renderDecoration (#2974)
* fix React warnings on renderMark, renderBlock, renderDecoration

* included decorateNode and relocated code into constants in EventHandler

* Put decorateNode and render handlers into a seperate file.

* fix indentation

* overlooked indentation.
2019-08-22 12:50:32 -04:00
Ian Storm Taylor
1f673a9b43 Publish
- slate-base64-serializer@0.2.110
 - slate-html-serializer@0.8.9
 - slate-hyperscript@0.13.7
 - slate-plain-serializer@0.7.9
 - slate-prop-types@0.5.40
 - slate-react-placeholder@0.2.7
 - slate-react@0.22.7
 - slate@0.47.7
slate@0.47.7 slate-react@0.22.7 slate-react-placeholder@0.2.7 slate-prop-types@0.5.40 slate-plain-serializer@0.7.9 slate-hyperscript@0.13.7 slate-html-serializer@0.8.9 slate-base64-serializer@0.2.110
2019-08-21 22:45:19 -04:00
themithy
1895c6696f Fix extracting relative ranges from decorations. (#2970) 2019-08-21 22:42:43 -04:00
themithy
f4283866f2 Fix range normalization in remove node. (#2971) 2019-08-21 22:42:07 -04:00
kay delaney
9c2d55e800 deleteBackwardAtRange now works when offset is equal to n (#2966)
* deleteBackwardAtRange now works when offset is equal to n
Closes #2965

* Adds test to verify behaviour of `deleteBackwardAtRange` when offset===length
2019-08-21 22:41:21 -04:00
Lionel
1aa1783c9c Update installing-slate.md (#2975)
Just noticed a missing word in this doc, thought I'd add a quick fix.
2019-08-21 22:40:18 -04:00
themithy
9a2b53e81c Fix rendering of collapsed annotation at offset zero. (#2918) 2019-08-21 22:39:58 -04:00
Charley DAVID
2ea6d40ad0 Fix improper selection after insertFragment (#2976)
* Fix typo & remove useless check

* No need to check the end of the selection, as this part is called after the
  `deleteExpanded` call. Selection is collapsed at this point.

* Fix insertFragment selection not place properly
2019-08-21 22:39:38 -04:00
Ian Storm Taylor
3ed981aedf Publish
- slate-base64-serializer@0.2.109
 - slate-html-serializer@0.8.8
 - slate-hyperscript@0.13.6
 - slate-plain-serializer@0.7.8
 - slate-prop-types@0.5.39
 - slate-react-placeholder@0.2.6
 - slate-react@0.22.6
 - slate@0.47.6
slate@0.47.6 slate-react@0.22.6 slate-react-placeholder@0.2.6 slate-prop-types@0.5.39 slate-plain-serializer@0.7.8 slate-hyperscript@0.13.6 slate-html-serializer@0.8.8 slate-base64-serializer@0.2.109
2019-08-19 12:41:58 -04:00
themithy
ff831eba7d Deduplicate dirty paths for normalization. (#2916)
* Deduplicate dirty paths for normalization.

* Update editor.js
2019-08-19 10:37:38 -06:00
Yulong Ruan
8ab49c04c4 fixed #1237 which calls Selection.getRangeAt(0) when Selection.type = 'None' (#2920)
it should check the latest rangeCount, not the previous memorized one
2019-08-19 10:24:49 -06:00
Stan Gurenkov
65796c8ba0 insertTextByPath should replace marks on the inserted text with the once that are provided (#2936)
It were trying to add those marks that are passed to the function to the existing once,
but it should replace them instead.

Example error behavior was:
* put cursor at the end of the marked text
* toggle marks
* enter text

expected:
text is being added without toggled marks

actual:
text is added with those marks applied
2019-08-19 10:23:46 -06:00
Devin Morgan
9d9d6067e4 Update glossary.md with definition of match (#2964)
`match` get's used a number of times within the slate/schema.md but it does not appear to be explicitly defined anywhere. This term seems like a great candidate for the Glossary.
2019-08-19 10:20:46 -06:00
Brendan
6672f553e9 Mutate newDirtyPaths instead of creating a new array every iteration (#2559)
* Mutate newDirtyPaths instead of creating a new array every iteration

* Switch to map + Array.prototype.concat.apply to improve readability

* Update editor.js
2019-08-19 10:19:24 -06:00
Charley DAVID
0edcc89692 Fix splitNode range updates when selection is backward (#2938) 2019-08-19 10:17:07 -06:00
Charley DAVID
b6a99ce752 Fix removing marks generate useless operations (#2946) 2019-08-19 10:12:55 -06:00
Naresh Bhatia
4369f3fc2f Fix renderBlock() in paste-html example (#2934)
* Fix renderBlock() in paste-html example

It appears that render block is missing a case for rendering `paragraph`. Without this paragraphs are being rendered as `<div>`s.

* Fixed lint error
2019-08-19 10:10:55 -06:00
lin onetwo
5686c3d8cc fix: Unknown event handler property onEvent (#2925)
* fix: Unknown event handler property `onEvent`

```
index.js:1 Warning: Unknown event handler property `onEvent`. It will be ignored.
	in div (created by Content)
    in Content (created by Editor)
```

* fix: make onEvent required

Seems this prop is provided in `component/editor.js`
2019-08-19 10:09:08 -06:00
lakatosandrei
6aba4260f8 fix(firefox): fixed the bug that happens when changing the focus from one field to another (#2236)
* fix(firefox): fixed the bug that happens when changing the focus from one field to another

* Publish

 - slate-base64-serializer@0.2.69
 - slate-html-serializer@0.7.8
 - slate-hyperscript@0.10.8
 - slate-plain-serializer@0.6.8
 - slate-prop-types@0.4.67
 - slate-react@0.18.11
 - slate-simulator@0.4.67
 - slate@0.41.3

* Publish

 - slate-base64-serializer@0.2.70
 - slate-html-serializer@0.7.9
 - slate-hyperscript@0.10.9
 - slate-plain-serializer@0.6.9
 - slate-prop-types@0.4.68
 - slate-react@0.18.12
 - slate-simulator@0.4.68
 - slate@0.41.4

* Publish

 - slate-react@0.18.13

* Revert "Fix an occasional crash in Firefox in isInEditor (#2229)"

This reverts commit 1ff050265bbcb8e6d5b5bbf9dc8839f1c6a2ddef.

* fix(firefox): added postinstall script to the main project

* fix(firefox): removed error causing line

* fix(firefox): added the right fix for this

* fix(firefox): added the best fix for this

* fix(firefox): made the range a constant

* fix(firefox): added the removeAllRanges inside the if wrapper

* fix(lint): fixed lint error

* fix(versions): removed changes for the package.json files

* fix(versions): removed remaining changes for the package.json files

* fix(conflict): fixed the issue that resolving the conflicts caused last time

* fix(lint): fixed the last lint error

* chore(content): moved comment in setTimeout to see why git is not showing conflicts locally
2019-08-19 10:08:22 -06:00
themithy
5c4e4f9548 Add annotation-related ops to path.transform. (#2) (#2915) 2019-08-19 10:04:30 -06:00
themithy
d4b003862d Add point normalization to addAnnotation. (#2914) 2019-08-19 10:03:49 -06:00
Ian Storm Taylor
2304df2f50 Publish
- slate-base64-serializer@0.2.108
 - slate-html-serializer@0.8.7
 - slate-hyperscript@0.13.5
 - slate-plain-serializer@0.7.7
 - slate-prop-types@0.5.38
 - slate-react-placeholder@0.2.5
 - slate-react@0.22.5
 - slate@0.47.5
slate@0.47.5 slate-react@0.22.5 slate-react-placeholder@0.2.5 slate-prop-types@0.5.38 slate-plain-serializer@0.7.7 slate-hyperscript@0.13.5 slate-html-serializer@0.8.7 slate-base64-serializer@0.2.108
2019-08-19 11:35:20 -04:00
John Isaac
09807df24f Fix typo in marks (#2929) 2019-08-08 07:10:26 -05:00
Brent Farese
767812cad3 Update plugins.md (#2950)
renderMark function signature is missing from the initial description of Hooks.
2019-08-08 07:03:49 -05:00