1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 17:23:07 +01:00

510 Commits

Author SHA1 Message Date
Ian Storm Taylor
bd07635b1e Publish
- slate-history@0.50.7
 - slate-hyperscript@0.50.6
 - slate-react@0.50.7
 - slate-schema@0.50.6
 - slate@0.50.6
2019-12-01 16:22:26 -05:00
Ian Storm Taylor
490acc502d simplify dist folder structure 2019-12-01 16:18:57 -05:00
Ian Storm Taylor
46f3be5319 Publish
- slate-history@0.50.6
 - slate-hyperscript@0.50.5
 - slate-react@0.50.6
 - slate-schema@0.50.5
 - slate@0.50.5
2019-12-01 14:48:53 -05:00
Ziad Beyens
d99629517d fix: ts error (#3180)
autoFocus was not an allowed property
2019-12-01 10:45:18 -05:00
Ziad Beyens
b4c15e13c1 fix: ts error (#3179)
This JSX tag's 'children' prop expects a single child of type 'Element', but multiple children were provided.
2019-12-01 10:44:26 -05:00
Ian Storm Taylor
f979332ea6 Publish
- slate-history@0.50.4
 - slate-hyperscript@0.50.4
 - slate-react@0.50.5
 - slate-schema@0.50.4
 - slate@0.50.4
2019-11-30 01:41:40 -05:00
Ian Storm Taylor
6bbecb1a9c Publish
- slate-history@0.50.3
 - slate-hyperscript@0.50.3
 - slate-react@0.50.4
 - slate-schema@0.50.3
 - slate@0.50.3
2019-11-30 01:13:08 -05:00
Ian Storm Taylor
fbd2a7154b Publish
- slate-history@0.50.2
 - slate-hyperscript@0.50.2
 - slate-react@0.50.3
 - slate-schema@0.50.2
 - slate@0.50.2
2019-11-29 08:10:57 -05:00
Ian Storm Taylor
75a0a4a703 add sideEffects: false, closes #2787 2019-11-29 08:01:17 -05:00
Ian Storm Taylor
57d9263088 fix editing commands in firefox, closes #3141 2019-11-29 07:58:43 -05:00
Ian Storm Taylor
9db1ef5b7a Publish
- slate-history@0.50.1
 - slate-hyperscript@0.50.1
 - slate-react@0.50.2
 - slate-schema@0.50.1
 - slate@0.50.1
2019-11-29 07:39:58 -05:00
Ian Storm Taylor
e1458c8c1b fix decorate logic 2019-11-29 07:35:12 -05:00
Irwan Fario Subastian
cedc7dc2a5 lint & example fixes (#3160)
* fix import extensions of eslint

* revert next.config.cjs

* fix eslint globbing

* add migrating to docs’ sidebar

* fix prettier error on Contributing.md

* put quotes for glob matching for windows user

* remove type: module from  package.json
2019-11-29 00:16:39 -05:00
Nathan Fenner
5bf58bbb71 improve prop typings for Editable (#3158) 2019-11-28 20:28:35 -05:00
Ian Storm Taylor
cd3a925592 Publish
- slate-react@0.50.1
2019-11-28 16:43:32 -05:00
Ian Storm Taylor
2b38fb3f3a fix placeholder prop 2019-11-28 16:18:15 -05:00
Ziad Beyens
f8c8ae8596 fix: make onDOMBeforeInput optional (#3138)
Fix this typescript error:

```
Property 'onDOMBeforeInput' is missing in type '{}' but required in type ...
```

with this code:
```
<Slate editor={editor} defaultValue={defaultValue}>
  <Editable />
</Slate>
```
2019-11-28 10:31:11 -05:00
Ian Storm Taylor
214b76d84b Publish
- slate-history@0.50.0
 - slate-hyperscript@0.50.0
 - slate-react@0.50.0
 - slate-schema@0.50.0
 - slate@0.50.0
2019-11-27 21:13:54 -05:00
Ian Storm Taylor
4ff6972096
Next (#3093)
* remove some key usage from core, refactor Operations.apply

* undeprecate some methods

* convert more key usage to paths

* update deprecations

* convert selection commands to use all paths

* refactor word boundary selection logic

* convert many at-range commands to use paths

* convert wrapBlock and wrapInline to not use keys

* cleanup

* remove chainability from editor

* simplify commands, queries and middleware

* convert deleteAtRange

* remove key usage from schema, deprecate *ByKey methods

* migrate *ByKey tests, remove index from *ByPath signatures

* rename at-current-range tests

* deprecate mode key usage, migrate more tests away from keys

* deprecate range and point methods which rely on keys to work

* refactor insertBlock, without fixing warnings

* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment

* refactor insertFragment

* get rich-text example rendering

* fix lint

* refactor query files, fix more tests

* remove unused queries, refactor others

* deprecate splitDescendantsByPath

* merge master

* add typescript, convert slate, slate-hyperscript, slate-plain-serializer

* add Point, Path, Range, Annotation tests

* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests

* add Operation and Text tests

* add Node tests

* get operations and normalization tests working for slate

* get *AtPath command tests passing

* rename *AtPath command tests

* rename

* get *AtPoint tests working

* rename

* rename

* add value queries tests

* add element, mark and path queries tests

* convert most on-selection tests

* convert on-selection commands

* rename

* get addMarks and delete commands working

* rename

* rename

* rename

* refactor value.positions(), work on delete tests

* progress on delete tests

* more delete work

* finish delete tests

* start converting to at-based commands

* restructure query tests

* restructure operations tests

* more work converting to multi-purpose commands

* lots of progress on converting to at-based commands

* add unwrapNodes

* remove setValue

* more progress

* refactor node commands to use consistent matching logic

* cleanup, get non-fragment commands passing

* remove annotations and isAtomic

* rename surround/pluck to cover/uncover

* add location concept, change at-path to from-path for iterables

* refactor batches

* add location-based queries

* refactor hanging logic

* more location query work

* renaming

* use getMatch more

* add split to wrap/unwrap

* flip levels/ancestors ordering

* switch splitNodes to use levels

* change split to always:false by default

* fix tests

* add more queries tests

* fixing more delete logic

* add more splitNodes tests

* get rest of delete tests passing

* fix location-based logic in some commands

* cleanup

* get previous packages tests passing again

* add slate-history package

* start slate-schema work

* start of react working

* rendering fixes

* get rich and plain text examples working

* get image example working with hooks and dropping

* refactor onDrop to be internal

* inline more event handlers

* refactor lots of event-related logic

* change rendering to use render props

* delete unused stuff

* cleanup dom utils

* remove unused deps

* remove unnecessary packages, add placeholder

* remove slate-react-placeholder package

* remove unused dep

* remove unnecessary tests, fix readonly example

* convert checklists example

* switch to next from webpack

* get link example working

* convert more examples

* preserve keys, memoized leafs/texts, fix node lookup

* fix to always useLayoutEffect for ordering

* fix annotations to be maps, memoize elements

* remove Change interface

* remove String interface

* rename Node.entries to Node.nodes

* remove unnecessary value queries

* default to selection when iterating, cleanup

* remove unused files

* update scroll into view logic

* fix undoing, remove constructor types

* dont sync selection while composing

* add workflows

* remove unused deps

* convert mentions example

* tweaks

* convert remaining examples

* rename h to jsx, update schema

* fix schema tests

* fix slate-schema logic and tests

* really fix slate-schema and forced-layout example

* get start of insertFragment tests working

* remove Fragment interface

* remove debugger

* get all non-skipped tests passing

* cleanup deps

* run prettier

* configure eslint for typescript

* more eslint fixes...

* more passing

* update some docs

* fix examples

* port windows undo hotkey change

* fix deps, add basic firefox support

* add event overriding, update walkthroughs

* add commands, remove classes, cleanup examples

* cleanup rollup config

* update tests

* rename queries tests

* update other tests

* update walkthroughs

* cleanup interface exports

* cleanup, change mark transforms to require location

* undo mark transform change

* more

* fix tests

* fix example

* update walkthroughs

* update docs

* update docs

* remove annotations

* remove value, move selection and children to editor

* add migrating doc

* fix lint

* fix tests

* fix DOM types aliasing

* add next export

* update deps, fix prod build

* fix prod build

* update scripts

* update docs and changelogs

* update workflow and pull request template
2019-11-27 20:54:42 -05:00
Ian Storm Taylor
a0b7976cb9 Publish
- slate-base64-serializer@0.2.112
 - slate-html-serializer@0.8.11
 - slate-hyperscript@0.13.9
 - slate-plain-serializer@0.7.11
 - slate-prop-types@0.5.42
 - slate-react-placeholder@0.2.9
 - slate-react@0.22.10
 - slate@0.47.9
2019-11-09 20:37:07 -05:00
Guillaume Racicot
d28f78c060 Mark some events as 'user actions' to prevent scrolling when a programatic selection tranformation is performed (#3019) 2019-10-06 09:22:00 -04:00
Ian Storm Taylor
cd945cd536 Publish
- slate-react@0.22.9
2019-09-27 10:34:24 -04:00
kay delaney
6d637f37a2 Bugfix: Fixes issue where focusing on editor always placed caret at offset 0 (#2995)
* Revert "fix(firefox): fixed the bug that happens when changing the focus from one field to another (#2236)"

This reverts commit 6aba4260f84a4ffe6ccbe60078c95f7c39a8a6c0.

* Fixes issue where focusing on editor always placed caret at offset 0

* Inlines `selectionsEqual` logic and adds some comments
2019-09-27 10:30:29 -04:00
Akumatus
21d0f4a233 Replace deprecated findDOMNode with editor.findDOMNode in cloneFragment (#3018) 2019-09-21 13:48:25 -04:00
ibone
fb728f4754 FIX findPoint offset may be include zero width string (#2982)
* FIX point offset may be include zero width string

* fix prettier style

* FIX prettier style
2019-09-08 10:11:49 -07:00
Justin Weiss
6269fcaa71 Drop dragged nodes into the correct place (#3001)
When drag-and-dropping nodes within the same editor, the removal of
the dragged nodes can cause paths and offsets to change. This is
really hard to compensate for.

Instead of compensating for it, rearranging the order things happen
mean we are always working with a document in a reasonable state.

Now, we:

1. Fire a MouseUp event on `event.target` (because we haven't done
   anything, it's guaranteed to exist)
2. Save the range we're dragging (for later)
3. Select the target range (because we haven't deleted anything, this
   is still valid)
4. Delete the range we're dragging (this will automatically adjust the
   editor's selection)
5. Insert the dragged fragment at the current range

No matter where we're dragging from or to, these should all be
pointing at places that both exist, and haven't changed.
2019-09-08 10:06:19 -07:00
Ian Storm Taylor
c42d84dbf6 Publish
- slate-base64-serializer@0.2.111
 - slate-html-serializer@0.8.10
 - slate-hyperscript@0.13.8
 - slate-plain-serializer@0.7.10
 - slate-prop-types@0.5.41
 - slate-react-placeholder@0.2.8
 - slate-react@0.22.8
 - slate@0.47.8
2019-08-27 10:31:30 -04:00
Stan Gurenkov
de376d79b8 Fix several undo/redo issues related to selection operation (#2948)
Should fix the following issues: #2891, #2729
2019-08-22 14:28:13 -04:00
Yue
6e56932ee4 fix React warnings on renderMark, renderBlock, renderDecoration (#2974)
* fix React warnings on renderMark, renderBlock, renderDecoration

* included decorateNode and relocated code into constants in EventHandler

* Put decorateNode and render handlers into a seperate file.

* fix indentation

* overlooked indentation.
2019-08-22 12:50:32 -04:00
Ian Storm Taylor
1f673a9b43 Publish
- slate-base64-serializer@0.2.110
 - slate-html-serializer@0.8.9
 - slate-hyperscript@0.13.7
 - slate-plain-serializer@0.7.9
 - slate-prop-types@0.5.40
 - slate-react-placeholder@0.2.7
 - slate-react@0.22.7
 - slate@0.47.7
2019-08-21 22:45:19 -04:00
themithy
1895c6696f Fix extracting relative ranges from decorations. (#2970) 2019-08-21 22:42:43 -04:00
Ian Storm Taylor
3ed981aedf Publish
- slate-base64-serializer@0.2.109
 - slate-html-serializer@0.8.8
 - slate-hyperscript@0.13.6
 - slate-plain-serializer@0.7.8
 - slate-prop-types@0.5.39
 - slate-react-placeholder@0.2.6
 - slate-react@0.22.6
 - slate@0.47.6
2019-08-19 12:41:58 -04:00
Yulong Ruan
8ab49c04c4 fixed #1237 which calls Selection.getRangeAt(0) when Selection.type = 'None' (#2920)
it should check the latest rangeCount, not the previous memorized one
2019-08-19 10:24:49 -06:00
lin onetwo
5686c3d8cc fix: Unknown event handler property onEvent (#2925)
* fix: Unknown event handler property `onEvent`

```
index.js:1 Warning: Unknown event handler property `onEvent`. It will be ignored.
	in div (created by Content)
    in Content (created by Editor)
```

* fix: make onEvent required

Seems this prop is provided in `component/editor.js`
2019-08-19 10:09:08 -06:00
lakatosandrei
6aba4260f8 fix(firefox): fixed the bug that happens when changing the focus from one field to another (#2236)
* fix(firefox): fixed the bug that happens when changing the focus from one field to another

* Publish

 - slate-base64-serializer@0.2.69
 - slate-html-serializer@0.7.8
 - slate-hyperscript@0.10.8
 - slate-plain-serializer@0.6.8
 - slate-prop-types@0.4.67
 - slate-react@0.18.11
 - slate-simulator@0.4.67
 - slate@0.41.3

* Publish

 - slate-base64-serializer@0.2.70
 - slate-html-serializer@0.7.9
 - slate-hyperscript@0.10.9
 - slate-plain-serializer@0.6.9
 - slate-prop-types@0.4.68
 - slate-react@0.18.12
 - slate-simulator@0.4.68
 - slate@0.41.4

* Publish

 - slate-react@0.18.13

* Revert "Fix an occasional crash in Firefox in isInEditor (#2229)"

This reverts commit 1ff050265bbcb8e6d5b5bbf9dc8839f1c6a2ddef.

* fix(firefox): added postinstall script to the main project

* fix(firefox): removed error causing line

* fix(firefox): added the right fix for this

* fix(firefox): added the best fix for this

* fix(firefox): made the range a constant

* fix(firefox): added the removeAllRanges inside the if wrapper

* fix(lint): fixed lint error

* fix(versions): removed changes for the package.json files

* fix(versions): removed remaining changes for the package.json files

* fix(conflict): fixed the issue that resolving the conflicts caused last time

* fix(lint): fixed the last lint error

* chore(content): moved comment in setTimeout to see why git is not showing conflicts locally
2019-08-19 10:08:22 -06:00
Ian Storm Taylor
2304df2f50 Publish
- slate-base64-serializer@0.2.108
 - slate-html-serializer@0.8.7
 - slate-hyperscript@0.13.5
 - slate-plain-serializer@0.7.7
 - slate-prop-types@0.5.38
 - slate-react-placeholder@0.2.5
 - slate-react@0.22.5
 - slate@0.47.5
2019-08-19 11:35:20 -04:00
Nadeem Shaik
b1af2d3dc8 Add prop to optionally enable grammarly (#2855) 2019-07-03 13:04:58 -07:00
themithy
9e2e2a1cc5 Fix bugs in getRelativeRange. (#2872) 2019-07-03 13:03:26 -07:00
Sunny Hirai
7d4062cde9
Add Android 8 and 9 compatibility using Mutations (#2853)
* Add debug-mutations

* Fix linting

* Add debug-mutations to o core plugins

* Fix debug output

* Add comment about debug statement

* Add comment explaining the building of debug output object

* Add framework for mutations and mutation observer

* Working splitBlock and mergeBlock

* many things working but not autocorrect

* All later tests pass

* Before adding isComposing to composition-manager

* Fixit

* fix enter enter backspace backspace

* Pass all tests except space-back-space-back

* Passes all tests I think but doesn't continuous backspace or select delete

* Passes all tests and delete selection work

* Fix for merge

* Passes all tests including typing hello world on new line and enter

* Before switching to a function

* Fix enter after last char

* Fix it wasn't me. no. bug

* Remove timeout delay on compositionEnd and everthing works except it wasnt me. no.

* Passes all tests but need to add tests for delete all and select delete

* Pass all tests

* Fix  remove selection

* Added flush onCompositionEnd just in case

* Fix bugs for Android 8 split join and fix side effects on Android 9 to that fix

* Add comments to composition manager

* Clean up code

* Fix bug with delete range

* Add comments

* Fix focus lost bug on change examples

* Improve comments

* Rename clear to clearAction and a comment

* Rename lastEl to last.rootEl

* Remove isListening

* Rename vars

* Fix bug where changing to new example during a composition messes up update

* Add comment to switching examples in composition fix

* Improve comments

* Refactor

* Refactor removeNode

* Remove unused event callbacks

* Refactor connect

* Cleanup mutation plugin

* Remove unnecessary comments

* Remove readme

* Refactor ReactPlugin

* Refactor plugins and injection locations

* Remove dom-observer

* Remove is-input-data helpers

* Move fixSelectionInZeroWidthBlock

* Fix some linting and also a composition manager bug

* Fix linting and remove placeholder on Android

* Refactor

* Update composition-manager description

* Fix comment on composition manager

Co-Authored-By: Nick Anderson <tetramputechture@gmail.com>
2019-06-12 16:14:00 -07:00
Ian Storm Taylor
67e397100e Publish
- slate-base64-serializer@0.2.107
 - slate-html-serializer@0.8.6
 - slate-hyperscript@0.13.4
 - slate-plain-serializer@0.7.6
 - slate-prop-types@0.5.37
 - slate-react-placeholder@0.2.4
 - slate-react@0.22.4
 - slate@0.47.4
2019-06-07 11:11:42 -07:00
Justin Weiss
af8a0baafe Fix several errors in the deprecated getEventRange (#2847)
This version of the method has drifted from `editor.findEventRange`,
and now crashes when it's being used. This commit fixes an import and
changes some code to match the new code in `editor.findEventRange`.
2019-06-07 18:57:08 +01:00
Sunny Hirai
f15538d6a5
Normalize target node in debug mutations (#2845)
* Normalize target node in debug mutations

* Added comments and fixed linting
2019-05-30 16:07:04 -07:00
Sunny Hirai
d2f9b4167c
Improve debug mutations plugin (#2844) 2019-05-29 18:03:42 -07:00
Sunny Hirai
78264cf117
Hook debug-mutations into lifecycle events (#2841) 2019-05-28 18:10:50 -07:00
Sunny Hirai
2265240c04
Removed pseudo-event object from lifecycle events (#2840) 2019-05-28 17:48:40 -07:00
Sunny Hirai
2634c58e32
Add render event for plugins (#2834) 2019-05-27 18:34:00 -07:00
Sunny Hirai
2ec21e7fc4
Add 3 lifecycle event handlers (#2833) 2019-05-27 15:04:59 -07:00
Sunny Hirai
80212943cc
Fix Hot Module Reload for plugins (#2825)
* Fix HMR for plugins

* Use TheReactPlugin in resolveController argument inside method
2019-05-22 18:57:29 -07:00
Sunny Hirai
96cb419ccb
Second attempt at Debug Mutations (#2823)
* Add debug-mutations

* Fix linting

* Add debug-mutations to o core plugins

* Fix debug output

* Add comment about debug statement

* Add comment explaining the building of debug output object
2019-05-22 18:21:20 -07:00
Sunny Hirai
8311767108
Add noop plugin as detached plugin (#2824) 2019-05-22 17:57:58 -07:00