// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly. import { registerDropIndicatorElement, type DropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from "@prosekit/web/drop-indicator"; 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 DropIndicator} Solid component. */ export interface DropIndicatorProps { /** * The ProseKit editor instance. * * @default null * @hidden */ editor?: DropIndicatorElementProps['editor']; /** * The line width in pixels. * * @default 2 */ width?: DropIndicatorElementProps['width']; } /** A Solid component that renders an `prosekit-drop-indicator` custom element. */ export const DropIndicator: Component> = (props): any => { registerDropIndicatorElement() const [getElement, setElement] = createSignal(null) const [ elementProps, restProps ] = splitProps(props, ["editor","width"]) const p0Fallback = useEditorContext(); createEffect(() => { const element = getElement() if (!element) return Object.assign(element, { editor: elementProps.editor ?? p0Fallback, width: elementProps.width }) }) return () => h( 'prosekit-drop-indicator', mergeProps(restProps, { ref: (el: DropIndicatorElement | null ) => { setElement(el) }, }), ) };