@univerjs/ui 0.2.2 → 0.2.4-alpha.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.
Files changed (57) hide show
  1. package/README.md +11 -4
  2. package/lib/cjs/index.js +14 -14
  3. package/lib/es/index.js +3781 -3733
  4. package/lib/index.css +1 -1
  5. package/lib/locale/vi-VN.json +61 -0
  6. package/lib/locale/zh-TW.json +61 -0
  7. package/lib/types/common/component-manager.d.ts +1 -1
  8. package/lib/types/common/lifecycle.d.ts +1 -1
  9. package/lib/types/common/menu-hidden-observable.d.ts +1 -2
  10. package/lib/types/const.d.ts +19 -0
  11. package/lib/types/controllers/menus/menus.d.ts +1 -1
  12. package/lib/types/controllers/shared-shortcut.controller.d.ts +1 -2
  13. package/lib/types/controllers/shortcut-display/menu.d.ts +1 -1
  14. package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +1 -2
  15. package/lib/types/controllers/ui/ui-desktop.controller.d.ts +1 -2
  16. package/lib/types/controllers/ui/ui-mobile.controller.d.ts +1 -2
  17. package/lib/types/controllers/ui/ui.controller.d.ts +1 -1
  18. package/lib/types/index.d.ts +12 -6
  19. package/lib/types/locale/vi-VN.d.ts +4 -0
  20. package/lib/types/locale/zh-TW.d.ts +4 -0
  21. package/lib/types/mobile-ui-plugin.d.ts +1 -2
  22. package/lib/types/services/before-close/before-close.service.d.ts +2 -2
  23. package/lib/types/services/clipboard/clipboard-interface.service.d.ts +1 -1
  24. package/lib/types/services/confirm/confirm.service.d.ts +2 -2
  25. package/lib/types/services/confirm/desktop-confirm.service.d.ts +1 -2
  26. package/lib/types/services/contextmenu/contextmenu.service.d.ts +2 -3
  27. package/lib/types/services/dialog/desktop-dialog.service.d.ts +1 -2
  28. package/lib/types/services/dialog/dialog.service.d.ts +2 -2
  29. package/lib/types/services/editor/editor.service.d.ts +2 -3
  30. package/lib/types/services/global-zone/desktop-global-zone.service.d.ts +1 -1
  31. package/lib/types/services/global-zone/global-zone.service.d.ts +2 -2
  32. package/lib/types/services/layout/layout.service.d.ts +2 -3
  33. package/lib/types/services/menu/menu.d.ts +1 -1
  34. package/lib/types/services/menu/menu.service.d.ts +2 -3
  35. package/lib/types/services/message/__testing__/mock-message.service.d.ts +2 -1
  36. package/lib/types/services/message/desktop-message.service.d.ts +2 -1
  37. package/lib/types/services/message/message.service.d.ts +3 -2
  38. package/lib/types/services/notification/desktop-notification.service.d.ts +1 -2
  39. package/lib/types/services/notification/notification.service.d.ts +2 -2
  40. package/lib/types/services/parts/parts.service.d.ts +4 -4
  41. package/lib/types/services/platform/platform.service.d.ts +1 -1
  42. package/lib/types/services/popup/canvas-popup.service.d.ts +1 -1
  43. package/lib/types/services/progress/progress.service.d.ts +2 -3
  44. package/lib/types/services/range-selector/range-selector.service.d.ts +2 -3
  45. package/lib/types/services/shortcut/keycode.d.ts +2 -0
  46. package/lib/types/services/shortcut/shortcut.service.d.ts +2 -3
  47. package/lib/types/services/sidebar/desktop-sidebar.service.d.ts +2 -1
  48. package/lib/types/services/sidebar/sidebar.service.d.ts +3 -2
  49. package/lib/types/services/zen-zone/desktop-zen-zone.service.d.ts +1 -1
  50. package/lib/types/services/zen-zone/zen-zone.service.d.ts +2 -2
  51. package/lib/types/ui-plugin.d.ts +2 -3
  52. package/lib/types/utils/util.d.ts +1 -0
  53. package/lib/types/views/components/ComponentContainer.d.ts +1 -1
  54. package/lib/types/views/workbench/Workbench.d.ts +8 -0
  55. package/lib/umd/index.js +14 -14
  56. package/package.json +14 -16
  57. package/lib/types/views/DesktopApp.d.ts +0 -8
@@ -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('@wendellhu/redi').IdentifierDecorator<IPlatformService>;
24
+ export declare const IPlatformService: import('@univerjs/core').IdentifierDecorator<IPlatformService>;
25
25
  export declare class PlatformService implements IPlatformService {
26
26
  get isMac(): boolean;
27
27
  get isWindows(): boolean;
@@ -20,7 +20,7 @@ export interface ICanvasPopupService {
20
20
  popups$: Observable<[string, IPopup][]>;
21
21
  get popups(): [string, IPopup][];
22
22
  }
23
- export declare const ICanvasPopupService: import('@wendellhu/redi').IdentifierDecorator<ICanvasPopupService>;
23
+ export declare const ICanvasPopupService: import('@univerjs/core').IdentifierDecorator<ICanvasPopupService>;
24
24
  export declare class CanvasPopupService extends Disposable implements ICanvasPopupService {
25
25
  private readonly _popupMap;
26
26
  private readonly _popups$;
@@ -1,5 +1,4 @@
1
- import { Disposable } from '@univerjs/core';
2
- import { IDisposable } from '@wendellhu/redi';
1
+ import { Disposable, IDisposable } from '@univerjs/core';
3
2
  import { Observable } from 'rxjs';
4
3
 
5
4
  export interface IProgressCount {
@@ -51,4 +50,4 @@ export declare class ProgressService extends Disposable implements IProgressServ
51
50
  getTaskCount(): number;
52
51
  private _clear;
53
52
  }
54
- export declare const IProgressService: import('@wendellhu/redi').IdentifierDecorator<IProgressService>;
53
+ export declare const IProgressService: import('@univerjs/core').IdentifierDecorator<IProgressService>;
@@ -1,5 +1,4 @@
1
- import { IUnitRange, Nullable, Disposable } from '@univerjs/core';
2
- import { IDisposable } from '@wendellhu/redi';
1
+ import { IDisposable, IUnitRange, Nullable, Disposable } from '@univerjs/core';
3
2
  import { Observable } from 'rxjs';
4
3
 
5
4
  export interface IRangeSelectorRange extends IUnitRange {
@@ -24,4 +23,4 @@ export declare class RangeSelectorService extends Disposable implements IRangeSe
24
23
  selectionChange(range: IRangeSelectorRange[]): void;
25
24
  openSelector(): void;
26
25
  }
27
- export declare const IRangeSelectorService: import('@wendellhu/redi').IdentifierDecorator<IRangeSelectorService>;
26
+ export declare const IRangeSelectorService: import('@univerjs/core').IdentifierDecorator<IRangeSelectorService>;
@@ -19,6 +19,8 @@ export declare enum KeyCode {
19
19
  BACKSPACE = 8,
20
20
  TAB = 9,
21
21
  ENTER = 13,
22
+ SHIFT = 16,
23
+ CTRL = 17,
22
24
  ESC = 27,
23
25
  SPACE = 32,
24
26
  ARROW_LEFT = 37,
@@ -1,5 +1,4 @@
1
- import { Disposable, ICommandService, IContextService } from '@univerjs/core';
2
- import { IDisposable } from '@wendellhu/redi';
1
+ import { Disposable, ICommandService, IContextService, IDisposable } from '@univerjs/core';
3
2
  import { Observable } from 'rxjs';
4
3
  import { ILayoutService } from '../layout/layout.service';
5
4
  import { IPlatformService } from '../platform/platform.service';
@@ -35,7 +34,7 @@ export interface IShortcutService {
35
34
  getAllShortcuts(): IShortcutItem[];
36
35
  setDisable(disable: boolean): void;
37
36
  }
38
- export declare const IShortcutService: import('@wendellhu/redi').IdentifierDecorator<IShortcutService>;
37
+ export declare const IShortcutService: import('@univerjs/core').IdentifierDecorator<IShortcutService>;
39
38
  export declare class ShortcutService extends Disposable implements IShortcutService {
40
39
  private readonly _commandService;
41
40
  private readonly _platformService;
@@ -1,4 +1,4 @@
1
- import { IDisposable } from '@wendellhu/redi';
1
+ 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';
@@ -6,6 +6,7 @@ import { ISidebarService } from './sidebar.service';
6
6
  export declare class DesktopSidebarService implements ISidebarService {
7
7
  private _sidebarOptions;
8
8
  readonly sidebarOptions$: Subject<ISidebarMethodOptions>;
9
+ readonly scrollEvent$: Subject<Event>;
9
10
  open(params: ISidebarMethodOptions): IDisposable;
10
11
  close(): void;
11
12
  }
@@ -1,10 +1,11 @@
1
- import { IDisposable } from '@wendellhu/redi';
1
+ import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { ISidebarMethodOptions } from '../../views/components/sidebar/interface';
4
4
 
5
- export declare const ISidebarService: import('@wendellhu/redi').IdentifierDecorator<ISidebarService>;
5
+ export declare const ISidebarService: import('@univerjs/core').IdentifierDecorator<ISidebarService>;
6
6
  export interface ISidebarService {
7
7
  readonly sidebarOptions$: Subject<ISidebarMethodOptions>;
8
+ readonly scrollEvent$: Subject<Event>;
8
9
  open(params: ISidebarMethodOptions): IDisposable;
9
10
  close(): void;
10
11
  }
@@ -1,4 +1,4 @@
1
- import { IDisposable } from '@wendellhu/redi';
1
+ import { IDisposable } from '@univerjs/core';
2
2
  import { ForwardRefExoticComponent } from 'react';
3
3
  import { Subject } from 'rxjs';
4
4
  import { ComponentManager } from '../../common/component-manager';
@@ -1,7 +1,7 @@
1
- import { IDisposable } from '@wendellhu/redi';
1
+ import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
3
 
4
- export declare const IZenZoneService: import('@wendellhu/redi').IdentifierDecorator<IZenZoneService>;
4
+ export declare const IZenZoneService: import('@univerjs/core').IdentifierDecorator<IZenZoneService>;
5
5
  export interface IZenZoneService {
6
6
  readonly visible$: Subject<boolean>;
7
7
  readonly componentKey$: Subject<string>;
@@ -1,8 +1,7 @@
1
- import { IContextService, Plugin } from '@univerjs/core';
2
- import { Injector } from '@wendellhu/redi';
1
+ import { IContextService, Injector, Plugin } from '@univerjs/core';
3
2
  import { IUniverUIConfig } from './controllers/ui/ui.controller';
4
3
 
5
- export declare const DefaultUiConfig: {};
4
+ export declare const UNIVER_UI_PLUGIN_NAME = "UNIVER_UI_PLUGIN";
6
5
  export declare const DISABLE_AUTO_FOCUS_KEY = "DISABLE_AUTO_FOCUS";
7
6
  /**
8
7
  * UI plugin provides basic interaction with users. Including workbench (menus, UI parts, notifications etc.), copy paste, shortcut.
@@ -14,3 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export declare function textTrim(x: string): string;
17
+ export declare function isElementVisible(element: HTMLElement | null): boolean;
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, default as React } from 'react';
2
- import { Injector } from '@wendellhu/redi';
2
+ import { Injector } from '@univerjs/core';
3
3
 
4
4
  export interface IComponentContainerProps {
5
5
  components?: Set<ComponentType>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { IWorkbenchOptions } from '../../controllers/ui/ui.controller';
3
+
4
+ export interface IUniverWorkbenchProps extends IWorkbenchOptions {
5
+ mountContainer: HTMLElement;
6
+ onRendered?: (container: HTMLElement) => void;
7
+ }
8
+ export declare function DesktopWorkbench(props: IUniverWorkbenchProps): React.JSX.Element;