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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(ui): prevent formula bar from displaying when header is set to false & remove unused code (#1633)
白熱e3d875ca78d3
diff --git a/docs/architecture.md b/docs/architecture.mdindex 2ee8dcc943..d9a3b800a8 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -44,7 +44,6 @@ univer.registerPlugin(UniverRenderEngine);univer.registerPlugin(UniverUI, {container: 'univer-container', // where to mount the UIheader: true,- toolbar: true,footer: true,});univer.registerPlugin(sheetsPlugin);diff --git a/examples/src/docs-uniscript/main.ts b/examples/src/docs-uniscript/main.tsindex 8e4cfbf64c..4ee2c7b715 100644--- a/examples/src/docs-uniscript/main.ts+++ b/examples/src/docs-uniscript/main.ts@@ -41,7 +41,6 @@ univer.registerPlugin(UniverFormulaEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',header: true,- toolbar: true,});univer.registerPlugin(UniverDocsPlugin, {diff --git a/examples/src/docs/main.ts b/examples/src/docs/main.tsindex e462b40e6e..599a447732 100644--- a/examples/src/docs/main.ts+++ b/examples/src/docs/main.ts@@ -50,7 +50,6 @@ univer.registerPlugin(DebuggerPlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',header: true,- toolbar: true,});univer.registerPlugin(UniverDocsPlugin, {standalone: true,diff --git a/examples/src/sheets-multi/main.tsx b/examples/src/sheets-multi/main.tsxindex a6c6f6562a..f43a202b4e 100644--- a/examples/src/sheets-multi/main.tsx+++ b/examples/src/sheets-multi/main.tsx@@ -46,7 +46,6 @@ function factory(id: string) {univer.registerPlugin(UniverUIPlugin, {container: id,header: true,- toolbar: true,footer: true,});univer.registerPlugin(UniverDocsPlugin, {diff --git a/examples/src/sheets-uniscript/main.ts b/examples/src/sheets-uniscript/main.tsindex d5c571410b..5cb02597c9 100644--- a/examples/src/sheets-uniscript/main.ts+++ b/examples/src/sheets-uniscript/main.ts@@ -43,7 +43,6 @@ univer.registerPlugin(UniverRenderEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',header: true,- toolbar: true,footer: true,});diff --git a/examples/src/sheets/main.ts b/examples/src/sheets/main.tsindex aada98fc87..aae59d51ee 100644--- a/examples/src/sheets/main.ts+++ b/examples/src/sheets/main.ts@@ -52,7 +52,6 @@ univer.registerPlugin(UniverRenderEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',header: true,- toolbar: true,footer: true,});diff --git a/packages/sheets-ui/src/basics/const/default-univer-sheet-config.ts b/packages/sheets-ui/src/basics/const/default-univer-sheet-config.tsdeleted file mode 100644index 1d6220aa70..0000000000--- a/packages/sheets-ui/src/basics/const/default-univer-sheet-config.ts+++ /dev/null@@ -1,87 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export const DefaultRightMenuConfig = {- InsertRow: true,- InsertColumn: true,- AddRowTop: false,- AddRowBottom: false,- AddColumnLeft: false,- AddColumnRight: false,- DeleteRow: true,- DeleteColumn: true,- HideRow: false,- ShowRow: false,- RowHeight: false,- HideColumn: false,- ShowColumn: false,- ColumnWidth: false,- DeleteCell: true,- ClearContent: true,- Matrix: false,-};--export const DefaultToolbarConfig = {- undo: true,- redo: true, // Undo redo- paintFormat: true, // Format brush- currencyFormat: true, // currency format- percentageFormat: true, // Percentage format- numberDecrease: true, // 'Decrease the number of decimal places'- numberIncrease: true, // 'Increase the number of decimal places- moreFormats: true, // 'More Formats'- font: true, // 'font'- fontSize: true, // 'Font size'- bold: true, // 'Bold (Ctrl+B)'- italic: true, // 'Italic (Ctrl+I)'- strikethrough: true, // 'Strikethrough (Alt+Shift+5)'- underline: true, // 'Underline (Alt+Shift+6)'- textColor: true, // 'Text color'- fillColor: true, // 'Cell color'- border: true, // 'border'- horizontalAlignMode: true, // 'Horizontal alignment'- verticalAlignMode: true, // 'Vertical alignment'- textWrapMode: true, // 'Wrap mode'- textRotateMode: true, // 'Text Rotation Mode'- mergeCell: true,-};--export const DefaultSheetContainerConfig = {- outerLeft: false,- outerRight: false,- header: true,- footer: true,- innerLeft: false,- innerRight: false,- frozenHeaderLT: false,- frozenHeaderRT: false,- frozenHeaderLM: false,- frozenContent: false,- infoBar: true,- toolbar: true,- formulaBar: true,- rightMenu: true,- countBar: true,- sheetBar: true,-};--export const DefaultSheetUIConfig = {- layout: {- sheetContainerConfig: DefaultSheetContainerConfig,- rightMenuConfig: DefaultRightMenuConfig,- toolbarConfig: DefaultToolbarConfig,- },-};diff --git a/packages/sheets-ui/src/basics/const/index.ts b/packages/sheets-ui/src/basics/const/index.tsindex 31446fc32a..1346a59a4d 100644--- a/packages/sheets-ui/src/basics/const/index.ts+++ b/packages/sheets-ui/src/basics/const/index.ts@@ -14,5 +14,4 @@* limitations under the License.*/-export * from './default-univer-sheet-config';export * from './plugin-name';diff --git a/packages/sheets-ui/src/basics/index.ts b/packages/sheets-ui/src/basics/index.tsindex 8f44670218..a0d584ae3f 100644--- a/packages/sheets-ui/src/basics/index.ts+++ b/packages/sheets-ui/src/basics/index.ts@@ -15,4 +15,3 @@*/export * from './const';-export * from './interfaces';diff --git a/packages/sheets-ui/src/basics/interfaces/cell.ts b/packages/sheets-ui/src/basics/interfaces/cell.tsdeleted file mode 100644index d69dcb582a..0000000000--- a/packages/sheets-ui/src/basics/interfaces/cell.ts+++ /dev/null@@ -1,21 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export interface ICell {- row: number;- column: number;- value: string;-}diff --git a/packages/sheets-ui/src/basics/interfaces/component-config/i-sheet-ui-plugin-config.ts b/packages/sheets-ui/src/basics/interfaces/component-config/i-sheet-ui-plugin-config.tsdeleted file mode 100644index 9646eda1ba..0000000000--- a/packages/sheets-ui/src/basics/interfaces/component-config/i-sheet-ui-plugin-config.ts+++ /dev/null@@ -1,31 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { LocaleType } from '@univerjs/core';--import type { SheetContainerConfig } from './sheet-container-config';-import type { SheetToolbarConfig } from './toolbar-config';--export interface ILayout {- sheetContainerConfig?: SheetContainerConfig;- toolbarConfig?: SheetToolbarConfig;-}--export interface IUniverSheetsUIConfig {- container?: HTMLElement | string;- layout?: ILayout;- locale?: LocaleType;-}diff --git a/packages/sheets-ui/src/basics/interfaces/component-config/index.ts b/packages/sheets-ui/src/basics/interfaces/component-config/index.tsdeleted file mode 100644index 028831d5e9..0000000000--- a/packages/sheets-ui/src/basics/interfaces/component-config/index.ts+++ /dev/null@@ -1,18 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export * from './i-sheet-ui-plugin-config';-export * from './toolbar-config';diff --git a/packages/sheets-ui/src/basics/interfaces/component-config/sheet-container-config.ts b/packages/sheets-ui/src/basics/interfaces/component-config/sheet-container-config.tsdeleted file mode 100644index 322244d85f..0000000000--- a/packages/sheets-ui/src/basics/interfaces/component-config/sheet-container-config.ts+++ /dev/null@@ -1,52 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export interface SheetContainerConfig {- outerLeft?: boolean;-- outerRight?: boolean;-- header?: boolean;-- footer?: boolean;-- innerLeft?: boolean;-- innerRight?: boolean;-- frozenHeaderLT?: boolean;-- frozenHeaderRT?: boolean;-- frozenHeaderLM?: boolean;-- frozenContent?: boolean;-- infoBar?: boolean;-- formulaBar?: boolean;-- countBar?: boolean;-- sheetBar?: boolean;-- // Whether to show the toolbar- toolbar?: boolean;-- rightMenu?: boolean;-- contentSplit?: boolean | string;-}diff --git a/packages/sheets-ui/src/basics/interfaces/component-config/toolbar-config.ts b/packages/sheets-ui/src/basics/interfaces/component-config/toolbar-config.tsdeleted file mode 100644index 81ddd47f96..0000000000--- a/packages/sheets-ui/src/basics/interfaces/component-config/toolbar-config.ts+++ /dev/null@@ -1,40 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export interface SheetToolbarConfig {- undo?: boolean; // Undo redo- redo?: boolean; // Undo redo- paintFormat?: boolean; // Format brush- currencyFormat?: boolean; // currency format- percentageFormat?: boolean; // Percentage format- numberDecrease?: boolean; // 'Decrease the number of decimal places'- numberIncrease?: boolean; // 'Increase the number of decimal places- font?: boolean; // 'font'- moreFormats?: boolean;- fontSize?: boolean; // 'Font size'- bold?: boolean; // 'Bold (Ctrl+B)'- italic?: boolean; // 'Italic (Ctrl+I)'- strikethrough?: boolean; // 'Strikethrough (Alt+Shift+5)'- underline?: boolean; // 'Underline (Alt+Shift+6)'- textColor?: boolean; // 'Text color'- fillColor?: boolean; // 'Cell color'- border?: boolean; // 'border'- horizontalAlignMode?: boolean; // 'Horizontal alignment'- verticalAlignMode?: boolean; // 'Vertical alignment'- textWrapMode?: boolean; // 'Wrap mode'- textRotateMode?: boolean; // 'Text Rotation Mode'- mergeCell?: boolean; // 'Merge cells'-}diff --git a/packages/sheets-ui/src/basics/interfaces/index.ts b/packages/sheets-ui/src/basics/interfaces/index.tsdeleted file mode 100644index 082d1a0308..0000000000--- a/packages/sheets-ui/src/basics/interfaces/index.ts+++ /dev/null@@ -1,18 +0,0 @@-/**- * Copyright 2023-present DreamNum Inc.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export * from './component-config';-// @endindexdiff --git a/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsx b/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsxindex ecd595fa7f..5d9e267874 100644--- a/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsx+++ b/packages/sheets-ui/src/views/sheet-container/SheetContainer.tsx@@ -16,7 +16,6 @@import React from 'react';-import type { IUniverSheetsUIConfig } from '../../basics';import { CountBar } from '../count-bar/CountBar';import { EditorContainer } from '../editor-container/EditorContainer';import { FormulaBar } from '../formula-bar/FormulaBar';@@ -25,12 +24,6 @@ import { SheetBar } from '../sheet-bar/SheetBar';import { StatusBar } from '../status-bar/StatusBar';import styles from './index.module.less';-export interface IBaseSheetContainerProps {- config: IUniverSheetsUIConfig;- changeLocale: (locale: string) => void;- methods?: any;-}-export function RenderSheetFooter() {return (<section className={styles.sheetContainer} data-range-selector>@@ -43,9 +36,7 @@ export function RenderSheetFooter() {export function RenderSheetHeader() {return (- <>- <FormulaBar />- </>+ <FormulaBar />);}diff --git a/packages/slides-ui/src/basics/const/default-univer-slide-config.ts b/packages/slides-ui/src/basics/const/default-univer-slide-config.tsindex 70fbb1800e..069ce852fd 100644--- a/packages/slides-ui/src/basics/const/default-univer-slide-config.ts+++ b/packages/slides-ui/src/basics/const/default-univer-slide-config.ts@@ -40,8 +40,6 @@ export const DefaultToolbarConfig = {};export const DefaultSlideContainerConfig = {- outerLeft: false,- outerRight: false,header: true,footer: true,innerLeft: false,@@ -50,8 +48,6 @@ export const DefaultSlideContainerConfig = {frozenHeaderRT: false,frozenHeaderLM: false,frozenContent: false,- infoBar: true,- toolbar: true,};export const DefaultSlideUIConfig = {diff --git a/packages/ui/src/controllers/ui/ui.controller.ts b/packages/ui/src/controllers/ui/ui.controller.tsindex 8ee4e9ced4..040a338d97 100644--- a/packages/ui/src/controllers/ui/ui.controller.ts+++ b/packages/ui/src/controllers/ui/ui.controller.ts@@ -19,11 +19,7 @@ import { createIdentifier } from '@wendellhu/redi';export interface IWorkbenchOptions {container?: string | HTMLElement;- outerLeft?: boolean;- innerLeft?: boolean;header?: boolean;- infoBar?: boolean;- toolbar?: boolean;footer?: boolean;}diff --git a/packages/ui/src/views/App.tsx b/packages/ui/src/views/App.tsxindex 2135027473..2850f5536a 100644--- a/packages/ui/src/views/App.tsx+++ b/packages/ui/src/views/App.tsx@@ -40,6 +40,8 @@ export interface IUniverAppProps extends IWorkbenchOptions {}export function App(props: IUniverAppProps) {+ const { header, footer } = props;+const localeService = useDependency(LocaleService);const themeService = useDependency(ThemeService);const messageService = useDependency(IMessageService);@@ -102,7 +104,7 @@ export function App(props: IUniverAppProps) {*/}<div className={styles.appLayout} tabIndex={-1}>{/* header */}- {props.toolbar && (+ {header && (<header className={styles.appContainerHeader}><Toolbar headerMenuComponents={headerMenuComponents} /></header>@@ -113,7 +115,9 @@ export function App(props: IUniverAppProps) {<div className={styles.appContainerWrapper}><section className={styles.appContainerContent}><header>- <ComponentContainer components={headerComponents} />+ {header && (+ <ComponentContainer components={headerComponents} />+ )}</header><section@@ -132,7 +136,7 @@ export function App(props: IUniverAppProps) {</div>{/* footer */}- {props.footer && (+ {footer && (<footer className={styles.appFooter}><ComponentContainer components={footerComponents} /></footer>