@univerjs/ui 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/lib/cjs/index.js +3 -3
  2. package/lib/es/index.js +385 -220
  3. package/lib/types/commands/operations/editor/set-editor-resize.operation.d.ts +0 -1
  4. package/lib/types/commands/operations/toggle-shortcut-panel.operation.d.ts +0 -1
  5. package/lib/types/common/component-manager.d.ts +0 -1
  6. package/lib/types/common/lifecycle.d.ts +0 -1
  7. package/lib/types/common/menu-hidden-observable.d.ts +0 -1
  8. package/lib/types/common/menu-merge-configs.d.ts +0 -1
  9. package/lib/types/components/custom-label/CustomLabel.d.ts +0 -1
  10. package/lib/types/components/editor/TextEditor.d.ts +0 -1
  11. package/lib/types/components/font-family/FontFamily.d.ts +0 -1
  12. package/lib/types/components/font-family/FontFamilyItem.d.ts +0 -1
  13. package/lib/types/components/font-family/interface.d.ts +0 -1
  14. package/lib/types/components/font-size/FontSize.d.ts +0 -1
  15. package/lib/types/components/font-size/interface.d.ts +0 -1
  16. package/lib/types/components/hooks/layout.d.ts +0 -1
  17. package/lib/types/components/hooks/locale.d.ts +0 -1
  18. package/lib/types/components/hooks/observable.d.ts +0 -1
  19. package/lib/types/components/hooks/virtual-list.d.ts +35 -0
  20. package/lib/types/components/menu/common/hook.d.ts +0 -1
  21. package/lib/types/components/menu/desktop/Menu.d.ts +0 -1
  22. package/lib/types/components/menu/mobile/MobileMenu.d.ts +0 -1
  23. package/lib/types/components/menu/mobile/MobileMenu.stories.d.ts +0 -1
  24. package/lib/types/components/notification/Notification.d.ts +0 -1
  25. package/lib/types/components/notification/Notification.stories.d.ts +0 -1
  26. package/lib/types/components/progress-bar/ProgressBar.d.ts +0 -1
  27. package/lib/types/components/range-selector/RangeSelector.d.ts +0 -1
  28. package/lib/types/controllers/error/error.controller.d.ts +0 -1
  29. package/lib/types/controllers/menus/menus.d.ts +0 -1
  30. package/lib/types/controllers/shared-shortcut.controller.d.ts +0 -1
  31. package/lib/types/controllers/shortcut-display/menu.d.ts +0 -1
  32. package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +0 -1
  33. package/lib/types/controllers/ui/ui-desktop.controller.d.ts +0 -1
  34. package/lib/types/controllers/ui/ui-mobile.controller.d.ts +0 -1
  35. package/lib/types/controllers/ui/ui.controller.d.ts +0 -1
  36. package/lib/types/index.d.ts +2 -1
  37. package/lib/types/locale/en-US.d.ts +0 -1
  38. package/lib/types/locale/ru-RU.d.ts +0 -1
  39. package/lib/types/locale/vi-VN.d.ts +0 -1
  40. package/lib/types/locale/zh-TW.d.ts +0 -1
  41. package/lib/types/mobile-ui-plugin.d.ts +0 -1
  42. package/lib/types/services/before-close/before-close.service.d.ts +0 -1
  43. package/lib/types/services/clipboard/clipboard-interface.service.d.ts +0 -1
  44. package/lib/types/services/clipboard/clipboard.command.d.ts +0 -1
  45. package/lib/types/services/confirm/confirm.service.d.ts +0 -1
  46. package/lib/types/services/confirm/desktop-confirm.service.d.ts +0 -1
  47. package/lib/types/services/contextmenu/contextmenu.service.d.ts +0 -1
  48. package/lib/types/services/dialog/desktop-dialog.service.d.ts +0 -1
  49. package/lib/types/services/dialog/dialog.service.d.ts +0 -1
  50. package/lib/types/services/dom/canvas-dom-layer.service.d.ts +1 -1
  51. package/lib/types/services/editor/editor.service.d.ts +0 -1
  52. package/lib/types/services/global-zone/desktop-global-zone.service.d.ts +0 -1
  53. package/lib/types/services/global-zone/global-zone.service.d.ts +0 -1
  54. package/lib/types/services/layout/layout.service.d.ts +0 -1
  55. package/lib/types/services/local-storage/local-storage.service.d.ts +0 -1
  56. package/lib/types/services/menu/menu.d.ts +10 -2
  57. package/lib/types/services/menu/menu.service.d.ts +20 -1
  58. package/lib/types/services/message/__testing__/mock-message.service.d.ts +0 -1
  59. package/lib/types/services/message/desktop-message.service.d.ts +0 -1
  60. package/lib/types/services/message/message.service.d.ts +0 -1
  61. package/lib/types/services/notification/desktop-notification.service.d.ts +0 -1
  62. package/lib/types/services/notification/notification.service.d.ts +0 -1
  63. package/lib/types/services/parts/parts.service.d.ts +2 -2
  64. package/lib/types/services/popup/canvas-popup.service.d.ts +4 -3
  65. package/lib/types/services/progress/progress.service.d.ts +0 -1
  66. package/lib/types/services/range-selector/range-selector.service.d.ts +0 -1
  67. package/lib/types/services/shortcut/shortcut-panel.service.d.ts +0 -1
  68. package/lib/types/services/shortcut/shortcut.service.d.ts +0 -1
  69. package/lib/types/services/sidebar/desktop-sidebar.service.d.ts +0 -1
  70. package/lib/types/services/sidebar/sidebar.service.d.ts +0 -1
  71. package/lib/types/services/zen-zone/desktop-zen-zone.service.d.ts +0 -1
  72. package/lib/types/services/zen-zone/zen-zone.service.d.ts +0 -1
  73. package/lib/types/ui-plugin.d.ts +0 -1
  74. package/lib/types/utils/cell.d.ts +0 -1
  75. package/lib/types/views/MobileApp.d.ts +0 -1
  76. package/lib/types/views/components/ComponentContainer.d.ts +0 -1
  77. package/lib/types/views/components/confirm-part/ConfirmPart.d.ts +0 -1
  78. package/lib/types/views/components/confirm-part/interface.d.ts +0 -1
  79. package/lib/types/views/components/context-menu/ContextMenu.d.ts +0 -1
  80. package/lib/types/views/components/context-menu/MobileContextMenu.d.ts +0 -1
  81. package/lib/types/views/components/dialog-part/DialogPart.d.ts +0 -1
  82. package/lib/types/views/components/dialog-part/interface.d.ts +0 -1
  83. package/lib/types/views/components/doc-bars/Button/ToolbarButton.d.ts +0 -1
  84. package/lib/types/views/components/doc-bars/Toolbar.d.ts +0 -1
  85. package/lib/types/views/components/doc-bars/ToolbarItem.d.ts +0 -1
  86. package/lib/types/views/components/doc-bars/hook.d.ts +1 -1
  87. package/lib/types/views/components/dom/FloatDom.d.ts +3 -2
  88. package/lib/types/views/components/global-zone/GlobalZone.d.ts +0 -1
  89. package/lib/types/views/components/popup/CanvasPopup.d.ts +0 -1
  90. package/lib/types/views/components/shortcut-panel/ShortcutPanel.d.ts +0 -1
  91. package/lib/types/views/components/sidebar/Sidebar.d.ts +0 -1
  92. package/lib/types/views/components/sidebar/interface.d.ts +0 -1
  93. package/lib/types/views/components/zen-zone/ZenZone.d.ts +0 -1
  94. package/lib/types/views/parts.d.ts +0 -1
  95. package/lib/types/views/workbench/Workbench.d.ts +0 -1
  96. package/lib/umd/index.js +3 -3
  97. package/package.json +15 -15
@@ -1,3 +1,2 @@
1
1
  import { IOperation } from '@univerjs/core';
2
-
3
2
  export declare const SetEditorResizeOperation: IOperation;
@@ -1,4 +1,3 @@
1
1
  import { IOperation } from '@univerjs/core';
2
-
3
2
  export declare const ShortcutPanelComponentName = "ShortcutPanel";
4
3
  export declare const ToggleShortcutPanelOperation: IOperation;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { defineComponent } from 'vue';
3
3
  import { default as React } from 'react';
4
-
5
4
  type ComponentFramework = 'vue3' | 'react';
6
5
  interface IComponentOptions {
7
6
  framework?: ComponentFramework;
@@ -1,4 +1,3 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
-
3
2
  export declare function fromGlobalEvent<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): IDisposable;
4
3
  export declare function fromEvent<K extends keyof HTMLElementEventMap>(target: HTMLElement, type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): IDisposable;
@@ -1,5 +1,4 @@
1
1
  import { IAccessor, UniverInstanceType } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export declare function getMenuHiddenObservable(accessor: IAccessor, targetUniverType: UniverInstanceType): Observable<boolean>;
5
4
  export declare function getHeaderFooterMenuHiddenObservable(accessor: IAccessor): Observable<boolean>;
@@ -1,3 +1,2 @@
1
1
  import { MenuConfig, MenuItemConfig } from '../services/menu/menu';
2
-
3
2
  export declare function mergeMenuConfigs<T = MenuConfig>(baseConfig: T, additionalConfig: MenuItemConfig | null): T;
@@ -1,7 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IMenuSelectorItem } from '../../services/menu/menu';
4
-
5
4
  export type ICustomLabelProps<T = undefined> = {
6
5
  value?: string | number | undefined;
7
6
  value$?: Observable<T>;
@@ -1,7 +1,6 @@
1
1
  import { IDocumentData, Nullable } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
3
  import { IEditorCanvasStyle } from '../../services/editor/editor.service';
4
-
5
4
  type MyComponentProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
6
5
  export interface ITextEditorProps {
7
6
  id: string;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFontFamilyProps } from './interface';
3
-
4
3
  export declare const FontFamily: (props: IFontFamilyProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFontFamilyItemProps } from './interface';
3
-
4
3
  export declare const FontFamilyItem: (props: IFontFamilyItemProps) => React.JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { ICustomComponentProps } from '@univerjs/ui';
2
-
3
2
  export interface IFontFamilyProps extends ICustomComponentProps<string> {
4
3
  value: string;
5
4
  }
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFontSizeProps } from './interface';
3
-
4
3
  export declare const FontSize: (props: IFontSizeProps) => React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { ICustomComponentProps } from '@univerjs/ui';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export interface IFontSizeProps extends ICustomComponentProps<string> {
5
4
  value: string;
6
5
  min: number;
@@ -1,5 +1,4 @@
1
1
  import { Nullable } from '@univerjs/core';
2
-
3
2
  /**
4
3
  * These hooks are used for browser layout
5
4
  * Prefer to client-side
@@ -1,4 +1,3 @@
1
1
  import { LocaleService } from '@univerjs/core';
2
-
3
2
  export declare function useLocaleService(): LocaleService;
4
3
  export declare function t(localeService: LocaleService, key: string, ...args: Array<number | string>): string;
@@ -1,6 +1,5 @@
1
1
  import { Nullable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  type ObservableOrFn<T> = Observable<T> | (() => Observable<T>);
5
4
  export declare function useObservable<T>(observable: ObservableOrFn<T>, defaultValue: T | undefined, shouldHaveSyncValue?: true): T;
6
5
  export declare function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue: T): T;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ type ItemHeight<T> = (index: number, data: T) => number;
17
+ export interface IVirtualListOptions<T> {
18
+ containerTarget: React.RefObject<HTMLElement>;
19
+ itemHeight: number | ItemHeight<T>;
20
+ overscan?: number;
21
+ }
22
+ declare const useVirtualList: <T>(list: T[], options: IVirtualListOptions<T>) => readonly [{
23
+ index: number;
24
+ data: T;
25
+ }[], {
26
+ readonly wrapperStyle: {
27
+ height: string | undefined;
28
+ marginTop: string | undefined;
29
+ };
30
+ readonly scrollTo: (index: number) => void;
31
+ readonly containerProps: {
32
+ readonly onScroll: (e: React.UIEvent<HTMLElement, UIEvent>) => void;
33
+ };
34
+ }];
35
+ export { useVirtualList };
@@ -1,3 +1,2 @@
1
1
  import { IDisplayMenuItem, IMenuItem } from '../../../services/menu/menu';
2
-
3
2
  export declare function useMenuItemState(menuItem: IDisplayMenuItem<IMenuItem>): void;
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IValueOption } from '../../../services/menu/menu.ts';
3
-
4
3
  export interface IBaseMenuProps {
5
4
  parentKey?: string | number;
6
5
  menuType?: string | string[];
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IBaseMenuProps } from '../desktop/Menu';
3
-
4
3
  /**
5
4
  * The mobile context menu wrapper.
6
5
  */
@@ -1,6 +1,5 @@
1
1
  import { Meta } from '@storybook/react';
2
2
  import { default as React } from 'react';
3
-
4
3
  declare const meta: Meta;
5
4
  export default meta;
6
5
  export declare const Playground: {
@@ -1,7 +1,6 @@
1
1
  import { Placement } from 'rc-notification/es/interface';
2
2
  import { default as React } from 'react';
3
3
  import { Subject } from 'rxjs';
4
-
5
4
  export type NotificationType = 'success' | 'info' | 'warning' | 'error';
6
5
  export interface INotificationOptions {
7
6
  /**
@@ -1,7 +1,6 @@
1
1
  import { Meta } from '@storybook/react';
2
2
  import { default as React } from 'react';
3
3
  import { Notification } from './Notification';
4
-
5
4
  declare const meta: Meta<typeof Notification>;
6
5
  export default meta;
7
6
  export declare const Playground: {
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export interface IProgressBarProps {
4
3
  barColor: string;
5
4
  }
@@ -1,6 +1,5 @@
1
1
  import { IUnitRangeWithName, Nullable } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
-
4
3
  export interface IRangeSelectorProps {
5
4
  id: string;
6
5
  value?: string;
@@ -1,6 +1,5 @@
1
1
  import { Disposable, ErrorService } from '@univerjs/core';
2
2
  import { IMessageService } from '../../services/message/message.service';
3
-
4
3
  export declare class ErrorController extends Disposable {
5
4
  private readonly _errorService;
6
5
  private readonly _messageService;
@@ -1,5 +1,4 @@
1
1
  import { IAccessor } from '@univerjs/core';
2
2
  import { IMenuButtonItem } from '../../services/menu/menu';
3
-
4
3
  export declare function UndoMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
5
4
  export declare function RedoMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -2,7 +2,6 @@ import { Disposable, ICommandService, Injector } from '@univerjs/core';
2
2
  import { IMenuService } from '../services/menu/menu.service';
3
3
  import { IShortcutItem, IShortcutService } from '../services/shortcut/shortcut.service';
4
4
  import { IUniverUIConfig } from './ui/ui.controller';
5
-
6
5
  export declare const CopyShortcutItem: IShortcutItem;
7
6
  export declare const CutShortcutItem: IShortcutItem;
8
7
  /**
@@ -1,4 +1,3 @@
1
1
  import { IAccessor } from '@univerjs/core';
2
2
  import { IMenuButtonItem } from '../../services/menu/menu';
3
-
4
3
  export declare function ShortcutPanelMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -3,7 +3,6 @@ import { ComponentManager } from '../../common/component-manager';
3
3
  import { IMenuService } from '../../services/menu/menu.service';
4
4
  import { IShortcutService } from '../../services/shortcut/shortcut.service';
5
5
  import { IUniverUIConfig } from '../ui/ui.controller';
6
-
7
6
  /**
8
7
  * This controller add a side panel to the application to display the shortcuts.
9
8
  */
@@ -3,7 +3,6 @@ import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ILayoutService } from '../../services/layout/layout.service';
4
4
  import { IUIPartsService } from '../../services/parts/parts.service';
5
5
  import { IUniverUIConfig } from './ui.controller';
6
-
7
6
  export declare class DesktopUIController extends Disposable {
8
7
  private readonly _config;
9
8
  private readonly _renderManagerService;
@@ -3,7 +3,6 @@ import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ILayoutService } from '../../services/layout/layout.service';
4
4
  import { IUIPartsService } from '../../services/parts/parts.service';
5
5
  import { IUIController, IUniverUIConfig } from './ui.controller';
6
-
7
6
  export declare class MobileUIController extends Disposable implements IUIController {
8
7
  private readonly _config;
9
8
  private readonly _instanceService;
@@ -1,6 +1,5 @@
1
1
  import { DependencyOverride } from '@univerjs/core';
2
2
  import { MenuConfig } from '../../services/menu/menu';
3
-
4
3
  export interface IWorkbenchOptions {
5
4
  container?: string | HTMLElement;
6
5
  header?: boolean;
@@ -19,6 +19,7 @@ export * from './components';
19
19
  export { t } from './components/hooks/locale';
20
20
  export { useObservable } from './components/hooks/observable';
21
21
  export { useEvent } from './components/hooks/event';
22
+ export { useVirtualList } from './components/hooks/virtual-list';
22
23
  export { CopyShortcutItem, CutShortcutItem, RedoShortcutItem, SharedController, UndoShortcutItem, } from './controllers/shared-shortcut.controller';
23
24
  export { UI_CONFIG_KEY, IUIController, type IWorkbenchOptions, type IUniverUIConfig } from './controllers/ui/ui.controller';
24
25
  export { DesktopUIController } from './controllers/ui/ui-desktop.controller';
@@ -58,7 +59,7 @@ export { IEditorService, EditorService, Editor } from './services/editor/editor.
58
59
  export { TextEditor } from './components/editor/TextEditor';
59
60
  export { RangeSelector } from './components/range-selector/RangeSelector';
60
61
  export { ProgressBar } from './components/progress-bar/ProgressBar';
61
- export { type IMenuGroup, useToolbarGroups, useToolbarItemStatus, useToolbarCollapseObserver } from './views/components/doc-bars/hook';
62
+ export { type IMenuGroup, useSimpleToolbarGroups, useToolbarGroups, useToolbarItemStatus, useToolbarCollapseObserver } from './views/components/doc-bars/hook';
62
63
  export { mergeMenuConfigs } from './common/menu-merge-configs';
63
64
  export { ShortcutPanelController } from './controllers/shortcut-display/shortcut-panel.controller';
64
65
  export { ShortcutPanelService } from './services/shortcut/shortcut-panel.service';
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,6 +1,5 @@
1
1
  import { Injector, Plugin } from '@univerjs/core';
2
2
  import { IUniverUIConfig } from './controllers/ui/ui.controller';
3
-
4
3
  export declare const UNIVER_MOBILE_UI_PLUGIN_NAME = "UNIVER_MOBILE_UI_PLUGIN";
5
4
  /**
6
5
  * @ignore
@@ -1,6 +1,5 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { INotificationService } from '../notification/notification.service';
3
-
4
3
  export interface IBeforeCloseService {
5
4
  /**
6
5
  * Provide a callback to check if the web page could be closed safely.
@@ -1,6 +1,5 @@
1
1
  import { Disposable, ILogService, LocaleService } from '@univerjs/core';
2
2
  import { INotificationService } from '../notification/notification.service';
3
-
4
3
  export declare const PLAIN_TEXT_CLIPBOARD_MIME_TYPE = "text/plain";
5
4
  export declare const HTML_CLIPBOARD_MIME_TYPE = "text/html";
6
5
  /**
@@ -1,5 +1,4 @@
1
1
  import { IMultiCommand } from '@univerjs/core';
2
-
3
2
  export declare const CopyCommand: IMultiCommand;
4
3
  export declare const CutCommand: IMultiCommand;
5
4
  export declare const PasteCommand: IMultiCommand;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { IConfirmPartMethodOptions } from '../../views/components/confirm-part/interface';
4
-
5
4
  export declare const IConfirmService: import('@univerjs/core').IdentifierDecorator<IConfirmService>;
6
5
  export interface IConfirmService {
7
6
  readonly confirmOptions$: Subject<IConfirmPartMethodOptions[]>;
@@ -3,7 +3,6 @@ import { Subject } from 'rxjs';
3
3
  import { IConfirmPartMethodOptions } from '../../views/components/confirm-part/interface';
4
4
  import { IUIPartsService } from '../parts/parts.service';
5
5
  import { IConfirmService } from './confirm.service';
6
-
7
6
  export declare class DesktopConfirmService extends Disposable implements IConfirmService {
8
7
  protected readonly _injector: Injector;
9
8
  protected readonly _uiPartsService: IUIPartsService;
@@ -1,6 +1,5 @@
1
1
  import { Disposable, IDisposable } from '@univerjs/core';
2
2
  import { IMouseEvent, IPointerEvent } from '@univerjs/engine-render';
3
-
4
3
  export interface IContextMenuHandler {
5
4
  /** A callback to open context menu with given position and menu type. */
6
5
  handleContextMenu(event: IPointerEvent | IMouseEvent, menuType: string): void;
@@ -3,7 +3,6 @@ import { Subject } from 'rxjs';
3
3
  import { IDialogPartMethodOptions } from '../../views/components/dialog-part/interface';
4
4
  import { IUIPartsService } from '../parts/parts.service';
5
5
  import { IDialogService } from './dialog.service';
6
-
7
6
  export declare class DesktopDialogService extends Disposable implements IDialogService {
8
7
  protected readonly _injector: Injector;
9
8
  protected readonly _uiPartsService: IUIPartsService;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IDialogPartMethodOptions } from '../../views/components/dialog-part/interface';
4
-
5
4
  export declare const IDialogService: import('@univerjs/core').IdentifierDecorator<IDialogService>;
6
5
  export interface IDialogService {
7
6
  open(params: IDialogPartMethodOptions): IDisposable;
@@ -1,6 +1,5 @@
1
1
  import { IPosition, Serializable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export interface IFloatDomLayout extends IPosition {
5
4
  rotate: number;
6
5
  width: number;
@@ -20,6 +19,7 @@ export interface IFloatDom {
20
19
  onWheel: (evt: WheelEvent) => void;
21
20
  props?: Record<string, any>;
22
21
  data?: Serializable;
22
+ unitId: string;
23
23
  }
24
24
  export declare class CanvasFloatDomService {
25
25
  private _domLayerMap;
@@ -2,7 +2,6 @@ import { DocumentDataModel, IDisposable, IDocumentBody, IDocumentData, IPosition
2
2
  import { Observable } from 'rxjs';
3
3
  import { IRender, ISuccinctDocRangeParam, IRenderManagerService } from '@univerjs/engine-render';
4
4
  import { LexerTreeBuilder } from '@univerjs/engine-formula';
5
-
6
5
  export interface IEditorStateParam extends Partial<IPosition> {
7
6
  visible?: boolean;
8
7
  }
@@ -3,7 +3,6 @@ import { ForwardRefExoticComponent } from 'react';
3
3
  import { Subject } from 'rxjs';
4
4
  import { ComponentManager } from '../../common/component-manager';
5
5
  import { IGlobalZoneService } from './global-zone.service';
6
-
7
6
  export declare class DesktopGlobalZoneService implements IGlobalZoneService {
8
7
  private readonly _componentManager;
9
8
  readonly visible$: Subject<boolean>;
@@ -1,6 +1,5 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
-
4
3
  export declare const IGlobalZoneService: import('@univerjs/core').IdentifierDecorator<IGlobalZoneService>;
5
4
  export interface IGlobalZoneService {
6
5
  readonly visible$: Subject<boolean>;
@@ -1,6 +1,5 @@
1
1
  import { ContextService, IDisposable, Nullable, Disposable, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
2
2
  import { IEditorService } from '../editor/editor.service';
3
-
4
3
  type FocusHandlerFn = (unitId: string) => void;
5
4
  export declare const FOCUSING_UNIVER = "FOCUSING_UNIVER";
6
5
  export interface ILayoutService {
@@ -1,5 +1,4 @@
1
1
  import { ILocalStorageService } from '@univerjs/core';
2
-
3
2
  export declare class DesktopLocalStorageService implements ILocalStorageService {
4
3
  getItem<T>(key: string): Promise<T | null>;
5
4
  setItem<T>(key: string, value: T): Promise<T>;
@@ -1,6 +1,5 @@
1
1
  import { IAccessor } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export type OneOrMany<T> = T | T[];
5
4
  export declare enum MenuPosition {
6
5
  VOID = "void",
@@ -10,7 +9,8 @@ export declare enum MenuPosition {
10
9
  TOOLBAR_DATA = "uiToolbar.data",
11
10
  TOOLBAR_VIEW = "uiToolbar.view",
12
11
  TOOLBAR_OTHERS = "uiToolbar.others",
13
- CONTEXT_MENU = "contextMenu"
12
+ CONTEXT_MENU = "contextMenu",
13
+ FOOTER = "footer"
14
14
  }
15
15
  export declare enum MenuGroup {
16
16
  TOOLBAR_HISTORY = 0,
@@ -49,8 +49,10 @@ interface IMenuItemBase<V> {
49
49
  icon?: string | Observable<string>;
50
50
  tooltip?: string;
51
51
  /** The group that the item belongs to. */
52
+ /** @deprecated group will be removed in the future. */
52
53
  group?: MenuGroup;
53
54
  /** In what menu should the item display. */
55
+ /** @deprecated positions will be removed in the future. */
54
56
  positions: OneOrMany<MenuPosition | string>;
55
57
  type: MenuItemType;
56
58
  /**
@@ -93,6 +95,12 @@ export interface ICustomComponentProps<T> {
93
95
  }
94
96
  export interface IMenuSelectorItem<V = MenuItemDefaultValueType, T = undefined> extends IMenuItemBase<V> {
95
97
  type: MenuItemType.SELECTOR | MenuItemType.BUTTON_SELECTOR | MenuItemType.SUBITEMS;
98
+ /**
99
+ * If this property is set, changing the value of the selection will trigger the command with this id,
100
+ * instead of {@link IMenuItemBase.id} or {@link IMenuItemBase.commandId}. At the same title,
101
+ * clicking the button will trigger IMenuItemBase.id or IMenuItemBase.commandId.
102
+ */
103
+ selectionsCommandId?: string;
96
104
  /** Options or IDs of registered components. */
97
105
  selections?: Array<IValueOption<T>> | Observable<Array<IValueOption<T>>>;
98
106
  /** If `type` is `MenuItemType.BUTTON_SELECTOR`, this determines if the button is activated. */
@@ -2,31 +2,50 @@ import { Disposable, IDisposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IShortcutService } from '../shortcut/shortcut.service';
4
4
  import { IDisplayMenuItem, IMenuItem, MenuConfig, MenuPosition } from './menu';
5
-
6
5
  export declare const IMenuService: import('@univerjs/core').IdentifierDecorator<IMenuService>;
6
+ /**
7
+ * Breaking changes to IMenuService are expected in the next version. Use with caution. by @jikkai
8
+ */
7
9
  export interface IMenuService {
8
10
  menuChanged$: Observable<void>;
11
+ /** @deprecated */
9
12
  addMenuItem(item: IMenuItem, config: MenuConfig): IDisposable;
13
+ /** @deprecated */
10
14
  setMenuItem(item: IMenuItem): void;
11
15
  /** Get menu items for display at a given position or a submenu. */
16
+ /** @deprecated */
12
17
  getMenuItems(position: MenuPosition | string): Array<IDisplayMenuItem<IMenuItem>>;
18
+ /** @deprecated */
13
19
  getMenuItem(id: string): IMenuItem | null;
14
20
  }
15
21
  export declare class MenuService extends Disposable implements IMenuService {
16
22
  private readonly _shortcutService;
23
+ /** @deprecated */
17
24
  private readonly _menuItemMap;
25
+ /** @deprecated */
18
26
  private readonly _menuByPositions;
27
+ /** @deprecated */
19
28
  private readonly _menuConfigs;
20
29
  private _menuChanged$;
21
30
  menuChanged$: Observable<void>;
22
31
  constructor(_shortcutService: IShortcutService);
23
32
  dispose(): void;
33
+ /** @deprecated */
24
34
  addMenuItem(item: IMenuItem, config: MenuConfig): IDisposable;
35
+ /** @deprecated */
25
36
  getMenuItems(positions: MenuPosition | string): Array<IDisplayMenuItem<IMenuItem>>;
37
+ /** @deprecated */
26
38
  setMenuItem(item: IMenuItem): void;
39
+ /** @deprecated */
27
40
  getMenuItem(id: string): IMenuItem | null;
41
+ /** @deprecated */
28
42
  setMenuConfigs(id: string, config: MenuConfig): void;
43
+ /** @deprecated */
29
44
  getMenuConfig(id: string): MenuConfig | null;
45
+ /** @deprecated */
30
46
  private _getDisplayMenuItems;
47
+ /** @deprecated */
31
48
  private _appendMenuToPosition;
49
+ /** @deprecated */
50
+ private _updateMenuItems;
32
51
  }
@@ -1,7 +1,6 @@
1
1
  import { IMessageOptions, IMessageProps } from '@univerjs/design';
2
2
  import { IDisposable } from '@univerjs/core';
3
3
  import { IMessageService } from '../message.service';
4
-
5
4
  /**
6
5
  * This is a mocked message service for testing purposes.
7
6
  */
@@ -1,7 +1,6 @@
1
1
  import { IMessageOptions, IMessageProps, Message } from '@univerjs/design';
2
2
  import { IDisposable } from '@univerjs/core';
3
3
  import { IMessageService } from './message.service';
4
-
5
4
  export declare class DesktopMessageService implements IMessageService, IDisposable {
6
5
  protected _portalContainer: HTMLElement | undefined;
7
6
  protected _message?: Message;
@@ -1,6 +1,5 @@
1
1
  import { IMessageOptions } from '@univerjs/design';
2
2
  import { IDisposable } from '@univerjs/core';
3
-
4
3
  export declare const IMessageService: import('@univerjs/core').IdentifierDecorator<IMessageService>;
5
4
  export interface IMessageService {
6
5
  show(options: IMessageOptions): IDisposable;
@@ -2,7 +2,6 @@ import { Disposable, IDisposable, Injector } from '@univerjs/core';
2
2
  import { INotificationOptions } from '../../components/notification/Notification';
3
3
  import { IUIPartsService } from '../parts/parts.service';
4
4
  import { INotificationService } from './notification.service';
5
-
6
5
  export declare class DesktopNotificationService extends Disposable implements INotificationService {
7
6
  private readonly _injector;
8
7
  private readonly _uiPartsService;
@@ -1,6 +1,5 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { INotificationOptions } from '../../components/notification/Notification';
3
-
4
3
  export declare const INotificationService: import('@univerjs/core').IdentifierDecorator<INotificationService>;
5
4
  export interface INotificationService {
6
5
  show(params: INotificationOptions): IDisposable;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable, Disposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { ComponentType } from '../../common/component-manager';
4
-
5
4
  type ComponentRenderer = () => ComponentType;
6
5
  type ComponentPartKey = BuiltInUIPart | string;
7
6
  export declare enum BuiltInUIPart {
@@ -11,7 +10,8 @@ export declare enum BuiltInUIPart {
11
10
  CONTENT = "content",
12
11
  FOOTER = "footer",
13
12
  LEFT_SIDEBAR = "left-sidebar",
14
- FLOATING = "floating"
13
+ FLOATING = "floating",
14
+ UNIT = "unit"
15
15
  }
16
16
  export interface IUIPartsService {
17
17
  componentRegistered$: Observable<ComponentPartKey>;