@univerjs/ui 0.2.6 → 0.2.8

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 +6 -6
  2. package/lib/es/index.js +335 -185
  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 +3 -3
  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 +1 -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 +6 -2
  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 +0 -1
  51. package/lib/types/services/editor/editor.service.d.ts +10 -5
  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 +8 -9
  55. package/lib/types/services/local-storage/local-storage.service.d.ts +0 -1
  56. package/lib/types/services/menu/menu.d.ts +7 -2
  57. package/lib/types/services/menu/menu.service.d.ts +1 -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 +0 -1
  64. package/lib/types/services/popup/canvas-popup.service.d.ts +2 -1
  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 +2 -2
  69. package/lib/types/services/sidebar/desktop-sidebar.service.d.ts +3 -2
  70. package/lib/types/services/sidebar/sidebar.service.d.ts +5 -3
  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 -2
  87. package/lib/types/views/components/dom/FloatDom.d.ts +0 -1
  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 +1 -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 +1 -2
  96. package/lib/umd/index.js +6 -6
  97. package/package.json +15 -15
@@ -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 {
@@ -2,7 +2,6 @@ import { 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
-
6
5
  export interface IPopup extends Pick<IRectPopupProps, 'closeOnSelfTarget' | 'direction' | 'excludeOutside' | 'onClickOutside'> {
7
6
  anchorRect: IBoundRectNoAngle;
8
7
  anchorRect$: Observable<IBoundRectNoAngle>;
@@ -12,6 +11,8 @@ export interface IPopup extends Pick<IRectPopupProps, 'closeOnSelfTarget' | 'dir
12
11
  unitId: string;
13
12
  subUnitId: string;
14
13
  offset?: [number, number];
14
+ canvasElement: HTMLCanvasElement;
15
+ hideOnInvisible?: boolean;
15
16
  }
16
17
  export interface ICanvasPopupService {
17
18
  addPopup(item: IPopup): string;
@@ -1,6 +1,5 @@
1
1
  import { Disposable, IDisposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export interface IProgressCount {
5
4
  count: number;
6
5
  }
@@ -1,6 +1,5 @@
1
1
  import { IDisposable, IUnitRange, Nullable, Disposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export interface IRangeSelectorRange extends IUnitRange {
5
4
  sheetName: string;
6
5
  }
@@ -1,5 +1,4 @@
1
1
  import { Disposable } from '@univerjs/core';
2
-
3
2
  export declare class ShortcutPanelService extends Disposable {
4
3
  private _open$;
5
4
  open$: import('rxjs').Observable<boolean>;
@@ -2,7 +2,7 @@ import { Disposable, ICommandService, IContextService, IDisposable } from '@univ
2
2
  import { Observable } from 'rxjs';
3
3
  import { ILayoutService } from '../layout/layout.service';
4
4
  import { IPlatformService } from '../platform/platform.service';
5
-
5
+ import { KeyCode } from './keycode';
6
6
  export interface IShortcutItem<P extends object = object> {
7
7
  /** This should reuse the corresponding command's id. */
8
8
  id: string;
@@ -13,7 +13,7 @@ export interface IShortcutItem<P extends object = object> {
13
13
  /** A callback that will be triggered to examine if the shortcut should be invoked. */
14
14
  preconditions?: (contextService: IContextService) => boolean;
15
15
  /** A command can be bound to several bindings, with different static parameters perhaps. */
16
- binding: number;
16
+ binding: KeyCode | number;
17
17
  mac?: number;
18
18
  win?: number;
19
19
  linux?: number;
@@ -2,11 +2,12 @@ import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { ISidebarMethodOptions } from '../../views/components/sidebar/interface';
4
4
  import { ISidebarService } from './sidebar.service';
5
-
6
5
  export declare class DesktopSidebarService implements ISidebarService {
7
6
  private _sidebarOptions;
8
7
  readonly sidebarOptions$: Subject<ISidebarMethodOptions>;
9
8
  readonly scrollEvent$: Subject<Event>;
9
+ get visible(): boolean;
10
+ get options(): ISidebarMethodOptions;
10
11
  open(params: ISidebarMethodOptions): IDisposable;
11
- close(): void;
12
+ close(id?: string): void;
12
13
  }
@@ -1,11 +1,13 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { ISidebarMethodOptions } from '../../views/components/sidebar/interface';
4
-
5
- export declare const ISidebarService: import('@univerjs/core').IdentifierDecorator<ISidebarService>;
6
4
  export interface ISidebarService {
7
5
  readonly sidebarOptions$: Subject<ISidebarMethodOptions>;
8
6
  readonly scrollEvent$: Subject<Event>;
9
7
  open(params: ISidebarMethodOptions): IDisposable;
10
- close(): void;
8
+ close(id?: string): void;
9
+ get visible(): boolean;
10
+ get options(): ISidebarMethodOptions;
11
11
  }
12
+ export declare const ILeftSidebarService: import('@univerjs/core').IdentifierDecorator<ISidebarService>;
13
+ export declare const ISidebarService: import('@univerjs/core').IdentifierDecorator<ISidebarService>;
@@ -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 { IZenZoneService } from './zen-zone.service';
6
-
7
6
  export declare class DesktopZenZoneService implements IZenZoneService {
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 IZenZoneService: import('@univerjs/core').IdentifierDecorator<IZenZoneService>;
5
4
  export interface IZenZoneService {
6
5
  readonly visible$: Subject<boolean>;
@@ -1,6 +1,5 @@
1
1
  import { IContextService, Injector, Plugin } from '@univerjs/core';
2
2
  import { IUniverUIConfig } from './controllers/ui/ui.controller';
3
-
4
3
  export declare const UNIVER_UI_PLUGIN_NAME = "UNIVER_UI_PLUGIN";
5
4
  export declare const DISABLE_AUTO_FOCUS_KEY = "DISABLE_AUTO_FOCUS";
6
5
  /**
@@ -1,5 +1,4 @@
1
1
  import { IDocumentData, IRange, IStyleData } from '@univerjs/core';
2
-
3
2
  export declare const DEFAULT_BACKGROUND_COLOR_RGBA = "rgba(0,0,0,0)";
4
3
  export declare const DEFAULT_BACKGROUND_COLOR_RGB = "rgb(0,0,0)";
5
4
  /**
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IWorkbenchOptions } from '../controllers/ui/ui.controller';
3
-
4
3
  export interface IUniverAppProps extends IWorkbenchOptions {
5
4
  mountContainer: HTMLElement;
6
5
  onRendered?: (container: HTMLElement) => void;
@@ -1,6 +1,5 @@
1
1
  import { ComponentType, default as React } from 'react';
2
2
  import { Injector } from '@univerjs/core';
3
-
4
3
  export interface IComponentContainerProps {
5
4
  components?: Set<ComponentType>;
6
5
  fallback?: React.ReactNode;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function ConfirmPart(): React.JSX.Element[];
@@ -1,6 +1,5 @@
1
1
  import { IConfirmProps } from '@univerjs/design';
2
2
  import { ICustomLabelProps } from '../../../components/custom-label/CustomLabel';
3
-
4
3
  export type IConfirmPartMethodOptions = {
5
4
  id: string;
6
5
  children?: ICustomLabelProps;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function DesktopContextMenu(): React.JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function MobileContextMenu(): React.JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function DialogPart(): React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { IDialogProps } from '@univerjs/design';
2
2
  import { ICustomLabelProps } from '../../../components/custom-label/CustomLabel';
3
-
4
3
  export type IDialogPartMethodOptions = {
5
4
  id: string;
6
5
  children?: ICustomLabelProps;
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export interface IBaseToolbarButtonProps {
4
3
  children?: React.ReactNode;
5
4
  /** Semantic DOM class */
@@ -1,5 +1,4 @@
1
1
  import { ComponentType, default as React } from 'react';
2
-
3
2
  export interface IToolbarProps {
4
3
  headerMenuComponents?: Set<ComponentType>;
5
4
  }
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IDisplayMenuItem, IMenuItem } from '../../../services/menu/menu';
3
-
4
3
  export declare const ToolbarItem: React.ForwardRefExoticComponent<IDisplayMenuItem<IMenuItem> & React.RefAttributes<any>>;
@@ -1,5 +1,4 @@
1
1
  import { IDisplayMenuItem, IMenuItem, MenuGroup, MenuPosition } from '../../../services/menu/menu';
2
-
3
2
  type MenuPositionWithCustom = MenuPosition | string;
4
3
  export interface IMenuGroup {
5
4
  name: MenuPositionWithCustom;
@@ -20,7 +19,7 @@ export interface IToolbarRenderHookHandler {
20
19
  * you can use this hook to get the toolbar status.
21
20
  * @returns toolbar status
22
21
  */
23
- export declare function useToolbarGroups(categories: MenuPositionWithCustom[]): IToolbarRenderHookHandler;
22
+ export declare function useToolbarGroups(categories: MenuPositionWithCustom[], initCategory?: string): IToolbarRenderHookHandler;
24
23
  export interface IToolbarItemStatus {
25
24
  disabled: boolean;
26
25
  value: any;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare const FloatDom: () => React.JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function GlobalZone(): React.JSX.Element | null;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function CanvasPopup(): React.JSX.Element[];
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  /**
4
3
  * This component is responsible for rendering the shortcut panel on the desktop version of the app.
5
4
  */
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function Sidebar(): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ICustomLabelProps } from '../../../components/custom-label/CustomLabel';
2
-
3
2
  export interface ISidebarMethodOptions {
3
+ id?: string;
4
4
  header?: ICustomLabelProps;
5
5
  children?: ICustomLabelProps;
6
6
  footer?: ICustomLabelProps;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare function ZenZone(): React.JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ComponentType } from 'react';
2
-
3
2
  export declare const builtInGlobalComponents: Set<ComponentType>;
@@ -1,8 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { IWorkbenchOptions } from '../../controllers/ui/ui.controller';
3
-
4
3
  export interface IUniverWorkbenchProps extends IWorkbenchOptions {
5
4
  mountContainer: HTMLElement;
6
- onRendered?: (container: HTMLElement) => void;
5
+ onRendered?: (containerElement: HTMLElement) => void;
7
6
  }
8
7
  export declare function DesktopWorkbench(props: IUniverWorkbenchProps): React.JSX.Element;