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
feat(ui)!: add support for hiding context menu (#2275)
白熱3f12ad80188a
diff --git a/examples/src/docs-uniscript/main.ts b/examples/src/docs-uniscript/main.tsindex ea17ade5e3..1842151cdb 100644--- a/examples/src/docs-uniscript/main.ts+++ b/examples/src/docs-uniscript/main.ts@@ -40,7 +40,7 @@ univer.registerPlugin(UniverRenderEnginePlugin);univer.registerPlugin(UniverFormulaEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',- header: true,+ footer: false,});univer.registerPlugin(UniverDocsPlugin);diff --git a/examples/src/docs/main.ts b/examples/src/docs/main.tsindex 641a3587a2..e64d733014 100644--- a/examples/src/docs/main.ts+++ b/examples/src/docs/main.ts@@ -50,7 +50,7 @@ univer.registerPlugin(UniverFormulaEnginePlugin);univer.registerPlugin(UniverDebuggerPlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',- header: true,+ footer: false,});univer.registerPlugin(UniverDocsPlugin);univer.registerPlugin(UniverDocsUIPlugin, {diff --git a/examples/src/sheets-multi/main.tsx b/examples/src/sheets-multi/main.tsxindex f43a202b4e..540d070bbf 100644--- a/examples/src/sheets-multi/main.tsx+++ b/examples/src/sheets-multi/main.tsx@@ -45,8 +45,6 @@ function factory(id: string) {univer.registerPlugin(UniverRenderEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: id,- header: true,- footer: true,});univer.registerPlugin(UniverDocsPlugin, {hasScroll: false,diff --git a/examples/src/sheets-uniscript/main.ts b/examples/src/sheets-uniscript/main.tsindex a10897555a..314f3dd735 100644--- a/examples/src/sheets-uniscript/main.ts+++ b/examples/src/sheets-uniscript/main.ts@@ -42,8 +42,6 @@ const univer = new Univer({univer.registerPlugin(UniverRenderEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',- header: true,- footer: true,});univer.registerPlugin(UniverDocsPlugin, {diff --git a/examples/src/sheets/main.ts b/examples/src/sheets/main.tsindex b9e97cd3fc..1c527e2f89 100644--- a/examples/src/sheets/main.ts+++ b/examples/src/sheets/main.ts@@ -60,8 +60,6 @@ univer.registerPlugin(UniverDocsPlugin, {univer.registerPlugin(UniverRenderEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: 'app',- header: true,- footer: true,});univer.registerPlugin(UniverDocsUIPlugin);diff --git a/examples/src/slides/main.ts b/examples/src/slides/main.tsindex eb734129d8..d72f52c26a 100644--- a/examples/src/slides/main.ts+++ b/examples/src/slides/main.ts@@ -34,8 +34,6 @@ univer.registerPlugin(UniverRenderEnginePlugin);univer.registerPlugin(UniverFormulaEnginePlugin);univer.registerPlugin(UniverUIPlugin, {container: 'univer-container',- header: true,- footer: true,});univer.registerPlugin(UniverSlidesPlugin);univer.registerPlugin(UniverSlidesUIPlugin);diff --git a/packages/ui/src/controllers/ui/ui.controller.ts b/packages/ui/src/controllers/ui/ui.controller.tsindex 040a338d97..4f348ff230 100644--- a/packages/ui/src/controllers/ui/ui.controller.ts+++ b/packages/ui/src/controllers/ui/ui.controller.ts@@ -21,6 +21,7 @@ export interface IWorkbenchOptions {header?: boolean;footer?: boolean;+ contextMenu?: boolean;}export interface IUIController {diff --git a/packages/ui/src/views/App.tsx b/packages/ui/src/views/App.tsxindex e61a1edb80..3382c1cb64 100644--- a/packages/ui/src/views/App.tsx+++ b/packages/ui/src/views/App.tsx@@ -29,6 +29,7 @@ import { Sidebar } from './components/sidebar/Sidebar';import { ZenZone } from './components/zen-zone/ZenZone';import { CanvasPopup } from './components/popup';import { builtInGlobalComponents } from './parts';+import { ContextMenu } from './components/context-menu/ContextMenu';export interface IUniverAppProps extends IWorkbenchOptions {mountContainer: HTMLElement;@@ -38,8 +39,9 @@ export interface IUniverAppProps extends IWorkbenchOptions {export function App(props: IUniverAppProps) {const {- header,- footer,+ header = true,+ footer = true,+ contextMenu = true,mountContainer,onRendered,} = props;@@ -172,6 +174,7 @@ export function App(props: IUniverAppProps) {<ComponentContainer components={globalComponents} /><ComponentContainer components={builtInGlobalComponents} />+ {contextMenu && <ContextMenu />}</ConfigProvider>);}diff --git a/packages/ui/src/views/parts.ts b/packages/ui/src/views/parts.tsindex a91b2a436d..d00f32fa85 100644--- a/packages/ui/src/views/parts.ts+++ b/packages/ui/src/views/parts.ts@@ -16,10 +16,8 @@import type { ComponentType } from 'react';-import { ContextMenu } from './components/context-menu/ContextMenu';import { GlobalZone } from './components/global-zone/GlobalZone';export const builtInGlobalComponents: Set<() => ComponentType> = new Set([- () => ContextMenu,() => GlobalZone,]);