Add EmbeddedBlobComponent for rendering embedded snippets
What does this MR do and why?
Adds the EmbeddedBlobComponent, used in the follow-up MR Embed blob permalinks in GLFM behind FF (!246838) to render the embedded blobs!
This MR doesn't introduce the consumer, just the component itself. The ViewComponent idea comes from Draft: Allow embedding of code in Markdown (!96310 - closed), itself an old draft solution to the work item that didn't land.
We're re-using the file-content class (since we're showing file content, and it gives us exactly the right styles). There's an optimisation in app/assets/javascripts/behaviors/copy_code.js which uses the presence of a .file-content.code in the page as a signal to not add any code copy buttons which we have to make a little more precise as of this MR.
MR stack
For Render blob line of code in GFM (#300855):
- Add suppress_line_ids to Gitlab::Highlight (!246835)
- Add EmbeddedBlobComponent for rendering embedde... (!246837)
⬅️ you are here - Embed blob permalinks in GLFM behind FF (!246838)
- Add blob snippet embed support to content editor (!246840)
Screenshots or screen recordings
See Embed blob permalinks in GLFM behind FF (!246838), which exposes this component.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.