@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.
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +385 -220
- package/lib/types/commands/operations/editor/set-editor-resize.operation.d.ts +0 -1
- package/lib/types/commands/operations/toggle-shortcut-panel.operation.d.ts +0 -1
- package/lib/types/common/component-manager.d.ts +0 -1
- package/lib/types/common/lifecycle.d.ts +0 -1
- package/lib/types/common/menu-hidden-observable.d.ts +0 -1
- package/lib/types/common/menu-merge-configs.d.ts +0 -1
- package/lib/types/components/custom-label/CustomLabel.d.ts +0 -1
- package/lib/types/components/editor/TextEditor.d.ts +0 -1
- package/lib/types/components/font-family/FontFamily.d.ts +0 -1
- package/lib/types/components/font-family/FontFamilyItem.d.ts +0 -1
- package/lib/types/components/font-family/interface.d.ts +0 -1
- package/lib/types/components/font-size/FontSize.d.ts +0 -1
- package/lib/types/components/font-size/interface.d.ts +0 -1
- package/lib/types/components/hooks/layout.d.ts +0 -1
- package/lib/types/components/hooks/locale.d.ts +0 -1
- package/lib/types/components/hooks/observable.d.ts +0 -1
- package/lib/types/components/hooks/virtual-list.d.ts +35 -0
- package/lib/types/components/menu/common/hook.d.ts +0 -1
- package/lib/types/components/menu/desktop/Menu.d.ts +0 -1
- package/lib/types/components/menu/mobile/MobileMenu.d.ts +0 -1
- package/lib/types/components/menu/mobile/MobileMenu.stories.d.ts +0 -1
- package/lib/types/components/notification/Notification.d.ts +0 -1
- package/lib/types/components/notification/Notification.stories.d.ts +0 -1
- package/lib/types/components/progress-bar/ProgressBar.d.ts +0 -1
- package/lib/types/components/range-selector/RangeSelector.d.ts +0 -1
- package/lib/types/controllers/error/error.controller.d.ts +0 -1
- package/lib/types/controllers/menus/menus.d.ts +0 -1
- package/lib/types/controllers/shared-shortcut.controller.d.ts +0 -1
- package/lib/types/controllers/shortcut-display/menu.d.ts +0 -1
- package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +0 -1
- package/lib/types/controllers/ui/ui-desktop.controller.d.ts +0 -1
- package/lib/types/controllers/ui/ui-mobile.controller.d.ts +0 -1
- package/lib/types/controllers/ui/ui.controller.d.ts +0 -1
- package/lib/types/index.d.ts +2 -1
- package/lib/types/locale/en-US.d.ts +0 -1
- package/lib/types/locale/ru-RU.d.ts +0 -1
- package/lib/types/locale/vi-VN.d.ts +0 -1
- package/lib/types/locale/zh-TW.d.ts +0 -1
- package/lib/types/mobile-ui-plugin.d.ts +0 -1
- package/lib/types/services/before-close/before-close.service.d.ts +0 -1
- package/lib/types/services/clipboard/clipboard-interface.service.d.ts +0 -1
- package/lib/types/services/clipboard/clipboard.command.d.ts +0 -1
- package/lib/types/services/confirm/confirm.service.d.ts +0 -1
- package/lib/types/services/confirm/desktop-confirm.service.d.ts +0 -1
- package/lib/types/services/contextmenu/contextmenu.service.d.ts +0 -1
- package/lib/types/services/dialog/desktop-dialog.service.d.ts +0 -1
- package/lib/types/services/dialog/dialog.service.d.ts +0 -1
- package/lib/types/services/dom/canvas-dom-layer.service.d.ts +1 -1
- package/lib/types/services/editor/editor.service.d.ts +0 -1
- package/lib/types/services/global-zone/desktop-global-zone.service.d.ts +0 -1
- package/lib/types/services/global-zone/global-zone.service.d.ts +0 -1
- package/lib/types/services/layout/layout.service.d.ts +0 -1
- package/lib/types/services/local-storage/local-storage.service.d.ts +0 -1
- package/lib/types/services/menu/menu.d.ts +10 -2
- package/lib/types/services/menu/menu.service.d.ts +20 -1
- package/lib/types/services/message/__testing__/mock-message.service.d.ts +0 -1
- package/lib/types/services/message/desktop-message.service.d.ts +0 -1
- package/lib/types/services/message/message.service.d.ts +0 -1
- package/lib/types/services/notification/desktop-notification.service.d.ts +0 -1
- package/lib/types/services/notification/notification.service.d.ts +0 -1
- package/lib/types/services/parts/parts.service.d.ts +2 -2
- package/lib/types/services/popup/canvas-popup.service.d.ts +4 -3
- package/lib/types/services/progress/progress.service.d.ts +0 -1
- package/lib/types/services/range-selector/range-selector.service.d.ts +0 -1
- package/lib/types/services/shortcut/shortcut-panel.service.d.ts +0 -1
- package/lib/types/services/shortcut/shortcut.service.d.ts +0 -1
- package/lib/types/services/sidebar/desktop-sidebar.service.d.ts +0 -1
- package/lib/types/services/sidebar/sidebar.service.d.ts +0 -1
- package/lib/types/services/zen-zone/desktop-zen-zone.service.d.ts +0 -1
- package/lib/types/services/zen-zone/zen-zone.service.d.ts +0 -1
- package/lib/types/ui-plugin.d.ts +0 -1
- package/lib/types/utils/cell.d.ts +0 -1
- package/lib/types/views/MobileApp.d.ts +0 -1
- package/lib/types/views/components/ComponentContainer.d.ts +0 -1
- package/lib/types/views/components/confirm-part/ConfirmPart.d.ts +0 -1
- package/lib/types/views/components/confirm-part/interface.d.ts +0 -1
- package/lib/types/views/components/context-menu/ContextMenu.d.ts +0 -1
- package/lib/types/views/components/context-menu/MobileContextMenu.d.ts +0 -1
- package/lib/types/views/components/dialog-part/DialogPart.d.ts +0 -1
- package/lib/types/views/components/dialog-part/interface.d.ts +0 -1
- package/lib/types/views/components/doc-bars/Button/ToolbarButton.d.ts +0 -1
- package/lib/types/views/components/doc-bars/Toolbar.d.ts +0 -1
- package/lib/types/views/components/doc-bars/ToolbarItem.d.ts +0 -1
- package/lib/types/views/components/doc-bars/hook.d.ts +1 -1
- package/lib/types/views/components/dom/FloatDom.d.ts +3 -2
- package/lib/types/views/components/global-zone/GlobalZone.d.ts +0 -1
- package/lib/types/views/components/popup/CanvasPopup.d.ts +0 -1
- package/lib/types/views/components/shortcut-panel/ShortcutPanel.d.ts +0 -1
- package/lib/types/views/components/sidebar/Sidebar.d.ts +0 -1
- package/lib/types/views/components/sidebar/interface.d.ts +0 -1
- package/lib/types/views/components/zen-zone/ZenZone.d.ts +0 -1
- package/lib/types/views/parts.d.ts +0 -1
- package/lib/types/views/workbench/Workbench.d.ts +0 -1
- package/lib/umd/index.js +3 -3
- package/package.json +15 -15
|
@@ -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,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,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,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
|
/**
|
|
@@ -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;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -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,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,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 { 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,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, 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>;
|