@univerjs/ui 0.2.7 → 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 +2 -2
  2. package/lib/es/index.js +119 -10
  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 +1 -0
  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 +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 +0 -1
  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 +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 +0 -1
  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 +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 +2 -2
  97. package/package.json +14 -14
@@ -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",
@@ -2,7 +2,6 @@ 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>;
7
6
  export interface IMenuService {
8
7
  menuChanged$: Observable<void>;
@@ -29,4 +28,5 @@ export declare class MenuService extends Disposable implements IMenuService {
29
28
  getMenuConfig(id: string): MenuConfig | null;
30
29
  private _getDisplayMenuItems;
31
30
  private _appendMenuToPosition;
31
+ private _updateMenuItems;
32
32
  }
@@ -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>;
@@ -3,7 +3,6 @@ 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
-
7
6
  export interface IShortcutItem<P extends object = object> {
8
7
  /** This should reuse the corresponding command's id. */
9
8
  id: string;
@@ -2,7 +2,6 @@ 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>;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { ISidebarMethodOptions } from '../../views/components/sidebar/interface';
4
-
5
4
  export interface ISidebarService {
6
5
  readonly sidebarOptions$: Subject<ISidebarMethodOptions>;
7
6
  readonly scrollEvent$: Subject<Event>;
@@ -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;
@@ -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,5 +1,4 @@
1
1
  import { ICustomLabelProps } from '../../../components/custom-label/CustomLabel';
2
-
3
2
  export interface ISidebarMethodOptions {
4
3
  id?: string;
5
4
  header?: 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,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 IUniverWorkbenchProps extends IWorkbenchOptions {
5
4
  mountContainer: HTMLElement;
6
5
  onRendered?: (containerElement: HTMLElement) => void;