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

60 Commits

Author SHA1 Message Date
Maulik
ebc72bf38f Updating function in readme.md (#2185)
Typo in function definition
2018-09-19 11:38:27 -07:00
Martti Laine
1ff1dfa4b8 Add slate-react to the bundled source guide (#2010) 2018-07-31 16:46:30 -07:00
David Chang
bcf41a96b4 Update docs (#1893) 2018-06-12 10:42:09 -07:00
Dominic Eden
fbd76895b5 [fix/html-serializer-docs-add-class-name-example] add example to the … (#1863)
* [fix/html-serializer-docs-add-class-name-example] add example to the HTML serializer docs on how to use element attributes when serializing and deserializing. I spent a lot of time figuring this out myself so hopefully will save others from having to go through the same process!

* [fix/html-serializer-docs-add-class-name-example] Fix linting errors with Prettier
2018-06-10 16:41:03 -07:00
Jinxuan Zhu
6e6e9cf710 Fix spell check bug (#1753)
* Fix spell check bug by add data-text:true

* Fix spell check bug by spell check add length to a leaf

* Fix tests to use data-text:true for marks

* Rename data-text to data-slate-leaf; Remove setRef; unlift attributes in leaf

* Update examples with data-*

* Add attributes to document

* Fix renderMark in all documents

* Prettier markdown
2018-04-27 14:06:24 -07:00
Nima Mehanian
2dd77c00f1 Update adding-event-handlers.md (#1751)
* Update adding-event-handlers.md

Make clarifying changes to sentence structure and code sample syntax

* Revert to React.Component declaration

* Update adding-event-handlers.md
2018-04-27 14:01:17 -07:00
Mitchel Humpherys
30143adf60 docs: walkthroughs: saving: Fix grammar (#1766)
Should be possessive (you're => your)
2018-04-10 14:59:21 +01:00
Francesco Agnoletto
6ad3aada5b Make serialize/deserialize friendlier (#1705) 2018-03-21 15:34:20 -07:00
徐凯
09b15adb96 fix applying-custom-formatting.md demo (#1715) 2018-03-21 14:09:51 -07:00
Zach Schneider
c5f0626a05 Convert setBlock and setInline to plurals for more intuitive naming. (#1558) 2018-02-21 18:03:30 -08:00
Renaud Chaput
de4c9e478a Lint JSON, CSS and Markdown files with Prettier (#1612)
* Process and Lint CSS, Markdown and JSON files with Prettier

* Run `yarn prettier` to re-format Markdown, CSS and JSON files
2018-02-07 07:58:41 -08:00
Nicholas
3fa2fde253 Examples: Use ctrlKey instead of metaKey (for Windows compatibility) (#1601)
* Change example to ctrlKey for Windows

metaKey + B is already mapped to a shortcut on Windows, so this example fails (tested on Chrome, Edge)

* Docs: use ctrlKey to allow custom formatting example to work on Windows

* Docs: change metaKey examples from other walkthroughs for consistency

* Docs: change a missed metaKey
2018-02-06 14:09:49 -08:00
Stéphane Klein
b98e675bfb [Doc] Adding an unknown mark doesn't produce an error (#1597)
The *Applying custom formatting* guide states that Slate outputs an error in the console when a mark is applied without a corresponding renderer but AFAIK, that's not the case in the current version. I'm guessing this is an old behaviour (I'm completely new to this library), hence the doc update.
2018-02-03 18:08:17 -05:00
Zach Schneider
228b97ff29 Switch to using Rollup for bundling (#1568)
* Implement first working rollup config for main slate pkg

* Convert slate-base64-serializer to rollup

* Convert slate-dev-logger to rollup

* Convert slate-html-serializer to rollup

* Convert slate-hyperscript to rollup

* Convert slate-plain-serializer to rollup

* Convert slate-prop-types to rollup

* Convert (mostly) slate-react to rollup

* Convert slate-simulator to rollup

* Misc cleanup and configuration tweaks/fixes

* Convert slate-schema-violations to rollup

* Successful rollup build for top-level examples

* Add plugin to replace process.env.NODE_ENV

* Only rebuild modules and dev examples in watch mode

* Enable sourcemaps for development builds

* Force debug to use browser version, remove builtins plugin

* Remove is-image from example
It relies on node `path` and wouldn't work well in-browser anyway

* Use browser version of react-dom/server

* Move stray require to import

* Configure examples to watch child package output

* Fix tests

* Remove unneeded preferBuiltins from resolve config

* Use more precise files array to ensure sourcemaps aren't included

* Use lodash instead of lodash.throttle
It's pulled in anyway since slate-react needs slate, so using the
minipackage actually causes code duplication

* Improve naming/fix UMD builds, update UMD doc

* Add rollup configs to linting, add a missing dep to package.json

* Use longform rollup CLI flags

* Add rollup-plugin-auto-external to reduce external module configuration

* Combine rollup config into a unioned helper

* Centralize to a single rollup configuration

* Update dist structure and package field naming for PR feedback

* Add comments and address PR feedback on rollup config

* i.e. -> e.g.

* Add some spacing to the configuration to improve readability

* Add a bit more spacing

* Remove umd from example Slate unpkg link
2018-02-02 15:46:36 -08:00
Nicholas
85b4f2f495 Docs: Add that Edge does not support CTRL+... (#1585)
The CTRL-` example fails in Edge due to lack of support for CTRL+... events. Reference: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/742263/.

Added a note so other Edge users won't be tripped up by the walkthrough.
2018-02-01 19:22:08 -08: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
Spencer Baynton
2d7c470c94 Changed metaKey to crtlKey (#1508)
Fixes documentation suggested in issue #690.
2018-01-08 13:38:46 -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
Joel Gustafson
dd87e3b26d Update saving-and-loading-html-content.md (#1362)
Fixed a typo: should be `paragraph`, not `code`.
2017-10-31 22:24:32 -07:00
Ryan
49ebbf9595 update doc's text node key ranges -> leaves (#1343) 2017-10-30 09:06:50 -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
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
54ec11e199 update walkthroughs, docs and changelog 2017-10-16 21:13:07 -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
Renaud Chaput
a68a6466f9 [Doc] Remove unused code in Plugins Walkthroughs (#1172)
The `BoldMark` function has been inlined below, it is no longer used here
2017-10-12 19:59:56 -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
Yifeng Wang
f34a716ee7 update import declaration in walkthrough (#1174) 2017-09-25 08:43:18 -07:00
Ian Storm Taylor
560dbe5038 fix docs links, closes #1116 2017-09-12 08:55:15 -07:00
Ian Storm Taylor
133831ee4e update docs 2017-09-10 15:29:42 -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
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
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
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
Ryan Yurkanin
17cd478fad tagName returns capitalized name now (#985) 2017-08-15 10:57:18 -07:00
Hans-Wilhelm Warlo
469d8b394c Refactor render arrow functions (#969) 2017-08-02 09:36:33 -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
Leon Koole
b6541854fa Fix missing isAltKey (#855) 2017-05-30 13:15:11 -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
Brian Kabiro
cb98408115 Update defining-custom-block-nodes.md (#776) 2017-05-03 16:51:13 -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
Conor Cussell
6333275aa0 use correct localStorage method for setting content (#684) 2017-03-24 16:19:23 -07:00
Prayag Verma
3d96d2a309 Fix a typo in walkthroughs/saving-to-a-database (#681)
intial → initial
2017-03-23 10:43:34 -07:00
Kyle Kelley
fa4f9dff6c docs: Delete dangling } (#642) 2017-03-02 17:18:16 -08:00
Victor Pontis
16d8496760 Fix typo on installing Slate documentation (#638) 2017-03-01 11:40:17 -08:00
Ian Storm Taylor
77ffcaae66 add preventDefault to all examples 2017-02-16 10:16:19 -08:00
Michael Plotke
da10eaeca9 Prevent an unexpected ampersand (#604) 2017-02-16 10:12:38 -08:00