diff --git a/site/examples/check-lists.tsx b/site/examples/check-lists.tsx index 359e305ff..9cf074ce7 100644 --- a/site/examples/check-lists.tsx +++ b/site/examples/check-lists.tsx @@ -19,7 +19,7 @@ import { import { css } from 'emotion' import { withHistory } from 'slate-history' -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/code-highlighting.tsx b/site/examples/code-highlighting.tsx index 6899fd039..b2ad12a83 100644 --- a/site/examples/code-highlighting.tsx +++ b/site/examples/code-highlighting.tsx @@ -142,7 +142,7 @@ const Leaf = ({ attributes, children, leaf }) => { ) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/editable-voids.tsx b/site/examples/editable-voids.tsx index bcbda8c90..45031e336 100644 --- a/site/examples/editable-voids.tsx +++ b/site/examples/editable-voids.tsx @@ -1,10 +1,5 @@ import React, { useState, useMemo } from 'react' -import { - Transforms, - createEditor, - Element as SlateElement, - Descendant, -} from 'slate' +import { Transforms, createEditor, Descendant } from 'slate' import { Slate, Editable, useSlateStatic, withReact } from 'slate-react' import { withHistory } from 'slate-history' import { css } from 'emotion' @@ -136,7 +131,7 @@ const InsertEditableVoidButton = () => { ) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/embeds.tsx b/site/examples/embeds.tsx index c8a13e2a9..561aa9c1a 100644 --- a/site/examples/embeds.tsx +++ b/site/examples/embeds.tsx @@ -2,7 +2,6 @@ import React, { useState, useMemo } from 'react' import { Transforms, createEditor, - Node, Element as SlateElement, Descendant, } from 'slate' @@ -12,8 +11,6 @@ import { withReact, useSlateStatic, ReactEditor, - useFocused, - useSelected, } from 'slate-react' const EmbedsExample = () => { @@ -104,7 +101,7 @@ const UrlInput = ({ url, onChange }) => { ) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/forced-layout.tsx b/site/examples/forced-layout.tsx index 3905a5ed7..7d2c5f6a4 100644 --- a/site/examples/forced-layout.tsx +++ b/site/examples/forced-layout.tsx @@ -75,7 +75,7 @@ const Element = ({ attributes, children, element }) => { } } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'title', children: [{ text: 'Enforce Your Layout!' }], diff --git a/site/examples/hovering-toolbar.tsx b/site/examples/hovering-toolbar.tsx index 5de0dc68b..23258923d 100644 --- a/site/examples/hovering-toolbar.tsx +++ b/site/examples/hovering-toolbar.tsx @@ -147,7 +147,7 @@ const FormatButton = ({ format, icon }) => { ) } -const initialValue: Element[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/huge-document.tsx b/site/examples/huge-document.tsx index 6c5986053..20746e999 100644 --- a/site/examples/huge-document.tsx +++ b/site/examples/huge-document.tsx @@ -1,11 +1,11 @@ import React, { useState, useMemo, useCallback } from 'react' import faker from 'faker' -import { Element as SlateElement, Node, createEditor, Descendant } from 'slate' +import { createEditor, Descendant } from 'slate' import { Slate, Editable, withReact } from 'slate-react' const HEADINGS = 100 const PARAGRAPHS = 7 -const initialValue: SlateElement[] = [] +const initialValue: Descendant[] = [] for (let h = 0; h < HEADINGS; h++) { initialValue.push({ diff --git a/site/examples/iframe.tsx b/site/examples/iframe.tsx index 860c847b6..e6cd922b4 100644 --- a/site/examples/iframe.tsx +++ b/site/examples/iframe.tsx @@ -2,12 +2,7 @@ import React, { useCallback, useMemo, useState } from 'react' import { createPortal } from 'react-dom' import isHotkey from 'is-hotkey' import { Editable, withReact, useSlate, Slate, ReactEditor } from 'slate-react' -import { - Editor, - Element as SlateElement, - createEditor, - Descendant, -} from 'slate' +import { Editor, createEditor, Descendant } from 'slate' import { withHistory } from 'slate-history' import { Button, Icon, Toolbar } from '../components' @@ -122,7 +117,7 @@ const IFrame = ({ children, ...props }) => { ) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/images.tsx b/site/examples/images.tsx index 335013531..5416303e5 100644 --- a/site/examples/images.tsx +++ b/site/examples/images.tsx @@ -1,12 +1,7 @@ import React, { useState, useMemo } from 'react' import imageExtensions from 'image-extensions' import isUrl from 'is-url' -import { - Transforms, - createEditor, - Element as SlateElement, - Descendant, -} from 'slate' +import { Transforms, createEditor, Descendant } from 'slate' import { Slate, Editable, @@ -137,7 +132,7 @@ const isImageUrl = url => { return imageExtensions.includes(ext) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/links.tsx b/site/examples/links.tsx index 66e1e14ff..ffb271dea 100644 --- a/site/examples/links.tsx +++ b/site/examples/links.tsx @@ -134,7 +134,7 @@ const LinkButton = () => { ) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/markdown-preview.tsx b/site/examples/markdown-preview.tsx index 280cbaab7..0d6703f8f 100644 --- a/site/examples/markdown-preview.tsx +++ b/site/examples/markdown-preview.tsx @@ -109,7 +109,7 @@ const Leaf = ({ attributes, children, leaf }) => { ) } -const initialValue: Element[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/markdown-shortcuts.tsx b/site/examples/markdown-shortcuts.tsx index e4422644e..ffecace2b 100644 --- a/site/examples/markdown-shortcuts.tsx +++ b/site/examples/markdown-shortcuts.tsx @@ -160,7 +160,7 @@ const Element = ({ attributes, children, element }) => { } } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/mentions.tsx b/site/examples/mentions.tsx index c36ef8b6a..dac03f7b2 100644 --- a/site/examples/mentions.tsx +++ b/site/examples/mentions.tsx @@ -1,12 +1,5 @@ import React, { useMemo, useCallback, useRef, useEffect, useState } from 'react' -import { - Editor, - Transforms, - Range, - createEditor, - Element as SlateElement, - Descendant, -} from 'slate' +import { Editor, Transforms, Range, createEditor, Descendant } from 'slate' import { withHistory } from 'slate-history' import { Slate, @@ -205,7 +198,7 @@ const Mention = ({ attributes, children, element }) => { ) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/paste-html.tsx b/site/examples/paste-html.tsx index fd2dc3d0b..9f6007139 100644 --- a/site/examples/paste-html.tsx +++ b/site/examples/paste-html.tsx @@ -1,11 +1,6 @@ import React, { useState, useCallback, useMemo } from 'react' import { jsx } from 'slate-hyperscript' -import { - Transforms, - createEditor, - Element as SlateElement, - Descendant, -} from 'slate' +import { Transforms, createEditor, Descendant } from 'slate' import { withHistory } from 'slate-history' import { css } from 'emotion' import { @@ -216,7 +211,7 @@ const Leaf = ({ attributes, children, leaf }) => { return {children} } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/plaintext.tsx b/site/examples/plaintext.tsx index a96e177e3..9ba20dda7 100644 --- a/site/examples/plaintext.tsx +++ b/site/examples/plaintext.tsx @@ -1,5 +1,5 @@ import React, { useState, useMemo } from 'react' -import { createEditor, Element, Descendant } from 'slate' +import { createEditor, Descendant } from 'slate' import { Slate, Editable, withReact } from 'slate-react' import { withHistory } from 'slate-history' @@ -13,7 +13,7 @@ const PlainTextExample = () => { ) } -const initialValue: Element[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/read-only.tsx b/site/examples/read-only.tsx index 75a02a4a6..41aaff524 100644 --- a/site/examples/read-only.tsx +++ b/site/examples/read-only.tsx @@ -12,7 +12,7 @@ const ReadOnlyExample = () => { ) } -const initialValue: Element[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [ diff --git a/site/examples/richtext.tsx b/site/examples/richtext.tsx index 294c904c9..243a182b0 100644 --- a/site/examples/richtext.tsx +++ b/site/examples/richtext.tsx @@ -175,7 +175,7 @@ const MarkButton = ({ format, icon }) => { ) } -const initialValue: SlateElement[] = [ +const initialValue: Descendant[] = [ { type: 'paragraph', children: [