/**
 * Build the `DragObject` for moving one or more components, mirroring the shape
 * produced by the frame-menu native drag. Returns null when the component has no
 * datasource (and therefore cannot be dragged). `selectedIds` is the set of
 * component ids to move (the grabbed component, or the whole selection when it
 * is part of a multi-selection).
 */
export function buildComponentDragObject(component, selectedIds, page) {
    if (!component.datasourceItem)
        return null;
    const language = page.item.language;
    const version = page.item.version;
    const components = selectedIds.map((id) => ({ id, language, version }));
    return {
        type: "component",
        typeId: component.typeId,
        templateId: component.datasourceItem.templateId,
        name: component.name,
        components,
    };
}
//# sourceMappingURL=componentDragObject.js.map