import type { Editor } from '@prosekit/core' import { createComponent, type Component, type ParentProps } from 'solid-js' import { EditorContextProvider } from '../contexts/editor-context.ts' import { ViewRenderer } from './view-renderer.ts' export type ProseKitProps = ParentProps<{ editor: Editor }> /** * The root component for a ProseKit editor. */ export const ProseKit: Component = (props) => { return createComponent(EditorContextProvider, { get value() { return props.editor }, get children() { return createComponent(ViewRenderer, { get editor() { return props.editor }, get children() { return props.children }, }) }, }) }