@univerjs/ui 0.7.0-beta.0 → 0.7.0-nightly.202504301607

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.
@@ -17,4 +17,5 @@ export { useEvent } from './event';
17
17
  export { useConfigValue } from './layout';
18
18
  export { useUpdateEffect } from './update-effect';
19
19
  export { useClickOutSide } from './use-click-out-side';
20
+ export { useDebounceFn } from './use-debounce';
20
21
  export { useVirtualList } from './virtual-list';
@@ -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 useDebounceFn<T extends (...args: any[]) => void>(fn: T, delay?: number): T;
@@ -72,8 +72,7 @@ export { DesktopZenZoneService } from './services/zen-zone/desktop-zen-zone.serv
72
72
  export { IZenZoneService } from './services/zen-zone/zen-zone.service';
73
73
  export { FloatDomSingle } from './views/components/dom/FloatDom';
74
74
  export { PrintFloatDomSingle } from './views/components/dom/print';
75
- export { DISABLE_AUTO_FOCUS_KEY, UniverUIPlugin } from './ui-plugin';
76
- export { UNIVER_UI_PLUGIN_NAME } from './ui-plugin';
75
+ export { DISABLE_AUTO_FOCUS_KEY, UNIVER_UI_PLUGIN_NAME, UniverUIPlugin } from './ui-plugin';
77
76
  export * from './utils';
78
77
  export { ComponentContainer, type IComponentContainerProps, useComponentsOfPart } from './views/components/ComponentContainer';
79
78
  export { ZenZone } from './views/components/zen-zone/ZenZone';
@@ -84,10 +83,11 @@ export { MobileContextMenu } from './views/components/context-menu/MobileContext
84
83
  export { type IDialogPartMethodOptions } from './views/components/dialog-part/interface';
85
84
  export { FloatDom } from './views/components/dom/FloatDom';
86
85
  export { GlobalZone } from './views/components/global-zone/GlobalZone';
87
- export { CanvasPopup } from './views/components/popup/CanvasPopup';
86
+ export { CanvasPopup, SingleCanvasPopup } from './views/components/popup/CanvasPopup';
88
87
  export { ToolbarButton } from './views/components/ribbon/Button/ToolbarButton';
89
88
  export { useToolbarItemStatus } from './views/components/ribbon/hook';
90
89
  export { Ribbon } from './views/components/ribbon/Ribbon';
91
90
  export { ToolbarItem } from './views/components/ribbon/ToolbarItem';
92
91
  export { type ISidebarMethodOptions, Sidebar } from './views/components/sidebar/Sidebar';
93
92
  export { ToggleShortcutPanelOperation } from './commands/operations/toggle-shortcut-panel.operation';
93
+ export { MockMessageService } from './services/message/__testing__/mock-message.service.ts';
@@ -3,9 +3,13 @@ import { IMessageProps } from '@univerjs/design';
3
3
  import { IMessageService } from '../message.service';
4
4
  /**
5
5
  * This is a mocked message service for testing purposes.
6
+ *
7
+ * @ignore
6
8
  */
7
9
  export declare class MockMessageService implements IMessageService {
8
10
  show(_options: IMessageProps): IDisposable;
11
+ remove(_id: string): void;
12
+ removeAll(): void;
9
13
  setContainer(): void;
10
14
  getContainer(): HTMLElement | undefined;
11
15
  }
@@ -1,6 +1,6 @@
1
+ import { IDisposable, Disposable, Injector } from '@univerjs/core';
1
2
  import { IMessageProps } from '@univerjs/design';
2
3
  import { IMessageService } from './message.service';
3
- import { Disposable, Injector } from '@univerjs/core';
4
4
  import { IUIPartsService } from '../parts/parts.service';
5
5
  export declare class DesktopMessageService extends Disposable implements IMessageService {
6
6
  protected readonly _injector: Injector;
@@ -8,5 +8,7 @@ export declare class DesktopMessageService extends Disposable implements IMessag
8
8
  constructor(_injector: Injector, _uiPartsService: IUIPartsService);
9
9
  protected _initUIPart(): void;
10
10
  dispose(): void;
11
- show(options: IMessageProps): void;
11
+ show(options: IMessageProps): IDisposable;
12
+ remove(id: string): void;
13
+ removeAll(): void;
12
14
  }
@@ -1,5 +1,8 @@
1
+ import { IDisposable } from '@univerjs/core';
1
2
  import { IMessageProps } from '@univerjs/design';
2
3
  export declare const IMessageService: import('@wendellhu/redi').IdentifierDecorator<IMessageService>;
3
4
  export interface IMessageService {
4
- show(options: IMessageProps): void;
5
+ show(options: IMessageProps): IDisposable;
6
+ remove(id: string): void;
7
+ removeAll(): void;
5
8
  }
@@ -1,16 +1,9 @@
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
- */
1
+ import { IPopup } from '../../../services/popup/canvas-popup.service';
2
+ import { default as React } from 'react';
3
+ interface ISingleCanvasPopupProps {
4
+ popup: IPopup;
5
+ children?: React.ReactNode;
6
+ }
7
+ export declare const SingleCanvasPopup: ({ popup, children }: ISingleCanvasPopupProps) => import("react/jsx-runtime").JSX.Element | null;
16
8
  export declare function CanvasPopup(): import("react/jsx-runtime").JSX.Element[];
9
+ export {};
@@ -28,6 +28,7 @@ export interface IRectPopupProps {
28
28
  zIndex?: number;
29
29
  maskZIndex?: number;
30
30
  onMaskClick?: () => void;
31
+ noPushMinimumGap?: boolean;
31
32
  }
32
33
  export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
33
34
  position: IAbsolutePosition;
@@ -35,6 +36,7 @@ export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
35
36
  height: number;
36
37
  containerWidth: number;
37
38
  containerHeight: number;
39
+ noPushMinimumGap?: boolean;
38
40
  }
39
41
  declare function RectPopup(props: IRectPopupProps): import("react/jsx-runtime").JSX.Element | null;
40
42
  declare namespace RectPopup {