import React, { Ref, PropsWithChildren } from 'react' import ReactDOM from 'react-dom' import { cx, css } from '@emotion/css' interface BaseProps { className: string [key: string]: unknown } type OrNull = T | null export const Button = React.forwardRef( ( { className, active, reversed, ...props }: PropsWithChildren< { active: boolean reversed: boolean } & BaseProps >, ref: Ref> ) => ( ) ) export const EditorValue = React.forwardRef( ( { className, value, ...props }: PropsWithChildren< { value: any } & BaseProps >, ref: Ref> ) => { const textLines = value.document.nodes .map(node => node.text) .toArray() .join('\n') return (
Slate's value as text
{textLines}
) } ) export const Icon = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: Ref> ) => ( ) ) export const Instruction = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: Ref> ) => (
) ) export const Menu = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: Ref> ) => (
* { display: inline-block; } & > * + * { margin-left: 15px; } ` )} /> ) ) export const Portal = ({ children }) => { return typeof document === 'object' ? ReactDOM.createPortal(children, document.body) : null } export const Toolbar = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: Ref> ) => ( ) )