@univerjs/ui 0.24.0 → 0.25.0-insiders.20260608-e4336f7
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.
- package/lib/cjs/facade.js +8 -7
- package/lib/cjs/index.js +576 -186
- package/lib/cjs/locale/ar-SA.js +81 -0
- package/lib/cjs/locale/ca-ES.js +5 -3
- package/lib/cjs/locale/de-DE.js +81 -0
- package/lib/cjs/locale/en-US.js +5 -3
- package/lib/cjs/locale/es-ES.js +5 -3
- package/lib/cjs/locale/fa-IR.js +5 -3
- package/lib/cjs/locale/fr-FR.js +5 -3
- package/lib/cjs/locale/id-ID.js +81 -0
- package/lib/cjs/locale/it-IT.js +81 -0
- package/lib/cjs/locale/ja-JP.js +5 -3
- package/lib/cjs/locale/ko-KR.js +5 -3
- package/lib/cjs/locale/pl-PL.js +81 -0
- package/lib/cjs/locale/pt-BR.js +81 -0
- package/lib/cjs/locale/ru-RU.js +5 -3
- package/lib/cjs/locale/sk-SK.js +5 -3
- package/lib/cjs/locale/vi-VN.js +5 -3
- package/lib/cjs/locale/zh-CN.js +5 -3
- package/lib/cjs/locale/zh-HK.js +81 -0
- package/lib/cjs/locale/zh-TW.js +5 -3
- package/lib/es/facade.js +8 -7
- package/lib/es/index.js +577 -170
- package/lib/es/locale/ar-SA.js +80 -0
- package/lib/es/locale/ca-ES.js +5 -3
- package/lib/es/locale/de-DE.js +80 -0
- package/lib/es/locale/en-US.js +5 -3
- package/lib/es/locale/es-ES.js +5 -3
- package/lib/es/locale/fa-IR.js +5 -3
- package/lib/es/locale/fr-FR.js +5 -3
- package/lib/es/locale/id-ID.js +80 -0
- package/lib/es/locale/it-IT.js +80 -0
- package/lib/es/locale/ja-JP.js +5 -3
- package/lib/es/locale/ko-KR.js +5 -3
- package/lib/es/locale/pl-PL.js +80 -0
- package/lib/es/locale/pt-BR.js +80 -0
- package/lib/es/locale/ru-RU.js +5 -3
- package/lib/es/locale/sk-SK.js +5 -3
- package/lib/es/locale/vi-VN.js +5 -3
- package/lib/es/locale/zh-CN.js +5 -3
- package/lib/es/locale/zh-HK.js +80 -0
- package/lib/es/locale/zh-TW.js +5 -3
- package/lib/facade.js +8 -7
- package/lib/index.css +9 -4
- package/lib/index.js +577 -170
- package/lib/locale/ar-SA.js +80 -0
- package/lib/locale/ca-ES.js +5 -3
- package/lib/locale/de-DE.js +80 -0
- package/lib/locale/en-US.js +5 -3
- package/lib/locale/es-ES.js +5 -3
- package/lib/locale/fa-IR.js +5 -3
- package/lib/locale/fr-FR.js +5 -3
- package/lib/locale/id-ID.js +80 -0
- package/lib/locale/it-IT.js +80 -0
- package/lib/locale/ja-JP.js +5 -3
- package/lib/locale/ko-KR.js +5 -3
- package/lib/locale/pl-PL.js +80 -0
- package/lib/locale/pt-BR.js +80 -0
- package/lib/locale/ru-RU.js +5 -3
- package/lib/locale/sk-SK.js +5 -3
- package/lib/locale/vi-VN.js +5 -3
- package/lib/locale/zh-CN.js +5 -3
- package/lib/locale/zh-HK.js +80 -0
- package/lib/locale/zh-TW.js +5 -3
- package/lib/types/components/common-label/index.d.ts +1 -1
- package/lib/types/components/custom-label/CustomLabel.d.ts +1 -1
- package/lib/types/components/font-family/FontFamily.d.ts +1 -1
- package/lib/types/components/font-family/FontFamilyItem.d.ts +1 -1
- package/lib/types/components/font-size/FontSize.d.ts +1 -1
- package/lib/types/components/heading-item/index.d.ts +1 -1
- package/lib/types/components/menu/desktop/DesignTinyMenuGroup.d.ts +2 -1
- package/lib/types/components/menu/desktop/TinyMenuGroup.d.ts +6 -2
- package/lib/types/components/menu/mobile/MobileMenu.d.ts +1 -1
- package/lib/types/components/menu/mobile/MobileMenu.stories.d.ts +1 -1
- package/lib/types/components/message/MessageContainer.d.ts +1 -1
- package/lib/types/components/notification/Notification.d.ts +1 -1
- package/lib/types/components/notification/Notification.stories.d.ts +5 -5
- package/lib/types/components/progress-bar/ProgressBar.d.ts +1 -1
- package/lib/types/components/slider/Slider.d.ts +2 -1
- package/lib/types/components/slider/Slider.stories.d.ts +1 -1
- package/lib/types/facade/f-shortcut.d.ts +2 -1
- package/lib/types/facade/f-univer.d.ts +8 -4
- package/lib/types/index.d.ts +0 -1
- package/lib/types/{components/hooks/locale.d.ts → locale/ar-SA.d.ts} +3 -3
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +79 -75
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/services/before-close/before-close.service.d.ts +5 -1
- package/lib/types/services/clipboard/clipboard-interface.service.d.ts +2 -2
- package/lib/types/services/menu/menu-manager.service.d.ts +1 -0
- package/lib/types/services/ribbon/ribbon.service.d.ts +2 -0
- package/lib/types/services/shortcut/shortcut.service.d.ts +8 -0
- package/lib/types/utils/storage-driver.d.ts +26 -0
- package/lib/types/views/components/confirm-part/ConfirmPart.d.ts +1 -1
- package/lib/types/views/components/context-menu/AnchoredContextMenu.d.ts +1 -1
- package/lib/types/views/components/context-menu/ContextMenu.d.ts +1 -1
- package/lib/types/views/components/context-menu/ContextMenuPanel.d.ts +6 -1
- package/lib/types/views/components/dialog-part/DialogPart.d.ts +1 -1
- package/lib/types/views/components/dom/FloatDom.d.ts +2 -2
- package/lib/types/views/components/dom/Print.d.ts +1 -1
- package/lib/types/views/components/gallery-part/GalleryPart.d.ts +1 -1
- package/lib/types/views/components/popup/CanvasPopup.d.ts +2 -2
- package/lib/types/views/components/popup/RectPopup.d.ts +1 -1
- package/lib/types/views/components/ribbon/MobileRibbon.d.ts +1 -1
- package/lib/types/views/components/ribbon/Ribbon.d.ts +1 -1
- package/lib/types/views/components/ribbon/ToolbarButton.d.ts +1 -1
- package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +2 -2
- package/lib/types/views/components/ribbon/ribbon-menu/ClassicMenu.d.ts +1 -1
- package/lib/types/views/components/ribbon/ribbon-menu/DefaultMenu.d.ts +1 -1
- package/lib/types/views/components/shortcut-panel/ShortcutPanel.d.ts +1 -1
- package/lib/types/views/components/sidebar/Sidebar.d.ts +1 -1
- package/lib/types/views/components/zen-zone/ZenZone.d.ts +1 -1
- package/lib/types/views/mobile-workbench/MobileWorkbench.d.ts +1 -1
- package/lib/types/views/workbench/Workbench.d.ts +2 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +51 -43
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +9 -10
- package/LICENSE +0 -176
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IDisposable } from '@univerjs/core';
|
|
17
|
+
import { Disposable } from '@univerjs/core';
|
|
17
18
|
import { INotificationService } from '../notification/notification.service';
|
|
18
19
|
export interface IBeforeCloseService {
|
|
19
20
|
/**
|
|
@@ -32,11 +33,14 @@ export interface IBeforeCloseService {
|
|
|
32
33
|
registerOnClose(callback: () => void): IDisposable;
|
|
33
34
|
}
|
|
34
35
|
export declare const IBeforeCloseService: import("@wendellhu/redi").IdentifierDecorator<IBeforeCloseService>;
|
|
35
|
-
export declare class DesktopBeforeCloseService implements IBeforeCloseService {
|
|
36
|
+
export declare class DesktopBeforeCloseService extends Disposable implements IBeforeCloseService {
|
|
36
37
|
private readonly _notificationService;
|
|
37
38
|
private _beforeUnloadCallbacks;
|
|
38
39
|
private _onCloseCallbacks;
|
|
40
|
+
private readonly _beforeUnloadHandler;
|
|
41
|
+
private readonly _unloadHandler;
|
|
39
42
|
constructor(_notificationService: INotificationService);
|
|
43
|
+
dispose(): void;
|
|
40
44
|
registerBeforeClose(callback: () => string | undefined): IDisposable;
|
|
41
45
|
registerOnClose(callback: () => void): IDisposable;
|
|
42
46
|
private _init;
|
|
@@ -37,7 +37,7 @@ export interface IClipboardInterfaceService {
|
|
|
37
37
|
* @param text
|
|
38
38
|
* @param html
|
|
39
39
|
*/
|
|
40
|
-
write(text: string, html: string): Promise<void>;
|
|
40
|
+
write(text: string, html: string, customData?: Record<string, string>): Promise<void>;
|
|
41
41
|
/**
|
|
42
42
|
* Read plain text from clipboard. Use read() to read both plain text and html.
|
|
43
43
|
* @returns plain text
|
|
@@ -59,7 +59,7 @@ export declare class BrowserClipboardService extends Disposable implements IClip
|
|
|
59
59
|
private readonly _notificationService?;
|
|
60
60
|
get supportClipboard(): boolean;
|
|
61
61
|
constructor(_localeService: LocaleService, _logService: ILogService, _notificationService?: INotificationService | undefined);
|
|
62
|
-
write(text: string, html: string): Promise<void>;
|
|
62
|
+
write(text: string, html: string, customData?: Record<string, string>): Promise<void>;
|
|
63
63
|
writeText(text: string): Promise<void>;
|
|
64
64
|
read(): Promise<ClipboardItem[]>;
|
|
65
65
|
readText(): Promise<string>;
|
|
@@ -46,6 +46,7 @@ export declare class DesktopRibbonService extends Disposable implements IRibbonS
|
|
|
46
46
|
private readonly _visibleContextualTabs;
|
|
47
47
|
private readonly _contextualTabs;
|
|
48
48
|
private _lastNonContextualActivatedTab;
|
|
49
|
+
private _hiddenSubscription;
|
|
49
50
|
constructor(_menuManagerService: IMenuManagerService, _univerInstanceService: IUniverInstanceService);
|
|
50
51
|
setActivatedTab(tab: string): void;
|
|
51
52
|
showContextualTab(tab: string, options?: {
|
|
@@ -60,4 +61,5 @@ export declare class DesktopRibbonService extends Disposable implements IRibbonS
|
|
|
60
61
|
private _filterContextualTabs;
|
|
61
62
|
private _setRibbon;
|
|
62
63
|
private _isContextualTab;
|
|
64
|
+
dispose(): void;
|
|
63
65
|
}
|
|
@@ -61,6 +61,14 @@ export interface IShortcutItem<P extends object = object> {
|
|
|
61
61
|
* @example { group: '10_global-shortcut' }
|
|
62
62
|
*/
|
|
63
63
|
group?: string;
|
|
64
|
+
/**
|
|
65
|
+
* The locale key for the group title displayed in the shortcut panel.
|
|
66
|
+
* If not specified, the group name (without the sequence prefix) will be used as the locale key.
|
|
67
|
+
* It supports dot-notation paths for namespaced locale keys.
|
|
68
|
+
*
|
|
69
|
+
* @example { groupTitle: 'ui.global-shortcut' }
|
|
70
|
+
*/
|
|
71
|
+
groupTitle?: string;
|
|
64
72
|
/**
|
|
65
73
|
* Static parameters of this shortcut. Would be send to {@link ICommandService.executeCommand} as the second
|
|
66
74
|
* parameter when the corresponding command is executed.
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
interface IStorageDriver {
|
|
17
|
+
getItem<T>(key: string): Promise<T | null>;
|
|
18
|
+
setItem<T>(key: string, value: T): Promise<T>;
|
|
19
|
+
removeItem(key: string): Promise<void>;
|
|
20
|
+
clear(): Promise<void>;
|
|
21
|
+
key(index: number): Promise<string | null>;
|
|
22
|
+
keys(): Promise<string[]>;
|
|
23
|
+
iterate<T, U>(iteratee: (value: T, key: string, iterationNumber: number) => U): Promise<U>;
|
|
24
|
+
}
|
|
25
|
+
export declare const browserStorage: IStorageDriver;
|
|
26
|
+
export {};
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function ConfirmPart(): import("react
|
|
16
|
+
export declare function ConfirmPart(): import("react").JSX.Element[];
|
|
@@ -29,4 +29,4 @@ export interface IAnchoredContextMenuProps {
|
|
|
29
29
|
onRequestClose: () => void;
|
|
30
30
|
onOptionSelect?: (option: IValueOption) => void;
|
|
31
31
|
}
|
|
32
|
-
export declare function AnchoredContextMenu(props: IAnchoredContextMenuProps): import("react
|
|
32
|
+
export declare function AnchoredContextMenu(props: IAnchoredContextMenuProps): import("react").JSX.Element;
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function DesktopContextMenu(): import("react
|
|
16
|
+
export declare function DesktopContextMenu(): import("react").JSX.Element;
|
|
@@ -14,12 +14,17 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IValueOption } from '../../../services/menu/menu';
|
|
17
|
+
import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
|
|
17
18
|
interface IContextMenuPanelProps {
|
|
18
19
|
menuType: string;
|
|
19
20
|
menuSessionVersion?: number;
|
|
20
21
|
className?: string;
|
|
22
|
+
activeItemIds?: string[];
|
|
23
|
+
hiddenItemIds?: string[];
|
|
21
24
|
onOptionSelect?: (option: IValueOption) => void;
|
|
22
25
|
}
|
|
26
|
+
export declare const CONTEXT_MENU_SUBMENU_CLOSE_DELAY = 500;
|
|
23
27
|
export declare const CONTEXT_MENU_SUBMENU_PORTAL_ATTR = "data-u-context-menu-submenu";
|
|
24
|
-
export declare function
|
|
28
|
+
export declare function hasRenderableContextMenuSchema(menuSchema: IMenuSchema): boolean;
|
|
29
|
+
export declare function ContextMenuPanel(props: IContextMenuPanelProps): import("react").JSX.Element | null;
|
|
25
30
|
export {};
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function DialogPart(): import("react
|
|
16
|
+
export declare function DialogPart(): import("react").JSX.Element[];
|
|
@@ -17,7 +17,7 @@ import type { IFloatDom } from '../../../services/dom/canvas-dom-layer.service';
|
|
|
17
17
|
export declare const FloatDomSingle: import("react").MemoExoticComponent<(props: {
|
|
18
18
|
layer: IFloatDom;
|
|
19
19
|
id: string;
|
|
20
|
-
}) => import("react
|
|
20
|
+
}) => import("react").JSX.Element | null>;
|
|
21
21
|
export declare const FloatDom: ({ unitId }: {
|
|
22
22
|
unitId?: string;
|
|
23
|
-
}) => import("react
|
|
23
|
+
}) => import("react").JSX.Element[] | undefined;
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function GalleryPart(): import("react
|
|
16
|
+
export declare function GalleryPart(): import("react").JSX.Element | null;
|
|
@@ -19,6 +19,6 @@ interface ISingleCanvasPopupProps {
|
|
|
19
19
|
popup: IPopup;
|
|
20
20
|
children?: ReactNode;
|
|
21
21
|
}
|
|
22
|
-
export declare const SingleCanvasPopup: ({ popup, children }: ISingleCanvasPopupProps) => import("react
|
|
23
|
-
export declare function CanvasPopup(): import("react
|
|
22
|
+
export declare const SingleCanvasPopup: ({ popup, children }: ISingleCanvasPopupProps) => import("react").JSX.Element | null;
|
|
23
|
+
export declare function CanvasPopup(): import("react").JSX.Element[];
|
|
24
24
|
export {};
|
|
@@ -54,7 +54,7 @@ export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
|
|
|
54
54
|
containerHeight: number;
|
|
55
55
|
noPushMinimumGap?: boolean;
|
|
56
56
|
}
|
|
57
|
-
declare function RectPopup(props: IRectPopupProps): import("react
|
|
57
|
+
declare function RectPopup(props: IRectPopupProps): import("react").JSX.Element | null;
|
|
58
58
|
declare namespace RectPopup {
|
|
59
59
|
var calcPopupPosition: (layout: IPopupLayoutInfo) => {
|
|
60
60
|
top: number;
|
|
@@ -18,5 +18,5 @@ interface IMobileRibbonProps {
|
|
|
18
18
|
headerMenuComponents?: Set<ComponentType>;
|
|
19
19
|
headerMenu?: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare function MobileRibbon(props: IMobileRibbonProps): import("react
|
|
21
|
+
export declare function MobileRibbon(props: IMobileRibbonProps): import("react").JSX.Element | null;
|
|
22
22
|
export {};
|
|
@@ -20,5 +20,5 @@ interface IRibbonProps {
|
|
|
20
20
|
headerMenuComponents?: Set<ComponentType>;
|
|
21
21
|
headerMenu?: boolean;
|
|
22
22
|
}
|
|
23
|
-
export declare function Ribbon(props: IRibbonProps): import("react
|
|
23
|
+
export declare function Ribbon(props: IRibbonProps): import("react").JSX.Element;
|
|
24
24
|
export {};
|
|
@@ -43,4 +43,4 @@ export declare const toolbarButtonClassName = "\nuniver-box-border univer-flex u
|
|
|
43
43
|
/**
|
|
44
44
|
* Button Component
|
|
45
45
|
*/
|
|
46
|
-
export declare function ToolbarButton(props: IBaseToolbarButtonProps): import("react
|
|
46
|
+
export declare function ToolbarButton(props: IBaseToolbarButtonProps): import("react").JSX.Element;
|
|
@@ -23,7 +23,7 @@ export declare const TooltipWrapper: import("react").ForwardRefExoticComponent<I
|
|
|
23
23
|
export declare function DropdownWrapper(props: Omit<Partial<IDropdownProps>, 'overlay'> & {
|
|
24
24
|
overlay: ReactNode;
|
|
25
25
|
align?: 'start' | 'end' | 'center';
|
|
26
|
-
}): import("react
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
27
|
export declare function DropdownMenuWrapper({ menuId, slot, value, options, children, disabled, onOptionSelect, }: {
|
|
28
28
|
menuId: string;
|
|
29
29
|
slot?: boolean;
|
|
@@ -32,4 +32,4 @@ export declare function DropdownMenuWrapper({ menuId, slot, value, options, chil
|
|
|
32
32
|
children: ReactNode;
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
onOptionSelect: (option: IValueOption) => void;
|
|
35
|
-
}): import("react
|
|
35
|
+
}): import("react").JSX.Element;
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* This component is responsible for rendering the shortcut panel on the desktop version of the app.
|
|
18
18
|
*/
|
|
19
|
-
export declare function ShortcutPanel(): import("react
|
|
19
|
+
export declare function ShortcutPanel(): import("react").JSX.Element;
|
|
@@ -18,4 +18,4 @@ export interface IUniverAppProps extends IWorkbenchOptions {
|
|
|
18
18
|
mountContainer: HTMLElement;
|
|
19
19
|
onRendered?: (container: HTMLElement) => void;
|
|
20
20
|
}
|
|
21
|
-
export declare function MobileWorkbench(props: IUniverAppProps): import("react
|
|
21
|
+
export declare function MobileWorkbench(props: IUniverAppProps): import("react").JSX.Element;
|
|
@@ -18,5 +18,5 @@ export interface IUniverWorkbenchProps extends IWorkbenchOptions {
|
|
|
18
18
|
mountContainer: HTMLElement;
|
|
19
19
|
onRendered?: (containerElement: HTMLElement) => void;
|
|
20
20
|
}
|
|
21
|
-
export declare function DesktopWorkbench(props: IUniverWorkbenchProps): import("react
|
|
22
|
-
export declare function DesktopWorkbenchContent(props: IUniverWorkbenchProps): import("react
|
|
21
|
+
export declare function DesktopWorkbench(props: IUniverWorkbenchProps): import("react").JSX.Element;
|
|
22
|
+
export declare function DesktopWorkbenchContent(props: IUniverWorkbenchProps): import("react").JSX.Element;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core/facade"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/core")):typeof define==`function`&&define.amd?define([`@univerjs/core/facade`,`@univerjs/engine-render`,`@univerjs/ui`,`@univerjs/core`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCoreFacade,e.UniverEngineRender,e.UniverUi,e.UniverCore))})(this,function(e,t,n,r){function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}function a(e,t){if(i(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o(e){var t=a(e,`string`);return i(t)==`symbol`?t:t+``}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var u=class extends e.FBase{appendTo(e){let t=typeof e==`string`?e.split(`|`):e,n=t.length,r={},i=r,a=this.__getSchema();t.forEach((e,t)=>{t===n-1?i[e]=a:i[e]={},i=i[e]}),this._menuManagerService.mergeMenu(r)}};let d=class extends u{constructor(e,t,i,a){super(),this._item=e,this._injector=t,this._commandService=i,this._menuManagerService=a,s(this,`_commandToRegister`,new Map),s(this,`_buildingSchema`,void 0);let o=typeof e.action==`string`?e.action:(0,r.generateRandomId)(12);o!==e.action&&this._commandToRegister.set(o,e.action),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.BUTTON,icon:e.icon,title:e.title,tooltip:e.tooltip,commandId:o})},e.order!==void 0&&(this._buildingSchema.order=e.order)}__getSchema(){return this._commandToRegister.forEach((e,t)=>{this._commandService.hasCommand(t)||this._commandService.registerCommand({id:t,type:r.CommandType.COMMAND,handler:e})}),{[this._item.id]:this._buildingSchema}}};s(d,`RibbonStartGroup`,n.RibbonStartGroup),s(d,`RibbonPosition`,n.RibbonPosition),s(d,`MenuManagerPosition`,n.MenuManagerPosition),d=l([c(1,(0,r.Inject)(r.Injector)),c(2,r.ICommandService),c(3,n.IMenuManagerService)],d);let f=class extends u{constructor(e,t,r){super(),this._item=e,this._injector=t,this._menuManagerService=r,s(this,`_menuByGroups`,[]),s(this,`_submenus`,[]),s(this,`_buildingSchema`,void 0),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.SUBITEMS,icon:e.icon,title:e.title,tooltip:e.tooltip})},e.order!==void 0&&(this._buildingSchema.order=e.order)}addSubmenu(e){return this._submenus.push(e),this}addSeparator(){return this._menuByGroups.push(this._submenus),this._submenus=[],this}__getSchema(){let e={};return this.addSeparator(),this._menuByGroups.forEach((t,n)=>{let r={};t.forEach(e=>{Object.assign(r,e.__getSchema())}),e[`${this._item.id}-group-${n}`]=r}),{[this._item.id]:Object.assign(this._buildingSchema,e)}}};f=l([c(1,(0,r.Inject)(r.Injector)),c(2,n.IMenuManagerService)],f);let p=class extends e.FBase{constructor(e,t,n,r){super(),this._injector=e,this._renderManagerService=t,this._univerInstanceService=n,this._shortcutService=r,s(this,`_forceDisableDisposable`,null)}enableShortcut(){var e;return(e=this._forceDisableDisposable)==null||e.dispose(),this._forceDisableDisposable=null,this}disableShortcut(){return this._forceDisableDisposable||(this._forceDisableDisposable=this._shortcutService.forceDisable()),this}triggerShortcut(e){let t=this._univerInstanceService.getCurrentUnitOfType(r.UniverInstanceType.UNIVER_SHEET);if(!t)return;let n=this._renderManagerService.getRenderById(t.getUnitId());if(n)return n.engine.getCanvasElement().dispatchEvent(e),this._shortcutService.dispatch(e)}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};p=l([c(0,(0,r.Inject)(r.Injector)),c(1,(0,r.Inject)(t.IRenderManagerService)),c(2,r.IUniverInstanceService),c(3,n.IShortcutService)],p);var m=class extends e.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(p)}copy(){return this._commandService.executeCommand(n.CopyCommand.id)}paste(){return this._commandService.executeCommand(n.PasteCommand.id)}createMenu(e){return this._injector.createInstance(d,e)}createSubmenu(e){return this._injector.createInstance(f,e)}openSiderbar(e){return this._injector.get(n.ISidebarService).open(e)}openSidebar(e){return this.openSiderbar(e)}openDialog(e){let t=this._injector.get(n.IDialogService).open({...e,onClose:()=>{t.dispose()}});return t}getComponentManager(){return this._injector.get(n.ComponentManager)}showMessage(e){return this._injector.get(n.IMessageService).show(e),this}setUIVisible(e,t){return this._injector.get(n.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(n.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(n.IUIPartsService).registerComponent(e,()=>(0,n.connectInjector)(t,this._injector))}registerComponent(e,t,r){let i=this._injector.get(n.ComponentManager);return this.disposeWithMe(i.register(e,t,r))}setCurrent(e){if(!this._injector.get(t.IRenderManagerService).getRenderById(e))throw Error(`Unit not found`);this._univerInstanceService.setCurrentUnitForType(e)}addFonts(e){let t=this._injector.get(n.IFontService);e.forEach(e=>{t.addFont(e)})}};e.FUniver.extend(m);var h=class extends e.FHooks{onBeforeCopy(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(t=>{t.id===n.CopyCommand.id&&e()})}onCopy(e){return this._injector.get(r.ICommandService).onCommandExecuted(t=>{t.id===n.CopyCommand.id&&e()})}onBeforePaste(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(t=>{t.id===n.PasteCommand.id&&e()})}onPaste(e){return this._injector.get(r.ICommandService).onCommandExecuted(t=>{(t.id===n.PasteCommand.id||t.id===n.SheetPasteShortKeyCommandName)&&e()})}};e.FHooks.extend(h);var g=class extends e.FEnum{get BuiltInUIPart(){return n.BuiltInUIPart}get KeyCode(){return n.KeyCode}};e.FEnum.extend(g)});
|