@univerjs/ui 0.2.11 → 0.2.13
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 +13 -13
- package/lib/es/index.js +6083 -5689
- package/lib/index.css +1 -1
- package/lib/locale/en-US.json +3 -3
- package/lib/locale/ru-RU.json +3 -3
- package/lib/locale/vi-VN.json +3 -3
- package/lib/locale/zh-CN.json +3 -3
- package/lib/locale/zh-TW.json +3 -3
- package/lib/types/common/menu-hidden-observable.d.ts +1 -1
- package/lib/types/components/editor/TextEditor.d.ts +2 -1
- package/lib/types/components/hooks/event.d.ts +1 -1
- package/lib/types/components/menu/desktop/Menu.d.ts +2 -2
- package/lib/types/components/range-selector/RangeSelector.d.ts +3 -1
- package/lib/types/controllers/config.schema.d.ts +12 -0
- package/lib/types/controllers/menus/menu.schema.d.ts +2 -0
- package/lib/types/controllers/shared-shortcut.controller.d.ts +2 -8
- package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +3 -4
- package/lib/types/controllers/ui/ui-desktop.controller.d.ts +7 -4
- package/lib/types/controllers/ui/ui-mobile.controller.d.ts +6 -2
- package/lib/types/controllers/ui/ui.controller.d.ts +16 -10
- package/lib/types/index.d.ts +52 -46
- package/lib/types/locale/zh-CN.d.ts +2 -2
- package/lib/types/mobile-ui-plugin.d.ts +2 -2
- package/lib/types/services/before-close/before-close.service.d.ts +1 -1
- package/lib/types/services/clipboard/clipboard-interface.service.d.ts +1 -1
- package/lib/types/services/confirm/confirm.service.d.ts +1 -1
- package/lib/types/services/contextmenu/contextmenu.service.d.ts +1 -1
- package/lib/types/services/dialog/dialog.service.d.ts +1 -1
- package/lib/types/services/editor/editor.service.d.ts +4 -4
- package/lib/types/services/global-zone/global-zone.service.d.ts +1 -1
- package/lib/types/services/layout/layout.service.d.ts +1 -1
- package/lib/types/services/local-file/desktop-file-opener.service.d.ts +15 -0
- package/lib/types/services/local-file/file-opener.service.d.ts +27 -0
- package/lib/types/services/menu/menu-manager.service.d.ts +44 -0
- package/lib/types/services/menu/menu.d.ts +11 -9
- package/lib/types/services/menu/menu.service.d.ts +9 -3
- package/lib/types/services/menu/types.d.ts +64 -0
- package/lib/types/services/message/message.service.d.ts +1 -1
- package/lib/types/services/notification/notification.service.d.ts +1 -1
- package/lib/types/services/parts/parts.service.d.ts +1 -1
- package/lib/types/services/platform/platform.service.d.ts +1 -1
- package/lib/types/services/popup/canvas-popup.service.d.ts +12 -2
- package/lib/types/services/progress/progress.service.d.ts +1 -1
- package/lib/types/services/range-selector/range-selector.service.d.ts +8 -1
- package/lib/types/services/shortcut/shortcut.service.d.ts +1 -1
- package/lib/types/services/sidebar/sidebar.service.d.ts +2 -2
- package/lib/types/services/zen-zone/desktop-zen-zone.service.d.ts +6 -1
- package/lib/types/services/zen-zone/zen-zone.service.d.ts +12 -2
- package/lib/types/ui-plugin.d.ts +5 -4
- package/lib/types/views/components/ribbon/Ribbon.d.ts +6 -0
- package/lib/types/views/components/{doc-bars → ribbon}/ToolbarItem.d.ts +4 -1
- package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +4 -0
- package/lib/types/views/components/{doc-bars → ribbon}/hook.d.ts +0 -8
- package/lib/umd/index.js +10 -10
- package/package.json +19 -19
- package/lib/types/views/components/doc-bars/Toolbar.d.ts +0 -8
- /package/lib/types/views/components/{doc-bars → ribbon}/Button/ToolbarButton.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDisposable } from '@univerjs/core';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
|
-
export declare const IGlobalZoneService: import('@
|
|
3
|
+
export declare const IGlobalZoneService: import('@wendellhu/redi').IdentifierDecorator<IGlobalZoneService>;
|
|
4
4
|
export interface IGlobalZoneService {
|
|
5
5
|
readonly visible$: Subject<boolean>;
|
|
6
6
|
readonly componentKey$: Subject<string>;
|
|
@@ -19,7 +19,7 @@ export interface ILayoutService {
|
|
|
19
19
|
checkElementInCurrentContainers(element: HTMLElement): boolean;
|
|
20
20
|
checkContentIsFocused(): boolean;
|
|
21
21
|
}
|
|
22
|
-
export declare const ILayoutService: import('@
|
|
22
|
+
export declare const ILayoutService: import('@wendellhu/redi').IdentifierDecorator<ILayoutService>;
|
|
23
23
|
/**
|
|
24
24
|
* This service is responsible for storing layout information of the current
|
|
25
25
|
* Univer application instance.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Disposable, Injector } from '@univerjs/core';
|
|
2
|
+
import { IUIPartsService } from '../parts/parts.service';
|
|
3
|
+
import { ILocalFileService, IOpenFileOptions } from './file-opener.service';
|
|
4
|
+
interface IOpenFileRequest extends IOpenFileOptions {
|
|
5
|
+
onFileSelected: (files: File[]) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class DesktopLocalFileService extends Disposable implements ILocalFileService {
|
|
8
|
+
private readonly _uiPartsService;
|
|
9
|
+
private readonly _fileOpenRequest$;
|
|
10
|
+
readonly fileOpenRequest$: import('rxjs').Observable<IOpenFileRequest | null>;
|
|
11
|
+
constructor(injector: Injector, _uiPartsService: IUIPartsService);
|
|
12
|
+
openFile(options?: IOpenFileOptions): Promise<File[]>;
|
|
13
|
+
downloadFile(data: Blob, fileName: string): void;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
export interface IOpenFileOptions {
|
|
17
|
+
accept?: string;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ILocalFileService {
|
|
21
|
+
openFile(options?: IOpenFileOptions): Promise<File[]>;
|
|
22
|
+
downloadFile(data: Blob, fileName: string): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* This service is used to upload files.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ILocalFileService: import('@wendellhu/redi').IdentifierDecorator<ILocalFileService>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IAccessor, Disposable, IConfigService, Injector } from '@univerjs/core';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
|
+
import { IMenuItem } from '../menu/menu';
|
|
4
|
+
export declare const IMenuManagerService: import('@wendellhu/redi').IdentifierDecorator<IMenuManagerService>;
|
|
5
|
+
export interface IMenuSchema {
|
|
6
|
+
key: string;
|
|
7
|
+
order: number;
|
|
8
|
+
item?: IMenuItem;
|
|
9
|
+
children?: IMenuSchema[];
|
|
10
|
+
}
|
|
11
|
+
export interface IMenuManagerService {
|
|
12
|
+
readonly menuChanged$: Observable<void>;
|
|
13
|
+
mergeMenu(source: MenuSchemaType, target?: MenuSchemaType): void;
|
|
14
|
+
appendRootMenu(source: MenuSchemaType): void;
|
|
15
|
+
getMenuByPositionKey(position: string): IMenuSchema[];
|
|
16
|
+
}
|
|
17
|
+
export type MenuSchemaType = {
|
|
18
|
+
order?: number;
|
|
19
|
+
menuItemFactory?: (accessor: IAccessor) => IMenuItem;
|
|
20
|
+
} | {
|
|
21
|
+
[key: string]: MenuSchemaType;
|
|
22
|
+
};
|
|
23
|
+
export declare class MenuManagerService extends Disposable implements IMenuManagerService {
|
|
24
|
+
private readonly _injector;
|
|
25
|
+
private readonly _configService;
|
|
26
|
+
readonly menuChanged$: Subject<void>;
|
|
27
|
+
private _menu;
|
|
28
|
+
constructor(_injector: Injector, _configService: IConfigService);
|
|
29
|
+
dispose(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Merge source menu to target menu recursively
|
|
32
|
+
* @param source
|
|
33
|
+
* @param target default is root menu
|
|
34
|
+
*/
|
|
35
|
+
mergeMenu(source: MenuSchemaType, target?: MenuSchemaType): void;
|
|
36
|
+
appendRootMenu(source: MenuSchemaType): void;
|
|
37
|
+
private _buildMenuSchema;
|
|
38
|
+
/**
|
|
39
|
+
* Get menu schema by position key
|
|
40
|
+
* @param key
|
|
41
|
+
* @returns Menu schema array or empty array if not found
|
|
42
|
+
*/
|
|
43
|
+
getMenuByPositionKey(key: string): IMenuSchema[];
|
|
44
|
+
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { IAccessor } from '@univerjs/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
export type OneOrMany<T> = T | T[];
|
|
4
|
+
/** @deprecated */
|
|
4
5
|
export declare enum MenuPosition {
|
|
5
6
|
VOID = "void",
|
|
6
|
-
TOOLBAR_START = "
|
|
7
|
-
TOOLBAR_INSERT = "
|
|
8
|
-
TOOLBAR_FORMULAS = "
|
|
9
|
-
TOOLBAR_DATA = "
|
|
10
|
-
TOOLBAR_VIEW = "
|
|
11
|
-
TOOLBAR_OTHERS = "
|
|
12
|
-
CONTEXT_MENU = "contextMenu",
|
|
7
|
+
TOOLBAR_START = "ribbon.start",
|
|
8
|
+
TOOLBAR_INSERT = "ribbon.insert",
|
|
9
|
+
TOOLBAR_FORMULAS = "ribbon.formulas",
|
|
10
|
+
TOOLBAR_DATA = "ribbon.data",
|
|
11
|
+
TOOLBAR_VIEW = "ribbon.view",
|
|
12
|
+
TOOLBAR_OTHERS = "ribbon.others",
|
|
13
|
+
CONTEXT_MENU = "contextMenu.mainArea",
|
|
13
14
|
FOOTER = "footer"
|
|
14
15
|
}
|
|
16
|
+
/** @deprecated */
|
|
15
17
|
export declare enum MenuGroup {
|
|
16
18
|
TOOLBAR_HISTORY = 0,
|
|
17
19
|
TOOLBAR_FORMAT = 1,
|
|
@@ -53,7 +55,7 @@ interface IMenuItemBase<V> {
|
|
|
53
55
|
group?: MenuGroup;
|
|
54
56
|
/** In what menu should the item display. */
|
|
55
57
|
/** @deprecated positions will be removed in the future. */
|
|
56
|
-
positions
|
|
58
|
+
positions?: OneOrMany<MenuPosition | string>;
|
|
57
59
|
type: MenuItemType;
|
|
58
60
|
/**
|
|
59
61
|
* Custom label component id.
|
|
@@ -108,7 +110,7 @@ export interface IMenuSelectorItem<V = MenuItemDefaultValueType, T = undefined>
|
|
|
108
110
|
}
|
|
109
111
|
export declare function isMenuSelectorItem<T extends MenuItemDefaultValueType>(v: IMenuItem): v is IMenuSelectorItem<T>;
|
|
110
112
|
export type MenuItemDefaultValueType = string | number | undefined;
|
|
111
|
-
export type IMenuItem = IMenuButtonItem<MenuItemDefaultValueType> | IMenuSelectorItem<MenuItemDefaultValueType>;
|
|
113
|
+
export type IMenuItem = IMenuButtonItem<MenuItemDefaultValueType> | IMenuSelectorItem<MenuItemDefaultValueType, any>;
|
|
112
114
|
export type IDisplayMenuItem<T extends IMenuItem> = T & {
|
|
113
115
|
shortcut?: string;
|
|
114
116
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { Disposable, IDisposable } from '@univerjs/core';
|
|
1
|
+
import { Disposable, ILogService, 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
|
-
|
|
5
|
+
import { IMenuManagerService } from './menu-manager.service';
|
|
6
|
+
/** @deprecated */
|
|
7
|
+
export declare const IMenuService: import('@wendellhu/redi').IdentifierDecorator<IMenuService>;
|
|
6
8
|
/**
|
|
7
9
|
* Breaking changes to IMenuService are expected in the next version. Use with caution. by @jikkai
|
|
10
|
+
* @deprecated
|
|
8
11
|
*/
|
|
9
12
|
export interface IMenuService {
|
|
10
13
|
menuChanged$: Observable<void>;
|
|
@@ -18,8 +21,11 @@ export interface IMenuService {
|
|
|
18
21
|
/** @deprecated */
|
|
19
22
|
getMenuItem(id: string): IMenuItem | null;
|
|
20
23
|
}
|
|
24
|
+
/** @deprecated */
|
|
21
25
|
export declare class MenuService extends Disposable implements IMenuService {
|
|
22
26
|
private readonly _shortcutService;
|
|
27
|
+
private readonly _menuManagerService;
|
|
28
|
+
protected readonly _logService: ILogService;
|
|
23
29
|
/** @deprecated */
|
|
24
30
|
private readonly _menuItemMap;
|
|
25
31
|
/** @deprecated */
|
|
@@ -28,7 +34,7 @@ export declare class MenuService extends Disposable implements IMenuService {
|
|
|
28
34
|
private readonly _menuConfigs;
|
|
29
35
|
private _menuChanged$;
|
|
30
36
|
menuChanged$: Observable<void>;
|
|
31
|
-
constructor(_shortcutService: IShortcutService);
|
|
37
|
+
constructor(_shortcutService: IShortcutService, _menuManagerService: IMenuManagerService, _logService: ILogService);
|
|
32
38
|
dispose(): void;
|
|
33
39
|
/** @deprecated */
|
|
34
40
|
addMenuItem(item: IMenuItem, config: MenuConfig): IDisposable;
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
export declare enum MenuManagerPosition {
|
|
17
|
+
RIBBON = "ribbon",
|
|
18
|
+
CONTEXT_MENU = "contextMenu"
|
|
19
|
+
}
|
|
20
|
+
export declare enum RibbonPosition {
|
|
21
|
+
START = "ribbon.start",
|
|
22
|
+
INSERT = "ribbon.insert",
|
|
23
|
+
FORMULAS = "ribbon.formulas",
|
|
24
|
+
DATA = "ribbon.data",
|
|
25
|
+
VIEW = "ribbon.view",
|
|
26
|
+
OTHERS = "ribbon.others"
|
|
27
|
+
}
|
|
28
|
+
export declare enum RibbonStartGroup {
|
|
29
|
+
HISTORY = "ribbon.start.history",
|
|
30
|
+
FORMAT = "ribbon.start.format",
|
|
31
|
+
LAYOUT = "ribbon.start.layout",
|
|
32
|
+
FORMULAS_INSERT = "ribbon.start.insert",
|
|
33
|
+
FORMULAS_VIEW = "ribbon.start.view",
|
|
34
|
+
FILE = "ribbon.start.file",
|
|
35
|
+
OTHERS = "ribbon.start.others"
|
|
36
|
+
}
|
|
37
|
+
export declare enum RibbonInsertGroup {
|
|
38
|
+
OTHERS = "ribbon.insert.others"
|
|
39
|
+
}
|
|
40
|
+
export declare enum RibbonFormulasGroup {
|
|
41
|
+
OTHERS = "ribbon.formulas.others"
|
|
42
|
+
}
|
|
43
|
+
export declare enum RibbonDataGroup {
|
|
44
|
+
OTHERS = "ribbon.data.others"
|
|
45
|
+
}
|
|
46
|
+
export declare enum RibbonViewGroup {
|
|
47
|
+
OTHERS = "ribbon.view.others"
|
|
48
|
+
}
|
|
49
|
+
export declare enum RibbonOthersGroup {
|
|
50
|
+
OTHERS = "ribbon.others.others"
|
|
51
|
+
}
|
|
52
|
+
export declare enum ContextMenuPosition {
|
|
53
|
+
MAIN_AREA = "contextMenu.mainArea",
|
|
54
|
+
COL_HEADER = "contextMenu.colHeader",
|
|
55
|
+
ROW_HEADER = "contextMenu.rowHeader",
|
|
56
|
+
FOOTER_TABS = "contextMenu.footerTabs",
|
|
57
|
+
FOOTER_MENU = "contextMenu.footerMenu"
|
|
58
|
+
}
|
|
59
|
+
export declare enum ContextMenuGroup {
|
|
60
|
+
FORMAT = "contextMenu.format",
|
|
61
|
+
LAYOUT = "contextMenu.layout",
|
|
62
|
+
DATA = "contextMenu.data",
|
|
63
|
+
OTHERS = "contextMenu.others"
|
|
64
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMessageOptions } from '@univerjs/design';
|
|
2
2
|
import { IDisposable } from '@univerjs/core';
|
|
3
|
-
export declare const IMessageService: import('@
|
|
3
|
+
export declare const IMessageService: import('@wendellhu/redi').IdentifierDecorator<IMessageService>;
|
|
4
4
|
export interface IMessageService {
|
|
5
5
|
show(options: IMessageOptions): IDisposable;
|
|
6
6
|
setContainer(container: HTMLElement): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDisposable } from '@univerjs/core';
|
|
2
2
|
import { INotificationOptions } from '../../components/notification/Notification';
|
|
3
|
-
export declare const INotificationService: import('@
|
|
3
|
+
export declare const INotificationService: import('@wendellhu/redi').IdentifierDecorator<INotificationService>;
|
|
4
4
|
export interface INotificationService {
|
|
5
5
|
show(params: INotificationOptions): IDisposable;
|
|
6
6
|
}
|
|
@@ -18,7 +18,7 @@ export interface IUIPartsService {
|
|
|
18
18
|
registerComponent(part: ComponentPartKey, componentFactory: () => ComponentType): IDisposable;
|
|
19
19
|
getComponents(part: ComponentPartKey): Set<ComponentRenderer>;
|
|
20
20
|
}
|
|
21
|
-
export declare const IUIPartsService: import('@
|
|
21
|
+
export declare const IUIPartsService: import('@wendellhu/redi').IdentifierDecorator<IUIPartsService>;
|
|
22
22
|
export declare class UIPartsService extends Disposable implements IUIPartsService {
|
|
23
23
|
private _componentsByPart;
|
|
24
24
|
private readonly _componentRegistered$;
|
|
@@ -21,7 +21,7 @@ export interface IPlatformService {
|
|
|
21
21
|
readonly isWindows: boolean;
|
|
22
22
|
readonly isLinux: boolean;
|
|
23
23
|
}
|
|
24
|
-
export declare const IPlatformService: import('@
|
|
24
|
+
export declare const IPlatformService: import('@wendellhu/redi').IdentifierDecorator<IPlatformService>;
|
|
25
25
|
export declare class PlatformService implements IPlatformService {
|
|
26
26
|
get isMac(): boolean;
|
|
27
27
|
get isWindows(): boolean;
|
|
@@ -2,7 +2,7 @@ import { Nullable, Disposable } from '@univerjs/core';
|
|
|
2
2
|
import { IRectPopupProps } from '@univerjs/design';
|
|
3
3
|
import { IBoundRectNoAngle } from '@univerjs/engine-render';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
-
export interface IPopup extends Pick<IRectPopupProps, '
|
|
5
|
+
export interface IPopup extends Pick<IRectPopupProps, 'direction' | 'excludeOutside' | 'onClickOutside'> {
|
|
6
6
|
anchorRect: Nullable<IBoundRectNoAngle>;
|
|
7
7
|
anchorRect$: Observable<IBoundRectNoAngle>;
|
|
8
8
|
excludeRects?: IBoundRectNoAngle[];
|
|
@@ -13,6 +13,10 @@ export interface IPopup extends Pick<IRectPopupProps, 'closeOnSelfTarget' | 'dir
|
|
|
13
13
|
offset?: [number, number];
|
|
14
14
|
canvasElement: HTMLCanvasElement;
|
|
15
15
|
hideOnInvisible?: boolean;
|
|
16
|
+
hiddenType?: 'hide' | 'destroy';
|
|
17
|
+
onPointerEnter?: () => void;
|
|
18
|
+
onPointerLeave?: () => void;
|
|
19
|
+
onClick?: () => void;
|
|
16
20
|
}
|
|
17
21
|
export interface ICanvasPopupService {
|
|
18
22
|
addPopup(item: IPopup): string;
|
|
@@ -20,13 +24,19 @@ export interface ICanvasPopupService {
|
|
|
20
24
|
removeAll(): void;
|
|
21
25
|
popups$: Observable<[string, IPopup][]>;
|
|
22
26
|
get popups(): [string, IPopup][];
|
|
27
|
+
/**
|
|
28
|
+
* which popup is under hovering now
|
|
29
|
+
*/
|
|
30
|
+
get activePopupId(): Nullable<string>;
|
|
23
31
|
}
|
|
24
|
-
export declare const ICanvasPopupService: import('@
|
|
32
|
+
export declare const ICanvasPopupService: import('@wendellhu/redi').IdentifierDecorator<ICanvasPopupService>;
|
|
25
33
|
export declare class CanvasPopupService extends Disposable implements ICanvasPopupService {
|
|
26
34
|
private readonly _popupMap;
|
|
27
35
|
private readonly _popups$;
|
|
28
36
|
readonly popups$: Observable<[string, IPopup][]>;
|
|
29
37
|
get popups(): [string, IPopup][];
|
|
38
|
+
private _activePopupId;
|
|
39
|
+
get activePopupId(): Nullable<string>;
|
|
30
40
|
private _update;
|
|
31
41
|
dispose(): void;
|
|
32
42
|
addPopup(item: IPopup): string;
|
|
@@ -49,4 +49,4 @@ export declare class ProgressService extends Disposable implements IProgressServ
|
|
|
49
49
|
getTaskCount(): number;
|
|
50
50
|
private _clear;
|
|
51
51
|
}
|
|
52
|
-
export declare const IProgressService: import('@
|
|
52
|
+
export declare const IProgressService: import('@wendellhu/redi').IdentifierDecorator<IProgressService>;
|
|
@@ -10,6 +10,9 @@ export interface IRangeSelectorService {
|
|
|
10
10
|
getCurrentSelectorId(): Nullable<string>;
|
|
11
11
|
openSelector$: Observable<unknown>;
|
|
12
12
|
openSelector(): void;
|
|
13
|
+
selectorModalVisible$: Observable<boolean>;
|
|
14
|
+
get selectorModalVisible(): boolean;
|
|
15
|
+
triggerModalVisibleChange(visible: boolean): void;
|
|
13
16
|
}
|
|
14
17
|
export declare class RangeSelectorService extends Disposable implements IRangeSelectorService, IDisposable {
|
|
15
18
|
private _currentSelectorId;
|
|
@@ -17,9 +20,13 @@ export declare class RangeSelectorService extends Disposable implements IRangeSe
|
|
|
17
20
|
readonly selectionChange$: Observable<IRangeSelectorRange[]>;
|
|
18
21
|
private readonly _openSelector$;
|
|
19
22
|
readonly openSelector$: Observable<unknown>;
|
|
23
|
+
private readonly _selectorModalVisible$;
|
|
24
|
+
readonly selectorModalVisible$: Observable<boolean>;
|
|
25
|
+
get selectorModalVisible(): boolean;
|
|
20
26
|
setCurrentSelectorId(id: Nullable<string>): void;
|
|
21
27
|
getCurrentSelectorId(): Nullable<string>;
|
|
22
28
|
selectionChange(range: IRangeSelectorRange[]): void;
|
|
23
29
|
openSelector(): void;
|
|
30
|
+
triggerModalVisibleChange(visible: boolean): void;
|
|
24
31
|
}
|
|
25
|
-
export declare const IRangeSelectorService: import('@
|
|
32
|
+
export declare const IRangeSelectorService: import('@wendellhu/redi').IdentifierDecorator<IRangeSelectorService>;
|
|
@@ -56,7 +56,7 @@ export interface IShortcutItem<P extends object = object> {
|
|
|
56
56
|
/**
|
|
57
57
|
* The dependency injection identifier of the {@link IShortcutService}.
|
|
58
58
|
*/
|
|
59
|
-
export declare const IShortcutService: import('@
|
|
59
|
+
export declare const IShortcutService: import('@wendellhu/redi').IdentifierDecorator<IShortcutService>;
|
|
60
60
|
/**
|
|
61
61
|
* The interface of the shortcut service.
|
|
62
62
|
*/
|
|
@@ -9,5 +9,5 @@ export interface ISidebarService {
|
|
|
9
9
|
get visible(): boolean;
|
|
10
10
|
get options(): ISidebarMethodOptions;
|
|
11
11
|
}
|
|
12
|
-
export declare const ILeftSidebarService: import('@
|
|
13
|
-
export declare const ISidebarService: import('@
|
|
12
|
+
export declare const ILeftSidebarService: import('@wendellhu/redi').IdentifierDecorator<ISidebarService>;
|
|
13
|
+
export declare const ISidebarService: import('@wendellhu/redi').IdentifierDecorator<ISidebarService>;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { IDisposable } from '@univerjs/core';
|
|
2
|
-
import { ForwardRefExoticComponent } from 'react';
|
|
3
2
|
import { Subject } from 'rxjs';
|
|
3
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
4
4
|
import { ComponentManager } from '../../common/component-manager';
|
|
5
5
|
import { IZenZoneService } from './zen-zone.service';
|
|
6
6
|
export declare class DesktopZenZoneService implements IZenZoneService {
|
|
7
7
|
private readonly _componentManager;
|
|
8
8
|
readonly visible$: Subject<boolean>;
|
|
9
9
|
readonly componentKey$: Subject<string>;
|
|
10
|
+
private readonly _temporaryHidden$;
|
|
11
|
+
readonly temporaryHidden$: import('rxjs').Observable<boolean>;
|
|
10
12
|
private _visible;
|
|
11
13
|
get visible(): boolean;
|
|
14
|
+
get temporaryHidden(): boolean;
|
|
12
15
|
constructor(_componentManager: ComponentManager);
|
|
16
|
+
hide(): void;
|
|
17
|
+
show(): void;
|
|
13
18
|
set(key: string, component: ForwardRefExoticComponent<any>): IDisposable;
|
|
14
19
|
open(): void;
|
|
15
20
|
close(): void;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { IDisposable } from '@univerjs/core';
|
|
2
|
-
import { Subject } from 'rxjs';
|
|
3
|
-
export declare const IZenZoneService: import('@
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
|
+
export declare const IZenZoneService: import('@wendellhu/redi').IdentifierDecorator<IZenZoneService>;
|
|
4
4
|
export interface IZenZoneService {
|
|
5
5
|
readonly visible$: Subject<boolean>;
|
|
6
6
|
readonly componentKey$: Subject<string>;
|
|
7
|
+
readonly temporaryHidden$: Observable<boolean>;
|
|
7
8
|
readonly visible: boolean;
|
|
9
|
+
readonly temporaryHidden: boolean;
|
|
8
10
|
set(key: string, component: any): IDisposable;
|
|
9
11
|
open(): void;
|
|
10
12
|
close(): void;
|
|
13
|
+
/**
|
|
14
|
+
* temporarily hide the zen zone, often
|
|
15
|
+
*/
|
|
16
|
+
hide(): void;
|
|
17
|
+
/**
|
|
18
|
+
* show the zen zone
|
|
19
|
+
*/
|
|
20
|
+
show(): void;
|
|
11
21
|
}
|
package/lib/types/ui-plugin.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { IContextService, Injector, Plugin } from '@univerjs/core';
|
|
2
|
-
import { IUniverUIConfig } from './controllers/
|
|
1
|
+
import { IConfigService, IContextService, Injector, Plugin } from '@univerjs/core';
|
|
2
|
+
import { IUniverUIConfig } from './controllers/config.schema';
|
|
3
3
|
export declare const UNIVER_UI_PLUGIN_NAME = "UNIVER_UI_PLUGIN";
|
|
4
4
|
export declare const DISABLE_AUTO_FOCUS_KEY = "DISABLE_AUTO_FOCUS";
|
|
5
5
|
/**
|
|
6
6
|
* UI plugin provides basic interaction with users. Including workbench (menus, UI parts, notifications etc.), copy paste, shortcut.
|
|
7
7
|
*/
|
|
8
8
|
export declare class UniverUIPlugin extends Plugin {
|
|
9
|
-
private _config;
|
|
9
|
+
private readonly _config;
|
|
10
10
|
private readonly _contextService;
|
|
11
11
|
protected readonly _injector: Injector;
|
|
12
|
+
private readonly _configService;
|
|
12
13
|
static pluginName: string;
|
|
13
|
-
constructor(_config: Partial<IUniverUIConfig
|
|
14
|
+
constructor(_config: Partial<IUniverUIConfig> | undefined, _contextService: IContextService, _injector: Injector, _configService: IConfigService);
|
|
14
15
|
onStarting(): void;
|
|
15
16
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { IDropdownProps } from '@univerjs/design';
|
|
2
3
|
import { IDisplayMenuItem, IMenuItem } from '../../../services/menu/menu';
|
|
3
|
-
export declare const ToolbarItem: React.ForwardRefExoticComponent<IDisplayMenuItem<IMenuItem> &
|
|
4
|
+
export declare const ToolbarItem: React.ForwardRefExoticComponent<(IDisplayMenuItem<IMenuItem> & {
|
|
5
|
+
align?: IDropdownProps["align"];
|
|
6
|
+
}) & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IDropdownProps, ITooltipProps, NullableTooltipRef } from '@univerjs/design';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export declare const TooltipWrapper: React.ForwardRefExoticComponent<ITooltipProps & React.RefAttributes<NullableTooltipRef>>;
|
|
4
|
+
export declare function DropdownWrapper(props: IDropdownProps): React.JSX.Element;
|
|
@@ -33,12 +33,4 @@ export interface IToolbarItemStatus {
|
|
|
33
33
|
* @returns The menu item's status
|
|
34
34
|
*/
|
|
35
35
|
export declare function useToolbarItemStatus(menuItem: IDisplayMenuItem<IMenuItem>): IToolbarItemStatus;
|
|
36
|
-
export declare function useToolbarCollapseObserver(visibleItems: IToolbarRenderHookHandler['visibleItems']): {
|
|
37
|
-
toolbarRef: import('react').RefObject<HTMLDivElement>;
|
|
38
|
-
toolbarItemRefs: import('react').MutableRefObject<Record<string, {
|
|
39
|
-
el: HTMLDivElement;
|
|
40
|
-
key: string;
|
|
41
|
-
}>>;
|
|
42
|
-
collapsedId: string[];
|
|
43
|
-
};
|
|
44
36
|
export {};
|