// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly. import { registerBlockHandleDraggableElement, type BlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from "@prosekit/web/block-handle"; import { createEffect, createSignal, mergeProps, splitProps } from "solid-js"; import type { Component, JSX } from "solid-js"; import h from "solid-js/h"; import { useEditorContext } from "../../contexts/editor-context.ts"; /** Props for the {@link BlockHandleDraggable} Solid component. */ export interface BlockHandleDraggableProps { /** * The ProseKit editor instance. * * @default null * @hidden */ editor?: BlockHandleDraggableElementProps['editor']; } /** A Solid component that renders an `prosekit-block-handle-draggable` custom element. */ export const BlockHandleDraggable: Component> = (props): any => { registerBlockHandleDraggableElement() const [getElement, setElement] = createSignal(null) const [ elementProps, restProps ] = splitProps(props, ["editor"]) const p0Fallback = useEditorContext(); createEffect(() => { const element = getElement() if (!element) return Object.assign(element, { editor: elementProps.editor ?? p0Fallback }) }) return () => h( 'prosekit-block-handle-draggable', mergeProps(restProps, { ref: (el: BlockHandleDraggableElement | null ) => { setElement(el) }, }), ) };