@univerjs/ui 0.15.5 → 0.16.0
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 +61 -10
- package/lib/es/index.js +4857 -4259
- package/lib/index.css +1 -1
- package/lib/index.js +4857 -4259
- package/lib/types/components/menu/desktop/TinyMenuGroup.d.ts +3 -2
- package/lib/types/components/message/MessageContainer.d.ts +16 -0
- package/lib/types/components/notification/Notification.stories.d.ts +13 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/services/contextmenu/contextmenu-host.service.d.ts +18 -0
- package/lib/types/services/local-file/desktop-local-file.service.d.ts +1 -1
- package/lib/types/services/menu/menu-manager.service.d.ts +3 -0
- package/lib/types/services/menu/menu.d.ts +1 -0
- package/lib/types/views/components/context-menu/AnchoredContextMenu.d.ts +17 -0
- package/lib/types/views/components/context-menu/ContextMenuPanel.d.ts +9 -0
- package/lib/types/views/components/ribbon/hook.d.ts +1 -0
- package/lib/umd/index.js +61 -10
- package/package.json +6 -6
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IValueOption } from '../../../services/menu/menu';
|
|
2
2
|
import { IMenuSchema } from '../../../services/menu/menu-manager.service';
|
|
3
|
-
interface
|
|
3
|
+
interface IUIQuickMenuGroupProps {
|
|
4
4
|
item: IMenuSchema;
|
|
5
5
|
onOptionSelect?: (option: IValueOption) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare function UITinyMenuGroup(props:
|
|
7
|
+
export declare function UITinyMenuGroup(props: IUIQuickMenuGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export declare function UIQuickTileMenuGroup(props: IUIQuickMenuGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 function MessageContainer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,18 @@ import { Meta } from '@storybook/react';
|
|
|
2
2
|
import { Notification } from './Notification';
|
|
3
3
|
declare const meta: Meta<typeof Notification>;
|
|
4
4
|
export default meta;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const InteractivePlayground: {
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export declare const VisualRegressionLight: {
|
|
9
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export declare const VisualRegressionDark: {
|
|
12
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export declare const PlacementMatrix: {
|
|
15
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export declare const LongContentAndLoading: {
|
|
6
18
|
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
19
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export { BrowserClipboardService, FILE__BMP_CLIPBOARD_MIME_TYPE, FILE__JPEG_CLIP
|
|
|
47
47
|
export { supportClipboardAPI } from './services/clipboard/clipboard-utils';
|
|
48
48
|
export { CopyCommand, CutCommand, PasteCommand, SheetPasteShortKeyCommandName } from './services/clipboard/clipboard.command';
|
|
49
49
|
export { DesktopConfirmService } from './services/confirm/desktop-confirm.service';
|
|
50
|
+
export { ContextMenuHostService, IContextMenuHostService } from './services/contextmenu/contextmenu-host.service';
|
|
50
51
|
export { ContextMenuService, type IContextMenuHandler, IContextMenuService } from './services/contextmenu/contextmenu.service';
|
|
51
52
|
export { DesktopDialogService } from './services/dialog/desktop-dialog.service';
|
|
52
53
|
export { IDialogService } from './services/dialog/dialog.service';
|
|
@@ -86,6 +87,7 @@ export * from './utils';
|
|
|
86
87
|
export { ComponentContainer, type IComponentContainerProps, useComponentsOfPart } from './views/components/ComponentContainer';
|
|
87
88
|
export type { IConfirmChildrenProps } from './views/components/confirm-part/interface';
|
|
88
89
|
export { type IConfirmPartMethodOptions } from './views/components/confirm-part/interface';
|
|
90
|
+
export { AnchoredContextMenu, type IContextMenuAnchorRect } from './views/components/context-menu/AnchoredContextMenu';
|
|
89
91
|
export { DesktopContextMenu as ContextMenu } from './views/components/context-menu/ContextMenu';
|
|
90
92
|
export { MobileContextMenu } from './views/components/context-menu/MobileContextMenu';
|
|
91
93
|
export { type IDialogPartMethodOptions } from './views/components/dialog-part/interface';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IDisposable, Disposable } from '@univerjs/core';
|
|
2
|
+
export interface IContextMenuHostService {
|
|
3
|
+
readonly activeMenuId: string | null;
|
|
4
|
+
registerMenu(menuId: string, hide: () => void): IDisposable;
|
|
5
|
+
activateMenu(menuId: string): void;
|
|
6
|
+
deactivateMenu(menuId: string): void;
|
|
7
|
+
hideActiveMenu(exceptMenuId?: string): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const IContextMenuHostService: import('@wendellhu/redi').IdentifierDecorator<IContextMenuHostService>;
|
|
10
|
+
export declare class ContextMenuHostService extends Disposable implements IContextMenuHostService {
|
|
11
|
+
private readonly _menuMap;
|
|
12
|
+
private _activeMenuId;
|
|
13
|
+
get activeMenuId(): string | null;
|
|
14
|
+
registerMenu(menuId: string, hide: () => void): IDisposable;
|
|
15
|
+
activateMenu(menuId: string): void;
|
|
16
|
+
deactivateMenu(menuId: string): void;
|
|
17
|
+
hideActiveMenu(exceptMenuId?: string): void;
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Disposable } from '@univerjs/core';
|
|
2
1
|
import { ILocalFileService, IOpenFileOptions } from './local-file.service';
|
|
2
|
+
import { Disposable } from '@univerjs/core';
|
|
3
3
|
export declare class DesktopLocalFileService extends Disposable implements ILocalFileService {
|
|
4
4
|
openFile(options?: IOpenFileOptions): Promise<File[]>;
|
|
5
5
|
downloadFile(data: Blob, fileName: string): void;
|
|
@@ -2,12 +2,14 @@ import { IAccessor, Disposable, IConfigService, Injector } from '@univerjs/core'
|
|
|
2
2
|
import { Observable, Subject } from 'rxjs';
|
|
3
3
|
import { IMenuItem } from '../menu/menu';
|
|
4
4
|
export declare const IMenuManagerService: import('@wendellhu/redi').IdentifierDecorator<IMenuManagerService>;
|
|
5
|
+
export type ContextMenuQuickLayout = 'icon' | 'tile';
|
|
5
6
|
export interface IMenuSchema {
|
|
6
7
|
key: string;
|
|
7
8
|
order: number;
|
|
8
9
|
title?: string;
|
|
9
10
|
item?: IMenuItem;
|
|
10
11
|
children?: IMenuSchema[];
|
|
12
|
+
quickLayout?: ContextMenuQuickLayout;
|
|
11
13
|
tiny?: boolean;
|
|
12
14
|
}
|
|
13
15
|
export interface IMenuManagerService {
|
|
@@ -21,6 +23,7 @@ export type MenuSchemaType = {
|
|
|
21
23
|
order?: number;
|
|
22
24
|
menuItemFactory?: (accessor: IAccessor) => IMenuItem;
|
|
23
25
|
title?: string;
|
|
26
|
+
quickLayout?: ContextMenuQuickLayout;
|
|
24
27
|
} | {
|
|
25
28
|
[key: string]: MenuSchemaType;
|
|
26
29
|
};
|
|
@@ -82,6 +82,7 @@ export interface IMenuSelectorItem<V = MenuItemDefaultValueType, T = undefined>
|
|
|
82
82
|
activated$?: Observable<boolean>;
|
|
83
83
|
}
|
|
84
84
|
export declare function isMenuSelectorItem<T extends MenuItemDefaultValueType>(v: IMenuItem): v is IMenuSelectorItem<T>;
|
|
85
|
+
export declare function isMenuButtonSelectorItem<T extends MenuItemDefaultValueType>(v: IMenuItem): v is IMenuSelectorItem<T>;
|
|
85
86
|
export type MenuItemDefaultValueType = string | number | undefined;
|
|
86
87
|
export type IMenuItem = IMenuButtonItem<MenuItemDefaultValueType> | IMenuSelectorItem<MenuItemDefaultValueType, any>;
|
|
87
88
|
export type IDisplayMenuItem<T extends IMenuItem> = T & {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IValueOption } from '../../../services/menu/menu';
|
|
2
|
+
export interface IContextMenuAnchorRect {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
}
|
|
7
|
+
export interface IAnchoredContextMenuProps {
|
|
8
|
+
hostId: string;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
anchorRect: IContextMenuAnchorRect | null;
|
|
11
|
+
menuType: string;
|
|
12
|
+
anchorVertical?: 'top' | 'bottom';
|
|
13
|
+
menuOffset?: number;
|
|
14
|
+
onRequestClose: () => void;
|
|
15
|
+
onOptionSelect?: (option: IValueOption) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function AnchoredContextMenu(props: IAnchoredContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IValueOption } from '../../../services/menu/menu';
|
|
2
|
+
interface IContextMenuPanelProps {
|
|
3
|
+
menuType: string;
|
|
4
|
+
menuSessionVersion?: number;
|
|
5
|
+
onOptionSelect?: (option: IValueOption) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const CONTEXT_MENU_SUBMENU_PORTAL_ATTR = "data-u-context-menu-submenu";
|
|
8
|
+
export declare function ContextMenuPanel(props: IContextMenuPanelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|