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

2837 Commits

Author SHA1 Message Date
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
stefaniehansen
02b87d5968 Add redo hotkey for Windows (Ctrl+Shift+Z) (#3110) 2019-11-13 11:40:04 -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
slate@0.47.9 slate-react@0.22.10 slate-react-placeholder@0.2.9 slate-prop-types@0.5.42 slate-plain-serializer@0.7.11 slate-hyperscript@0.13.9 slate-html-serializer@0.8.11 slate-base64-serializer@0.2.112
2019-11-09 20:37:07 -05:00
Ian Storm Taylor
a39277ad15
Update ci.yml 2019-11-09 20:29:14 -05:00
Ian Storm Taylor
c381d72b41
Update ci.yml 2019-11-09 20:26:58 -05:00
Ian Storm Taylor
06812a1efe
Create ci.yml 2019-11-09 20:22:31 -05:00
dependabot[bot]
69f85a77f2 Bump macaddress from 0.2.8 to 0.2.9 (#3106)
Bumps [macaddress](https://github.com/scravy/node-macaddress) from 0.2.8 to 0.2.9.
- [Release notes](https://github.com/scravy/node-macaddress/releases)
- [Commits](https://github.com/scravy/node-macaddress/compare/0.2.8...0.2.9)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 19:59:00 -05:00
Kamil Kamiński
df743127ca Simplify the mentions example (#3079)
* Simplify the mentions example

* Fix wrong method call in onChange

* Return after inserting the mention
2019-11-09 19:58:29 -05:00
dependabot[bot]
dd6438436d Bump webpack-dev-server from 2.11.1 to 3.1.11 (#3104)
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 2.11.1 to 3.1.11.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v2.11.1...v3.1.11)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 19:46:03 -05:00
dependabot[bot]
06635fde9b Bump atob from 2.0.3 to 2.1.2 (#3105)
Bumps [atob](https://github.com/coolaj86/node-browser-compat) from 2.0.3 to 2.1.2.
- [Release notes](https://github.com/coolaj86/node-browser-compat/releases)
- [Commits](https://github.com/coolaj86/node-browser-compat/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 19:45:57 -05:00
dependabot[bot]
84d1ba4a2b Bump tar from 2.2.1 to 2.2.2 (#3102)
Bumps [tar](https://github.com/npm/node-tar) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Commits](https://github.com/npm/node-tar/compare/v2.2.1...v2.2.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 19:45:17 -05:00
dependabot[bot]
4812ad4833 Bump extend from 3.0.1 to 3.0.2 (#3103)
Bumps [extend](https://github.com/justmoon/node-extend) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/justmoon/node-extend/releases)
- [Changelog](https://github.com/justmoon/node-extend/blob/master/CHANGELOG.md)
- [Commits](https://github.com/justmoon/node-extend/compare/v3.0.1...v3.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 19:45:09 -05:00
dependabot[bot]
ec3e32c95b Bump sshpk from 1.13.0 to 1.16.1 (#3100)
Bumps [sshpk](https://github.com/joyent/node-sshpk) from 1.13.0 to 1.16.1.
- [Release notes](https://github.com/joyent/node-sshpk/releases)
- [Commits](https://github.com/joyent/node-sshpk/compare/v1.13.0...v1.16.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 18:33:09 -05:00
dependabot[bot]
c2a33e9664 Bump fstream from 1.0.11 to 1.0.12 (#3101)
Bumps [fstream](https://github.com/npm/fstream) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/npm/fstream/releases)
- [Commits](https://github.com/npm/fstream/compare/v1.0.11...v1.0.12)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 18:33:02 -05:00
dependabot[bot]
488cede2f6 Bump mixin-deep from 1.3.1 to 1.3.2 (#3099)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 18:32:45 -05:00
dependabot[bot]
7084bd4f08 Bump clean-css from 4.1.9 to 4.1.11 (#3098)
Bumps [clean-css](https://github.com/jakubpawlowicz/clean-css) from 4.1.9 to 4.1.11.
- [Release notes](https://github.com/jakubpawlowicz/clean-css/releases)
- [Changelog](https://github.com/jakubpawlowicz/clean-css/blob/master/History.md)
- [Commits](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.9...v4.1.11)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 18:32:36 -05:00
dependabot[bot]
51400f377e Bump lodash from 4.17.4 to 4.17.13 (#3097)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.4 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.4...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 18:32:23 -05:00
dependabot[bot]
db688e5460 Bump nwmatcher from 1.4.3 to 1.4.4 (#3096)
Bumps [nwmatcher](https://github.com/dperini/nwmatcher) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/dperini/nwmatcher/releases)
- [Commits](https://github.com/dperini/nwmatcher/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-09 18:32:05 -05:00
Justin Weiss
3635390820 Include data and type when converting set_annotation to JS (#3085)
These were missing, and `set_annotation` operations don't have
marks. This meant that when converting these operations to JS and
back, they could not become real annotations again.
2019-11-09 18:01:15 -05:00
Kamil Kamiński
88b7efa975 Change renderNode docs to renderBlock and renderInline (#3083) 2019-11-09 17:59:31 -05:00
whyour
91c2cb4e9e Fix when clear search text, all text split by blank (#3072)
in search-highlighting example, when search text is empty, no need to split text and addAnnotation
2019-11-09 17:58:53 -05:00
Entkenntnis
862e74a0cb fixing paste html example (#3070) 2019-11-09 17:56:46 -05:00
Stewart Sum
6fc0bc85e6 Update saving-and-loading-html-content.md (#3064)
Change the name of the first argument of the serialize function from 'object' to 'obj' in the description to match what is used in the code.
2019-11-09 17:56:18 -05:00
comerc
4c0be6d7ce Removed 404 links from Changelog.md (#3062)
* Removed 404 link of slate-dev-warning

* Removed 404 link of slate-simulator
2019-11-09 17:55:20 -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
Stefan
7f5ad9c1fc tests, test organizaiton, and improvements for paste (#2589) 2019-10-06 09:13:11 -04:00
Yue
d134f64cd7 Added onMouseUp into available hooks. (#3047) 2019-10-06 09:08:25 -04:00
davidhoeller
8dce7538eb Fix unicode offset (#3044)
* Merges pr-2680

* Handle end/beginning of node/text: we have to return 1 in order not to break jumping to next/previous node

* Update emojis example to insert emojis as plain text with shift+click.

* Fix eslint issues
2019-10-06 09:07:53 -04:00
Sebastian Seilund
d71ea08fdf Fixed /placeholder link on Examples page (#3038)
The directory is at https://github.com/ianstormtaylor/slate/tree/master/examples/placeholder (without the last `s`)
2019-10-06 09:04:18 -04:00
Sebastian Seilund
7f201f139b Fixed typo in docs: addMarkAt_Ar_ange -> addMarkAt_R_ange (#3033) 2019-10-06 09:03:49 -04:00
Tim Saunders
549359d19e Capitalise references to Mark for consistency (#3031) 2019-10-06 09:03:29 -04:00
往日。
03ee011834 Correct the document mentioned by #3029 (#3035) 2019-09-30 09:25:59 -07:00
Ian Storm Taylor
cd945cd536 Publish
- slate-react@0.22.9
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
Akumatus
3fa6ff17e1 fix broken core-plugin link in doc and add one item to the products list (#3017) 2019-09-21 13:46:21 -04:00
Mitchell Donaldson
58b0f9f1a3 Remove range parameter from getTexts documentation (#3016) 2019-09-21 13:45:50 -04:00
Entkenntnis
1c29165661 fix cursor jumping to end in embeds example (#3014)
* fix cursor jumping to end in embeds example

* prettier

* prettier again
2019-09-21 13:44:57 -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
Brent Farese
ca73f2a671 Update range.md (#2996)
It appears that references to point.normalize(document) should be range.normalize(document).
2019-09-08 10:07:24 -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
Dragos Bulugean
8d0899fee9 Add Archbee to resources.md (#2994) 2019-09-08 10:04:36 -07:00
Sunny Hirai
7a6cd1ea2d
Improve data model docs (#2992)
* Improve data model docs

* Fix linting
2019-08-30 22:19:57 -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
slate@0.47.8 slate-react@0.22.8 slate-react-placeholder@0.2.8 slate-prop-types@0.5.41 slate-plain-serializer@0.7.10 slate-hyperscript@0.13.8 slate-html-serializer@0.8.10 slate-base64-serializer@0.2.111
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
slate@0.47.7 slate-react@0.22.7 slate-react-placeholder@0.2.7 slate-prop-types@0.5.40 slate-plain-serializer@0.7.9 slate-hyperscript@0.13.7 slate-html-serializer@0.8.9 slate-base64-serializer@0.2.110
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
themithy
f4283866f2 Fix range normalization in remove node. (#2971) 2019-08-21 22:42:07 -04:00
kay delaney
9c2d55e800 deleteBackwardAtRange now works when offset is equal to n (#2966)
* deleteBackwardAtRange now works when offset is equal to n
Closes #2965

* Adds test to verify behaviour of `deleteBackwardAtRange` when offset===length
2019-08-21 22:41:21 -04:00