1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 05:42:00 +02:00

3620 Commits

Author SHA1 Message Date
I Made Budi Surya Darma
834ce3483d
fix(android): Fix editors mark is not inserted on insert text in android (#4342)
* fix(android): Fix mark is not inputed on insert text in android

* add changeset

* null mark only when mark exist

Co-authored-by: surya darma <budi.surya@kumparan.com>
2021-08-13 03:55:27 -07:00
Seiichi Nishikata
220f2d2ce6
Fix invalid cursor when IME converting (#4450) 2021-08-13 03:52:42 -07:00
Jimmy Oliger
0025900349
Add unicode sequences support (#4326)
* Add failing test

* Handle sequences

* Uncomment test cases

* Handle RTL unicode sequences

* Remove esrever

* Add tests

* Use iterator instead of Array.from

* Add changeset

* Rename split to splitByCharacterDistance

* Make reverse optional

* Fix casing

* Fix yarn.lock

* Fix tests

* Remove fast-deep-equal after bad merge
2021-08-13 03:50:52 -07:00
I Made Budi Surya Darma
a1f925bddf
fix(android): Get fragment from text/html when application/x-slate-fragment is missing on copy-paste slate fragment in android (#4433)
* fix(android): clipboard application/x-slate-fragment is missing on paste in android

* add event onCut

* add changeset

* make slate fragment available when props onPaste, call preventDefault

* .

* get the fragment from text/html when it missing

* remove setData

* use getClipboardData instead of hooks
2021-08-13 03:44:41 -07:00
Georgy Perepecho
d32ce0f49b
fix example paste-html if children are empty (#4446)
Co-authored-by: Georgii Perepecho <georgii.perepecho@revolut.com>
2021-08-12 14:54:01 -07:00
Githoniel
c6203a2d68
fix unwrapNode when split && add in nested block (#3820)
* fix unwrapNode when splite && add in nested block

* Update packages/slate/src/transforms/node.ts

chore: add comment

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

* chore: prettier fix

* chore: add changeset

* Update packages/slate/src/transforms/node.ts

chore: update comments

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-12 07:04:14 -07:00
Samarjeet
906e5af1b1
Capture element selections through useSelected (#4365)
* Capture element selections (ianstormtaylor#4338)

* Rebase

* Add changeset
2021-08-12 07:03:22 -07:00
Tomas Carnecky
62d1a068be
Do not needlessly JSON.stringify() the whole editor (#4411)
* Do not needlessly JSON.stringify() the whole editor

* Refactor based on feedback

* Linting fix for error messages

* linting fix

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-12 06:59:53 -07:00
Samarjeet
3e4d92005a
cypress: paste html example test (#4439) 2021-08-12 04:42:53 -07:00
Samarjeet
8f46d686ac
cypress: fix flaky code highlight test (#4444)
* cypress: fix flaky code highlight test

* condition spelling fix
2021-08-12 04:34:02 -07:00
Brian Krausz
25afbd4300
Use native character insertion to fix browser/OS text features (#3888)
* use native character insertion to fix browser/OS text features. (flickering spellcheck, autocorrect, text shortcuts, etc.)

move some checks into previous if statement, remove commented out code

move native behavior into `slate-react`, and remove any external interface

dont use native editing if marks are set, as a new node will be inserted

match -> above

remove nativeOperationsQueue from editor

bail out of native queueing and immediately flush events if non insert_text operation is being applied.

* Convert TextString to a functional component

* Batch normalization of native op application

* Add changeset

* only proceed as native event if single character non-special character or space, to limit potential bad side effects.

* Revert "fix ime double input with mark"

* Comment wording tweak

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

* Comment wording tweak

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

* Comment wording tweak

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

* Comment wording tweak

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

* Comment wording tweak

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

Co-authored-by: Ludwig Pettersson <luddep@gmail.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-11 15:57:10 -07:00
Andrew Herron
55ff8f00e4
Fixed regression in #4208 where normalization on empty block nodes could not be overridden (#4431) 2021-08-11 13:01:44 -07:00
Andrew Herron
6f47cbbe0d
Remove fast-deep-equal (#4276)
* Remove fast-deep-equal in favour of a custom slate-specific equality check that only supports nested objects

* Add array comparison to deep equal. Fix bug with multiple nested objects.
2021-08-11 12:58:25 -07:00
Pulkit Singh
69ee04ac14
Update 02-nodes.md (#4442)
* Update 02-nodes.md

* Update 02-nodes.md
2021-08-11 12:55:41 -07:00
Dylan Schiemann
4cb1837934
Comment out currently flaky integration test (#4441)
* Comment out currently flaky integration test

Even with a longer timeout, this test is intermittently failing, causing most PRs to show as failing.

* Update cypress/integration/examples/code-highlighting.ts
2021-08-11 10:16:23 -07:00
Dylan Schiemann
03ffe4596d
Add CoCalc to list of resources (#4437) 2021-08-11 06:28:45 -07:00
Kelly Joseph Price
479a759108
Fix mergeNodes moving node into parent sibling (#4296)
* test: add test case for bug

* prefer next will transforming selection in remove_node

* add remove_node test

* Add changeset

* review: handle nested blocks

* refactor

* Revert "refactor"

This reverts commit 45a8aab7cb8408295c93d48186f5c7ecb135f4ae.

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-10 19:07:11 -07:00
dependabot[bot]
4dea740862
build(deps): bump path-parse from 1.0.6 to 1.0.7 (#4435)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-11 10:01:30 +10:00
Andrew Herron
b47d3fd191
Don't set null in set_node newProperties when using unsetNodes (#4428) 2021-08-11 07:55:32 +10:00
github-actions[bot]
936070738c
Version Packages (#4368)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.65.3 slate-react@0.65.3 slate-history@0.65.3
2021-08-10 10:12:29 -07:00
Benny Zhao
3f69a9f395
Update findDocumentOrShadowRoot to return the root node instead of throwing unnecessarily (#4427)
* Update `findDocumentOrShadowRoot` to return undefined instead of throwing unnecessarily

* Small refactoring to improve the diff for reviewers

* Add changeset for patch

* Update new-trainers-peel.md

* Resolve PR comments

* Revert undefined checks, return window.document and update changeset

* Simplify findDocumentOrShadowRoot based on PR feedback

* Re-run CI

Thanks everyone for your review and thanks @ben10code for your first contribution!
2021-08-10 10:03:41 -07:00
Jake Donham
237edc6ea6
fix decorate bug (#4277) without adding extra layers of render tree (#4421)
* fix #4394 without adding extra layers of render tree

* oops unused import

* Add changeset

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-09 19:59:59 -07:00
Andrew Herron
748bf75005
Remove unused slate-history dependency on immer (#4430) 2021-08-10 11:43:47 +10:00
dependabot[bot]
4f0ba30f0a
build(deps-dev): bump prismjs from 1.23.0 to 1.24.0 (#4355)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-10 11:26:20 +10:00
dependabot[bot]
247372d5e1
build(deps): bump tar from 4.4.13 to 4.4.15 (#4410)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.13...v4.4.15)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-10 11:25:09 +10:00
I Made Budi Surya Darma
236754c4d2
feature(slate): Add isElementType utility function to Element Interface (#4349) 2021-08-09 10:55:45 -04:00
Pulkit Singh
706f2fc072
Update 01-interfaces.md (#4424)
* Update 01-interfaces.md

* Update docs/concepts/01-interfaces.md

* Update docs/concepts/01-interfaces.md

* Update docs/concepts/01-interfaces.md

* Update docs/concepts/01-interfaces.md

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-08 14:48:16 -07:00
Trang Le
ba8e5d8bc2
feat(docs): mention third parameter to toSlateRange method in the docs (#4416)
* Add third parameter to `toSlateRange` method

The `toSlateRange` method accepts an optional third parameter that is an object with property `exactMatch` and value is a boolean.

Example of this implementation can be found at the `Editable` component of `slate-react`, inside the custom `onDOMSelectionChange`.

* toSlateRange third param is optional

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

No changeset as it's a doc update.
2021-08-08 10:12:02 -07:00
Anish Aggarwal
e65eeb2939
added cypress tests (#4420)
* created editable-voids cypress test

* created markdown-preview cypress test

* created images cypress test

* created huge-document cypress test

* added hovering-toolbar, and forced-layout cypress tests

* added embeds cypress test

No changeset as it's adding tests for the examples.
2021-08-07 08:28:22 -07:00
Devesh Kumar
40a12d7511
small UI fix for the search icon and placeholder of the search higlighting (#4422)
no changeset as it doesn't change a package, just an example.
2021-08-07 08:20:07 -07:00
Ulion
ca9e2147c1
Support custom scrollIntoView from user side. (#4037)
simplify scroll into view call
2021-08-07 06:12:07 -07:00
Dylan Schiemann
e4e27575a0
prevent code highlighting test failure due to timeout (#4423) 2021-08-07 05:46:36 -07:00
Bryan Haakman
1f3a489afd
Fix useTimeout type to use browser type instead of nodejs type (#4419) 2021-08-06 15:30:48 -07:00
Marco Wettstein
0765766db3
docs: update link for react-page (former ORY Editor) (#3783)
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-06 09:18:43 -07:00
Dylan Schiemann
e0776c5c92
Allow setFragmentData without clipboardData object (#4333)
* allow setFragmentData to be used without a copy/paste or DnD data structure

* Add changeset

* return data for use outside of setFragmentData call
2021-08-06 07:43:42 -07:00
Dylan Schiemann
f0721ac42a
Update resources.md (#4418)
fix typo
2021-08-06 06:30:09 -07:00
Ulion
6c84422721
Fix ios chrome ime double input issue. (#4049)
* Fix ios chrome ime double input issue.

* add changeset

* pretty fix.

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

Thanks @ulion!
2021-08-05 20:58:46 -07:00
Dylan Schiemann
2614dc3c46
Update resources.md (#4414)
* Update resources.md

Add additional Slate resources

* Update resources.md

remove extra blank line
2021-08-05 14:33:40 -07:00
Sihong
4b373dc290
fix: hide placeholder when composing (#4352) 2021-08-05 11:05:42 -07:00
gyh9457
bde6e80476
fix(slate-react): use Text.equals to compare leaf (#4175)
* fix(slate-react): use Text.equals to compare leaf

* refactor(slate-react): simplify MenoizedLeaf logic

* Create breezy-lizards-travel.md

* Update packages/slate-react/src/components/leaf.tsx

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-05 10:42:41 -07:00
liangxiwei
13b3f9c783
Do not remove empty node in merge operation if it is first children i… (#4287)
* Do not remove empty node in merge operation if it is first children in parent(#4228)

* Create merge-nodes-issue

* fix typo in changeset

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-05 10:38:31 -07:00
Jake Donham
0188980796
fix bug: decorate is not called for immediate children of editor (#4394)
* fix bug: decorate is not called for immediate children of editor

* short-circuit return instead of else in Child

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>

* oops missing brace

* changeset

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>
2021-08-05 13:22:48 -04:00
Andrew Herron
0214b63077
Skip wrapping nodes when the only match is an editor (#4253)
* Skip wrapping nodes when the only match is an editor

* Check for empty path instead of using isEditor
2021-08-05 10:12:53 -07:00
Luke Murray
e6faf8e08d
add test case to cover issue from #4103 (#4292)
Landing this without a changeset as it's simply a test to cover a previously accepted fix.
2021-08-05 09:54:41 -07:00
Samarjeet
8def57665c
cypress: shadow-dom example test (#4413) 2021-08-05 12:08:37 -04:00
ilovecommits
81d62e129d
Remove unused useEffect import (#4406)
It's imported, but not actually being used.
2021-08-04 22:02:14 -07:00
Dylan Schiemann
4d133e02fc
Fix broken plugins link in Editor documentation (#4335) 2021-08-04 21:59:10 -07:00
Thomas
531707e746
Clean up imports (#4319) 2021-08-04 21:56:45 -07:00
Chase Adams
5169cf5ddb
fix sentence order in doc (#4363) 2021-08-04 21:55:37 -07:00
pubuzhixing8
8860c91300
feat(docs): add another member for slate (#4393) 2021-08-04 21:54:06 -07:00