@univerjs/ui 0.5.4 → 0.5.5-experimental.20250123-34738ff
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 +1 -1
- package/lib/cjs/index.js +23 -32
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +211 -155
- package/lib/es/index.js +5756 -6080
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/index.css +1 -1
- package/lib/types/components/custom-label/CustomLabel.d.ts +2 -2
- package/lib/types/components/font-family/FontFamily.d.ts +1 -2
- package/lib/types/components/font-family/FontFamilyItem.d.ts +1 -2
- package/lib/types/components/font-size/FontSize.d.ts +1 -2
- package/lib/types/components/hooks/{__tests__/observable.spec.d.ts → index.d.ts} +5 -1
- package/lib/types/components/hooks/update-effect.d.ts +2 -0
- package/lib/types/components/hooks/useClickOutSide.d.ts +5 -0
- package/lib/types/components/menu/desktop/Menu.d.ts +1 -2
- package/lib/types/components/menu/mobile/MobileMenu.d.ts +1 -2
- package/lib/types/components/menu/mobile/MobileMenu.stories.d.ts +1 -2
- package/lib/types/components/notification/Notification.d.ts +2 -3
- package/lib/types/components/notification/Notification.stories.d.ts +1 -2
- package/lib/types/components/progress-bar/ProgressBar.d.ts +16 -2
- package/lib/types/controllers/ui/ui-mobile.controller.d.ts +3 -3
- package/lib/types/facade/f-enum.d.ts +6 -0
- package/lib/types/facade/f-hooks.d.ts +6 -0
- package/lib/types/facade/f-menu-builder.d.ts +67 -18
- package/lib/types/facade/f-shortcut.d.ts +30 -2
- package/lib/types/facade/f-univer.d.ts +17 -1
- package/lib/types/index.d.ts +3 -5
- package/lib/types/services/clipboard/clipboard-interface.service.d.ts +1 -0
- package/lib/types/services/parts/parts.service.d.ts +2 -1
- package/lib/types/views/MobileApp.d.ts +1 -2
- package/lib/types/views/components/ComponentContainer.d.ts +1 -1
- package/lib/types/views/components/confirm-part/ConfirmPart.d.ts +16 -2
- package/lib/types/views/components/context-menu/ContextMenu.d.ts +16 -2
- package/lib/types/views/components/context-menu/MobileContextMenu.d.ts +16 -2
- package/lib/types/views/components/dialog-part/DialogPart.d.ts +16 -2
- package/lib/types/views/components/dom/FloatDom.d.ts +16 -2
- package/lib/types/views/components/global-zone/GlobalZone.d.ts +16 -2
- package/lib/types/views/components/popup/CanvasPopup.d.ts +16 -2
- package/lib/types/views/components/popup/RectPopup.d.ts +3 -2
- package/lib/types/views/components/popup/dom-popup.d.ts +12 -0
- package/lib/types/views/components/popup/single-canvas-popup.d.ts +9 -0
- package/lib/types/views/components/ribbon/Button/ToolbarButton.d.ts +1 -1
- package/lib/types/views/components/ribbon/Ribbon.d.ts +2 -2
- package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +1 -1
- package/lib/types/views/components/shortcut-panel/ShortcutPanel.d.ts +16 -2
- package/lib/types/views/components/sidebar/Sidebar.d.ts +16 -2
- package/lib/types/views/components/zen-zone/ZenZone.d.ts +16 -2
- package/lib/types/views/workbench/Workbench.d.ts +1 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +23 -32
- package/lib/umd/locale/en-US.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/ru-RU.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-TW.js +1 -1
- package/package.json +9 -9
- package/LICENSE +0 -176
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IWorkbenchOptions } from '../controllers/ui/ui.controller';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
export interface IUniverAppProps extends IWorkbenchOptions {
|
|
4
3
|
mountContainer: HTMLElement;
|
|
5
4
|
onRendered?: (container: HTMLElement) => void;
|
|
6
5
|
}
|
|
7
|
-
export declare function MobileApp(props: IUniverAppProps):
|
|
6
|
+
export declare function MobileApp(props: IUniverAppProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ export interface IComponentContainerProps {
|
|
|
6
6
|
fallback?: React.ReactNode;
|
|
7
7
|
sharedProps?: Record<string, unknown>;
|
|
8
8
|
}
|
|
9
|
-
export declare function ComponentContainer(props: IComponentContainerProps):
|
|
9
|
+
export declare function ComponentContainer(props: IComponentContainerProps): React.ReactNode;
|
|
10
10
|
/**
|
|
11
11
|
* Get a set of render functions to render components of a part.
|
|
12
12
|
*
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function ConfirmPart(): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function DesktopContextMenu(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function MobileContextMenu(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function DialogPart(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
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
|
+
*/
|
|
2
16
|
export declare const FloatDom: ({ unitId }: {
|
|
3
17
|
unitId?: string;
|
|
4
|
-
}) =>
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element[] | undefined;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function GlobalZone(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function CanvasPopup(): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -14,7 +14,7 @@ export interface IRectPopupProps {
|
|
|
14
14
|
*/
|
|
15
15
|
anchorRect$: Observable<IAbsolutePosition>;
|
|
16
16
|
excludeRects?: RefObject<Nullable<IAbsolutePosition[]>>;
|
|
17
|
-
direction?: 'vertical' | 'horizontal' | '
|
|
17
|
+
direction?: 'vertical' | 'horizontal' | 'top' | 'right' | 'left' | 'bottom' | 'bottom-center' | 'top-center';
|
|
18
18
|
hidden?: boolean;
|
|
19
19
|
onClickOutside?: (e: MouseEvent) => void;
|
|
20
20
|
excludeOutside?: HTMLElement[];
|
|
@@ -22,6 +22,7 @@ export interface IRectPopupProps {
|
|
|
22
22
|
onPointerEnter?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
23
23
|
onPointerLeave?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
24
24
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
25
|
+
portal?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
|
|
27
28
|
position: IAbsolutePosition;
|
|
@@ -30,7 +31,7 @@ export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
|
|
|
30
31
|
containerWidth: number;
|
|
31
32
|
containerHeight: number;
|
|
32
33
|
}
|
|
33
|
-
declare function RectPopup(props: IRectPopupProps):
|
|
34
|
+
declare function RectPopup(props: IRectPopupProps): import("react/jsx-runtime").JSX.Element;
|
|
34
35
|
declare namespace RectPopup {
|
|
35
36
|
var calcPopupPosition: (layout: IPopupLayoutInfo) => {
|
|
36
37
|
top: number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPopup } from '../../../services/popup/canvas-popup.service';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface ISingleDOMPopupProps {
|
|
4
|
+
popup: IPopup;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Align position is diff from SingleCanvasPopup
|
|
9
|
+
*/
|
|
10
|
+
declare const SingleDOMPopup: ({ popup, children }: ISingleDOMPopupProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export type { ISingleDOMPopupProps };
|
|
12
|
+
export { SingleDOMPopup };
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
declare const SingleCanvasPopup: ({ popup, children }: ISingleCanvasPopupProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export type { ISingleCanvasPopupProps };
|
|
9
|
+
export { SingleCanvasPopup };
|
|
@@ -28,4 +28,4 @@ export interface IBaseToolbarButtonProps {
|
|
|
28
28
|
/**
|
|
29
29
|
* Button Component
|
|
30
30
|
*/
|
|
31
|
-
export declare function ToolbarButton(props: IBaseToolbarButtonProps):
|
|
31
|
+
export declare function ToolbarButton(props: IBaseToolbarButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentType
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
2
|
interface IRibbonProps {
|
|
3
3
|
headerMenuComponents?: Set<ComponentType>;
|
|
4
4
|
}
|
|
5
|
-
export declare function Ribbon(props: IRibbonProps):
|
|
5
|
+
export declare function Ribbon(props: IRibbonProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -7,4 +7,4 @@ export declare const TooltipWrapper: React.ForwardRefExoticComponent<ITooltipPro
|
|
|
7
7
|
export declare function DropdownWrapper({ children, overlay, disabled, offset }: IDropdownOverlayProps & {
|
|
8
8
|
overlay: React.ReactNode;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
-
}):
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
|
|
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
|
+
*/
|
|
2
16
|
/**
|
|
3
17
|
* This component is responsible for rendering the shortcut panel on the desktop version of the app.
|
|
4
18
|
*/
|
|
5
|
-
export declare function ShortcutPanel():
|
|
19
|
+
export declare function ShortcutPanel(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function Sidebar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
export declare function ZenZone(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IWorkbenchOptions } from '../../controllers/ui/ui.controller';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
export interface IUniverWorkbenchProps extends IWorkbenchOptions {
|
|
4
3
|
mountContainer: HTMLElement;
|
|
5
4
|
onRendered?: (containerElement: HTMLElement) => void;
|
|
6
5
|
}
|
|
7
|
-
export declare function DesktopWorkbench(props: IUniverWorkbenchProps):
|
|
6
|
+
export declare function DesktopWorkbench(props: IUniverWorkbenchProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(require("@univerjs/core"),require("@univerjs/ui")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/ui"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverCore,global.UniverUi))})(this,function(core,ui){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b,_c;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const _FMenuBase=class _FMenuBase extends core.FBase{appendTo(path){const paths=typeof path=="string"?path.split("|"):path,len=paths.length,menuConfig={};let obj=menuConfig;const schema=this.__getSchema();paths.forEach((p,index)=>{index===len-1?obj[p]=schema:obj[p]={},obj=obj[p]}),this._menuManagerService.mergeMenu(menuConfig)}};__name(_FMenuBase,"FMenuBase");let FMenuBase=_FMenuBase,FMenu=(_a=class extends FMenuBase{constructor(_item,_injector,_commandService,_menuManagerService){super();__publicField(this,"_commandToRegister",new Map);__publicField(this,"_buildingSchema");this._item=_item,this._injector=_injector,this._commandService=_commandService,this._menuManagerService=_menuManagerService;const commandId=typeof _item.action=="string"?_item.action:core.Tools.generateRandomId(12);commandId!==_item.action&&this._commandToRegister.set(commandId,_item.action),this._buildingSchema={menuItemFactory:__name(()=>({id:_item.id,type:ui.MenuItemType.BUTTON,icon:_item.icon,title:_item.title,tooltip:_item.tooltip,commandId}),"menuItemFactory")},typeof _item.order<"u"&&(this._buildingSchema.order=_item.order)}__getSchema(){return this._commandToRegister.forEach((command,id)=>{this._commandService.hasCommand(id)||this._commandService.registerCommand({id,type:core.CommandType.COMMAND,handler:command})}),{[this._item.id]:this._buildingSchema}}},__name(_a,"FMenu"),__publicField(_a,"RibbonStartGroup",ui.RibbonStartGroup),__publicField(_a,"RibbonPosition",ui.RibbonPosition),__publicField(_a,"MenuManagerPosition",ui.MenuManagerPosition),_a);FMenu=__decorateClass$1([__decorateParam$1(1,core.Inject(core.Injector)),__decorateParam$1(2,core.ICommandService),__decorateParam$1(3,ui.IMenuManagerService)],FMenu);let FSubmenu=(_b=class extends FMenuBase{constructor(_item,_injector,_menuManagerService){super();__publicField(this,"_menuByGroups",[]);__publicField(this,"_submenus",[]);__publicField(this,"_buildingSchema");this._item=_item,this._injector=_injector,this._menuManagerService=_menuManagerService,this._buildingSchema={menuItemFactory:__name(()=>({id:_item.id,type:ui.MenuItemType.SUBITEMS,icon:_item.icon,title:_item.title,tooltip:_item.tooltip}),"menuItemFactory")},typeof _item.order<"u"&&(this._buildingSchema.order=_item.order)}addSubmenu(submenu){return this._submenus.push(submenu),this}addSeparator(){return this._menuByGroups.push(this._submenus),this._submenus=[],this}__getSchema(){const schema={};return this.addSeparator(),this._menuByGroups.forEach((group,index)=>{const groupSchema={};group.forEach(menu=>{Object.assign(groupSchema,menu.__getSchema())}),schema[`${this._item.id}-group-${index}`]=groupSchema}),{[this._item.id]:Object.assign(this._buildingSchema,schema)}}},__name(_b,"FSubmenu"),_b);FSubmenu=__decorateClass$1([__decorateParam$1(1,core.Inject(core.Injector)),__decorateParam$1(2,ui.IMenuManagerService)],FSubmenu);var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam");let FShortcut=(_c=class extends core.FBase{constructor(_injector,_shortcutService){super();__publicField(this,"_forceEscapeDisposable",null);this._injector=_injector,this._shortcutService=_shortcutService}enableShortcut(){var _a2;return(_a2=this._forceEscapeDisposable)==null||_a2.dispose(),this._forceEscapeDisposable=null,this}disableShortcut(){return this._forceEscapeDisposable||(this._forceEscapeDisposable=this._shortcutService.forceEscape()),this}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}},__name(_c,"FShortcut"),_c);FShortcut=__decorateClass([__decorateParam(0,core.Inject(core.Injector)),__decorateParam(1,ui.IShortcutService)],FShortcut);const _FUniverUIMixin=class _FUniverUIMixin extends core.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(FShortcut)}copy(){return this._commandService.syncExecuteCommand(ui.CopyCommand.id)}paste(){return this._commandService.syncExecuteCommand(ui.PasteCommand.id)}createMenu(menuItem){return this._injector.createInstance(FMenu,menuItem)}createSubmenu(submenuItem){return this._injector.createInstance(FSubmenu,submenuItem)}openSiderbar(params){return this._injector.get(ui.ISidebarService).open(params)}openSidebar(params){return this.openSiderbar(params)}openDialog(dialog){const disposable=this._injector.get(ui.IDialogService).open({...dialog,onClose:__name(()=>{disposable.dispose()},"onClose")});return disposable}getComponentManager(){return this._injector.get(ui.ComponentManager)}showMessage(options){return this._injector.get(ui.IMessageService).show(options),this}setUIVisible(ui$1,visible){return this._injector.get(ui.IUIPartsService).setUIVisible(ui$1,visible),this}isUIVisible(ui$1){return this._injector.get(ui.IUIPartsService).isUIVisible(ui$1)}registerUIPart(key,component){return this._injector.get(ui.IUIPartsService).registerComponent(key,()=>core.connectInjector(component,this._injector))}registerComponent(name,component,options){const componentManager=this._injector.get(ui.ComponentManager);return this.disposeWithMe(componentManager.register(name,component,options))}};__name(_FUniverUIMixin,"FUniverUIMixin");let FUniverUIMixin=_FUniverUIMixin;core.FUniver.extend(FUniverUIMixin);const _FHooksSheetsMixin=class _FHooksSheetsMixin extends core.FHooks{onBeforeCopy(callback){return this._injector.get(core.ICommandService).beforeCommandExecuted(command=>{command.id===ui.CopyCommand.id&&callback()})}onCopy(callback){return this._injector.get(core.ICommandService).onCommandExecuted(command=>{command.id===ui.CopyCommand.id&&callback()})}onBeforePaste(callback){return this._injector.get(core.ICommandService).beforeCommandExecuted(command=>{command.id===ui.PasteCommand.id&&callback()})}onPaste(callback){return this._injector.get(core.ICommandService).onCommandExecuted(command=>{(command.id===ui.PasteCommand.id||command.id===ui.SheetPasteShortKeyCommandName)&&callback()})}};__name(_FHooksSheetsMixin,"FHooksSheetsMixin");let FHooksSheetsMixin=_FHooksSheetsMixin;core.FHooks.extend(FHooksSheetsMixin);const _FUIEnum=class _FUIEnum extends core.FEnum{get BuiltInUIPart(){return ui.BuiltInUIPart}};__name(_FUIEnum,"FUIEnum");let FUIEnum=_FUIEnum;core.FEnum.extend(FUIEnum)});
|