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

208 Commits

Author SHA1 Message Date
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
Tobias Andersen
bf24e77518 Improve documentation (#1000)
* Fix typos in docs

* Add missing Editor properties in docs
2017-08-17 10:24:31 -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
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
Zach Schneider
4bbf7487ea Replace cheerio with parse5 (#934)
* Replace cheerio with parse5

* Convert to dependency injection for HTML parser
* Add options.domParser to HTML serializer
* Fallback to native DOMParser if present and no option provided
* Error if no DOM parser is available (option or native)
* Update tests to pass parse5 as config option

* Update test so it passes.
Cheerio interprets `<p><hr /></p>` as one `p` node with a child `hr`
node, but both parse5 and native DOMParser interpret it as 3 nodes: a
blank `p` node, `hr` node, and second blank `p` node. Update test
expectation to match new API.

* Remove cheerio-esque compatibility conversion.

* Use `application/xml` in native DOMParser
Using `text/html` causes it to wrap the fragment in html, body, etc

* Change error message to single line.
Was inserting an undesired newline char

* Add documentation for new `domParser` option to html serializer
Also boyscout missing documentation for `defaultBlockType` option

* Rename `domParser` option to `parseHtml`
Rename the option to make it clearer what it does, since it accepts a
function and not a `DOMParser` analogue object.
2017-07-20 09:46:02 -07:00
Samy Pessé
74bf684ec9 Add property "isEmpty" (#863)
* Add property isEmpty to State

* Update hovering menu example

* Document isEmpty

* Improve perf of isEmpty with @Soreine 's suggestion

* Fix return of isEmpty
2017-07-11 13:34:02 -07:00
Eamon Taaffe
e66adf1295 Issue with the Overriding Defaults example. (#914)
I tried using the exact code from the example to be met by errors.

The order of arguments in the function example is wrong, it should be use the API described in the [docs](https://docs.slatejs.org/reference/plugins/plugin.html#onbeforeinput).

```
Function onBeforeInput(event: Event, data: Object, state: State, editor: Editor) => State || Void
```
2017-07-11 13:08:50 -07:00
Dylan Phelan
c7f14e1254 Updated findDOMNode function (#892)
Newer implementations of findDOMNode take the node to find as the argument, not the key of the node
2017-06-21 17:31:12 -04:00
Anuj
c26f2dc71b Documenting node's getFurther* functions (#845)
I remembered coming across these functions and then didn't find them in the docs. So, here they are now!
2017-05-30 12:07:24 -07:00
Anuj
7b358b4ced Add firstOnly prop to Placeholder (#765)
* Adding firstOnly prop to Placeholder

Partly addresses #737

* Updating placeholder logic to check for parent only if firstOnly is set to true

* removing extra newlines

* simplifying shouldComponentUpdate condition
2017-05-04 15:11:55 -07:00
Anuj
9250baafe6 Clarifying insertTextByKey description (#778)
As per #775
2017-05-04 05:58:21 -07:00
Anuj
fb6f3d5b61 Documenting node's 'getFirstText' & 'getLastText' (#779)
Noticed a couple of useful functions I found useful that weren't documented. Also, fixed a couple of broken links.
2017-05-04 05:57:52 -07:00
Max
f787b68a36 add note to document documentation (#755)
can perhaps spare some time from someone else wondering about this: https://github.com/ianstormtaylor/slate/issues/746
2017-04-25 10:52:37 -07:00