@univerjs/ui 0.7.0-beta.0 → 0.7.0-beta.1

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;
@@ -44,6 +44,8 @@ export { DesktopConfirmService } from './services/confirm/desktop-confirm.servic
44
44
  export { ContextMenuService, type IContextMenuHandler, IContextMenuService } from './services/contextmenu/contextmenu.service';
45
45
  export { DesktopDialogService } from './services/dialog/desktop-dialog.service';
46
46
  export { IDialogService } from './services/dialog/dialog.service';
47
+ export { IGalleryService } from './services/gallery/gallery.service';
48
+ export { DesktopGalleryService } from './services/gallery/desktop-gallery.service';
47
49
  export { CanvasFloatDomService, type IFloatDom, type IFloatDomLayout } from './services/dom/canvas-dom-layer.service';
48
50
  export { DesktopGlobalZoneService } from './services/global-zone/desktop-global-zone.service';
49
51
  export { IGlobalZoneService } from './services/global-zone/global-zone.service';
@@ -72,22 +74,23 @@ export { DesktopZenZoneService } from './services/zen-zone/desktop-zen-zone.serv
72
74
  export { IZenZoneService } from './services/zen-zone/zen-zone.service';
73
75
  export { FloatDomSingle } from './views/components/dom/FloatDom';
74
76
  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';
77
+ export { DISABLE_AUTO_FOCUS_KEY, UNIVER_UI_PLUGIN_NAME, UniverUIPlugin } from './ui-plugin';
77
78
  export * from './utils';
78
79
  export { ComponentContainer, type IComponentContainerProps, useComponentsOfPart } from './views/components/ComponentContainer';
79
80
  export { ZenZone } from './views/components/zen-zone/ZenZone';
80
81
  export { Menu as DesktopMenu } from './components/menu/desktop/Menu';
82
+ export { ThemeSwitcherService } from './services/theme-switcher/theme-switcher.service';
81
83
  export { type IConfirmPartMethodOptions } from './views/components/confirm-part/interface';
82
84
  export { DesktopContextMenu as ContextMenu } from './views/components/context-menu/ContextMenu';
83
85
  export { MobileContextMenu } from './views/components/context-menu/MobileContextMenu';
84
86
  export { type IDialogPartMethodOptions } from './views/components/dialog-part/interface';
85
87
  export { FloatDom } from './views/components/dom/FloatDom';
86
88
  export { GlobalZone } from './views/components/global-zone/GlobalZone';
87
- export { CanvasPopup } from './views/components/popup/CanvasPopup';
89
+ export { CanvasPopup, SingleCanvasPopup } from './views/components/popup/CanvasPopup';
88
90
  export { ToolbarButton } from './views/components/ribbon/Button/ToolbarButton';
89
91
  export { useToolbarItemStatus } from './views/components/ribbon/hook';
90
92
  export { Ribbon } from './views/components/ribbon/Ribbon';
91
93
  export { ToolbarItem } from './views/components/ribbon/ToolbarItem';
92
94
  export { type ISidebarMethodOptions, Sidebar } from './views/components/sidebar/Sidebar';
93
95
  export { ToggleShortcutPanelOperation } from './commands/operations/toggle-shortcut-panel.operation';
96
+ export { MockMessageService } from './services/message/__testing__/mock-message.service.ts';
@@ -0,0 +1,15 @@
1
+ import { IDisposable, Disposable, Injector } from '@univerjs/core';
2
+ import { IGalleryProps } from '@univerjs/design';
3
+ import { IGalleryService } from './gallery.service';
4
+ import { Subject } from 'rxjs';
5
+ import { IUIPartsService } from '../parts/parts.service';
6
+ export declare class DesktopGalleryService extends Disposable implements IGalleryService {
7
+ protected readonly _injector: Injector;
8
+ protected readonly _uiPartsService: IUIPartsService;
9
+ constructor(_injector: Injector, _uiPartsService: IUIPartsService);
10
+ gallery$: Subject<IGalleryProps>;
11
+ dispose(): void;
12
+ open(option: IGalleryProps): IDisposable;
13
+ close(): void;
14
+ protected _initUIPart(): void;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { IDisposable } from '@univerjs/core';
2
+ import { IGalleryProps } from '@univerjs/design';
3
+ import { Subject } from 'rxjs';
4
+ export declare const IGalleryService: import('@wendellhu/redi').IdentifierDecorator<IGalleryService>;
5
+ export interface IGalleryService {
6
+ gallery$: Subject<IGalleryProps>;
7
+ open(params: IGalleryProps): IDisposable;
8
+ close(): void;
9
+ }
@@ -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
  }
@@ -0,0 +1,5 @@
1
+ import { Theme } from '@univerjs/themes';
2
+ export declare class ThemeSwitcherService {
3
+ private _styleSheetId;
4
+ injectThemeToHead(theme: Theme): void;
5
+ }
@@ -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 GalleryPart(): import("react/jsx-runtime").JSX.Element | null;
@@ -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,8 @@ export interface IRectPopupProps {
28
28
  zIndex?: number;
29
29
  maskZIndex?: number;
30
30
  onMaskClick?: () => void;
31
+ noPushMinimumGap?: boolean;
32
+ autoRelayout?: boolean;
31
33
  }
32
34
  export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
33
35
  position: IAbsolutePosition;
@@ -35,6 +37,7 @@ export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
35
37
  height: number;
36
38
  containerWidth: number;
37
39
  containerHeight: number;
40
+ noPushMinimumGap?: boolean;
38
41
  }
39
42
  declare function RectPopup(props: IRectPopupProps): import("react/jsx-runtime").JSX.Element | null;
40
43
  declare namespace RectPopup {