// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly. import { registerTableHandleRowPositionerElement, type TableHandleRowPositionerElement, type TableHandleRowPositionerProps as TableHandleRowPositionerElementProps } from "@prosekit/web/table-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 TableHandleRowPositioner} Solid component. */ export interface TableHandleRowPositionerProps { /** * The placement of the popover, relative to the hovered table cell. * * @default "left" */ placement?: TableHandleRowPositionerElementProps['placement']; /** * The strategy to use for positioning * * @default "absolute" */ strategy?: TableHandleRowPositionerElementProps['strategy']; /** * Options to activate auto-update listeners * * @see https://floating-ui.com/docs/autoUpdate * * @default true */ autoUpdate?: TableHandleRowPositionerElementProps['autoUpdate']; /** * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) * to place the floating element on top of other page content. * * @default false */ hoist?: TableHandleRowPositionerElementProps['hoist']; /** * @default 0 * @hidden */ offset?: TableHandleRowPositionerElementProps['offset']; /** * @default false * @hidden */ flip?: TableHandleRowPositionerElementProps['flip']; /** * @default false * @hidden */ shift?: TableHandleRowPositionerElementProps['shift']; /** * Whether the floating element can overlap the reference element to keep it * in view. * * @default false */ overlap?: TableHandleRowPositionerElementProps['overlap']; /** * Whether to constrain the floating element's width and height to not exceed * the viewport. * * @default false */ fitViewport?: TableHandleRowPositionerElementProps['fitViewport']; /** * Whether to constrain the floating element's width so that it matches the * reference element. * * @default false */ sameWidth?: TableHandleRowPositionerElementProps['sameWidth']; /** * Whether to constrain the floating element's height so that it matches the * reference element. * * @default false */ sameHeight?: TableHandleRowPositionerElementProps['sameHeight']; /** * Whether to improve positioning for inline reference elements that span over * multiple lines. * * @default false */ inline?: TableHandleRowPositionerElementProps['inline']; /** * @default true * @hidden */ hide?: TableHandleRowPositionerElementProps['hide']; /** * Describes the clipping element(s) or area that overflow will be checked relative to. * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information. * * @default 'clippingAncestors' */ boundary?: TableHandleRowPositionerElementProps['boundary']; /** * Describes the root boundary that the element will be checked for overflow relative to. * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information. * * @default 'viewport' */ rootBoundary?: TableHandleRowPositionerElementProps['rootBoundary']; /** * Describes the virtual padding around the boundary to check for overflow. * Please see https://floating-ui.com/docs/detectoverflow#padding for more information. * * @default 4 */ overflowPadding?: TableHandleRowPositionerElementProps['overflowPadding']; /** * The element that will be used to check for overflow. Please see * https://floating-ui.com/docs/detectoverflow#elementcontext for more * information. * * @default 'floating' */ elementContext?: TableHandleRowPositionerElementProps['elementContext']; /** * Whether to check the alternate elementContext's boundary. Please see * https://floating-ui.com/docs/detectoverflow#altboundary for more * information. * * @default false */ altBoundary?: TableHandleRowPositionerElementProps['altBoundary']; /** * The ProseKit editor instance. * * @default null * @hidden */ editor?: TableHandleRowPositionerElementProps['editor']; } /** A Solid component that renders an `prosekit-table-handle-row-positioner` custom element. */ export const TableHandleRowPositioner: Component> = (props): any => { registerTableHandleRowPositionerElement() const [getElement, setElement] = createSignal(null) const [ elementProps, restProps ] = splitProps(props, ["altBoundary","autoUpdate","boundary","editor","elementContext","fitViewport","flip","hide","hoist","inline","offset","overflowPadding","overlap","placement","rootBoundary","sameHeight","sameWidth","shift","strategy"]) const p3Fallback = useEditorContext(); createEffect(() => { const element = getElement() if (!element) return Object.assign(element, { altBoundary: elementProps.altBoundary, autoUpdate: elementProps.autoUpdate, boundary: elementProps.boundary, editor: elementProps.editor ?? p3Fallback, elementContext: elementProps.elementContext, fitViewport: elementProps.fitViewport, flip: elementProps.flip, hide: elementProps.hide, hoist: elementProps.hoist, inline: elementProps.inline, offset: elementProps.offset, overflowPadding: elementProps.overflowPadding, overlap: elementProps.overlap, placement: elementProps.placement, rootBoundary: elementProps.rootBoundary, sameHeight: elementProps.sameHeight, sameWidth: elementProps.sameWidth, shift: elementProps.shift, strategy: elementProps.strategy }) }) return () => h( 'prosekit-table-handle-row-positioner', mergeProps(restProps, { ref: (el: TableHandleRowPositionerElement | null ) => { setElement(el) }, }), ) };