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

431 Commits

Author SHA1 Message Date
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
560dbe5038 fix docs links, closes #1116 2017-09-12 08:55:15 -07:00
Ian Storm Taylor
0f530796f5 update docs 2017-09-11 19:36:46 -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
David Gertmenian-Wong
a75899f57a Update walkthrough docs to use change object instead of state (#1062) 2017-09-06 17:51:40 -07:00
Peter Klipfel
0ab70fd1af fixes errors for basic app with installation (#1056)
The old onChange function caused a bunch of `Uncaught TypeError: _this.state.state.change is not a function` errors. Adding the object destructure to the arguments fixes this.
2017-09-06 11:49:50 -07:00
Ian Storm Taylor
1c03d2a5af update docs 2017-09-06 09:35:08 -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
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
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
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
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
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
Ryan Yurkanin
af84cf2511 adding forced-layout-example (#954) 2017-07-31 18:19:45 -07:00
Ian Storm Taylor
6123985c4f add reboo editor to resources 2017-07-20 10:03:40 -07:00
Ian Storm Taylor
1a01c6f6d2 add showcase to resources 2017-07-20 10:01:59 -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
Michael McCombie
91619616ac Fix "Auto-Markdown" Doc Link (#906)
Fixes the auto markdown preview link in the list of examples
2017-07-11 13:01:38 -07:00
Joshua Li
17b1a455cc Update README.md (#905)
Fixed some doc links.
2017-07-11 12:49:26 -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
Leon Koole
b6541854fa Fix missing isAltKey (#855) 2017-05-30 13:15:11 -07: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
Mike Hearn
4013d0b18a Minor update to Saving to Database doc (#831) 2017-05-23 18:36:13 -07:00
Asaf Katz
06c54bd991 Docs improvements suggestions (#801)
* Fix typo

* Make it clearer that addMark has changed too
2017-05-21 10:36:23 -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
a338b36c76 Address doc suggestion in #644 (#760)
* Address doc suggestion in #644

* Move doc update to FAQ instead
2017-05-04 09:58:46 -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
Brian Kabiro
cb98408115 Update defining-custom-block-nodes.md (#776) 2017-05-03 16:51:13 -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
Rocky Meza
3ca977e26a Fix typo in plugin.md (#753) 2017-04-24 18:23:53 -07:00
Ian Storm Taylor
1471e0846f cleanup readme, move comparisons to external doc, closes #727 2017-04-24 13:17:18 -07:00
jatins
310b281469 fix example links in Readme (#745) 2017-04-23 12:02:57 -07:00
Anuj
51f1a2f9d9 Clarify instructions for plugin preventing default behavior (#740) 2017-04-21 21:17:04 -07:00
eden lane
eb03bd8ec4 Changed hotkey for code block in the walkthrough due to lack of support hotkey ⌘-C in Chrome on Mac (#741) 2017-04-21 21:14:04 -07:00