1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-18 22:08:18 +01:00

3195 Commits

Author SHA1 Message Date
喵喵喵
cc57894f98
fix(unmount): add destroyed flag, prevent apply change when component… (#3553)
* fix(unmount): add destroyed flag, prevent apply change when component has been destroyed.

* style(format): update format

* refactor(unmount): remove destroyed flag, use effect return callback to destroy onchange event

* styles(format): format styles

Co-authored-by: wangchao <wangchao08@kuaishou.com>
2020-04-26 12:19:25 -07:00
David Hrdlicka
67c4b3b330
Prioritize using Selection over Range to preserve direction (#3594)
accout for zero-width nodes
2020-04-25 22:23:52 -07:00
CameronAckermanSEL
4f6ca7bc62 v0.57.2 v0.57.2 2020-04-24 16:26:26 -07:00
Jolene Langlinais
970c2aac13
docs(concepts): include normalizing inline default behavior (#3637)
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
2020-04-24 08:28:21 -07:00
Jolene Langlinais
c04672b1f7
docs(resources): add product and editor (#3632)
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
2020-04-23 21:26:31 -07:00
George Rodier
9a6e8fba92
Import Transforms in custom elements walkthough (#3630) 2020-04-22 09:09:42 -07:00
Kirk Swenson
f6bfe034d7
Fix typos and other minor issues in docs (#3597)
Fixed typos and grammatical errors in the documentation
2020-04-10 09:05:03 -07:00
Charanjit Singh
c9891a29e1
Update Contributing.md (#3598)
Fix LearnaJs broken link
2020-04-10 08:59:23 -07:00
Cameron Ackerman
4f1cbf9418
[WIP] add cross-env to enable inline ENV set on multiple environments (#3595)
* add cross-env to enable inline ENV set on multiple environments
2020-04-08 10:58:50 -07:00
CameronAckermanSEL
41aacc009d Revert "add crossenv to allow ENV dependent scripts to work on windows"
This reverts commit b91a0cdd49c2e3a8304460f811e091a920a160ab.
2020-04-08 10:36:10 -07:00
CameronAckermanSEL
23141c046b Revert "v0.57.2"
This reverts commit f9ec4cfaa852d4aaf937c8347f2adb41e23bc793.
2020-04-08 10:35:45 -07:00
CameronAckermanSEL
f9ec4cfaa8 v0.57.2 2020-04-07 13:19:28 -07:00
CameronAckermanSEL
b91a0cdd49 add crossenv to allow ENV dependent scripts to work on windows 2020-04-07 13:17:16 -07:00
Cameron Ackerman
54b9b63f04
fix issue where inline voids can no longer be selected (#3572)
* fix issue where inline voids can no longer be selected by allowing the zero width space to be an editable target

Co-authored-by: damareyoh <chackerman@wsu.edu>
2020-04-07 09:14:57 -07:00
Entkenntnis
1d7ab97429
use state to avoid cursor jumping in controlled input (#3552)
Co-authored-by: dal <test@x.com>
2020-03-24 18:16:32 -07:00
Ken Aoki
5da89b8656
Update 01-installing-slate.md (#3554) 2020-03-24 18:12:06 -07:00
pavlyna
16ff44d056
3536 cover beforeinput behavior on edge legacy browser (#3537)
* 3536 support flat functionality + beforeinput in Edge

* 3536 support flat functionality + beforeinput in Edge

* 3536 remove support for flat functionality

* 3536 added description of regexp

Co-authored-by: Pavlyna Bevz <pavlynabevz@pbevz-mbp.local>
2020-03-11 08:20:30 -07:00
Charanjit Singh
f86f5ca065
Fix Typo (#3545)
Typo fix in documentation
2020-03-11 08:11:42 -07:00
Ryan Mitts
7857a68a2b
Attach the cloned DOM node before coputing its plaintext representation when copying. (#3543)
The cloned dom node constructed when copying must be attached to the dom for getComputedStyle to work.

This adds the div to the body as a hidden element and removes after computing its text representation.
2020-03-09 14:48:37 -07:00
Andreas Geffen Lundahl
f45058ec31
Avoid mutating the selection in Transforms.setPoint (#3541)
Since Immer freezes the selection, we will get a TypeError if we try to mutate
the selection. Also, there's no need to mutate it directly in
Transforms.setPoint.
2020-03-08 20:51:02 -04:00
Cameron Ackerman
a79e11c74e
add tests (#3535) 2020-03-05 09:53:23 -08:00
Cameron Ackerman
1e7d21f7cd
Add API documentation for Slate core package (#3524)
* Create transforms.md

* Create initial documentation for transforms

* Remove extra whitespace in transforms.md

* Create initial documentation for interfaces

* Rearrange API docs by category of interface

* Add documentation of static methods

* Use 'static' notation for transforms
2020-03-05 09:30:29 -08:00
Douwe den Blanken
1d9a7fa01d
Fix for backspace press in list (#3533)
Made a fix for the fact that if you were standing in a <li> wrapped in an <ul> with no text and pressed backspace, the <ul> would go away while the <li>'s stay.
2020-03-02 14:29:46 -08:00
琚致远
2d901f6520
Update 08-rendering.md (#3520) 2020-02-27 14:49:29 -08:00
Ryan Mitts
d17a1e86e3
Added source-map-loader to the Next Webpack config to pass through the source maps from the compiles Slate libraries. (#3445) 2020-02-26 08:02:47 -08:00
Cameron Ackerman
0aaab07792
fixed some bugs with the input event handler on the embeds example (#3516)
* fixed some bugs with the input event handler on the embeds example, got rid of the non functional 'is selected and is focused' conditions for showing the input.

* fix linting error

Co-authored-by: DamareYoh <34608378+DamareYoh@users.noreply.github.com>
2020-02-26 07:48:39 -08:00
Ondrej Stanek
ad881564d8
Fix invalid example link (#3517)
Hovering menu => Hovering toolbar
2020-02-26 07:47:59 -08:00
Ryan Mitts
9504c4472c
Fix inputs from not being able to be used within void nodes in Firefox and Added example of input and other editable void nodes (#3436) 2020-02-25 20:52:11 -08:00
Efim
d8cc9fc46b
fix: check isContentEditable of target element in ReactEditor.hasDOMNode (#3389)
* fix ReactEditor.hasDOMNode

* make ReactEditor.hasDOMNode variables more clear
2020-02-25 20:50:53 -08:00
Synthetic Dream
0d6271bc15
docs: update an example's link (#3514) 2020-02-23 10:44:41 -08:00
Sunny Hirai
bd52b9d080
Use lodash throttle instead of debounce for updating selection change (#3355)
* Add lodash

* Switched debounce to lodash/throttle

* Updated yarn.lock
2020-02-22 09:08:22 -08:00
Ken Aoki
1f11276ebd
Don't use stale readOnly prop. (Fix bug #3321) (#3388) 2020-02-22 08:36:09 -08:00
Marcin Grzywaczewski
83b1319c63
Fix Paste without Formatting / Paste and Match Style producing uneditable text nodes. (#3415)
* handle plaintext-only pastes using onPaste handler, regardless of browser

* remove extra console.log; merge code paths in onPaste - they contain the same code
2020-02-22 07:57:50 -08:00
Lucas Willems
c5249c745c
Update 06-editor.md (#3511) 2020-02-21 09:14:47 -08:00
Tyler Hallada
de9d0a3912
Fix pasting plain text with newlines (#3472)
Fixes https://github.com/ianstormtaylor/slate/issues/1681
2020-02-21 08:35:24 -08:00
Björn Theart
c4eb7b37bc
Update 06-editor.md (#3510) 2020-02-21 08:22:28 -08:00
Kamil Mielnik
378820602c
Enable processing of tsx files with babel in rollup.config.js (#3474)
It should fix https://github.com/ianstormtaylor/slate/issues/3471
2020-02-20 17:58:55 -08:00
Josh McFarlin
9137a1663f
Fixed incorrect editor usage in Embed example (#3397) 2020-02-20 17:28:11 -08:00
Marco Huttunen
e9bad8c5f4
Change lernajs to correct URL (#3475) 2020-02-20 16:28:21 -08:00
Oguz Gelal
e2dd13c24d
Fix test folders name swap for interfaces/Editor/nodes mode-highest vs. mode-all (#3484) 2020-02-20 16:27:13 -08:00
Adam Sanderson
e9e1eb2524
Adds Transforms import to forced-layout (#3503)
The forced layout demo included Editor, but not Transforms, and would crash when it needed to enforce the layout.
2020-02-20 16:20:36 -08:00
Andreas Geffen Lundahl
eb181f3279
Allow zero as offset on <anchor> and <focus> inside <selection> (#3491)
* Allow zero as offset on <anchor> and <focus> inside <selection>

When creating a selection using the <selection> hyperscript tag, you couldn't
set zero as offset on <anchor> and <focus>, because of a faulty falsiness
check. This is fixed by checking if the offset is falsy and explicitly not zero.

* Make sure offset can't be null or undefined on <anchor> and <focus>

Throw exception when offset is strictly null or undefined, on <anchor> and
<focus> when creating a <selection>.
2020-02-20 16:00:59 -05:00
Ian Storm Taylor
30bc30df4b
Update Readme.md 2020-02-20 11:06:45 -05:00
Ian Storm Taylor
17ee9f8954
Update Readme.md 2020-02-20 11:04:39 -05:00
Xleine
217bdd611b fix some doc's bug (with v0.57.1) (#3393)
* fix: code blocks's info string
this info string. should be `jsx`

* fix: editor's exec invoke
now, editor.exec() is not available in Slate v0.57.1
so, use editor.insertText() to instead it

*  refactor: delete a nerver used value

* update add new chinese translate
      update chinese translate to `v0.57.1`

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2020-01-27 15:24:15 -05:00
Lucas Willems
8202e08102 Fix link (#3440) 2020-01-27 15:23:53 -05:00
Tyler Hallada
d341cb1592 Fix links in slate-react readme (#3428)
Fixed the "Plugins" link and changed the "Constants" link (a folder which no longer exists) to a "Hooks" link.
2020-01-27 15:23:13 -05:00
Aykut Kardaş
f813af790e An unused state was deleted. (#3413) 2020-01-27 15:22:54 -05:00
Jonathan Wieben
612dbcb3a6 Chore: Typo in docs (#3411)
* Fix: Typo in docs

It should read edit instead of editor.

* Chore: Further typo fix
2020-01-27 15:22:36 -05:00
Arnas
a69e48d3ed Fixed Getting Started url (#3407)
Getting started URL was broken
2020-01-27 15:22:19 -05:00