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

220 Commits

Author SHA1 Message Date
DamareYoh
eda5c02e79 Bugfix/undo merge node (#1594)
* fixed build for windows

* fixed issue where undo of merge node does not restore the node back to its original properties

* fixed lint issue

* updated operation docs for additional property on split_node and merge_node

* finished incomplete sentence in the docs.

* updated test to also verify data is restored

* renamed the 'original' property to 'properties' to be more consistent with similar operation interfaces, updated docs

* got rid of extra operations property.

* deserializing properties in merge_node and split_node, passing properties object in splitNodeByKey

* missed committing operations modles.

* updated operations.toJSON for new properties on merge_node and split_node

* fix linting error

* remove outdated comment.

* expanded check for split node inverse to include inline nodes

* partially revert update to test with deletion across inlines
2018-02-05 10:16:55 -08:00
Andreas Mischke
0ef7b116f1 Fix broken "Characters" link (#1586)
Link was pointing to `./mark.md`, now points to `./character.md`
2018-02-01 09:33:49 -05:00
Ian Storm Taylor
10eea06a8a refactor schema violations to be a separate package 2018-01-26 12:28:40 -08:00
CameronAckermanSEL
ef5106e30f Improve normalize suppression to make less verbose and safer (#1549)
* change normalization can be set with setOperationFlag, and changes can be executed in sequence with automatic suppression with guaranteed document normalization at the end.

* responded to developer feedback by renaming execute to withMutations (to mirror immutable JS), implemented tests, updated documentation

* fixed typos discovered in review.

* fixed missing normalize flag usages and added withMutations to the schemas guide

* responded to developer feedback

* fixed lint errors and cleaned up code

* readd missing tests

* getFlag now allows options to override the change flags

* removed normalize restoration asserts from unit tests

* unit test cleanup
2018-01-26 11:32:37 -08:00
DamareYoh
7d5a33025b added export constant enum for schema violations (#1532)
* added export constant enum for schema violations

* updated examples to use the schema violations enum

* use SchemaViolations enum in tests and docs

* fixed path for schema violations import
2018-01-17 10:24:28 -05:00
Jinxuan Zhu
e6c7934cb9 Document: add change.snapshotSelection in the change.md (#1534)
* docs: add chang.snapshotSelection

* Minor style tweaks
2018-01-17 00:05:29 -05:00
Conor Cussell
62ffb4681b Remove parse5 (#1531)
Fix stripUnwantedAttrs

Remove .only

Remove parse5 from deps

Better imports

Cleanup

More succint removal of attributes
2018-01-13 15:41:48 -08:00
David Hrdlicka
6f1fd08fcd Expose core plugins (#1524) 2018-01-11 12:01:03 -08:00
Ian Storm Taylor
5444a300b8
rename kind to object for clarity (#1501)
* rename `kind` to `object` for clarity

* add deprecation warning for direct access

* add deprecation warning for node creation
2018-01-04 15:26:53 -08:00
Ryan
7dc93dced9 Docs: Fix method capitalization on resetKeyGenerator (#1474) 2017-12-29 10:43:02 -08:00
Justin Weiss
082fb53633 Add a copyFragment helper for plugin onCut/onCopy functions (#1429)
* Add a `copyFragment` helper for plugin onCut/onCopy functions

* Rename `copyFragment` to `cloneFragment`

* Fix a missing clone-fragment reference
2017-12-11 06:56:38 -08:00
Justin Weiss
1ae4471692 Document the position field of merge_node (#1440)
`merge_node` has a `position` field, which is exactly what I needed in order to transform some operations. It should be documented.
2017-12-02 12:30:05 -08:00
Ian Storm Taylor
98ed83c23b
Add schema first/last definitions (#1360)
* add `first` and `last` validations to schema

* update docs

* update schema usage in images example

* fix forced-layout example
2017-10-31 21:11:05 -07:00
Ryan
49ebbf9595 update doc's text node key ranges -> leaves (#1343) 2017-10-30 09:06:50 -07:00
Ian Storm Taylor
e991d5d480 update kind property in docs 2017-10-28 16:27:13 -07:00
Ian Storm Taylor
56a1f69a2f update docs 2017-10-27 14:50:27 -07:00
Ian Storm Taylor
adb2678732
Rename "state" to "value" everywhere (#1313)
* rename state to value in slate core, as deprecation

* rename all references to state to value in slate core

* migrate slate-base64-serializer

* migrate slate-html-serializer

* migrate slate-hyperscript

* migrate slate-plain-serializer

* migrate slate-prop-types

* migrate slate-simulator

* fix change.setState compat

* deprecate references to state in slate-react

* remove all references to state in slate-react

* remove `value` and `schema` from props to all components

* fix default renderPlaceholder

* fix tests

* update examples

* update walkthroughs

* update guides

* update reference
2017-10-27 13:39:06 -07:00
Ivan Starkov
39338d5c58 Fix wrap-unwrap Block-Inline docs (#1296) 2017-10-26 09:31:00 -07:00
Ian Storm Taylor
c22839c6eb add data model guide, update docs 2017-10-25 20:13:52 -07:00
Ian Storm Taylor
509d3d50fc remove rendering from schema & make it expressive (#1262)
* split rendering out of schema

* remove default components

* first stab at new schema

* make default normalizations smarter

* revert to forcing defaults to be verbose?

* refactor reason constants

* split nodes into blocks/inlines

* get tests passing

* restructure schema tests

* add parent test

* cleanup

* remove defaults from schema

* refactor schema rule.nodes validation, update example

* embed schema in state objects

* fixes

* update examples, and fixes

* update walkthroughs

* update docs

* remove old schemas doc page

* add more tests

* update benchmarks
2017-10-25 17:32:29 -07:00
Ian Storm Taylor
f42a64ac8f refactor placeholder to use schema (#1253)
* refactor placeholder to use schema

* update placeholder, remove old export

* add maxWidth to prevent overflow

* update docs
2017-10-18 00:23:39 -07:00
Ian Storm Taylor
117d8c55cc update docs 2017-10-17 20:53:38 -07:00
Ian Storm Taylor
204f491b6b update docs 2017-10-17 20:07:14 -07:00
Ian Storm Taylor
a28bd4100b update docs 2017-10-17 18:49:02 -07:00
Ian Storm Taylor
a341f4d4eb fix docs pages and plugins example 2017-10-17 09:22:08 -07:00
Ian Storm Taylor
54ec11e199 update walkthroughs, docs and changelog 2017-10-16 21:13:07 -07:00
Ian Storm Taylor
11b2003f53 Remove data (#1244)
* remove data from event handler signatures

* standardize known transfer types

* add setEventTransfer to docs

* update examples, fix drag/drop

* fix tests and draggable attribute setting
2017-10-16 21:04:16 -07:00
Ian Storm Taylor
045c1879f4 update changelog and docs 2017-10-16 18:58:31 -07:00
Ian Storm Taylor
f69d2c4a12 remove keyboard data.* properties (#1235)
* update examples and walkthroughs

* deprecate data keyboard properties

* update examples

* add is-hotkey to resources doc

* udpate docs

* update docs

* fix split-block test
2017-10-15 19:23:07 -07:00
Yifeng Wang
58648bc23f fix minor doc typos (#1233) 2017-10-15 14:22:00 -07:00
Ian Storm Taylor
6c42f6c9c3 Rename Range to Leaf, and Selection to Range (#1231)
* rename Range to Leaf

* rename Selection to Range

* add findDOMRange, findNode, findRange helpers

* refactor to remove findDropPoint util

* revert findDOMNode to throwing errors

* export new helpers, fix linter

* update docs

* update examples
2017-10-14 15:36:27 -07:00
Ian Storm Taylor
e53cee3942 refactor decorations to use selections (#1221)
* refactor decorations to use selections

* update docs

* cleanup

* add Selection.createList

* fix tests

* fix for nested blocks

* fix lint

* actually merge

* revert small change

* add state.decorations, with search example
2017-10-13 12:04:22 -07:00
Gabin Aureche
678589a809 Fix broken link to setKeyGenerator (#1214) 2017-10-11 00:42:59 -07:00
Conor Cussell
e0d7122881 Document replaceNodeByKey (#1200)
* Document `replaceNodeByKey`

* Update change.md
2017-10-02 11:29:16 -07:00
Ian Storm Taylor
c98ad903c8 Upgrade docs (#1182)
* remove table of contents

* remove more hard-coded table of contents

* remove comparisons, rewrite "why" section to be more general

* update intro
2017-09-25 11:50:23 -07:00
David O'Trakoun
e2d7a3acad typo (#1145) 2017-09-19 22:01:23 -07:00
Gabin Aureche
33a36679d9 Add a way to customize shouldComponentUpdate logic (#1140)
* Add a way to customize shouldComponentUpdate logic

* Clean

* Warn when returning false in shouldNodeComponentUpdate

* Clean
2017-09-19 08:52:38 -07:00
Brian Bucknam
692f7b474f Add more details about slate-html-serializer (#1139)
* Add more details about slate-html-serializer

* Update index.md
2017-09-19 08:13:36 -07:00
Ian Storm Taylor
ace9f47930 change slate to be a monorepo using lerna (#1106)
* init lerna, move files into ./packages

* move test files into ./packages

* more moving around

* fill out package.json files

* fixing imports

* more fixing of imports, and horribleness

* convert examples, fix linting errors

* add documentation

* update docs

* get tests passing

* update travis.yml

* update travis.yml

* update travis.yml

* update test script

* update travis.yml

* update scripts

* try simplifying travis.yml

* ocd stuff

* remove slate-core-test-helpers package

* add package readmes

* update reference docs structure

* refactor slate-simulator into its own package

* add docs for new packages

* update docs

* separate benchmarks into packages, and refactor them
2017-09-11 18:11:45 -07:00
Ian Storm Taylor
133831ee4e update docs 2017-09-10 15:29:42 -07:00
Tobias Andersen
5135f98845 Update plugin reference to use Change instead of State (#1093)
* update plugin reference to use Change instead of State

* fix description of onCopy event handler
2017-09-08 07:52:39 -07:00
Ian Storm Taylor
16d29db8cb add isSelected prop, cleanup sCU, add custom component reference (#1084)
* add isSelected prop, cleanup sCU, add custom component reference, fixes #1080

* fix custom node reference

* update custom node reference

* remove sCU check for text-only children
2017-09-07 14:33:34 -07:00
Ian Storm Taylor
976af2cda1 deprecate onDocumentChange and onSelectionChange, fixes #614 (#1081) 2017-09-07 11:51:45 -07:00
Ryan Yurkanin
609ab2e198 Add Linking to Change in docs (#1052)
* fixing a breaking change in node/mark properties

* Fixing gitbook linking to change.md
2017-09-06 08:58:26 -07:00
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
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
9faaccd8ed Adding , adding documentation, adding some basic tests (#1045) 2017-09-05 09:13:40 -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
Dan Burzo
239d97fcad Add State.characters to docs (#1006) 2017-08-18 08:51:13 -07:00