We should add a context menu to the part insertion menu (defined in insert-menu.tsx). This can probably follow the same pattern we have with MenuButton in card-components.tsx today. We can also probably lift the MenuButton component out into app-component-menu.tsx and then add it to the insert menu.
The existing item menu contents are defined in insertable-card.tsx. We don't need QuickInsert options in the admin menu, so you can probably add an inInsertMenu option to InsertableMenuItemsProps and use that to decide whether to show QuickInsertOptions.
interface InsertableMenuItemsProps {
favorite: Favorite | undefined;
insertable: InsertableOut;
}
export function InsertableMenuItems(
props: InsertableMenuItemsProps
): ReactNode {
const { favorite, insertable } = props;
return (
<>
<QuickInsertItems
insertable={insertable}
isFavorite={favorite !== undefined}
/>
<Menu.Divider />
<FavoriteInsertableItem
favorite={favorite}
insertable={insertable}
/>
<Menu.Divider />
<OpenDocumentItems path={insertable.path} />
<AdminOptionsSubmenu>
<InsertableAdminContextMenu insertable={insertable} />
</AdminOptionsSubmenu>
</>
);
}
As a bonus, it would be neat if the OpenDocument/Copy URL links included the current configuration. That could probably be implemented by adding an optional Configuration prop to InsertableMenuItems and OpenDocumentItems and passing the configuration in to makeUrl (which is something it already supports).
We should add a context menu to the part insertion menu (defined in
insert-menu.tsx). This can probably follow the same pattern we have with MenuButton incard-components.tsxtoday. We can also probably lift the MenuButton component out intoapp-component-menu.tsxand then add it to the insert menu.The existing item menu contents are defined in
insertable-card.tsx. We don't need QuickInsert options in the admin menu, so you can probably add aninInsertMenuoption to InsertableMenuItemsProps and use that to decide whether to show QuickInsertOptions.As a bonus, it would be neat if the OpenDocument/Copy URL links included the current configuration. That could probably be implemented by adding an optional Configuration prop to InsertableMenuItems and OpenDocumentItems and passing the configuration in to makeUrl (which is something it already supports).