Closed Delan1026 closed 5 days ago
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Origin Title: [Bug] The docs ui plugin provides a layout.toolbarConfig to control the display of toolbars, but in reality, this feature has not been implemented
Title: [Bug] The docs ui plugin provides a layout.toolbarConfig to control the display of toolbars, but in reality, this feature has not been implemented
0.1.16
The docs ui plugin provides a layout. toolbarConfiguration configuration to control the display of toolbars, but in reality, this feature has not been implemented
packages/docs-ui/src/controllers/doc-ui.controller.ts
private _initMenus(): void {
// 实际没有用到layout.toolbarConfig配置
const { menu = {} } = this._config;
// init menus
(
[
BoldMenuItemFactory,
ItalicMenuItemFactory,
UnderlineMenuItemFactory,
StrikeThroughMenuItemFactory,
SubscriptMenuItemFactory,
SuperscriptMenuItemFactory,
FontSizeSelectorMenuItemFactory,
FontFamilySelectorMenuItemFactory,
TextColorSelectorMenuItemFactory,
AlignLeftMenuItemFactory,
AlignCenterMenuItemFactory,
AlignRightMenuItemFactory,
AlignJustifyMenuItemFactory,
OrderListMenuItemFactory,
BulletListMenuItemFactory,
ResetBackgroundColorMenuItemFactory,
BackgroundColorSelectorMenuItemFactory,
] as IMenuItemFactory[]
).forEach((factory) => {
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(factory), menu));
});
}
I want to hide the font and fontSize selections, pass toolbarConfig as below:
univer.registerPlugin(UniverDocsUIPlugin, {
layout: {
toolbarConfig: {
font: false,
fontSize: false
}
}
});
Although I have set the font and fontSize parameters, the 2 menus are not hidden
No response
This is not a bug.
If you need to customize the UI, please refer to https://univer.ai/guides/sheet/customization/ui for guidance on how to customize menu items and hide existing menu items through configuration.
Before you submit this issue, have you checked the following
Affected packages and versions
0.1.16
Reproduction link
The docs ui plugin provides a layout. toolbarConfiguration configuration to control the display of toolbars, but in reality, this feature has not been implemented
packages/docs-ui/src/controllers/doc-ui.controller.ts
Expected behavior
I want to hide the font and fontSize selections, pass toolbarConfig as below:
Actual behavior
Although I have set the font and fontSize parameters, the 2 menus are not hidden
System information
No response