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

371 Commits

Author SHA1 Message Date
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
Ian Storm Taylor
35f96c27d4 Publish
- slate-react@0.11.6
2018-02-21 17:54:46 -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
2018-02-21 15:07:33 -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
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
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
2018-02-07 10:54:52 -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
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
2018-02-06 19:59:47 -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
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
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
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
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
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
2018-01-26 12:34:47 -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
Zach Schneider
1e128fffdd Switch to package.json "files" configuration rather than .npmignore (#1559) 2018-01-26 10:14:05 -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
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
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
2018-01-11 12:02:39 -08:00
David Hrdlicka
6f1fd08fcd Expose core plugins (#1524) 2018-01-11 12:01:03 -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
Ryan Grove
b991d71abf Fix double-handling of iOS return and backspace keypresses (#1520)
Fixes #1519
2018-01-10 22:26:42 -08:00
Sunny Hirai
7dee55d066 Updated scroll-to-selection to abort only if on iOS 11 2018-01-10 16:57:39 -08:00
Sunny Hirai
d96a528ac0 Fixed scroll-to-selection jumping to top on iOS 2018-01-09 13:07:40 -08:00
Ryan Grove
df5b4a5d61 Fix iOS autocorrect issues with Backspace and Return (#1475)
* Fix iOS autocorrect issues with Backspace and Return

Handling Backspace and Return keystrokes in `onNativeBeforeInput`
ensures that iOS recognizes word and paragraph breaks and generates
appropriate autocorrect suggestions.

Fixes #1471

* Cleaner `onKeyDown` iOS check courtesy of @davidlibland
2018-01-08 13:34:59 -08:00
Ian Storm Taylor
fc121b5821 Publish
- slate-base64-serializer@0.2.19
 - slate-html-serializer@0.5.0
 - slate-hyperscript@0.5.0
 - slate-plain-serializer@0.5.0
 - slate-prop-types@0.4.17
 - slate-react@0.11.0
 - slate-simulator@0.4.17
 - slate@0.32.0
2018-01-04 15:39:37 -08:00
Ian Storm Taylor
1b73d5531c update changelogs 2018-01-04 15:32:04 -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
Ian Storm Taylor
bfe3124b01 Publish
- slate-base64-serializer@0.2.18
 - slate-html-serializer@0.4.16
 - slate-hyperscript@0.4.16
 - slate-plain-serializer@0.4.16
 - slate-prop-types@0.4.16
 - slate-react@0.10.23
 - slate-simulator@0.4.16
 - slate@0.31.8
2018-01-02 17:02:19 -08:00
Stan Chang Khin Boon
9c07a6baa4 Flush change immediately (#1479) (#1480)
Propose to flush change immediately instead of delaying it using `setTimeout()`.

- Flushing change is only use for `props.onChange()` callback and invoked at the end of render lifecycle (didMount/didUpdate), can't find the rationale for delaying it.
- `setTimeout()` delay are not dependable for a predictive behaviour
- `onChange()` is an important callback for a controlled component, delaying it can cause race condition. e.g. any changes outside of the component lifecycle that happen between the delay of flushing change will be overridden
2017-12-29 11:07:55 -08:00
Charlie Martin
29bcb1c8d6 Don't attempt to remove event listeners from non-existent window (#1495)
```
<IFrameComponent>
  <SlateEditor {...props} />
</IFrameComponent>
```

Since react unmounts from top down, `IFrameComponent` will unmount first (destroying its window), then `SlateEditor` will unmount and attempt to access the iframe window (which no longer exists) throwing `Uncaught TypeError: Cannot read property 'document' of undefined`.

It should be safe to skip removing event listeners from windows that no longer exist since they will be garbage collected upon destruction of the window anyway
2017-12-29 10:49:54 -08:00
Stan Chang Khin Boon
02c4837d4c this.element might be null when the callback is executed (#1489) 2017-12-29 10:48:53 -08:00
Stan Chang Khin Boon
1b9d3944a9 change.operations is immutable List thus we should size property instead of length (#1478) 2017-12-29 10:42:32 -08:00
Ian Storm Taylor
22576e521f Publish
- slate-base64-serializer@0.2.17
 - slate-html-serializer@0.4.15
 - slate-hyperscript@0.4.15
 - slate-plain-serializer@0.4.15
 - slate-prop-types@0.4.15
 - slate-react@0.10.22
 - slate-simulator@0.4.15
 - slate@0.31.7
2017-12-12 18:10:57 -05:00
Evan Henley
a3d91b6daa fix: account for container padding in scrollToSelection (#1462) 2017-12-11 10:35:02 -08:00
Ian Storm Taylor
fafa607e54 Publish
- slate-base64-serializer@0.2.16
 - slate-html-serializer@0.4.14
 - slate-hyperscript@0.4.14
 - slate-plain-serializer@0.4.14
 - slate-prop-types@0.4.14
 - slate-react@0.10.21
 - slate-simulator@0.4.14
 - slate@0.31.6
2017-12-11 10:40:51 -05:00
David Silva
c58e53364f fix(scroll-to-selection): use getClientRects when selectionRect.top/height is still 0 in Safari (#1446)
* fix(scroll-to-selection): use getClientRects when startContainer.length is 1

* fix(scroll-to-selection): rewrite and check if selectionRect.top/height still 0, use getClientRects

* fix(scroll-to-selection): identation whoopsie

* fix(scroll-to-selection): tabs !== spaces

* fix(scroll-to-selection): check for getClientRects length

* feat(scroll-to-selection): add IS_SAFARI check
2017-12-11 06:59:31 -08:00
Justin Weiss
082fb53633 Add a copyFragment helper for plugin onCut/onCopy functions (#1429)
* Add a `copyFragment` helper for plugin onCut/onCopy functions

* Rename `copyFragment` to `cloneFragment`

* Fix a missing clone-fragment reference
2017-12-11 06:56:38 -08:00
Ian Storm Taylor
cef33de6aa Publish
- slate-base64-serializer@0.2.15
 - slate-html-serializer@0.4.13
 - slate-hyperscript@0.4.13
 - slate-plain-serializer@0.4.13
 - slate-prop-types@0.4.13
 - slate-react@0.10.20
 - slate-simulator@0.4.13
 - slate@0.31.5
2017-12-04 11:31:07 -08:00
Evan Henley
4f1c26961d refactor scroll logic (#1428) 2017-12-04 11:27:54 -08:00
Ian Storm Taylor
199c32a2b5 Publish
- slate-react@0.10.19
2017-12-02 13:53:25 -08:00
Ian Storm Taylor
4e021f58b5
handle native selectionchange event, closes #1135 (#1441) 2017-12-02 13:52:23 -08:00
Ian Storm Taylor
ac9965151a Publish
- slate-base64-serializer@0.2.14
 - slate-html-serializer@0.4.12
 - slate-hyperscript@0.4.12
 - slate-plain-serializer@0.4.12
 - slate-prop-types@0.4.12
 - slate-react@0.10.18
 - slate-simulator@0.4.12
 - slate@0.31.4
2017-12-02 13:07:39 -08:00
Raffy Li
b3324db24c fix editor auto focus (#1438)
current implement of auto focus is buggy, HTMLElement.focus method
have no effect on selection state of editor, another re-render will
cause editor blur unexpectedly.
2017-12-02 12:06:17 -08:00
Ian Storm Taylor
f3b1a806d7 Publish
- slate-base64-serializer@0.2.13
 - slate-html-serializer@0.4.11
 - slate-hyperscript@0.4.11
 - slate-plain-serializer@0.4.11
 - slate-prop-types@0.4.11
 - slate-react@0.10.17
 - slate-simulator@0.4.11
 - slate@0.31.3
2017-11-19 13:04:26 -08:00