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

2219 Commits

Author SHA1 Message Date
Andrew Fleming
91101465fa Update data-model.md (#1682)
Typo corrected
2018-03-03 18:58:30 -05:00
Jinxuan Zhu
0688a193a2 Add quotes to fix typo (#1683) 2018-03-03 18:57:23 -05:00
Zach Schneider
2bf04b4a8c Use source-map-loader for more fine-grained sourcemaps. (#1666) 2018-02-21 19:35:27 -08:00
Ian Storm Taylor
0935f20c11 update webpack config 2018-02-21 18:35:27 -08:00
Ian Storm Taylor
257580052d Publish
- slate-base64-serializer@0.2.25
 - slate-html-serializer@0.5.6
 - slate-hyperscript@0.5.6
 - slate-plain-serializer@0.5.6
 - slate-prop-types@0.4.23
 - slate-react@0.12.0
 - slate-schema-violations@0.1.4
 - slate-simulator@0.4.23
 - slate@0.33.0
slate@0.33.0 slate-simulator@0.4.23 slate-schema-violations@0.1.4 slate-react@0.12.0 slate-prop-types@0.4.23 slate-plain-serializer@0.5.6 slate-hyperscript@0.5.6 slate-html-serializer@0.5.6 slate-base64-serializer@0.2.25
2018-02-21 18:12:43 -08:00
Ian Storm Taylor
2e2ab66b60 update changelogs 2018-02-21 18:11:54 -08:00
Ian Storm Taylor
38020c73a6 fix deprecated kind usage in leaf components 2018-02-21 18:05:54 -08:00
Ian Storm Taylor
514f3de1be
remove the void text content restriction, closes #1504 (#1663) 2018-02-21 18:03:41 -08:00
Zach Schneider
c5f0626a05 Convert setBlock and setInline to plurals for more intuitive naming. (#1558) 2018-02-21 18:03:30 -08:00
Ian Storm Taylor
e6638f7822 update webpack building 2018-02-21 18:03:17 -08:00
Ian Storm Taylor
35f96c27d4 Publish
- slate-react@0.11.6
slate-react@0.11.6
2018-02-21 17:54:46 -08:00
Ian Storm Taylor
c6f5aa2487 update prettierignore 2018-02-21 17:50:52 -08:00
Ian Storm Taylor
bc524bd43a update webpack and rollup configs 2018-02-21 17:48:08 -08:00
Zach Schneider
1fbf999c41 Add back babel-cli as a development dependency. (#1665) 2018-02-21 17:44:13 -08:00
Zach Schneider
2ebf3b462b Set up webpack configuration for building examples (#1642)
* Set up webpack configuration for building examples

* Configure react-hot-loader in development

* Improve config, set gh-pages to use examples/dist directory

* PR feedback

* Rename App.js in git
2018-02-21 17:19:56 -08:00
Tom Moor
670ef391a8 Account for text being null in an onDrop event (#1647) 2018-02-21 16:54:28 -08:00
Ian Storm Taylor
fba5bc73e4 Publish
- slate-base64-serializer@0.2.24
 - slate-html-serializer@0.5.5
 - slate-hyperscript@0.5.5
 - slate-plain-serializer@0.5.5
 - slate-prop-types@0.4.22
 - slate-react@0.11.5
 - slate-schema-violations@0.1.3
 - slate-simulator@0.4.22
 - slate@0.32.5
slate@0.32.5 slate-simulator@0.4.22 slate-schema-violations@0.1.3 slate-react@0.11.5 slate-prop-types@0.4.22 slate-plain-serializer@0.5.5 slate-hyperscript@0.5.5 slate-html-serializer@0.5.5 slate-base64-serializer@0.2.24
2018-02-21 15:07:33 -08:00
Tomasz Sodzawiczny
8ab88871bc Use pageXOffset instead of scrollX (#1631)
`scrollX`/`scrollY` do not work on some browsers, using `pageXOffset`/`pageYOffset` instead: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#Notes
2018-02-21 12:47:40 -08:00
Conor Cussell
a43c3fbb61 Update plugins used in plugins example (#1637) 2018-02-21 12:40:55 -08:00
Irwan Fario Subastian
1269be7ba8 Fix marks of undefined on char.marks (#1643)
* fix typo on getMarksAtCollapsedRangeAsArray

* making sure that char is defined on char.marks
2018-02-21 12:40:02 -08:00
Blake Embrey
07788eb2d9 Replace zero width blocks with newline before copy (#1644)
* Replace zero width blocks with newline before copy

* Fix linting issue

* Fixing linting again, sorry Github
2018-02-21 12:38:56 -08:00
Jinxuan Zhu
1776d8e64c Fixing the bug that getMarks steals mark from the previous block (#1645) 2018-02-21 12:36:34 -08:00
Julien Poissonnier
324a025ee9 Remove redundant memoization (#1630)
* Remove memoization from node.getKeys

* Remove memoization from methods that are directly backed by AsArray variants

* Remove memoization from hasChild/Descendant/Node

These are thin wrappers on top of functions that are themselves
memoized.
2018-02-21 12:32:29 -08:00
Julien Poissonnier
e3abba0a29 Fix drag and dropping a node "forward" in the document (#1621)
When drag and dropping a node to a position earlier in the document,
the node is inserted and then removed right after.
Regenerate the key to make sure the old node is removed instead of the
new one.
2018-02-12 14:36:51 -08:00
Andrei Railean
a17ea2cc21 update example readme with dev server info (#1620)
* update example readme with dev server info

* Update Readme.md
2018-02-08 17:17:25 -08:00
Jinxuan Zhu
f7546d3c7c Fix getInsertMarksAtRangeAsArray for empty Text Node (#1614) 2018-02-08 17:13:05 -08:00
Francesco Agnoletto
5cec47541d Fix triple selection extending to next block (#1605)
* Fix triple selection extending to next block

* Remove unused startOffset

* Add Iscollapsed check to prevent failing setBlock on initial block position

* Fix across-blocks.js test

* Test new hanging selection behaviour

* Lint

* Revert e902fa1acbbcec94a82474b5fea86923c8f2c5ad

* Lint

* Use ternary operator instead of if/else
2018-02-08 17:10:46 -08:00
Andrei Railean
0c7703e206 add ability to click multiple emojis in example (#1619)
* add ability to click multiple emojis

currently, after clicking one emoji, user needs to click in the editor before being able to add another emoji
this fixes that by jumping to next text block and focusing selection to make it obvious where next insertion will take place.

* lint code
2018-02-08 17:09:06 -08:00
Ian Storm Taylor
0df151ee52 Publish
- slate-base64-serializer@0.2.23
 - slate-dev-logger@0.1.39
 - slate-html-serializer@0.5.4
 - slate-hyperscript@0.5.4
 - slate-plain-serializer@0.5.4
 - slate-prop-types@0.4.21
 - slate-react@0.11.4
 - slate-schema-violations@0.1.2
 - slate-simulator@0.4.21
 - slate@0.32.4
slate@0.32.4 slate-simulator@0.4.21 slate-schema-violations@0.1.2 slate-react@0.11.4 slate-prop-types@0.4.21 slate-plain-serializer@0.5.4 slate-hyperscript@0.5.4 slate-html-serializer@0.5.4 slate-dev-logger@0.1.39 slate-base64-serializer@0.2.23
2018-02-07 10:54:52 -08:00
Ian Storm Taylor
043e1a5fb5 fix require issue in bundle, add sourcemaps 2018-02-07 10:53:44 -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
Ian Storm Taylor
fc264841b6 update contributing instructions 2018-02-06 21:29:55 -08:00
Ian Storm Taylor
6df92950ab Publish
- slate-base64-serializer@0.2.22
 - slate-dev-logger@0.1.38
 - slate-html-serializer@0.5.3
 - slate-hyperscript@0.5.3
 - slate-plain-serializer@0.5.3
 - slate-prop-types@0.4.20
 - slate-react@0.11.3
 - slate-schema-violations@0.1.1
 - slate-simulator@0.4.20
 - slate@0.32.3
slate@0.32.3 slate-simulator@0.4.20 slate-schema-violations@0.1.1 slate-react@0.11.3 slate-prop-types@0.4.20 slate-plain-serializer@0.5.3 slate-hyperscript@0.5.3 slate-html-serializer@0.5.3 slate-dev-logger@0.1.38 slate-base64-serializer@0.2.22
2018-02-06 19:59:47 -08:00
Ian Storm Taylor
1340d3d915 fix benchmarks by exposing memoization utils 2018-02-06 19:58:11 -08:00
Ian Storm Taylor
0d5788691d update rollup examples config 2018-02-06 19:46:01 -08:00
Ian Storm Taylor
c8387c67c8 update ignore files 2018-02-06 19:42:12 -08:00
Ian Storm Taylor
83ec966113 refactor rollup, prettier and benchmark configuration 2018-02-06 19:41:03 -08:00
Renaud Chaput
3339d088e1 Add Prettier with ESLint integration (#1589)
* Add Prettier, with basic config and ESLint integration

* Apply Prettier to all files using `yarn lint --fix`

* Tell Prettier to ignore an empty text in a test output.

* Run Prettier on JS files not handled by ESLint, and lint them too
2018-02-06 15:12:00 -08:00
Jinxuan Zhu
f28c59a26e Use getAncestors in getDescendant (#1604) 2018-02-06 14:12:48 -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
Tobias Andersen
329787a07a fix(updateSelection): make sure there is a node to extend from (#1603)
* fix(updateSelection): make sure there is a node to extend from

* fix(updateSelection): use setBaseAndExtent over collapse/extend
2018-02-06 14:07:41 -08:00
Jinxuan Zhu
1f254aebec Fix BABEL_ENV bug in yarn benchmark (#1607) 2018-02-05 16:29:33 -05:00
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
Zach Schneider
1654a4113c
Standardize on yarn shorthand rather than yarn run (#1599) 2018-02-04 16:25:21 -05:00
Zach Schneider
b26bed1c88 Improvements to developer experience with building packages (#1595)
* Improvements to developer experience with building packages

* Add note to Contributing.md about watch:packages
2018-02-03 17:02:46 -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
DamareYoh
aee01ae703 fixed build for windows (#1592) 2018-02-02 17:20:06 -08: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
Jamie Talbot
c044d048ad Warn during normalization when range offsets are not numbers. (#1578) 2018-02-02 10:19:01 -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