import React, { 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: React.LegacyRef | undefined ) => ( ) ); export const EditorValue = React.forwardRef( ( { className, value, ...props }: PropsWithChildren< { value: any; } & BaseProps >, ref: React.LegacyRef | undefined ) => { const textLines = value.document.nodes .map((node: any) => node.text) .toArray() .join('\n'); return (
Slate's value as text
{textLines}
); } ); export const Icon = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: React.LegacyRef | undefined ) => ( ) ); export const Instruction = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: React.LegacyRef | undefined ) => (
) ); export const Menu = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: React.LegacyRef | undefined ) => (
* { display: inline-block; } & > * + * { margin-left: 15px; } ` )} /> ) ); export const Portal = ({ children }: any) => { // @ts-ignore return typeof document === 'object' ? // @ts-ignore ReactDOM.createPortal(children, document.body) : null; }; export const Toolbar = React.forwardRef( ( { className, ...props }: PropsWithChildren, ref: React.Ref | undefined ) => ( ) );