import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2022-2026 GoodData Corporation
import { RICH_TEXT_WIDGET_SIZE_INFO_DEFAULT, RICH_TEXT_WIDGET_SIZE_INFO_NEW_DEFAULT, } from "@gooddata/sdk-ui-ext";
import { useWidgetSelection } from "../../../model/react/useWidgetSelection.js";
import { DraggableCreatePanelItem } from "../DraggableCreatePanelItem.js";
const getDragItem = () => {
    return {
        type: "richTextListItem",
        size: {
            gridHeight: RICH_TEXT_WIDGET_SIZE_INFO_DEFAULT.height.default,
            gridWidth: RICH_TEXT_WIDGET_SIZE_INFO_NEW_DEFAULT.width.default,
        },
    };
};
/**
 * @internal
 */
export function DraggableRichTextCreatePanelItem({ CreatePanelItemComponent, WrapCreatePanelItemWithDragComponent, }) {
    const dragItem = getDragItem();
    const { deselectWidgets } = useWidgetSelection();
    return (_jsx(DraggableCreatePanelItem, { Component: CreatePanelItemComponent, WrapCreatePanelItemWithDragComponent: WrapCreatePanelItemWithDragComponent, dragItem: dragItem, hideDefaultPreview: false, onDragStart: () => deselectWidgets() }));
}
