feat(CustomizationService):Add a customization service (#2984)
* feat(customization):Add a customization service Update UICustomizationService to v3-stable. Also, adds an example customization for tab colors * moved the customization service to ui category
This commit is contained in:
1 parent
32bb7e4c1e
commit
daa56a8449
33 files changed
+1031
-67
No files matched your search
+22
-3
@@ -52,11 +52,19 @@ export default class ToolBarService {
|
||||
this.buttons = {};
|
||||
}
|
||||
|
||||
onModeEnter() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} interaction
|
||||
* @param {*} interaction - can be undefined to run nothing
|
||||
* @param {*} options is an optional set of extra commandOptions
|
||||
* used for calling the specified interaction. That is, the command is
|
||||
* called with {...commandOptions,...options}
|
||||
*/
|
||||
recordInteraction(interaction) {
|
||||
recordInteraction(interaction, options) {
|
||||
if (!interaction) return;
|
||||
const commandsManager = this._commandsManager;
|
||||
const { groupId, itemId, interactionType, commands } = interaction;
|
||||
|
||||
@@ -64,7 +72,14 @@ export default class ToolBarService {
|
||||
case 'action': {
|
||||
commands.forEach(({ commandName, commandOptions, context }) => {
|
||||
if (commandName) {
|
||||
commandsManager.runCommand(commandName, commandOptions, context);
|
||||
commandsManager.runCommand(
|
||||
commandName,
|
||||
{
|
||||
...commandOptions,
|
||||
...options,
|
||||
},
|
||||
context
|
||||
);
|
||||
}
|
||||
});
|
||||
break;
|
||||
@@ -171,6 +186,10 @@ export default class ToolBarService {
|
||||
}
|
||||
}
|
||||
|
||||
getButton(id) {
|
||||
return this.buttons[id];
|
||||
}
|
||||
|
||||
setButtons(buttons) {
|
||||
this.buttons = buttons;
|
||||
this._broadcastEvent(this.EVENTS.TOOL_BAR_MODIFIED, {
|
||||
File renamed without changes.
Reference in new issue
Block a user