Introduce the Source Editor Toolbar
What does this MR do and why?
This is the first out of two MRs introducing the toolbar into Source Editor:
- Introduce the Toolbar and its integration into the raw Source Editor (this MR)
- Introduce the UI components for the toolbar and connect those to the editor
This MR does the following:
-
Introduces the
Toolbar
class with onlyadd
andremove
methods for now. The instance of theToolbar
class will be created with theitems
property containing two groups of the toolbar items:left
andright
(the strings are defined as constants). The toolbar instance also creates an event emitter (in Monaco way) that gets fired every time we update the toolbar items. - Introduces the very basic
Button
class to be shared among the toolbar items. Later we might need to add other types like toggle to be addable to the toolbar - We connect the toolbar and Source Editor via the
.toolbar
property on the instance for it to be available anywhere the instance is available - We make use of the toolbar in the markdown live preview extension by adding the live preview button
How to set up and validate locally
Unfortunately, without the second part (UI integration) there is no easy way to check that a button is added to the toolbar, but the tests in this MR provide extensive coverage for different modules and scenarios.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #280800 (closed)
Edited by Denys Mishunov