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: hide the menu item of find-replace in docs (#1189)

白熱578f234ebe78
diff --git a/packages/find-replace/src/controllers/find-replace.menu.ts b/packages/find-replace/src/controllers/find-replace.menu.ts
index fb2c2bcad2..5da7c2d4af 100644
--- a/packages/find-replace/src/controllers/find-replace.menu.ts
+++ b/packages/find-replace/src/controllers/find-replace.menu.ts
@@ -14,12 +14,14 @@
* limitations under the License.
*/
+import { UniverInstanceType } from '@univerjs/core';
import type { IMenuButtonItem } from '@univerjs/ui';
-import { MenuGroup, MenuItemType, MenuPosition } from '@univerjs/ui';
+import { getMenuHiddenObservable, MenuGroup, MenuItemType, MenuPosition } from '@univerjs/ui';
+import type { IAccessor } from '@wendellhu/redi';
import { OpenFindDialogOperation } from '../commands/operations/find-replace.operation';
-export function FindReplaceMenuItemFactory(): IMenuButtonItem {
+export function FindReplaceMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
return {
id: OpenFindDialogOperation.id,
icon: 'SearchIcon',
@@ -27,5 +29,6 @@ export function FindReplaceMenuItemFactory(): IMenuButtonItem {
group: MenuGroup.TOOLBAR_OTHERS,
type: MenuItemType.BUTTON,
positions: [MenuPosition.TOOLBAR_START],
+ hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.SHEET),
};
}