@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,3 +1,2 @@
1
1
  import { IOperation } from '@univerjs/core';
2
-
3
2
  export declare const SetEditorResizeOperation: IOperation;
@@ -1,4 +1,3 @@
1
1
  import { IOperation } from '@univerjs/core';
2
-
3
2
  export declare const ShortcutPanelComponentName = "ShortcutPanel";
4
3
  export declare const ToggleShortcutPanelOperation: IOperation;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { defineComponent } from 'vue';
3
3
  import { default as React } from 'react';
4
-
5
4
  type ComponentFramework = 'vue3' | 'react';
6
5
  interface IComponentOptions {
7
6
  framework?: ComponentFramework;
@@ -1,4 +1,3 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
-
3
2
  export declare function fromGlobalEvent<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): IDisposable;
4
3
  export declare function fromEvent<K extends keyof HTMLElementEventMap>(target: HTMLElement, type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): IDisposable;
@@ -1,5 +1,4 @@
1
1
  import { IAccessor, UniverInstanceType } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export declare function getMenuHiddenObservable(accessor: IAccessor, targetUniverType: UniverInstanceType): Observable<boolean>;
5
4
  export declare function getHeaderFooterMenuHiddenObservable(accessor: IAccessor): Observable<boolean>;
@@ -1,3 +1,2 @@
1
1
  import { MenuConfig, MenuItemConfig } from '../services/menu/menu';
2
-
3
2
  export declare function mergeMenuConfigs<T = MenuConfig>(baseConfig: T, additionalConfig: MenuItemConfig | null): T;
@@ -1,7 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IMenuSelectorItem } from '../../services/menu/menu';
4
-
5
4
  export type ICustomLabelProps<T = undefined> = {
6
5
  value?: string | number | undefined;
7
6
  value$?: Observable<T>;
@@ -1,17 +1,17 @@
1
1
  import { IDocumentData, Nullable } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
3
  import { IEditorCanvasStyle } from '../../services/editor/editor.service';
4
-
5
4
  type MyComponentProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
6
5
  export interface ITextEditorProps {
7
6
  id: string;
8
7
  className?: string;
9
8
  snapshot?: IDocumentData;
9
+ value?: string;
10
10
  resizeCallBack?: (editor: Nullable<HTMLDivElement>) => void;
11
11
  cancelDefaultResizeListener?: boolean;
12
- isSheetEditor?: boolean;
13
12
  canvasStyle?: IEditorCanvasStyle;
14
- value?: string;
13
+ isSheetEditor?: boolean;
14
+ isFormulaEditor?: boolean;
15
15
  isSingle?: boolean;
16
16
  isReadonly?: boolean;
17
17
  onlyInputFormula?: boolean;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFontFamilyProps } from './interface';
3
-
4
3
  export declare const FontFamily: (props: IFontFamilyProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFontFamilyItemProps } from './interface';
3
-
4
3
  export declare const FontFamilyItem: (props: IFontFamilyItemProps) => React.JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { ICustomComponentProps } from '@univerjs/ui';
2
-
3
2
  export interface IFontFamilyProps extends ICustomComponentProps<string> {
4
3
  value: string;
5
4
  }
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IFontSizeProps } from './interface';
3
-
4
3
  export declare const FontSize: (props: IFontSizeProps) => React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { ICustomComponentProps } from '@univerjs/ui';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export interface IFontSizeProps extends ICustomComponentProps<string> {
5
4
  value: string;
6
5
  min: number;
@@ -1,5 +1,4 @@
1
1
  import { Nullable } from '@univerjs/core';
2
-
3
2
  /**
4
3
  * These hooks are used for browser layout
5
4
  * Prefer to client-side
@@ -1,4 +1,3 @@
1
1
  import { LocaleService } from '@univerjs/core';
2
-
3
2
  export declare function useLocaleService(): LocaleService;
4
3
  export declare function t(localeService: LocaleService, key: string, ...args: Array<number | string>): string;
@@ -1,10 +1,10 @@
1
1
  import { Nullable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  type ObservableOrFn<T> = Observable<T> | (() => Observable<T>);
5
4
  export declare function useObservable<T>(observable: ObservableOrFn<T>, defaultValue: T | undefined, shouldHaveSyncValue?: true): T;
6
5
  export declare function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue: T): T;
7
6
  export declare function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue?: undefined): T | undefined;
7
+ export declare function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue: T, shouldHaveSyncValue?: boolean, deps?: any[]): T;
8
8
  export declare function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue: undefined, shouldHaveSyncValue: true, deps?: any[]): T;
9
9
  export declare function useObservable<T>(observable: Nullable<ObservableOrFn<T>>, defaultValue?: T, shouldHaveSyncValue?: boolean, deps?: any[]): T | undefined;
10
10
  export {};
@@ -0,0 +1,35 @@
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
+ type ItemHeight<T> = (index: number, data: T) => number;
17
+ export interface IVirtualListOptions<T> {
18
+ containerTarget: React.RefObject<HTMLElement>;
19
+ itemHeight: number | ItemHeight<T>;
20
+ overscan?: number;
21
+ }
22
+ declare const useVirtualList: <T>(list: T[], options: IVirtualListOptions<T>) => readonly [{
23
+ index: number;
24
+ data: T;
25
+ }[], {
26
+ readonly wrapperStyle: {
27
+ height: string | undefined;
28
+ marginTop: string | undefined;
29
+ };
30
+ readonly scrollTo: (index: number) => void;
31
+ readonly containerProps: {
32
+ readonly onScroll: (e: React.UIEvent<HTMLElement, UIEvent>) => void;
33
+ };
34
+ }];
35
+ export { useVirtualList };
@@ -1,3 +1,2 @@
1
1
  import { IDisplayMenuItem, IMenuItem } from '../../../services/menu/menu';
2
-
3
2
  export declare function useMenuItemState(menuItem: IDisplayMenuItem<IMenuItem>): void;
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IValueOption } from '../../../services/menu/menu.ts';
3
-
4
3
  export interface IBaseMenuProps {
5
4
  parentKey?: string | number;
6
5
  menuType?: string | string[];
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IBaseMenuProps } from '../desktop/Menu';
3
-
4
3
  /**
5
4
  * The mobile context menu wrapper.
6
5
  */
@@ -1,6 +1,5 @@
1
1
  import { Meta } from '@storybook/react';
2
2
  import { default as React } from 'react';
3
-
4
3
  declare const meta: Meta;
5
4
  export default meta;
6
5
  export declare const Playground: {
@@ -1,7 +1,6 @@
1
1
  import { Placement } from 'rc-notification/es/interface';
2
2
  import { default as React } from 'react';
3
3
  import { Subject } from 'rxjs';
4
-
5
4
  export type NotificationType = 'success' | 'info' | 'warning' | 'error';
6
5
  export interface INotificationOptions {
7
6
  /**
@@ -1,7 +1,6 @@
1
1
  import { Meta } from '@storybook/react';
2
2
  import { default as React } from 'react';
3
3
  import { Notification } from './Notification';
4
-
5
4
  declare const meta: Meta<typeof Notification>;
6
5
  export default meta;
7
6
  export declare const Playground: {
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export interface IProgressBarProps {
4
3
  barColor: string;
5
4
  }
@@ -1,6 +1,5 @@
1
1
  import { IUnitRangeWithName, Nullable } from '@univerjs/core';
2
2
  import { default as React } from 'react';
3
-
4
3
  export interface IRangeSelectorProps {
5
4
  id: string;
6
5
  value?: string;
@@ -1,6 +1,5 @@
1
1
  import { Disposable, ErrorService } from '@univerjs/core';
2
2
  import { IMessageService } from '../../services/message/message.service';
3
-
4
3
  export declare class ErrorController extends Disposable {
5
4
  private readonly _errorService;
6
5
  private readonly _messageService;
@@ -1,5 +1,4 @@
1
1
  import { IAccessor } from '@univerjs/core';
2
2
  import { IMenuButtonItem } from '../../services/menu/menu';
3
-
4
3
  export declare function UndoMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
5
4
  export declare function RedoMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -2,7 +2,6 @@ import { Disposable, ICommandService, Injector } from '@univerjs/core';
2
2
  import { IMenuService } from '../services/menu/menu.service';
3
3
  import { IShortcutItem, IShortcutService } from '../services/shortcut/shortcut.service';
4
4
  import { IUniverUIConfig } from './ui/ui.controller';
5
-
6
5
  export declare const CopyShortcutItem: IShortcutItem;
7
6
  export declare const CutShortcutItem: IShortcutItem;
8
7
  /**
@@ -1,4 +1,3 @@
1
1
  import { IAccessor } from '@univerjs/core';
2
2
  import { IMenuButtonItem } from '../../services/menu/menu';
3
-
4
3
  export declare function ShortcutPanelMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -3,7 +3,6 @@ import { ComponentManager } from '../../common/component-manager';
3
3
  import { IMenuService } from '../../services/menu/menu.service';
4
4
  import { IShortcutService } from '../../services/shortcut/shortcut.service';
5
5
  import { IUniverUIConfig } from '../ui/ui.controller';
6
-
7
6
  /**
8
7
  * This controller add a side panel to the application to display the shortcuts.
9
8
  */
@@ -3,7 +3,6 @@ import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ILayoutService } from '../../services/layout/layout.service';
4
4
  import { IUIPartsService } from '../../services/parts/parts.service';
5
5
  import { IUniverUIConfig } from './ui.controller';
6
-
7
6
  export declare class DesktopUIController extends Disposable {
8
7
  private readonly _config;
9
8
  private readonly _renderManagerService;
@@ -3,7 +3,6 @@ import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ILayoutService } from '../../services/layout/layout.service';
4
4
  import { IUIPartsService } from '../../services/parts/parts.service';
5
5
  import { IUIController, IUniverUIConfig } from './ui.controller';
6
-
7
6
  export declare class MobileUIController extends Disposable implements IUIController {
8
7
  private readonly _config;
9
8
  private readonly _instanceService;
@@ -1,6 +1,5 @@
1
1
  import { DependencyOverride } from '@univerjs/core';
2
2
  import { MenuConfig } from '../../services/menu/menu';
3
-
4
3
  export interface IWorkbenchOptions {
5
4
  container?: string | HTMLElement;
6
5
  header?: boolean;
@@ -19,6 +19,7 @@ export * from './components';
19
19
  export { t } from './components/hooks/locale';
20
20
  export { useObservable } from './components/hooks/observable';
21
21
  export { useEvent } from './components/hooks/event';
22
+ export { useVirtualList } from './components/hooks/virtual-list';
22
23
  export { CopyShortcutItem, CutShortcutItem, RedoShortcutItem, SharedController, UndoShortcutItem, } from './controllers/shared-shortcut.controller';
23
24
  export { UI_CONFIG_KEY, IUIController, type IWorkbenchOptions, type IUniverUIConfig } from './controllers/ui/ui.controller';
24
25
  export { DesktopUIController } from './controllers/ui/ui-desktop.controller';
@@ -46,7 +47,7 @@ export { IGlobalZoneService } from './services/global-zone/global-zone.service';
46
47
  export { KeyCode, MetaKeys } from './services/shortcut/keycode';
47
48
  export { ShortcutService, type IShortcutItem, IShortcutService } from './services/shortcut/shortcut.service';
48
49
  export { DesktopSidebarService } from './services/sidebar/desktop-sidebar.service';
49
- export { ISidebarService } from './services/sidebar/sidebar.service';
50
+ export { ISidebarService, ILeftSidebarService } from './services/sidebar/sidebar.service';
50
51
  export { IZenZoneService } from './services/zen-zone/zen-zone.service';
51
52
  export { UniverUIPlugin, DISABLE_AUTO_FOCUS_KEY } from './ui-plugin';
52
53
  export { UniverMobileUIPlugin } from './mobile-ui-plugin';
@@ -54,7 +55,7 @@ export * from './utils';
54
55
  export { Menu } from './components/menu/desktop/Menu';
55
56
  export { type IConfirmPartMethodOptions } from './views/components/confirm-part/interface';
56
57
  export { ComponentContainer, useComponentsOfPart, type IComponentContainerProps } from './views/components/ComponentContainer';
57
- export { IEditorService, EditorService } from './services/editor/editor.service';
58
+ export { IEditorService, EditorService, Editor } from './services/editor/editor.service';
58
59
  export { TextEditor } from './components/editor/TextEditor';
59
60
  export { RangeSelector } from './components/range-selector/RangeSelector';
60
61
  export { ProgressBar } from './components/progress-bar/ProgressBar';
@@ -74,11 +75,14 @@ export { GlobalZone } from './views/components/global-zone/GlobalZone';
74
75
  export { builtInGlobalComponents } from './views/parts';
75
76
  export { DesktopContextMenu as ContextMenu } from './views/components/context-menu/ContextMenu';
76
77
  export { Sidebar } from './views/components/sidebar/Sidebar';
78
+ export { type ISidebarMethodOptions } from './views/components/sidebar/interface';
77
79
  export { ZenZone } from './views/components/zen-zone/ZenZone';
78
80
  export { CanvasPopup } from './views/components/popup/CanvasPopup';
79
81
  export { CanvasFloatDomService, type IFloatDomLayout } from './services/dom/canvas-dom-layer.service';
80
82
  export { FloatDom } from './views/components/dom/FloatDom';
81
83
  export { MobileContextMenu } from './views/components/context-menu/MobileContextMenu';
82
84
  export { Toolbar } from './views/components/doc-bars/Toolbar';
85
+ export { ToolbarItem } from './views/components/doc-bars/ToolbarItem';
86
+ export { ToolbarButton } from './views/components/doc-bars/Button/ToolbarButton';
83
87
  export { ToggleShortcutPanelOperation } from './commands/operations/toggle-shortcut-panel.operation';
84
88
  export { SetEditorResizeOperation } from './commands/operations/editor/set-editor-resize.operation';
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,6 +1,5 @@
1
1
  import { Injector, Plugin } from '@univerjs/core';
2
2
  import { IUniverUIConfig } from './controllers/ui/ui.controller';
3
-
4
3
  export declare const UNIVER_MOBILE_UI_PLUGIN_NAME = "UNIVER_MOBILE_UI_PLUGIN";
5
4
  /**
6
5
  * @ignore
@@ -1,6 +1,5 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { INotificationService } from '../notification/notification.service';
3
-
4
3
  export interface IBeforeCloseService {
5
4
  /**
6
5
  * Provide a callback to check if the web page could be closed safely.
@@ -1,6 +1,5 @@
1
1
  import { Disposable, ILogService, LocaleService } from '@univerjs/core';
2
2
  import { INotificationService } from '../notification/notification.service';
3
-
4
3
  export declare const PLAIN_TEXT_CLIPBOARD_MIME_TYPE = "text/plain";
5
4
  export declare const HTML_CLIPBOARD_MIME_TYPE = "text/html";
6
5
  /**
@@ -1,5 +1,4 @@
1
1
  import { IMultiCommand } from '@univerjs/core';
2
-
3
2
  export declare const CopyCommand: IMultiCommand;
4
3
  export declare const CutCommand: IMultiCommand;
5
4
  export declare const PasteCommand: IMultiCommand;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { Subject } from 'rxjs';
3
3
  import { IConfirmPartMethodOptions } from '../../views/components/confirm-part/interface';
4
-
5
4
  export declare const IConfirmService: import('@univerjs/core').IdentifierDecorator<IConfirmService>;
6
5
  export interface IConfirmService {
7
6
  readonly confirmOptions$: Subject<IConfirmPartMethodOptions[]>;
@@ -3,7 +3,6 @@ import { Subject } from 'rxjs';
3
3
  import { IConfirmPartMethodOptions } from '../../views/components/confirm-part/interface';
4
4
  import { IUIPartsService } from '../parts/parts.service';
5
5
  import { IConfirmService } from './confirm.service';
6
-
7
6
  export declare class DesktopConfirmService extends Disposable implements IConfirmService {
8
7
  protected readonly _injector: Injector;
9
8
  protected readonly _uiPartsService: IUIPartsService;
@@ -1,6 +1,5 @@
1
1
  import { Disposable, IDisposable } from '@univerjs/core';
2
2
  import { IMouseEvent, IPointerEvent } from '@univerjs/engine-render';
3
-
4
3
  export interface IContextMenuHandler {
5
4
  /** A callback to open context menu with given position and menu type. */
6
5
  handleContextMenu(event: IPointerEvent | IMouseEvent, menuType: string): void;
@@ -3,7 +3,6 @@ import { Subject } from 'rxjs';
3
3
  import { IDialogPartMethodOptions } from '../../views/components/dialog-part/interface';
4
4
  import { IUIPartsService } from '../parts/parts.service';
5
5
  import { IDialogService } from './dialog.service';
6
-
7
6
  export declare class DesktopDialogService extends Disposable implements IDialogService {
8
7
  protected readonly _injector: Injector;
9
8
  protected readonly _uiPartsService: IUIPartsService;
@@ -1,7 +1,6 @@
1
1
  import { IDisposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IDialogPartMethodOptions } from '../../views/components/dialog-part/interface';
4
-
5
4
  export declare const IDialogService: import('@univerjs/core').IdentifierDecorator<IDialogService>;
6
5
  export interface IDialogService {
7
6
  open(params: IDialogPartMethodOptions): IDisposable;
@@ -1,6 +1,5 @@
1
1
  import { IPosition, Serializable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  export interface IFloatDomLayout extends IPosition {
5
4
  rotate: number;
6
5
  width: number;
@@ -1,8 +1,7 @@
1
1
  import { DocumentDataModel, IDisposable, IDocumentBody, IDocumentData, IPosition, Nullable, Disposable, IContextService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
- import { IRender, ISuccinctTextRangeParam, IRenderManagerService } from '@univerjs/engine-render';
3
+ import { IRender, ISuccinctDocRangeParam, IRenderManagerService } from '@univerjs/engine-render';
4
4
  import { LexerTreeBuilder } from '@univerjs/engine-formula';
5
-
6
5
  export interface IEditorStateParam extends Partial<IPosition> {
7
6
  visible?: boolean;
8
7
  }
@@ -15,6 +14,11 @@ export interface IEditorConfigParam {
15
14
  cancelDefaultResizeListener?: boolean;
16
15
  canvasStyle?: IEditorCanvasStyle;
17
16
  isSheetEditor: boolean;
17
+ /**
18
+ * If the editor is for formula editing.
19
+ * @deprecated this is a temp fix before refactoring editor.
20
+ */
21
+ isFormulaEditor: boolean;
18
22
  isSingle: boolean;
19
23
  isReadonly: boolean;
20
24
  onlyInputFormula: boolean;
@@ -65,6 +69,8 @@ export declare class Editor {
65
69
  getBoundingClientRect(): DOMRect;
66
70
  isVisible(): boolean | undefined;
67
71
  isSheetEditor(): boolean;
72
+ /** @deprecated */
73
+ isFormulaEditor(): boolean;
68
74
  getValue(): string;
69
75
  getBody(): IDocumentBody | undefined;
70
76
  update(param: Partial<IEditorSetParam>): void;
@@ -98,7 +104,7 @@ export interface IEditorService {
98
104
  closeRangePrompt(): void;
99
105
  blur$: Observable<unknown>;
100
106
  blur(): void;
101
- focus$: Observable<ISuccinctTextRangeParam>;
107
+ focus$: Observable<ISuccinctDocRangeParam>;
102
108
  focus(editorUnitId?: string): void;
103
109
  setValue$: Observable<IEditorSetValueParam>;
104
110
  valueChange$: Observable<Readonly<Editor>>;
@@ -141,7 +147,7 @@ export declare class EditorService extends Disposable implements IEditorService,
141
147
  private readonly _blur$;
142
148
  readonly blur$: Observable<unknown>;
143
149
  private readonly _focus$;
144
- readonly focus$: Observable<ISuccinctTextRangeParam>;
150
+ readonly focus$: Observable<ISuccinctDocRangeParam>;
145
151
  private readonly _setValue$;
146
152
  readonly setValue$: Observable<IEditorSetValueParam>;
147
153
  private readonly _valueChange$;
@@ -187,7 +193,6 @@ export declare class EditorService extends Disposable implements IEditorService,
187
193
  checkValueLegality(editorUnitId: string): boolean;
188
194
  private _refreshValueChange;
189
195
  private _getCurrentEditorUnitId;
190
- private _refresh;
191
196
  private _getBlank;
192
197
  }
193
198
  export declare const IEditorService: import('@univerjs/core').IdentifierDecorator<IEditorService>;
@@ -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 {
@@ -12,13 +11,13 @@ export interface ILayoutService {
12
11
  registerFocusHandler(type: UniverInstanceType, handler: FocusHandlerFn): IDisposable;
13
12
  /** Register the root container element. */
14
13
  registerRootContainerElement(container: HTMLElement): IDisposable;
15
- /** Register a canvas element. */
16
- registerCanvasElement(container: HTMLCanvasElement): IDisposable;
14
+ /** Register a content element. */
15
+ registerContentElement(container: HTMLElement): IDisposable;
17
16
  /** Register an element as a container, especially floating components like Dialogs and Notifications. */
18
17
  registerContainerElement(container: HTMLElement): IDisposable;
19
- getCanvasElement(): HTMLCanvasElement;
18
+ getContentElement(): HTMLElement;
20
19
  checkElementInCurrentContainers(element: HTMLElement): boolean;
21
- checkCanvasIsFocused(): boolean;
20
+ checkContentIsFocused(): boolean;
22
21
  }
23
22
  export declare const ILayoutService: import('@univerjs/core').IdentifierDecorator<ILayoutService>;
24
23
  /**
@@ -33,18 +32,18 @@ export declare class DesktopLayoutService extends Disposable implements ILayoutS
33
32
  private _isFocused;
34
33
  get isFocused(): boolean;
35
34
  private readonly _focusHandlers;
36
- private _canvasContainers;
35
+ private _contentElements;
37
36
  private _allContainers;
38
37
  constructor(_contextService: ContextService, _univerInstanceService: IUniverInstanceService, _editorService: IEditorService);
39
38
  get rootContainerElement(): Nullable<HTMLElement>;
40
39
  focus(): void;
41
40
  registerFocusHandler(type: UniverInstanceType, handler: FocusHandlerFn): IDisposable;
42
- registerCanvasElement(container: HTMLCanvasElement): IDisposable;
43
- getCanvasElement(): HTMLCanvasElement;
41
+ registerContentElement(container: HTMLElement): IDisposable;
42
+ getContentElement(): HTMLElement;
44
43
  registerRootContainerElement(container: HTMLElement): IDisposable;
45
44
  registerContainerElement(container: HTMLElement): IDisposable;
46
45
  checkElementInCurrentContainers(element: HTMLElement): boolean;
47
- checkCanvasIsFocused(): boolean;
46
+ checkContentIsFocused(): boolean;
48
47
  private _initUniverFocusListener;
49
48
  private _initEditorStatus;
50
49
  private _blurSheetEditor;
@@ -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",
@@ -38,6 +37,11 @@ export declare enum MenuItemType {
38
37
  interface IMenuItemBase<V> {
39
38
  /** ID of the menu item. Normally it should be the same as the ID of the command that it would invoke. */
40
39
  id: string;
40
+ /**
41
+ * If two menus reuse the same command (e.g. copy & paste command). They should have the same command
42
+ * id and different ids.
43
+ */
44
+ commandId?: string;
41
45
  subId?: string;
42
46
  title?: string;
43
47
  description?: string;
@@ -66,6 +70,7 @@ export interface IMenuButtonItem<V = undefined> extends IMenuItemBase<V> {
66
70
  activated$?: Observable<boolean>;
67
71
  }
68
72
  export interface IValueOption<T = undefined> {
73
+ id?: string;
69
74
  value?: string | number;
70
75
  value$?: Observable<T>;
71
76
  label?: string | {
@@ -79,7 +84,7 @@ export interface IValueOption<T = undefined> {
79
84
  tooltip?: string;
80
85
  style?: object;
81
86
  disabled?: boolean;
82
- id?: string;
87
+ commandId?: string;
83
88
  }
84
89
  export interface ICustomComponentProps<T> {
85
90
  value: T;
@@ -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
  }