1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-15 12:44:38 +01:00

1858 Commits

Author SHA1 Message Date
Ian Storm Taylor
7470a6dd53 Expose transforms (#836)
* refactor to extract applyOperation util

* change handlers to receive transform instead of state

* change onChange to receive a transform, update rich-text example

* fix stack iterationg, convert check-list example

* convert code-highlighting, embeds, emojis examples

* change operations to use full paths, not indexes

* switch split and join to be recursive

* fix linter

* fix onChange calls

* make all operations invertable, add src/operations/* logic

* rename "join" to "merge"

* remove .length property of nodes

* fix node.getFragmentAtRange logic

* convert remaining examples, fix existing changes

* fix .apply() calls and tests

* change setSave and setIsNative transforms

* fix insert_text operations to include marks always

* cleanup and fixes

* fix node inheritance

* fix core onCut handler

* skip constructor in node inheritance

* cleanup

* change updateDescendant to updateNode

* add and update docs

* eliminate need for .apply(), change history to mutable

* add missing file

* add deprecation support to Transform objects

* rename "transform" to "change"

* update benchmark

* add deprecation util to logger

* update transform isNative attr

* fix remaining warn use

* simplify history checkpointing logic

* fix tests

* revert history to being immutable

* fix history

* fix normalize

* fix syntax error from merge
2017-09-05 18:03:41 -07:00
Dan Burzo
786050f732 Introduces state.activeMarks and has add/remove/toggleMark use it instead of state.marks (#990)
* WIP getting raw marks arrays from the current range

* Always handle marksRaw as Array, fixes tests/lint

* Clean up

* Fixes collapsed selection raw marks, simpler _every_ condition, harmonize toolbar buttons in rich-text example

* raw -> perCharacter

* Add tests for toggleMark collapsed selection

* Add .DS_Store to .gitignore

* Added test for toggleMark add in partially marked selection, with and without other marks

* Added docs for state.marksPerCharacter

* replace marksPerCharacter with activeMarks

* Update the other examples

* Clarify getActiveMarksAtRange

* AddMark/RemoveMark to use getActiveMarksByRange

* User activeMarks for toggle§MarkAtRange transform
2017-09-05 17:48:19 -07:00
Anuj
d21728ed86 Fix how plain text serializer serializes nested block (#1028)
* Fix how plain text serializer serializes nested blocks

* Updated test to check for more nested blocks

* Renamed getSerializedTextForNode to serializeNode, and added comment block

* Added a test for plain serializer: nested blocks with nested inlines

* Added additional test for simple inlines within block

* fixed expected test output

* fixed case where block has inlines but not other nested blocks
2017-09-05 17:48:06 -07:00
Ian Storm Taylor
9b5e7ba306 0.21.6 v0.21.6 2017-09-05 17:07:25 -07:00
Travis Person
84563aef43 Update schema model documentation (#1048)
When talking about `rules` and old interface was being used.
2017-09-05 16:44:20 -07:00
Ryan Yurkanin
05ab702e40 fixing a breaking change in node/mark properties (#1049) 2017-09-05 16:43:24 -07:00
Ian Storm Taylor
e72266802d 0.21.5 v0.21.5 2017-09-05 11:26:00 -07:00
Ryan Yurkanin
aec3b702c4 Fixing onDrop for Inline Nodes, Harder type checking in normalize fun… (#1033)
* Fixing onDrop for Inline Nodes, Harder type checking in normalize functions, Omitting Pseudo-symboles from nodeProperties/markProperties

* Refactoring code

* Making normalize blacklist clearer

* Update normalize.js

* Update core.js

* Linting fixes, no trailing spaces
2017-09-05 09:59:35 -07:00
mjadobson
43dbfbcb58 Fix drop contents insertion (#929)
Now drop fragments insert at correct location
2017-09-05 09:51:44 -07:00
AlbertHilb
8a6024fe85 Always call preventDefault() on onDrop events. (#1043) 2017-09-05 09:26:20 -07:00
Per-Kristian Nordnes
f6ca563c4d Remove event.preventDefault which causes cursor not to be shown when dragging (#1040) 2017-09-05 09:23:48 -07:00
Per-Kristian Nordnes
a0c4073f22 Fix bug where insertBlock and insertBlockAtRange always inserted the block below the target, even though focus was collapsed to start (#1037) 2017-09-05 09:22:58 -07:00
Per-Kristian Nordnes
e79ec24f39 Add tests for collapseToStart/End when selected node is void (#1038) 2017-09-05 09:21:26 -07:00
Per-Kristian Nordnes
044ffbf62c Fix bug where void nodes would not deleted, even though they were selected (#1041) 2017-09-05 09:20:39 -07:00
Per-Kristian Nordnes
10ff951661 Fix bug where up and down arrow keys would incorrectry select neighbouring void blocks (#1042) 2017-09-05 09:17:58 -07:00
Tobias Andersen
d85fcda0c0 fix: reset drag counter properly in void nodes (#1035) 2017-09-05 09:14:29 -07:00
Ryan Yurkanin
9faaccd8ed Adding , adding documentation, adding some basic tests (#1045) 2017-09-05 09:13:40 -07:00
Ian Storm Taylor
7cfbbfc5e4 0.21.4 v0.21.4 2017-08-25 12:13:18 -07:00
Irwan Fario Subastian
2076cdbc99 expose onKeyUp (#1026)
* expose onKeyUp to be used by plugin

* Update plugin.md
2017-08-24 22:24:15 -07:00
Ian Storm Taylor
b0d481978b 0.21.3 v0.21.3 2017-08-22 17:06:34 -07:00
Yifeng Wang
e5c42c416d Add .babelrc into .npmignore (#1020) 2017-08-22 16:57:47 -07:00
Lauren
d58f37b1c2 Add a missing dependency which was causing errors (#1017)
Because `src/serializers/html.js` depends on `ReactDOMServer.renderToStaticMarkup`, which is no longer bundled with ReactDOM, ReactDOMServer is needed to avoid errors when the HTML serializer is used.
2017-08-22 16:56:55 -07:00
Dan Burzo
5712bcb2af Fixes #1010 — adds debuginfo to Contributing.md (#1011) 2017-08-22 16:48:26 -07:00
Dan Burzo
239d97fcad Add State.characters to docs (#1006) 2017-08-18 08:51:13 -07:00
David Gertmenian-Wong
74d697b4b8 Use parent node to find text node parent (#1004) 2017-08-17 14:51:13 -07:00
Kirill Volkovich
577b5c7570 IE11 compat (#996)
* Convert "for ... of" loops to simple "for(;;)"

* Add .editorconfig

* Convert "for ... of" loops to simple "for(;;)"; Array.find => filter

* Replace Array.prototype.find via local "find" method implementation

* Replase utils/find by lodash/find

* Remove .editorconfig

* Fix lint errors
2017-08-17 11:49:44 -07:00
Kirill Volkovich
31601d9a26 Add .editorconfig and .gitattributes (#997)
* Add .editorconfig and .gitattributes

* Remove .gitattributes

* Update .editorconfig

* Update .editorconfig
2017-08-17 10:37:38 -07:00
Tobias Andersen
bf24e77518 Improve documentation (#1000)
* Fix typos in docs

* Add missing Editor properties in docs
2017-08-17 10:24:31 -07:00
Zach Schneider
e6a4009d75 Consistently use toLowerCase in tag name comparisons. (#1001)
* Consistently use toLowerCase in tag name comparisons.

* Add quick note about tagName casing.
2017-08-17 10:23:38 -07:00
Craig
8469c64d9e Custom wrapper component (#978)
* Provide prop to pass in custom wrapper component

* Fix linting

* Fix lint

* PR Feedback - change propName container -> tagName; remove custom-wrapper example

* Reset examples/index.js
2017-08-16 09:53:28 -07:00
Dan Burzo
31aa33b4d3 Add link to IME reference page in Contributing.md (#995) 2017-08-16 09:39:34 -07:00
Dan Burzo
b7db3feb36 Don't break macOS emoji insert nor composition when fixing #938 (#994)
* Don't break macOS emoji insert nor composition when fixing #938

* Simpler solution for this

* Remove data.isComposing
2017-08-16 09:39:10 -07:00
David Gertmenian-Wong
458c022013 When the isInEditor parameter is a text node use its parent only if the parent exists (#974)
* When the parameter passed to `isInEditor` is a text node use its parent if the parent exists

* Add comment on `parentElement` text node browser compatibility
2017-08-15 12:23:01 -07:00
Dan Burzo
169a59a596 Document Raw serializer options (#993)
* Document Raw serializer options

* Update raw.md
2017-08-15 11:16:10 -07:00
Ryan Yurkanin
17cd478fad tagName returns capitalized name now (#985) 2017-08-15 10:57:18 -07:00
Dan Burzo
979dadf2d6 Fixes #938 chrome eating first line of text on space at beginning of line (#991) 2017-08-15 10:42:33 -07:00
Dan Burzo
aafdc4a224 Fixes #817; fragment matcher regex (#992) 2017-08-15 10:39:46 -07:00
Ian Storm Taylor
ace2144e75 Update ISSUE_TEMPLATE.md 2017-08-15 10:38:44 -07:00
Ian Storm Taylor
f0e1965e4c Update Contributing.md 2017-08-15 10:36:10 -07:00
Ryan Yurkanin
ff57cd697f Allow Data to be passed to Marks when using HTML Deserializer (#986)
* making it possible to pass in data to marks on deserialize

* adding a test to make sure this doesn't happen again
2017-08-15 10:26:49 -07:00
Ian Storm Taylor
18f41e72ce 0.21.2 v0.21.2 2017-08-09 12:16:12 -07:00
Ian Storm Taylor
d7a82e81fa Merge branch 'cdd-master' 2017-08-09 12:11:50 -07:00
Ian Storm Taylor
207f459625 alphabetize package.json scripts 2017-08-09 12:08:35 -07:00
jacobbloomCDD
e0d993617d Speed up getting blocks at a range
Old implementation was far too slow if a selection included many nodes.
The performance hit occurred when converting each and every text node
into a block.  This is now avoided by using the same logic as
getTextsAtRangeAsArray for getBlocksAtRangeAsArray, but using blocks
directly.
2017-08-08 11:37:45 -07:00
Ryan Yurkanin
3eb72a8642 Remove instanceOf checks to allow Slate objects to be identifiable across module instances (#930)
* putting in the correct type pseudo-symbols

* getting the pseudo symbols everywhere that the instance of's are

* Making Ian's suggestions on checking types with static methods

* cleaning up leftover hard checks

* adding in slate proptypes, cleaning up unneeded whitespace

* updating documentation, moving keys to prototypes finally, al tests passing

* organizing types, prop-types, more succint type names

* eslint fix

* fixing model-types bug, changing proptype names
2017-08-02 10:49:09 -07:00
Hans-Wilhelm Warlo
469d8b394c Refactor render arrow functions (#969) 2017-08-02 09:36:33 -07:00
Ian Storm Taylor
f89f0f875c update prosemirror description in readme 2017-08-02 09:27:22 -07:00
Ian Storm Taylor
5d25699e5a update prosemirror description in docs 2017-08-02 09:25:32 -07:00
Ian Storm Taylor
c59ca5628e update prosemirror comparison in readme 2017-08-02 09:24:39 -07:00
Ian Storm Taylor
85fce2dd46 0.21.1 v0.21.1 2017-08-01 09:47:28 -07:00