@univerjs/ui 1.5.1 → 1.6.0
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 +6 -6
- package/lib/cjs/index.js +12562 -11849
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +6 -6
- package/lib/es/index.js +12508 -11819
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/facade.js +6 -6
- package/lib/index.css +235 -76
- package/lib/index.js +12508 -11819
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/components/editor-toolbar/EditorFloatingToolbar.d.ts +59 -0
- package/lib/types/components/editor-toolbar/EditorMenu.d.ts +33 -0
- package/lib/types/components/editor-toolbar/floating-toolbar-interaction.d.ts +19 -0
- package/lib/types/components/hyperlink/HyperlinkEditor.d.ts +38 -0
- package/lib/types/components/hyperlink/HyperlinkPreview.d.ts +34 -0
- package/lib/types/components/table-size-picker/MobileTableSizePicker.d.ts +17 -0
- package/lib/types/components/table-size-picker/TableSizePicker.d.ts +61 -0
- package/lib/types/controllers/components.controller.d.ts +3 -0
- package/lib/types/index.d.ts +14 -0
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/services/menu/menu-manager.service.d.ts +2 -0
- package/lib/types/services/menu/types.d.ts +1 -0
- package/lib/types/views/components/ribbon/RibbonGrid.d.ts +2 -1
- package/lib/types/views/components/ribbon/ToolbarItem.d.ts +1 -0
- package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +1 -1
- package/lib/types/views/object-permission/ObjectPermissionMembers.d.ts +2 -1
- package/lib/types/views/user-info/UserInfo.d.ts +54 -0
- package/lib/umd/index.js +19 -19
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- 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 -1
- package/lib/umd/locale/it-IT.js +1 -1
- 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 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- 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 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -11
package/lib/locale/ar-SA.js
CHANGED
package/lib/locale/ca-ES.js
CHANGED
package/lib/locale/de-DE.js
CHANGED
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
package/lib/locale/fa-IR.js
CHANGED
package/lib/locale/fr-FR.js
CHANGED
package/lib/locale/id-ID.js
CHANGED
package/lib/locale/it-IT.js
CHANGED
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/pl-PL.js
CHANGED
package/lib/locale/pt-BR.js
CHANGED
package/lib/locale/ru-RU.js
CHANGED
package/lib/locale/sk-SK.js
CHANGED
package/lib/locale/vi-VN.js
CHANGED
package/lib/locale/zh-CN.js
CHANGED
package/lib/locale/zh-HK.js
CHANGED
package/lib/locale/zh-TW.js
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
import type { ComponentProps, KeyboardEvent, MouseEvent, PointerEvent, ReactNode } from 'react';
|
|
17
|
+
import { Dropdown, Tooltip } from '@univerjs/design';
|
|
18
|
+
export declare function EditorToolbarTooltip(props: Omit<ComponentProps<typeof Tooltip>, 'visible' | 'onVisibleChange'> & {
|
|
19
|
+
popupOpen: boolean;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
type EditorDropdownProps = Omit<ComponentProps<typeof Dropdown>, 'avoidCollisions'>;
|
|
22
|
+
export declare function EditorDropdown(props: EditorDropdownProps): import("react").JSX.Element;
|
|
23
|
+
export declare function EditorToolbarIcon(props: {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export declare function EditorFloatingToolbar(props: {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
maxWidthClassName?: string;
|
|
31
|
+
onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
export declare function EditorToolbarButton(props: {
|
|
34
|
+
title?: string;
|
|
35
|
+
active?: boolean;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
className?: string;
|
|
39
|
+
sizeClassName?: string;
|
|
40
|
+
popupOpen?: boolean;
|
|
41
|
+
ariaExpanded?: boolean;
|
|
42
|
+
onClick?: () => void;
|
|
43
|
+
onKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
44
|
+
onMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
45
|
+
onPointerDown?: (event: PointerEvent<HTMLButtonElement>) => void;
|
|
46
|
+
}): import("react").JSX.Element;
|
|
47
|
+
export declare function EditorDropdownTrigger(props: {
|
|
48
|
+
title?: string;
|
|
49
|
+
label?: string;
|
|
50
|
+
icon: ReactNode;
|
|
51
|
+
active?: boolean;
|
|
52
|
+
className?: string;
|
|
53
|
+
sizeClassName?: string;
|
|
54
|
+
onKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
55
|
+
onMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
56
|
+
onPointerDown?: (event: PointerEvent<HTMLButtonElement>) => void;
|
|
57
|
+
}): import("react").JSX.Element;
|
|
58
|
+
export declare function resolveEditorDropdownSide(popupDirection: string, requestedSide?: 'top' | 'bottom'): 'top' | 'bottom';
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import type { ReactNode } from 'react';
|
|
17
|
+
import type { FloatingObjectToolbarPosition } from '../../services/menu/types';
|
|
18
|
+
export declare function EditorMenuActions(props: {
|
|
19
|
+
position: FloatingObjectToolbarPosition;
|
|
20
|
+
}): import("react").JSX.Element[];
|
|
21
|
+
export declare function EditorMenuPanel(props: {
|
|
22
|
+
title?: string;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
minWidthClassName?: string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export declare function EditorMenuItem(props: {
|
|
28
|
+
label: string;
|
|
29
|
+
shortcut?: string;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
danger?: boolean;
|
|
32
|
+
onClick: () => void;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
import type { MouseEvent, PointerEvent } from 'react';
|
|
17
|
+
export declare function shouldKeepFloatingToolbarMouseDownDefault(target: EventTarget | null): boolean;
|
|
18
|
+
export declare function preventFloatingToolbarPanelBlur(event: MouseEvent<HTMLElement> | PointerEvent<HTMLElement>): void;
|
|
19
|
+
export declare function keepFloatingToolbarPanelInteraction(event: MouseEvent<HTMLElement> | PointerEvent<HTMLElement>): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
import type { ComponentProps, ComponentType } from 'react';
|
|
17
|
+
import { Button, Input } from '@univerjs/design';
|
|
18
|
+
export interface IHyperlinkEditorProps {
|
|
19
|
+
url: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
urlError?: string;
|
|
22
|
+
labelError?: string;
|
|
23
|
+
labels: {
|
|
24
|
+
address: string;
|
|
25
|
+
label: string;
|
|
26
|
+
cancel: string;
|
|
27
|
+
confirm: string;
|
|
28
|
+
};
|
|
29
|
+
onUrlChange: (url: string) => void;
|
|
30
|
+
onLabelChange?: (label: string) => void;
|
|
31
|
+
onCancel: () => void;
|
|
32
|
+
onConfirm: () => void | Promise<unknown>;
|
|
33
|
+
mobile?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
InputComponent?: ComponentType<ComponentProps<typeof Input>>;
|
|
36
|
+
ButtonComponent?: ComponentType<ComponentProps<typeof Button>>;
|
|
37
|
+
}
|
|
38
|
+
export declare function HyperlinkEditor({ url, label, urlError, labelError, labels, onUrlChange, onLabelChange, onCancel, onConfirm, mobile, className, InputComponent, ButtonComponent }: IHyperlinkEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
17
|
+
export interface IHyperlinkPreviewProps extends Pick<HTMLAttributes<HTMLDivElement>, 'onPointerEnter' | 'onPointerLeave' | 'className'> {
|
|
18
|
+
title: string;
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
description?: string;
|
|
21
|
+
invalid?: boolean;
|
|
22
|
+
copyDisabled?: boolean;
|
|
23
|
+
labels: {
|
|
24
|
+
copy: string;
|
|
25
|
+
edit: string;
|
|
26
|
+
remove: string;
|
|
27
|
+
};
|
|
28
|
+
onOpen: () => void | Promise<unknown>;
|
|
29
|
+
onCopy: () => void | Promise<unknown>;
|
|
30
|
+
onEdit?: () => void | Promise<unknown>;
|
|
31
|
+
onRemove?: () => void | Promise<unknown>;
|
|
32
|
+
onDismiss?: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function HyperlinkPreview({ title, icon, description, invalid, copyDisabled, labels, onOpen, onCopy, onEdit, onRemove, onDismiss, className, ...attributes }: IHyperlinkPreviewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
import type { ITableSizePickerProps } from './TableSizePicker';
|
|
17
|
+
export declare function MobileTableSizePicker(props: ITableSizePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
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 interface ITableSize {
|
|
17
|
+
rows: number;
|
|
18
|
+
columns: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ITableSizePickerProps {
|
|
21
|
+
initialRows?: number;
|
|
22
|
+
initialColumns?: number;
|
|
23
|
+
maxGridRows?: number;
|
|
24
|
+
maxGridColumns?: number;
|
|
25
|
+
minRows?: number;
|
|
26
|
+
minColumns?: number;
|
|
27
|
+
maxRows?: number;
|
|
28
|
+
maxColumns?: number;
|
|
29
|
+
variant?: 'card' | 'dropdown';
|
|
30
|
+
direction?: 'ltr' | 'rtl';
|
|
31
|
+
title?: string;
|
|
32
|
+
labels: {
|
|
33
|
+
rows: string;
|
|
34
|
+
columns: string;
|
|
35
|
+
customSize: string;
|
|
36
|
+
confirm: string;
|
|
37
|
+
size: (columns: number, rows: number) => string;
|
|
38
|
+
};
|
|
39
|
+
onConfirm: (size: ITableSize) => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function useTableSizePicker(props: Omit<ITableSizePickerProps, 'labels'>): {
|
|
42
|
+
direction: "ltr" | "rtl";
|
|
43
|
+
title: string | undefined;
|
|
44
|
+
rows: number;
|
|
45
|
+
columns: number;
|
|
46
|
+
minRows: number;
|
|
47
|
+
minColumns: number;
|
|
48
|
+
maxRows: number;
|
|
49
|
+
maxColumns: number;
|
|
50
|
+
maxGridRows: number;
|
|
51
|
+
maxGridColumns: number;
|
|
52
|
+
setHoverSize: import("react").Dispatch<import("react").SetStateAction<ITableSize | null>>;
|
|
53
|
+
selectedRows: number;
|
|
54
|
+
selectedColumns: number;
|
|
55
|
+
isDropdown: boolean;
|
|
56
|
+
updateRows: (value: number) => void;
|
|
57
|
+
updateColumns: (value: number) => void;
|
|
58
|
+
handleConfirm: () => void;
|
|
59
|
+
onConfirm: (size: ITableSize) => void;
|
|
60
|
+
};
|
|
61
|
+
export declare function TableSizePicker(props: ITableSizePickerProps): import("react").JSX.Element;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { IDisposable } from '@univerjs/core';
|
|
16
17
|
import { Disposable } from '@univerjs/core';
|
|
17
18
|
import { ComponentManager } from '../common/component-manager';
|
|
18
19
|
import { IconManager } from '../common/icon-manager';
|
|
@@ -23,3 +24,5 @@ export declare class ComponentsController extends Disposable {
|
|
|
23
24
|
private _registerIcons;
|
|
24
25
|
private _registerComponents;
|
|
25
26
|
}
|
|
27
|
+
/** Snapshot the host renderer into an independent viewer registry; disposal only affects the viewer. */
|
|
28
|
+
export declare function inheritUserInfoComponent(source: ComponentManager, componentManager: ComponentManager): IDisposable;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -20,9 +20,20 @@ export * from './common';
|
|
|
20
20
|
export { getHeaderFooterMenuHiddenObservable, getMenuHiddenObservable } from './common/menu-hidden-observable';
|
|
21
21
|
export { mergeMenuConfigs } from './common/menu-merge-configs';
|
|
22
22
|
export { objectPermissionMenuItemFactory } from './common/object-permission-menu';
|
|
23
|
+
export { EditorDropdown, EditorDropdownTrigger, EditorFloatingToolbar, EditorToolbarButton, EditorToolbarIcon, EditorToolbarTooltip, resolveEditorDropdownSide } from './components/editor-toolbar/EditorFloatingToolbar';
|
|
24
|
+
export { EditorMenuActions, EditorMenuItem, EditorMenuPanel } from './components/editor-toolbar/EditorMenu';
|
|
25
|
+
export { keepFloatingToolbarPanelInteraction, preventFloatingToolbarPanelBlur, shouldKeepFloatingToolbarMouseDownDefault } from './components/editor-toolbar/floating-toolbar-interaction';
|
|
26
|
+
export { HyperlinkEditor } from './components/hyperlink/HyperlinkEditor';
|
|
27
|
+
export type { IHyperlinkEditorProps } from './components/hyperlink/HyperlinkEditor';
|
|
28
|
+
export { HyperlinkPreview } from './components/hyperlink/HyperlinkPreview';
|
|
29
|
+
export type { IHyperlinkPreviewProps } from './components/hyperlink/HyperlinkPreview';
|
|
30
|
+
export { MobileTableSizePicker } from './components/table-size-picker/MobileTableSizePicker';
|
|
31
|
+
export { TableSizePicker, useTableSizePicker } from './components/table-size-picker/TableSizePicker';
|
|
32
|
+
export type { ITableSize, ITableSizePickerProps } from './components/table-size-picker/TableSizePicker';
|
|
23
33
|
export { UI_PLUGIN_CONFIG_KEY } from './config/config';
|
|
24
34
|
export type { IUniverUIConfig } from './config/config';
|
|
25
35
|
export { MOBILE_UI_MODE, UNI_DISABLE_CHANGING_FOCUS_KEY } from './const';
|
|
36
|
+
export { inheritUserInfoComponent } from './controllers/components.controller';
|
|
26
37
|
export { ErrorController } from './controllers/error/error.controller';
|
|
27
38
|
export { CopyShortcutItem, CutShortcutItem, RedoShortcutItem, SharedController, UndoShortcutItem, } from './controllers/shared-shortcut.controller';
|
|
28
39
|
export { ShortcutPanelController } from './controllers/shortcut-display/shortcut-panel.controller';
|
|
@@ -30,6 +41,7 @@ export { DesktopUIController } from './controllers/ui/ui-desktop.controller';
|
|
|
30
41
|
export { SingleUnitUIController } from './controllers/ui/ui-shared.controller';
|
|
31
42
|
export { IUIController } from './controllers/ui/ui.controller';
|
|
32
43
|
export type { IWorkbenchOptions, RibbonType } from './controllers/ui/ui.controller';
|
|
44
|
+
export { RedoMenuItemFactory, UndoMenuItemFactory } from './menu/history.menu';
|
|
33
45
|
export { menuSchema as UIMenuSchema } from './menu/schema';
|
|
34
46
|
export { UniverMobileUIPlugin } from './mobile-plugin';
|
|
35
47
|
export { DISABLE_AUTO_FOCUS_KEY, UniverUIPlugin } from './plugin';
|
|
@@ -141,3 +153,5 @@ export { ObjectPermissionButton, openObjectPermissionDialog } from './views/obje
|
|
|
141
153
|
export type { IObjectPermissionButtonProps } from './views/object-permission/ObjectPermissionButton';
|
|
142
154
|
export { ObjectPermissionPanelButton, openObjectPermissionPanel } from './views/object-permission/ObjectPermissionPanel';
|
|
143
155
|
export { ProgressBar } from './views/progress-bar/ProgressBar';
|
|
156
|
+
export { DefaultUserInfo, USER_INFO_COMPONENT, UserInfo } from './views/user-info/UserInfo';
|
|
157
|
+
export type { IUserInfoContext, IUserInfoData, IUserInfoProps } from './views/user-info/UserInfo';
|
|
@@ -67,6 +67,8 @@ export type MenuSchemaType = {
|
|
|
67
67
|
order?: number;
|
|
68
68
|
replace?: boolean;
|
|
69
69
|
menuItemFactory?: (accessor: IAccessor) => IMenuItem;
|
|
70
|
+
/** Extend the registered item before applying application menu configuration. */
|
|
71
|
+
customizeMenuItem?: (accessor: IAccessor, item: IMenuItem) => IMenuItem;
|
|
70
72
|
headerActionMenuItemFactory?: (accessor: IAccessor) => IMenuItem;
|
|
71
73
|
title?: string;
|
|
72
74
|
contextual?: boolean;
|
|
@@ -52,6 +52,7 @@ export declare enum RibbonDataGroup {
|
|
|
52
52
|
FORMULAS = "ribbon.data.formulas",
|
|
53
53
|
RULES = "ribbon.data.rules",
|
|
54
54
|
ORGANIZATION = "ribbon.data.organization",
|
|
55
|
+
ANALYSIS = "ribbon.data.analysis",
|
|
55
56
|
OTHERS = "ribbon.data.others"
|
|
56
57
|
}
|
|
57
58
|
export declare enum RibbonViewGroup {
|
|
@@ -18,6 +18,7 @@ import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
|
|
|
18
18
|
interface IRibbonGridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
19
19
|
groups: IMenuSchema[];
|
|
20
20
|
title: string;
|
|
21
|
+
alignStart?: boolean;
|
|
21
22
|
}
|
|
22
|
-
export declare function RibbonGrid({ groups, title, className, ...props }: IRibbonGridProps): import("react").JSX.Element;
|
|
23
|
+
export declare function RibbonGrid({ groups, title, alignStart, className, ...props }: IRibbonGridProps): import("react").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -35,7 +35,7 @@ export declare const EMOJI_SKIN_TONE_OPTIONS: ReadonlyArray<IEmojiVariant & {
|
|
|
35
35
|
export declare const EMOJI_RECENT_LIMIT = 11;
|
|
36
36
|
export declare const EMOJI_CATEGORIES: {
|
|
37
37
|
key: EmojiCategory;
|
|
38
|
-
titleKey: "ui.accessibility.menu" | "ui.accessibility.resetZoom" | "ui.accessibility.zoom" | "ui.accessibility.zoomIn" | "ui.accessibility.zoomOut" | "ui.beforeClose.title" | "ui.clearFormatting" | "ui.clipboard.authentication.content" | "ui.clipboard.authentication.title" | "ui.column" | "ui.common-edit" | "ui.emojiPicker.activities" | "ui.emojiPicker.animals" | "ui.emojiPicker.emojis" | "ui.emojiPicker.food" | "ui.emojiPicker.noResults" | "ui.emojiPicker.objects" | "ui.emojiPicker.places" | "ui.emojiPicker.random" | "ui.emojiPicker.recents" | "ui.emojiPicker.search" | "ui.emojiPicker.searchResults" | "ui.emojiPicker.symbols" | "ui.featureSearch.contextMenu" | "ui.featureSearch.empty" | "ui.featureSearch.placeholder" | "ui.featureSearch.ribbon" | "ui.featureSearch.title" | "ui.fontFamily.not-supported" | "ui.formatPainter" | "ui.global-shortcut" | "ui.navigation.back" | "ui.navigation.next" | "ui.navigation.previous" | "ui.objectPermission.all" | "ui.objectPermission.base" | "ui.objectPermission.baseObjectParent" | "ui.objectPermission.baseParent" | "ui.objectPermission.board" | "ui.objectPermission.boardParent" | "ui.objectPermission.cancel" | "ui.objectPermission.comment" | "ui.objectPermission.conflict" | "ui.objectPermission.copy" | "ui.objectPermission.denied" | "ui.objectPermission.document" | "ui.objectPermission.documentObjectParent" | "ui.objectPermission.documentParent" | "ui.objectPermission.edit" | "ui.objectPermission.empty" | "ui.objectPermission.entity" | "ui.objectPermission.error" | "ui.objectPermission.export" | "ui.objectPermission.field" | "ui.objectPermission.fileHint" | "ui.objectPermission.loadMore" | "ui.objectPermission.loading" | "ui.objectPermission.master" | "ui.objectPermission.members" | "ui.objectPermission.more" | "ui.objectPermission.noMatchingPeople" | "ui.objectPermission.objectName" | "ui.objectPermission.operationDenied" | "ui.objectPermission.owner" | "ui.objectPermission.ownerInherit" | "ui.objectPermission.page" | "ui.objectPermission.paragraph" | "ui.objectPermission.paragraphParent" | "ui.objectPermission.parentHint" | "ui.objectPermission.peopleError" | "ui.objectPermission.presentation" | "ui.objectPermission.print" | "ui.objectPermission.record" | "ui.objectPermission.recordParent" | "ui.objectPermission.reload" | "ui.objectPermission.remove" | "ui.objectPermission.roleEditor" | "ui.objectPermission.roleOwner" | "ui.objectPermission.save" | "ui.objectPermission.saving" | "ui.objectPermission.search" | "ui.objectPermission.searchPeople" | "ui.objectPermission.section" | "ui.objectPermission.selectedCount" | "ui.objectPermission.slideObjectParent" | "ui.objectPermission.slideParent" | "ui.objectPermission.table" | "ui.objectPermission.title" | "ui.objectPermission.view" | "ui.rangeSelector.cancel" | "ui.ribbon.data" | "ui.ribbon.dataDesc" | "ui.ribbon.formulas" | "ui.ribbon.formulasDesc" | "ui.ribbon.groups.cells" | "ui.ribbon.groups.clipboard" | "ui.ribbon.groups.display" | "ui.ribbon.groups.editing" | "ui.ribbon.groups.font" | "ui.ribbon.groups.formulas" | "ui.ribbon.groups.layout" | "ui.ribbon.groups.media" | "ui.ribbon.groups.number" | "ui.ribbon.groups.organization" | "ui.ribbon.groups.rules" | "ui.ribbon.groups.tools" | "ui.ribbon.groups.visibility" | "ui.ribbon.insert" | "ui.ribbon.insertDesc" | "ui.ribbon.more" | "ui.ribbon.others" | "ui.ribbon.othersDesc" | "ui.ribbon.start" | "ui.ribbon.startDesc" | "ui.ribbon.view" | "ui.ribbon.viewDesc" | "ui.row" | "ui.shortcut-panel.title" | "ui.shortcut.copy" | "ui.shortcut.cut" | "ui.shortcut.paste" | "ui.shortcut.redo" | "ui.shortcut.shortcut-panel" | "ui.shortcut.undo" | "ui.sidebar.close" | "ui.sidebar.panel" | "ui.sidebar.resize" | "ui.symbolPicker.common" | "ui.symbolPicker.greek" | "ui.symbolPicker.mathematics" | "ui.toggle-shortcut-panel" | "ui.toolbar.heading.normal" | "ui.toolbar.heading.subTitle" | "ui.toolbar.heading.title" | `ui.emojiPicker.emojiSearchIndex.${string}` | `ui.emojiPicker.emojiTitles.${string}`;
|
|
38
|
+
titleKey: "ui.accessibility.menu" | "ui.accessibility.resetZoom" | "ui.accessibility.zoom" | "ui.accessibility.zoomIn" | "ui.accessibility.zoomOut" | "ui.beforeClose.title" | "ui.clearFormatting" | "ui.clipboard.authentication.content" | "ui.clipboard.authentication.title" | "ui.column" | "ui.common-edit" | "ui.emojiPicker.activities" | "ui.emojiPicker.animals" | "ui.emojiPicker.emojis" | "ui.emojiPicker.food" | "ui.emojiPicker.noResults" | "ui.emojiPicker.objects" | "ui.emojiPicker.places" | "ui.emojiPicker.random" | "ui.emojiPicker.recents" | "ui.emojiPicker.search" | "ui.emojiPicker.searchResults" | "ui.emojiPicker.symbols" | "ui.featureSearch.contextMenu" | "ui.featureSearch.empty" | "ui.featureSearch.placeholder" | "ui.featureSearch.ribbon" | "ui.featureSearch.title" | "ui.fontFamily.not-supported" | "ui.formatPainter" | "ui.global-shortcut" | "ui.navigation.back" | "ui.navigation.next" | "ui.navigation.previous" | "ui.objectPermission.all" | "ui.objectPermission.base" | "ui.objectPermission.baseObjectParent" | "ui.objectPermission.baseParent" | "ui.objectPermission.board" | "ui.objectPermission.boardParent" | "ui.objectPermission.cancel" | "ui.objectPermission.comment" | "ui.objectPermission.conflict" | "ui.objectPermission.copy" | "ui.objectPermission.denied" | "ui.objectPermission.document" | "ui.objectPermission.documentObjectParent" | "ui.objectPermission.documentParent" | "ui.objectPermission.edit" | "ui.objectPermission.empty" | "ui.objectPermission.entity" | "ui.objectPermission.error" | "ui.objectPermission.export" | "ui.objectPermission.field" | "ui.objectPermission.fileHint" | "ui.objectPermission.loadMore" | "ui.objectPermission.loading" | "ui.objectPermission.master" | "ui.objectPermission.members" | "ui.objectPermission.more" | "ui.objectPermission.noMatchingPeople" | "ui.objectPermission.objectName" | "ui.objectPermission.operationDenied" | "ui.objectPermission.owner" | "ui.objectPermission.ownerInherit" | "ui.objectPermission.page" | "ui.objectPermission.paragraph" | "ui.objectPermission.paragraphParent" | "ui.objectPermission.parentHint" | "ui.objectPermission.peopleError" | "ui.objectPermission.presentation" | "ui.objectPermission.print" | "ui.objectPermission.record" | "ui.objectPermission.recordParent" | "ui.objectPermission.reload" | "ui.objectPermission.remove" | "ui.objectPermission.roleEditor" | "ui.objectPermission.roleOwner" | "ui.objectPermission.save" | "ui.objectPermission.saving" | "ui.objectPermission.search" | "ui.objectPermission.searchPeople" | "ui.objectPermission.section" | "ui.objectPermission.selectedCount" | "ui.objectPermission.slideObjectParent" | "ui.objectPermission.slideParent" | "ui.objectPermission.table" | "ui.objectPermission.title" | "ui.objectPermission.view" | "ui.rangeSelector.cancel" | "ui.ribbon.data" | "ui.ribbon.dataDesc" | "ui.ribbon.formulas" | "ui.ribbon.formulasDesc" | "ui.ribbon.groups.analysis" | "ui.ribbon.groups.cells" | "ui.ribbon.groups.clipboard" | "ui.ribbon.groups.display" | "ui.ribbon.groups.editing" | "ui.ribbon.groups.font" | "ui.ribbon.groups.formulas" | "ui.ribbon.groups.layout" | "ui.ribbon.groups.media" | "ui.ribbon.groups.number" | "ui.ribbon.groups.organization" | "ui.ribbon.groups.rules" | "ui.ribbon.groups.tools" | "ui.ribbon.groups.visibility" | "ui.ribbon.insert" | "ui.ribbon.insertDesc" | "ui.ribbon.more" | "ui.ribbon.others" | "ui.ribbon.othersDesc" | "ui.ribbon.start" | "ui.ribbon.startDesc" | "ui.ribbon.view" | "ui.ribbon.viewDesc" | "ui.row" | "ui.shortcut-panel.title" | "ui.shortcut.copy" | "ui.shortcut.cut" | "ui.shortcut.paste" | "ui.shortcut.redo" | "ui.shortcut.shortcut-panel" | "ui.shortcut.undo" | "ui.sidebar.close" | "ui.sidebar.panel" | "ui.sidebar.resize" | "ui.symbolPicker.common" | "ui.symbolPicker.greek" | "ui.symbolPicker.mathematics" | "ui.toggle-shortcut-panel" | "ui.toolbar.heading.normal" | "ui.toolbar.heading.subTitle" | "ui.toolbar.heading.title" | `ui.emojiPicker.emojiSearchIndex.${string}` | `ui.emojiPicker.emojiTitles.${string}`;
|
|
39
39
|
}[];
|
|
40
40
|
export declare function getDefaultRecentEmojis(): IEmojiItem[];
|
|
41
41
|
export declare function getAllEmojis(): IEmojiItem[];
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
import type { ICollaborator } from '@univerjs/protocol';
|
|
17
17
|
interface IObjectPermissionMembersProps {
|
|
18
18
|
unitId: string;
|
|
19
|
+
objectId: string;
|
|
19
20
|
value: ICollaborator[];
|
|
20
21
|
disabled: boolean;
|
|
21
22
|
onChange: (value: ICollaborator[]) => void;
|
|
22
23
|
}
|
|
23
|
-
export declare function ObjectPermissionMembers({ unitId, value, disabled, onChange }: IObjectPermissionMembersProps): import("react").JSX.Element;
|
|
24
|
+
export declare function ObjectPermissionMembers({ unitId, objectId, value, disabled, onChange }: IObjectPermissionMembersProps): import("react").JSX.Element;
|
|
24
25
|
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
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 const USER_INFO_COMPONENT = "UserInfo";
|
|
17
|
+
export interface IUserInfoData {
|
|
18
|
+
/** Source user identity, available even before the profile loads. Never a collaboration session ID. */
|
|
19
|
+
userId?: string;
|
|
20
|
+
/** Display-only data; custom components may render a name without obtaining its plaintext. */
|
|
21
|
+
name?: string;
|
|
22
|
+
avatar?: string;
|
|
23
|
+
isAnonymous?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface IUserInfoContext {
|
|
26
|
+
scene: 'comment-author' | 'history-author' | 'history-filter' | 'permission-member' | 'permission-creator' | 'base-person';
|
|
27
|
+
/** Absent for standalone controls which have no associated document. */
|
|
28
|
+
unitId?: string;
|
|
29
|
+
subUnitId?: string;
|
|
30
|
+
commentId?: string;
|
|
31
|
+
threadId?: string;
|
|
32
|
+
versionId?: string;
|
|
33
|
+
objectId?: string;
|
|
34
|
+
tableId?: string;
|
|
35
|
+
fieldId?: string;
|
|
36
|
+
recordId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IUserInfoProps {
|
|
39
|
+
user: Readonly<IUserInfoData>;
|
|
40
|
+
part: 'name' | 'avatar';
|
|
41
|
+
context: Readonly<IUserInfoContext>;
|
|
42
|
+
avatarSize?: number;
|
|
43
|
+
fallbackSrc?: string;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Default renderer, also usable by host overrides for scenes they do not customize. */
|
|
47
|
+
export declare function DefaultUserInfo(props: IUserInfoProps): string | import("react").JSX.Element | null;
|
|
48
|
+
/**
|
|
49
|
+
* Renders user information through the host's registered component, including unresolved profiles.
|
|
50
|
+
* Register USER_INFO_COMPONENT with FUniver.registerComponent before opening the view.
|
|
51
|
+
* Hosts own external SDK initialization, identity mapping and asynchronous DOM rendering.
|
|
52
|
+
* This does not change permissions, persisted mentions, search text or Canvas rendering.
|
|
53
|
+
*/
|
|
54
|
+
export declare function UserInfo(props: IUserInfoProps): string | import("react").JSX.Element | null;
|