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

23 Commits

Author SHA1 Message Date
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
WangChienChieh
2d7642b9d3 Pasting external HTML does not work with Slate example. (#1129) (#1146)
* Pasting external HTML does not work with Slate example. (#1129)

*Due to the upgrade of slate, adjust the way of el.attrs.find to el.href.

* Update index.js
2017-09-21 14:45:24 -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
9fca2d3b9b start removing raw serializer (#1098)
* start removing raw serializer

* convert first tests to use jsx

* simplify jsx tests for raw serializer

* allow for options in raw serializer tests

* add more preserve option tests

* convert plain serializer tests

* convert html serialize

* start converting html deserialize

* add hyperscript util

* remove slate-sugar copy-pasted

* finish converting html deserialize

* convert plugins tests

* update rendering tests

* convert schemas tests

* convert core plugin tests

* update hyperscript utl

* refactor changes test directory structure

* fix changes before migration

* add migrated changes test files

* remove <x- prefixes from migration

* get addMark at-current-range tests passing

* get delete at-current-range tests passing

* remove old tests

* convert deleteForward and deleteBackward

* convert insertBlock, insertInline, insertFragment, insertText

* convert removeMark, setBlock, setInline, splitBlock, splitInline

* add unstaged tests

* convert toggleMark, unwrapBlock, unwrapInline, wrapBlock, wrapInline, wrapText

* convert call, setData

* convert on-selection tests

* remove old on-selection tests

* convert history tests

* convert insertFragmentByKey, insertNodeByKey, insertTextByKey, mergeNodeByKey, moveNodeByKey

* convert removeNodeByKey, removeTextByKey, setMarkByKey, setNodeByKey

* convert splitDescendantsByKey, splitNodeByKey, unwrapBlockByKey, unwrapInlineByKey, unwrapNodeByKey, wrapBlockByKey

* fix tests

* port missing at-range tests to at-current-range

* remove at-range tests

* fix raw serializer tests

* fix linter

* fix to prefer toJSON as the canonical method name

* fix todos

* remove internal references to Raw

* add deprecation helper to Text.fromJSON

* convert examples to not use Raw, and not rely on terse

* remove focus-blur example, rename large document example

* refactor Raw serialize to deprecate, not remove, terse

* deprecate defaultBlockType, toRaw, cleanup serializers
2017-09-10 14:56:03 -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
Hans-Wilhelm Warlo
469d8b394c Refactor render arrow functions (#969) 2017-08-02 09:36:33 -07:00
Zach Schneider
f8b103d75e Reckon with inconsistencies between parse5 and native DOMParser (#952) 2017-07-31 18:18:30 -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
Ian Storm Taylor
9d512580b7 add support for isShift on paste 2016-12-01 17:32:07 -08:00
Ian Storm Taylor
ccac6102a5 fixes 2016-08-14 13:21:46 -07:00
Ian Storm Taylor
d20b8511bb refactor onKeyDown to use data object 2016-07-27 16:22:11 -07:00
Ian Storm Taylor
d78ddeabad update examples for terse raw 2016-07-25 14:45:37 -07:00
Ian Storm Taylor
6993b0c666 change a few examples to omit ranges for cleanliness 2016-07-21 16:41:35 -07:00
Ian Storm Taylor
ca1dfd904d swap html serializer to take rules in options dictionary 2016-07-17 15:40:38 -07:00
Ian Storm Taylor
d8783d618a add more example readmes 2016-07-14 16:31:55 -07:00
Ian Storm Taylor
ab12518a4b clean up examples 2016-07-13 16:19:49 -07:00
Ian Storm Taylor
3d33ab3da2 add plain text serializer 2016-07-13 14:55:41 -07:00
Ian Storm Taylor
2f4c8726e0 add attributes props in examples 2016-07-11 18:39:45 -07:00
Ian Storm Taylor
db1151bd15 add linting to examples 2016-07-07 08:35:13 -07:00
Ian Storm Taylor
de4afd38b1 cleanup renderers in examples, fixes #43 2016-07-06 14:42:59 -07:00
Ian Storm Taylor
e9ed40dd7f remove default export, fixes #42 2016-07-06 14:21:11 -07:00
Ian Storm Taylor
27e71715a6 fix fragment pasting, remove <b> and <i> from paste html marks 2016-06-29 11:27:06 -07:00
Ian Storm Taylor
2f2437476e add paste html example with first stab at html serializer 2016-06-29 10:43:22 -07:00