import { css } from '@emotion/css'
import React, { useCallback, useMemo } from 'react'
import {
Editor,
Point,
Range,
Element as SlateElement,
Transforms,
createEditor,
} from 'slate'
import { withHistory } from 'slate-history'
import {
Editable,
ReactEditor,
Slate,
useReadOnly,
useSlateStatic,
withReact,
} from 'slate-react'
const initialValue = [
{
type: 'paragraph',
children: [
{
text: 'With Slate you can build complex block types that have their own embedded content and behaviors, like rendering checkboxes inside check list items!',
},
],
},
{
type: 'check-list-item',
checked: true,
children: [{ text: 'Slide to the left.' }],
},
{
type: 'check-list-item',
checked: true,
children: [{ text: 'Slide to the right.' }],
},
{
type: 'check-list-item',
checked: false,
children: [{ text: 'Criss-cross.' }],
},
{
type: 'check-list-item',
checked: true,
children: [{ text: 'Criss-cross!' }],
},
{
type: 'check-list-item',
checked: false,
children: [{ text: 'Cha cha real smooth…' }],
},
{
type: 'check-list-item',
checked: false,
children: [{ text: "Let's go to work!" }],
},
{
type: 'paragraph',
children: [{ text: 'Try it out for yourself!' }],
},
]
const CheckListsExample = () => {
const renderElement = useCallback(props =>
{children}
} } const CheckListItemElement = ({ attributes, children, element }) => { const { checked } = element const editor = useSlateStatic() const readOnly = useReadOnly() return (