Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(docs-ui): adjust grid layout widths for menu items and add DocPasteOptionsIcon (#7865)

白熱4577604f5d64
diff --git a/packages/docs-ui/src/menu/schema.ts b/packages/docs-ui/src/menu/schema.ts
index 0137df6da0..0f5a62d46c 100644
--- a/packages/docs-ui/src/menu/schema.ts
+++ b/packages/docs-ui/src/menu/schema.ts
@@ -252,52 +252,52 @@ export const menuSchema: MenuSchemaType = {
[RibbonStartGroup.FORMAT]: {
[SetInlineFormatBoldCommand.id]: {
order: 0,
- gridLayout: { row: 2, column: 1 },
+ gridLayout: { row: 2, column: 1, width: 44 },
menuItemFactory: BoldMenuItemFactory,
},
[SetInlineFormatItalicCommand.id]: {
order: 1,
- gridLayout: { row: 2, column: 2 },
+ gridLayout: { row: 2, column: 2, width: 44 },
menuItemFactory: ItalicMenuItemFactory,
},
[SetInlineFormatUnderlineCommand.id]: {
order: 2,
- gridLayout: { row: 2, column: 3 },
+ gridLayout: { row: 2, column: 3, width: 44 },
menuItemFactory: UnderlineMenuItemFactory,
},
[SetInlineFormatStrikethroughCommand.id]: {
order: 3,
- gridLayout: { row: 2, column: 4 },
+ gridLayout: { row: 2, column: 4, width: 44 },
menuItemFactory: StrikeThroughMenuItemFactory,
},
[SetInlineFormatSubscriptCommand.id]: {
order: 4,
- gridLayout: { row: 2, column: 5 },
+ gridLayout: { row: 2, column: 6, width: 44 },
menuItemFactory: SubscriptMenuItemFactory,
},
[SetInlineFormatSuperscriptCommand.id]: {
order: 5,
- gridLayout: { row: 2, column: 6 },
+ gridLayout: { row: 2, column: 5, width: 44 },
menuItemFactory: SuperscriptMenuItemFactory,
},
[SetParagraphNamedStyleCommand.id]: {
order: 5.5,
- gridLayout: { row: 1, column: 1, columnSpan: 2, width: 100 },
+ gridLayout: { row: 1, column: 1, columnSpan: 2, width: 96 },
menuItemFactory: HeadingSelectorMenuItemFactory,
},
[SetInlineFormatFontSizeCommand.id]: {
order: 6,
- gridLayout: { row: 1, column: 7, width: 64 },
+ gridLayout: { row: 1, column: 7, columnSpan: 2, width: 96 },
menuItemFactory: FontSizeSelectorMenuItemFactory,
},
[SetInlineFormatFontFamilyCommand.id]: {
order: 7,
- gridLayout: { row: 1, column: 3, columnSpan: 4, width: 160 },
+ gridLayout: { row: 1, column: 3, columnSpan: 4, width: 200 },
menuItemFactory: FontFamilySelectorMenuItemFactory,
},
[SetInlineFormatTextColorCommand.id]: {
order: 8,
- gridLayout: { row: 2, column: 7 },
+ gridLayout: { row: 2, column: 8, width: 44 },
menuItemFactory: TextColorSelectorMenuItemFactory,
[ResetInlineFormatTextColorCommand.id]: {
order: 0,
@@ -306,7 +306,7 @@ export const menuSchema: MenuSchemaType = {
},
[SetInlineFormatTextBackgroundColorCommand.id]: {
order: 9,
- gridLayout: { row: 2, column: 8 },
+ gridLayout: { row: 2, column: 7, width: 44 },
menuItemFactory: BackgroundColorSelectorMenuItemFactory,
[ResetInlineFormatTextBackgroundColorCommand.id]: {
order: 0,
diff --git a/packages/sheets-ui/src/controllers/sheets-ui-icons.ts b/packages/sheets-ui/src/controllers/sheets-ui-icons.ts
index 12c27e1177..f7f92ae2bf 100644
--- a/packages/sheets-ui/src/controllers/sheets-ui-icons.ts
+++ b/packages/sheets-ui/src/controllers/sheets-ui-icons.ts
@@ -41,6 +41,7 @@ import {
DeleteColumnDoubleIcon,
DeleteIcon,
DeleteRowDoubleIcon,
+ DocPasteOptionsIcon,
DownBorderDoubleIcon,
DownloadImageIcon,
EyeIcon,
@@ -128,6 +129,7 @@ export const sheetsUIIcons: IconMap = {
DeleteColumnDoubleIcon,
DeleteIcon,
DeleteRowDoubleIcon,
+ DocPasteOptionsIcon,
DownBorderDoubleIcon,
DownloadImageIcon,
EyeIcon,
diff --git a/packages/sheets-ui/src/menu/menu.ts b/packages/sheets-ui/src/menu/menu.ts
index a42d4c41f1..d3a0e4fbdc 100644
--- a/packages/sheets-ui/src/menu/menu.ts
+++ b/packages/sheets-ui/src/menu/menu.ts
@@ -1068,6 +1068,7 @@ export function PasteRibbonMenuItemFactory(accessor: IAccessor): IMenuSelectorIt
return {
...PasteSpacialMenuItemFactory(accessor),
id: PASTE_RIBBON_MENU_ID,
+ icon: 'DocPasteOptionsIcon',
title: 'sheets-ui.rightClick.paste',
hidden$: combineLatest([
getObservableWithExclusiveRange$(accessor, getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET)),