mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-16 12:14:14 +02:00
fix: fix 404 status of iframe example page (#4092)
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useCallback, useMemo, useState } from 'react'
|
|||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
import isHotkey from 'is-hotkey'
|
import isHotkey from 'is-hotkey'
|
||||||
import { Editable, withReact, useSlate, Slate, ReactEditor } from 'slate-react'
|
import { Editable, withReact, useSlate, Slate, ReactEditor } from 'slate-react'
|
||||||
import { Editor, createEditor } from 'slate'
|
import { Editor, createEditor, Node } from 'slate'
|
||||||
import { withHistory } from 'slate-history'
|
import { withHistory } from 'slate-history'
|
||||||
|
|
||||||
import { Button, Icon, Toolbar } from '../components'
|
import { Button, Icon, Toolbar } from '../components'
|
||||||
@@ -15,7 +15,7 @@ const HOTKEYS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const IFrameExample = () => {
|
const IFrameExample = () => {
|
||||||
const [value, setValue] = useState(initialValue)
|
const [value, setValue] = useState<Node[]>(initialValue)
|
||||||
const renderElement = useCallback(
|
const renderElement = useCallback(
|
||||||
({ attributes, children }) => <p {...attributes}>{children}</p>,
|
({ attributes, children }) => <p {...attributes}>{children}</p>,
|
||||||
[]
|
[]
|
||||||
@@ -42,7 +42,7 @@ const IFrameExample = () => {
|
|||||||
autoFocus
|
autoFocus
|
||||||
onKeyDown={event => {
|
onKeyDown={event => {
|
||||||
for (const hotkey in HOTKEYS) {
|
for (const hotkey in HOTKEYS) {
|
||||||
if (isHotkey(hotkey, event)) {
|
if (isHotkey(hotkey, event as any)) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
const mark = HOTKEYS[hotkey]
|
const mark = HOTKEYS[hotkey]
|
||||||
toggleMark(editor, mark)
|
toggleMark(editor, mark)
|
Reference in New Issue
Block a user