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

2132 Commits

Author SHA1 Message Date
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
Andreas Mischke
0ef7b116f1 Fix broken "Characters" link (#1586)
Link was pointing to `./mark.md`, now points to `./character.md`
2018-02-01 09:33:49 -05:00
Jinxuan Zhu
566c71c1d1 Fix range.moveToRangeOf when range is a backward range; (#1575)
* fix range.moveToRangeOf when isBackward

* add test for unwrapBlock with backward selection

* Always return isBackward:false in moveToRangeOf

* Update range.js
2018-01-31 13:01:58 -08:00
Conor Cussell
1ea96baf9f Fix selecting with shift+(left|right) key (#1570)
* Account for zero-width whitespace chars when selecting with arrow keys

* Change the correct line 😳

* Remove unused const

* Fix lint error

* Proper fix for shift select towards void nodes
2018-01-31 13:01:43 -08:00
Jinxuan Zhu
b1e5330ad5 Continue normalize next child when and only when the node exists still (#1538)
* Continue normalize next child when and only when the node exists still

* use the refindNode and refindPath provided

* Use Array.includes instead of Array.indexOf
2018-01-31 12:59:58 -08:00
Kelly Joseph Price
28450334a7 Edge browser selection edge case (#1574)
* Handle Edge browser selection case

* Re-use const
2018-01-30 18:09:39 -08:00
Jinxuan Zhu
2a1da72c70 Faster (but also safe) method about re-find node by path (#1548) 2018-01-30 18:05:43 -08:00
Ian Storm Taylor
44eccca60a Publish
- slate-base64-serializer@0.2.21
 - slate-dev-logger@0.1.37
 - slate-html-serializer@0.5.2
 - slate-hyperscript@0.5.2
 - slate-plain-serializer@0.5.2
 - slate-prop-types@0.4.19
 - slate-react@0.11.2
 - slate-schema-violations@0.1.0
 - slate-simulator@0.4.19
 - slate@0.32.2
slate@0.32.2 slate-simulator@0.4.19 slate-schema-violations@0.1.0 slate-react@0.11.2 slate-prop-types@0.4.19 slate-plain-serializer@0.5.2 slate-hyperscript@0.5.2 slate-html-serializer@0.5.2 slate-dev-logger@0.1.37 slate-base64-serializer@0.2.21
2018-01-26 12:34:47 -08:00
Ian Storm Taylor
598513a5fc fix linter 2018-01-26 12:33:54 -08:00
Ian Storm Taylor
4db6b1d7fe update docs 2018-01-26 12:31:51 -08:00
Ian Storm Taylor
b8ca5d04df update docs 2018-01-26 12:31:15 -08:00
Ian Storm Taylor
10eea06a8a refactor schema violations to be a separate package 2018-01-26 12:28:40 -08:00
CameronAckermanSEL
ef5106e30f Improve normalize suppression to make less verbose and safer (#1549)
* change normalization can be set with setOperationFlag, and changes can be executed in sequence with automatic suppression with guaranteed document normalization at the end.

* responded to developer feedback by renaming execute to withMutations (to mirror immutable JS), implemented tests, updated documentation

* fixed typos discovered in review.

* fixed missing normalize flag usages and added withMutations to the schemas guide

* responded to developer feedback

* fixed lint errors and cleaned up code

* readd missing tests

* getFlag now allows options to override the change flags

* removed normalize restoration asserts from unit tests

* unit test cleanup
2018-01-26 11:32:37 -08:00
Zach Schneider
00165a3155 Convert to babel-preset-env and upgrade build and linting packages. (#1557) 2018-01-26 10:55:29 -08:00
Gabriel Ramos Takeda
1467d687bd change reboo to nossas organization's editor name (#1564) 2018-01-26 10:22:56 -08:00
Zach Schneider
55e34e6d97 Fix code highlighting example (#1560) 2018-01-26 10:15:03 -08:00
Zach Schneider
1e128fffdd Switch to package.json "files" configuration rather than .npmignore (#1559) 2018-01-26 10:14:05 -08:00
Zach Schneider
856d033c5f Link to changelog in docs to generate links correctly. (#1540) 2018-01-25 13:31:21 -08:00
Zach Schneider
508cc74e3a Upgrade to lerna 2.7 to correct peer dependency management (#1539) 2018-01-25 13:14:55 -08:00
Blake Embrey
4e8dd7405a Fix selection replacement and marks (#1473)
* Fix selection replacement and marks

* Create `getInsertMarks` method for text insertion
2018-01-25 13:08:17 -08:00
DamareYoh
7d5a33025b added export constant enum for schema violations (#1532)
* added export constant enum for schema violations

* updated examples to use the schema violations enum

* use SchemaViolations enum in tests and docs

* fixed path for schema violations import
2018-01-17 10:24:28 -05:00
Jinxuan Zhu
e6c7934cb9 Document: add change.snapshotSelection in the change.md (#1534)
* docs: add chang.snapshotSelection

* Minor style tweaks
2018-01-17 00:05:29 -05:00
Jenna Nichols
bc7acefff2 Append copied fragment to editor DOM node instead of page body (#1533)
* append fragment to editor DOM node instead of body

* remove semicolon
2018-01-16 22:46:22 -05: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
Francesco Agnoletto
48f198b210 Remove deprecated plugin (#1530)
From https://github.com/withspectrum/slate-mentions
WE'VE SWITCHED TO DRAFT.JS, SO THIS REPO IS NO LONGER MAINTAINED!
Last version was released 8 months ago && was just a beta, not production ready.
2018-01-13 15:40:46 -08:00
Francesco Agnoletto
cfe5dac0f8 Fix broken links on docs (#1529)
@ianstormtaylor plugins + typo in core-plugins link
2018-01-13 09:24:52 -08:00
Ben Gotow
73392b9596 Update search-highlighting example per #1454 (#1526) 2018-01-12 10:41:17 -08:00
Sunny Hirai
6673e1ec6d
Merge pull request #1515 from thesunny/ios-fix
Fixed scroll-to-selection jumping to top on iOS 11
2018-01-11 15:41:53 -08:00
Ian Storm Taylor
6cfc864472 Publish
- slate-base64-serializer@0.2.20
 - slate-html-serializer@0.5.1
 - slate-hyperscript@0.5.1
 - slate-plain-serializer@0.5.1
 - slate-prop-types@0.4.18
 - slate-react@0.11.1
 - slate-simulator@0.4.18
 - slate@0.32.1
slate@0.32.1 slate-simulator@0.4.18 slate-react@0.11.1 slate-prop-types@0.4.18 slate-plain-serializer@0.5.1 slate-hyperscript@0.5.1 slate-html-serializer@0.5.1 slate-base64-serializer@0.2.20
2018-01-11 12:02:39 -08:00
David Hrdlicka
6f1fd08fcd Expose core plugins (#1524) 2018-01-11 12:01:03 -08:00
Francesco Agnoletto
32dd6f5ecc Update links to Plugins (#1522)
* Update links to Plugins

Links to ianstormtaylor were deprected.

* Fix typo
2018-01-11 10:54:30 -08:00
Sunny Hirai
3d86533b5b Updated scroll-to-selection so it skips the scroll only on version 11 of iOS. 2018-01-11 10:06:41 -08:00
Sunny Hirai
69e53cb556 Merged upstream/master 2018-01-11 09:55:07 -08:00
Ian Storm Taylor
db0fd84bbc update cache time for readme badge images 2018-01-10 22:30:29 -08:00
Ian Storm Taylor
9e2c42297c update plugins link in readme 2018-01-10 22:28:12 -08:00
Ryan Grove
b991d71abf Fix double-handling of iOS return and backspace keypresses (#1520)
Fixes #1519
2018-01-10 22:26:42 -08:00
Ian Storm Taylor
c9f98525b2 remove editors section from plugins docs 2018-01-10 22:22:52 -08:00
Ian Storm Taylor
9f358d1d29 update plugins reference links 2018-01-10 22:21:10 -08:00