@univerjs/ui 1.0.0-rc.0 → 1.0.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.
- package/README.md +16 -0
- package/lib/cjs/facade.js +12 -6
- package/lib/cjs/index.js +1820 -635
- package/lib/cjs/locale/ar-SA.js +2 -1
- package/lib/cjs/locale/ca-ES.js +2 -1
- package/lib/cjs/locale/de-DE.js +2 -1
- package/lib/cjs/locale/en-US.js +2 -1
- package/lib/cjs/locale/es-ES.js +2 -1
- package/lib/cjs/locale/fa-IR.js +2 -1
- package/lib/cjs/locale/fr-FR.js +2 -1
- package/lib/cjs/locale/id-ID.js +2 -1
- package/lib/cjs/locale/it-IT.js +2 -1
- package/lib/cjs/locale/ja-JP.js +2 -1
- package/lib/cjs/locale/ko-KR.js +2 -1
- package/lib/cjs/locale/pl-PL.js +2 -1
- package/lib/cjs/locale/pt-BR.js +2 -1
- package/lib/cjs/locale/ru-RU.js +2 -1
- package/lib/cjs/locale/sk-SK.js +2 -1
- package/lib/cjs/locale/vi-VN.js +2 -1
- package/lib/cjs/locale/zh-CN.js +2 -1
- package/lib/cjs/locale/zh-HK.js +2 -1
- package/lib/cjs/locale/zh-TW.js +2 -1
- package/lib/es/facade.js +12 -6
- package/lib/es/index.js +1815 -638
- package/lib/es/locale/ar-SA.js +2 -0
- package/lib/es/locale/ca-ES.js +2 -0
- package/lib/es/locale/de-DE.js +2 -0
- package/lib/es/locale/en-US.js +2 -0
- package/lib/es/locale/es-ES.js +2 -0
- package/lib/es/locale/fa-IR.js +2 -0
- package/lib/es/locale/fr-FR.js +2 -0
- package/lib/es/locale/id-ID.js +2 -0
- package/lib/es/locale/it-IT.js +2 -0
- package/lib/es/locale/ja-JP.js +2 -0
- package/lib/es/locale/ko-KR.js +2 -0
- package/lib/es/locale/pl-PL.js +2 -0
- package/lib/es/locale/pt-BR.js +2 -0
- package/lib/es/locale/ru-RU.js +2 -0
- package/lib/es/locale/sk-SK.js +2 -0
- package/lib/es/locale/vi-VN.js +2 -0
- package/lib/es/locale/zh-CN.js +2 -0
- package/lib/es/locale/zh-HK.js +2 -0
- package/lib/es/locale/zh-TW.js +2 -0
- package/lib/facade.js +12 -6
- package/lib/index.css +102 -34
- package/lib/index.js +1815 -638
- package/lib/locale/ar-SA.js +2 -0
- package/lib/locale/ca-ES.js +2 -0
- package/lib/locale/de-DE.js +2 -0
- package/lib/locale/en-US.js +2 -0
- package/lib/locale/es-ES.js +2 -0
- package/lib/locale/fa-IR.js +2 -0
- package/lib/locale/fr-FR.js +2 -0
- package/lib/locale/id-ID.js +2 -0
- package/lib/locale/it-IT.js +2 -0
- package/lib/locale/ja-JP.js +2 -0
- package/lib/locale/ko-KR.js +2 -0
- package/lib/locale/pl-PL.js +2 -0
- package/lib/locale/pt-BR.js +2 -0
- package/lib/locale/ru-RU.js +2 -0
- package/lib/locale/sk-SK.js +2 -0
- package/lib/locale/vi-VN.js +2 -0
- package/lib/locale/zh-CN.js +2 -0
- package/lib/locale/zh-HK.js +2 -0
- package/lib/locale/zh-TW.js +2 -0
- package/lib/types/controllers/format-painter.controller.d.ts +25 -0
- package/lib/types/facade/f-menu-builder.d.ts +14 -1
- package/lib/types/facade/f-univer.d.ts +30 -5
- package/lib/types/index.d.ts +10 -0
- package/lib/types/locale/en-US.d.ts +2 -0
- package/lib/types/menu/format-painter.menu.d.ts +19 -0
- package/lib/types/services/contextmenu/contextmenu.service.d.ts +1 -0
- package/lib/types/services/format-painter/format-painter-canvas.d.ts +28 -0
- package/lib/types/services/format-painter/format-painter-session.service.d.ts +61 -0
- package/lib/types/services/menu/menu-manager.service.d.ts +13 -1
- package/lib/types/services/menu/menu.d.ts +6 -0
- package/lib/types/utils/mobile-canvas-gesture.d.ts +50 -0
- package/lib/types/views/components/context-menu/MobileContextMenu.d.ts +6 -0
- package/lib/types/views/components/dialog-part/MobileDialogPart.d.ts +5 -0
- package/lib/types/views/components/mobile-drawer/MobileDrawer.d.ts +2 -0
- package/lib/types/views/components/mobile-zoom-indicator/mobile-zoom-indicator.d.ts +26 -0
- package/lib/types/views/components/ribbon/ToolbarButton.d.ts +1 -1
- package/lib/types/views/components/sidebar/MobileSidebar.d.ts +5 -0
- package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +1 -1
- package/lib/types/views/font-family/MobileFontFamilyDropdown.d.ts +17 -0
- package/lib/types/views/menu/mobile/MobileMenu.d.ts +1 -1
- package/lib/types/views/mobile-workbench/MobileCanvasLayout.d.ts +42 -0
- package/lib/types/views/mobile-workbench/MobileWorkbench.d.ts +2 -0
- package/lib/types/views/notification/Notification.d.ts +6 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +34 -16
- 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 +12 -12
|
@@ -0,0 +1,50 @@
|
|
|
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 { IPoint } from '@univerjs/engine-render';
|
|
17
|
+
import { Disposable } from '@univerjs/core';
|
|
18
|
+
export interface IMobileCanvasGestureOptions {
|
|
19
|
+
start: (point: IPoint) => 'pan' | 'object' | 'ignore';
|
|
20
|
+
tap: (point: IPoint) => void;
|
|
21
|
+
pan: (delta: IPoint) => void;
|
|
22
|
+
pinch: (factor: number, previousCenter: IPoint, center: IPoint) => void;
|
|
23
|
+
finishObjectTransform: () => void;
|
|
24
|
+
endPinch: () => void;
|
|
25
|
+
}
|
|
26
|
+
/** Routes touch browsing separately from the canvas's existing object manipulation. */
|
|
27
|
+
export declare class MobileCanvasGesture extends Disposable {
|
|
28
|
+
private readonly _canvas;
|
|
29
|
+
private readonly _options;
|
|
30
|
+
private readonly _points;
|
|
31
|
+
private _objectPointerId;
|
|
32
|
+
private _cancellingObject;
|
|
33
|
+
private _startPoint;
|
|
34
|
+
private _moved;
|
|
35
|
+
private _pinching;
|
|
36
|
+
private _suppressClick;
|
|
37
|
+
private _lastMoveTime;
|
|
38
|
+
private _velocity;
|
|
39
|
+
private _frame;
|
|
40
|
+
constructor(_canvas: HTMLCanvasElement, _options: IMobileCanvasGestureOptions);
|
|
41
|
+
private _point;
|
|
42
|
+
private _consume;
|
|
43
|
+
private _onDown;
|
|
44
|
+
private _onMove;
|
|
45
|
+
private _onEnd;
|
|
46
|
+
private _startInertia;
|
|
47
|
+
private _stopInertia;
|
|
48
|
+
private _reset;
|
|
49
|
+
private _cancelObjectPointer;
|
|
50
|
+
}
|
|
@@ -13,4 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { IContextMenuTriggerContext } from '../../../services/contextmenu/contextmenu.service';
|
|
17
|
+
export declare function resolveMobileCaretMenuPlacement(anchorX: number, containerLeft: number, containerWidth: number, menuWidth: number): {
|
|
18
|
+
menuLeft: number;
|
|
19
|
+
pointerLeft: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function shouldUseFloatingMobileContextMenu(_menuType: string, context?: IContextMenuTriggerContext): boolean;
|
|
16
22
|
export declare function MobileContextMenu(): import("react").JSX.Element | null;
|
|
@@ -13,4 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { MobilePanelLayout } from '../../mobile-workbench/MobileCanvasLayout';
|
|
17
|
+
import type { IDialogPartMethodOptions } from './interface';
|
|
18
|
+
export interface IMobileDialogPartMethodOptions extends IDialogPartMethodOptions {
|
|
19
|
+
layout?: MobilePanelLayout;
|
|
20
|
+
}
|
|
16
21
|
export declare function MobileDialogPart(): import("react").JSX.Element | null;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { AriaRole, ReactNode, RefObject } from 'react';
|
|
17
|
+
import type { MobilePanelLayout } from '../../mobile-workbench/MobileCanvasLayout';
|
|
17
18
|
export type MobileDrawerSnap = 'compact' | 'expanded';
|
|
18
19
|
export type MobileDrawerRelease = MobileDrawerSnap | 'closed';
|
|
19
20
|
export type MobileDrawerOpenMode = 'replace' | 'push';
|
|
@@ -45,5 +46,6 @@ export declare function MobileDrawer(props: {
|
|
|
45
46
|
footer?: ReactNode;
|
|
46
47
|
role?: AriaRole;
|
|
47
48
|
ariaLabel?: string;
|
|
49
|
+
layout?: MobilePanelLayout;
|
|
48
50
|
}): import("react").JSX.Element;
|
|
49
51
|
export {};
|
|
@@ -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
|
+
import { Disposable } from '@univerjs/core';
|
|
17
|
+
export declare class MobileZoomIndicator extends Disposable {
|
|
18
|
+
private readonly _canvasElement;
|
|
19
|
+
private readonly _element;
|
|
20
|
+
private _hideTimer;
|
|
21
|
+
constructor(_canvasElement: HTMLCanvasElement);
|
|
22
|
+
show(percentage: number): void;
|
|
23
|
+
hide(): void;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
private _mount;
|
|
26
|
+
}
|
|
@@ -39,7 +39,7 @@ export interface IBaseToolbarButtonProps {
|
|
|
39
39
|
onMouseEnter?: React.MouseEventHandler;
|
|
40
40
|
onMouseLeave?: React.MouseEventHandler;
|
|
41
41
|
}
|
|
42
|
-
export declare const toolbarButtonClassName = "\nuniver-box-border univer-flex univer-h-6 univer-min-w-6 univer-cursor-pointer univer-items-center\nuniver-justify-center univer-rounded univer-border-none univer-bg-transparent univer-p-0\nuniver-text-gray-900 univer-outline-none univer-transition-colors univer-animate-in univer-fade-in\ndark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700 dark:disabled:!univer-text-gray-600\ndisabled:univer-cursor-not-allowed disabled:univer-text-gray-300 disabled:hover:univer-bg-transparent\nhover:univer-bg-gray-100 whitespace-nowrap univer-w-max\n";
|
|
42
|
+
export declare const toolbarButtonClassName = "\nuniver-box-border univer-flex univer-h-6 univer-min-w-6 univer-cursor-pointer univer-items-center\nuniver-justify-center univer-rounded univer-border-none univer-bg-transparent univer-p-0\nuniver-text-gray-900 univer-outline-none univer-transition-colors univer-animate-in univer-fade-in\ndark:!univer-text-gray-0 dark:hover:!univer-bg-gray-700 dark:disabled:!univer-text-gray-600\ndisabled:univer-cursor-not-allowed disabled:univer-text-gray-300 disabled:hover:univer-bg-transparent\nhover:univer-bg-gray-100 whitespace-nowrap univer-w-max\n[&_svg]:univer-shrink-0\n";
|
|
43
43
|
export declare const toolbarButtonVariants: (props?: ({
|
|
44
44
|
noIcon?: boolean | null | undefined;
|
|
45
45
|
active?: boolean | null | undefined;
|
|
@@ -13,4 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { MobilePanelLayout } from '../../mobile-workbench/MobileCanvasLayout';
|
|
17
|
+
import type { ISidebarMethodOptions } from './Sidebar';
|
|
18
|
+
export interface IMobileSidebarMethodOptions extends ISidebarMethodOptions {
|
|
19
|
+
layout?: MobilePanelLayout;
|
|
20
|
+
}
|
|
16
21
|
export declare function MobileSidebar(): import("react").JSX.Element | null;
|
|
@@ -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.column" | "ui.
|
|
38
|
+
titleKey: "ui.row" | "ui.column" | "ui.clearFormatting" | "ui.formatPainter" | "ui.common-edit" | "ui.toggle-shortcut-panel" | "ui.global-shortcut" | "ui.fontFamily.not-supported" | "ui.ribbon.start" | "ui.ribbon.view" | "ui.ribbon.insert" | "ui.ribbon.data" | "ui.ribbon.startDesc" | "ui.ribbon.insertDesc" | "ui.ribbon.formulas" | "ui.ribbon.formulasDesc" | "ui.ribbon.dataDesc" | "ui.ribbon.viewDesc" | "ui.ribbon.others" | "ui.ribbon.othersDesc" | "ui.ribbon.more" | "ui.clipboard.authentication.title" | "ui.clipboard.authentication.content" | "ui.accessibility.menu" | "ui.accessibility.zoom" | "ui.accessibility.zoomIn" | "ui.accessibility.zoomOut" | "ui.accessibility.resetZoom" | "ui.objectPermission.all" | "ui.objectPermission.title" | "ui.objectPermission.paragraph" | "ui.objectPermission.table" | "ui.objectPermission.page" | "ui.objectPermission.empty" | "ui.objectPermission.field" | "ui.objectPermission.record" | "ui.objectPermission.view" | "ui.objectPermission.error" | "ui.objectPermission.search" | "ui.objectPermission.document" | "ui.objectPermission.remove" | "ui.objectPermission.owner" | "ui.objectPermission.members" | "ui.objectPermission.edit" | "ui.objectPermission.comment" | "ui.objectPermission.cancel" | "ui.objectPermission.copy" | "ui.objectPermission.more" | "ui.objectPermission.operationDenied" | "ui.objectPermission.roleOwner" | "ui.objectPermission.roleEditor" | "ui.objectPermission.selectedCount" | "ui.objectPermission.searchPeople" | "ui.objectPermission.noMatchingPeople" | "ui.objectPermission.loadMore" | "ui.objectPermission.fileHint" | "ui.objectPermission.documentParent" | "ui.objectPermission.paragraphParent" | "ui.objectPermission.documentObjectParent" | "ui.objectPermission.slideParent" | "ui.objectPermission.slideObjectParent" | "ui.objectPermission.baseParent" | "ui.objectPermission.baseObjectParent" | "ui.objectPermission.recordParent" | "ui.objectPermission.boardParent" | "ui.objectPermission.ownerInherit" | "ui.objectPermission.peopleError" | "ui.objectPermission.section" | "ui.objectPermission.entity" | "ui.objectPermission.presentation" | "ui.objectPermission.master" | "ui.objectPermission.base" | "ui.objectPermission.board" | "ui.objectPermission.objectName" | "ui.objectPermission.save" | "ui.objectPermission.saving" | "ui.objectPermission.loading" | "ui.objectPermission.conflict" | "ui.objectPermission.reload" | "ui.objectPermission.denied" | "ui.objectPermission.print" | "ui.objectPermission.export" | "ui.objectPermission.parentHint" | "ui.featureSearch.title" | "ui.featureSearch.empty" | "ui.featureSearch.placeholder" | "ui.featureSearch.ribbon" | "ui.featureSearch.contextMenu" | "ui.emojiPicker.search" | "ui.emojiPicker.objects" | "ui.emojiPicker.random" | "ui.emojiPicker.recents" | "ui.emojiPicker.emojis" | "ui.emojiPicker.animals" | "ui.emojiPicker.food" | "ui.emojiPicker.activities" | "ui.emojiPicker.places" | "ui.emojiPicker.symbols" | "ui.emojiPicker.searchResults" | "ui.emojiPicker.noResults" | `ui.emojiPicker.emojiSearchIndex.${string}` | `ui.emojiPicker.emojiTitles.${string}` | "ui.symbolPicker.mathematics" | "ui.symbolPicker.greek" | "ui.symbolPicker.common" | "ui.toolbar.heading.title" | "ui.toolbar.heading.normal" | "ui.toolbar.heading.subTitle" | "ui.shortcut-panel.title" | "ui.shortcut.copy" | "ui.shortcut.cut" | "ui.shortcut.paste" | "ui.shortcut.shortcut-panel" | "ui.shortcut.undo" | "ui.shortcut.redo" | "ui.navigation.back" | "ui.navigation.next" | "ui.navigation.previous" | "ui.sidebar.close" | "ui.sidebar.resize" | "ui.sidebar.panel" | "ui.beforeClose.title" | "ui.rangeSelector.cancel";
|
|
39
39
|
}[];
|
|
40
40
|
export declare function getDefaultRecentEmojis(): IEmojiItem[];
|
|
41
41
|
export declare function getAllEmojis(): IEmojiItem[];
|
|
@@ -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 { IFontFamilyDropdownProps } from './FontFamilyDropdown';
|
|
17
|
+
export declare function MobileFontFamilyDropdown(props: IFontFamilyDropdownProps): import("react").JSX.Element;
|
|
@@ -26,5 +26,5 @@ interface IMobileMenuProps extends IBaseMenuProps {
|
|
|
26
26
|
onBack: () => void;
|
|
27
27
|
} | null) => void;
|
|
28
28
|
}
|
|
29
|
-
export declare function MobileMenu(props: IMobileMenuProps): import("react").JSX.Element
|
|
29
|
+
export declare function MobileMenu(props: IMobileMenuProps): import("react").JSX.Element;
|
|
30
30
|
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { ReactElement, ReactNode, RefObject } from 'react';
|
|
17
|
+
export type MobilePanelLayout = 'canvas' | 'modal';
|
|
18
|
+
export declare function MobileCanvasLayoutProvider({ children }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): ReactElement;
|
|
21
|
+
/** Register the actual surface, not its full-screen portal container. */
|
|
22
|
+
export declare function useMobileCanvasPanel(ref: RefObject<HTMLElement | null>, layout: MobilePanelLayout, dragging?: boolean): void;
|
|
23
|
+
/** Connect design-layer overlay surfaces to the current workbench layout. */
|
|
24
|
+
export declare function useMobileOverlayRegistration(layout: MobilePanelLayout): (element: HTMLElement) => void | (() => void);
|
|
25
|
+
/** Minimal viewport translation in CSS pixels. Large objects keep their leading edge visible. */
|
|
26
|
+
export declare function getMobileCanvasPanDelta(target: Pick<DOMRect, 'left' | 'top' | 'width' | 'height'>, viewport: Pick<DOMRect, 'width' | 'height'>): {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Opt-in canvas host. Panels remain outside the resizable inner element so their
|
|
32
|
+
* measurement cannot feed back into their own containing block. No focus or zoom
|
|
33
|
+
* changes are performed here; each renderer owns its viewport translation.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useMobileCanvasViewport(options: {
|
|
36
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
37
|
+
canvasRef: RefObject<HTMLElement | null>;
|
|
38
|
+
enabled?: boolean;
|
|
39
|
+
/** Preserve the document's own keyboard viewport handling outside object panels. */
|
|
40
|
+
panelsOnly?: boolean;
|
|
41
|
+
onReveal: () => void;
|
|
42
|
+
}): void;
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { Injector } from '@univerjs/core';
|
|
17
17
|
import type { IWorkbenchOptions } from '../../controllers/ui/ui.controller';
|
|
18
|
+
export declare function resolveMobileKeyboardInset(stableHeight: number, visibleBottom: number, baselineInset: number): number;
|
|
19
|
+
export declare function shouldUpdateMobileStableHeight(stableHeight: number, nextHeight: number, stableWidth: number, nextWidth: number, editing: boolean, keyboardVisible: boolean): boolean;
|
|
18
20
|
export interface IUniverAppProps extends IWorkbenchOptions {
|
|
19
21
|
mountContainer: HTMLElement;
|
|
20
22
|
onRendered?: (container: HTMLElement) => void;
|
|
@@ -31,7 +31,12 @@ export interface INotificationOptions {
|
|
|
31
31
|
/** The icon of the notification */
|
|
32
32
|
icon?: React.ReactNode;
|
|
33
33
|
closable?: boolean;
|
|
34
|
+
/** Whether the notification can be dismissed by user interaction */
|
|
35
|
+
dismissible?: boolean;
|
|
36
|
+
/** An action rendered inside the notification */
|
|
37
|
+
action?: NonNullable<Parameters<typeof toast>[1]>['action'];
|
|
34
38
|
}
|
|
35
39
|
export declare const notification: {
|
|
36
|
-
show: (options: INotificationOptions) =>
|
|
40
|
+
show: (options: INotificationOptions) => string | number;
|
|
41
|
+
dismiss: (id: string | number) => string | number;
|
|
37
42
|
};
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/engine-render"),require("@univerjs/ui")):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/core/facade`,`@univerjs/engine-render`,`@univerjs/ui`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverCoreFacade,e.UniverEngineRender,e.UniverUi))})(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 t.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(t,n,i,a){super(),this._item=t,this._injector=n,this._commandService=i,this._menuManagerService=a,s(this,`_commandToRegister`,new Map),s(this,`_buildingSchema`,void 0);let o=typeof t.action==`string`?t.action:(0,e.generateRandomId)(12);o!==t.action&&this._commandToRegister.set(o,t.action),this._buildingSchema={menuItemFactory:()=>({id:t.id,type:r.MenuItemType.BUTTON,icon:t.icon,title:t.title,tooltip:t.tooltip,commandId:o})},t.order!==void 0&&(this._buildingSchema.order=t.order)}__getSchema(){return this._commandToRegister.forEach((t,n)=>{this._commandService.hasCommand(n)||this._commandService.registerCommand({id:n,type:e.CommandType.COMMAND,handler:t})}),{[this._item.id]:this._buildingSchema}}};s(d,`RibbonStartGroup`,r.RibbonStartGroup),s(d,`RibbonPosition`,r.RibbonPosition),s(d,`MenuManagerPosition`,r.MenuManagerPosition),d=l([c(1,(0,e.Inject)(e.Injector)),c(2,e.ICommandService),c(3,r.IMenuManagerService)],d);let f=class extends u{constructor(e,t,n){super(),this._item=e,this._injector=t,this._menuManagerService=n,s(this,`_menuByGroups`,[]),s(this,`_submenus`,[]),s(this,`_buildingSchema`,void 0),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:r.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,e.Inject)(e.Injector)),c(2,r.IMenuManagerService)],f);let p=class extends t.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._shortcutService.forceDisable(),this}triggerShortcut(t){let n=this._univerInstanceService.getCurrentUnitOfType(e.UniverInstanceType.UNIVER_SHEET);if(!n)return;let r=this._renderManagerService.getRenderUnitById(n.getUnitId());if(r)return r.engine.getCanvasElement().dispatchEvent(t),this._shortcutService.dispatch(t)}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};p=l([c(0,(0,e.Inject)(e.Injector)),c(1,(0,e.Inject)(n.IRenderManagerService)),c(2,e.IUniverInstanceService),c(3,r.IShortcutService)],p);var m=class extends t.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(p)}copy(){return this._commandService.executeCommand(r.CopyCommand.id)}paste(){return this._commandService.executeCommand(r.PasteCommand.id)}createMenu(e){return this._injector.createInstance(d,e)}createSubmenu(e){return this._injector.createInstance(f,e)}openSidebar(e){return this._injector.get(r.ISidebarService).open(e)}openDialog(e){let t=this._injector.get(r.IDialogService).open({...e,onClose:()=>{t.dispose()}});return t}getComponentManager(){return this._injector.get(r.ComponentManager)}showMessage(e){return this._injector.get(r.IMessageService).show(e),this}setRibbonType(t){return this._injector.get(e.IConfigService).setConfig(r.UI_PLUGIN_CONFIG_KEY,{ribbonType:t},{merge:!0}),this}setUIVisible(e,t){return this._injector.get(r.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(r.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(r.IUIPartsService).registerComponent(e,()=>(0,r.connectInjector)(t,this._injector))}registerComponent(e,t,n){let i=this._injector.get(r.ComponentManager);return this.disposeWithMe(i.register(e,t,n))}setCurrent(e){if(!this._injector.get(n.IRenderManagerService).getRenderUnitById(e))throw Error(`Unit not found`);this._univerInstanceService.setCurrentUnitForType(e)}addFonts(e){let t=this._injector.get(r.IFontService);e.forEach(e=>{t.addFont(e)})}};t.FUniver.extend(m);var h=class extends t.FEnum{get BuiltInUIPart(){return r.BuiltInUIPart}get KeyCode(){return r.KeyCode}};t.FEnum.extend(h)});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core"),require("@univerjs/core/facade"),require("@univerjs/engine-render"),require("@univerjs/ui")):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/core/facade`,`@univerjs/engine-render`,`@univerjs/ui`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverCoreFacade,e.UniverEngineRender,e.UniverUi))})(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 t.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(t,n,i,a){super(),this._item=t,this._injector=n,this._commandService=i,this._menuManagerService=a,s(this,`_commandToRegister`,new Map),s(this,`_buildingSchema`,void 0);let o=typeof t.action==`string`?t.action:(0,e.generateRandomId)(12);o!==t.action&&this._commandToRegister.set(o,t.action),this._buildingSchema={menuItemFactory:()=>({id:t.id,type:r.MenuItemType.BUTTON,icon:t.icon,title:t.title,tooltip:t.tooltip,commandId:o})},t.order!==void 0&&(this._buildingSchema.order=t.order),t.gridLayout&&(this._buildingSchema.gridLayout=t.gridLayout)}__getSchema(){return this._commandToRegister.forEach((t,n)=>{this._commandService.hasCommand(n)||this._commandService.registerCommand({id:n,type:e.CommandType.COMMAND,handler:t})}),{[this._item.id]:this._buildingSchema}}};s(d,`RibbonStartGroup`,r.RibbonStartGroup),s(d,`RibbonPosition`,r.RibbonPosition),s(d,`MenuManagerPosition`,r.MenuManagerPosition),d=l([c(1,(0,e.Inject)(e.Injector)),c(2,e.ICommandService),c(3,r.IMenuManagerService)],d);let f=class extends u{constructor(e,t,n){super(),this._item=e,this._injector=t,this._menuManagerService=n,s(this,`_menuByGroups`,[]),s(this,`_submenus`,[]),s(this,`_buildingSchema`,void 0),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:r.MenuItemType.SUBITEMS,icon:e.icon,title:e.title,tooltip:e.tooltip})},e.order!==void 0&&(this._buildingSchema.order=e.order),e.gridLayout&&(this._buildingSchema.gridLayout=e.gridLayout)}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,e.Inject)(e.Injector)),c(2,r.IMenuManagerService)],f);let p=class extends t.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._shortcutService.forceDisable(),this}triggerShortcut(t){let n=this._univerInstanceService.getCurrentUnitOfType(e.UniverInstanceType.UNIVER_SHEET);if(!n)return;let r=this._renderManagerService.getRenderUnitById(n.getUnitId());if(r)return r.engine.getCanvasElement().dispatchEvent(t),this._shortcutService.dispatch(t)}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};p=l([c(0,(0,e.Inject)(e.Injector)),c(1,(0,e.Inject)(n.IRenderManagerService)),c(2,e.IUniverInstanceService),c(3,r.IShortcutService)],p);var m=class extends t.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(p)}copy(){return this._commandService.executeCommand(r.CopyCommand.id)}paste(){return this._commandService.executeCommand(r.PasteCommand.id)}createMenu(e){return this._injector.createInstance(d,e)}createSubmenu(e){return this._injector.createInstance(f,e)}updateMenuConfig(e){return this._injector.get(r.IMenuManagerService).updateMenuConfig(e),this}openSidebar(e){return this._injector.get(r.ISidebarService).open(e)}openDialog(e){let t=this._injector.get(r.IDialogService).open({...e,onClose:()=>{t.dispose()}});return t}getComponentManager(){return this._injector.get(r.ComponentManager)}showMessage(e){return this._injector.get(r.IMessageService).show(e),this}setRibbonType(t){return this._injector.get(e.IConfigService).setConfig(r.UI_PLUGIN_CONFIG_KEY,{ribbonType:t},{merge:!0}),this}setUIVisible(e,t){return this._injector.get(r.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(r.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(r.IUIPartsService).registerComponent(e,()=>(0,r.connectInjector)(t,this._injector))}registerComponent(e,t,n){let i=this._injector.get(r.ComponentManager);return this.disposeWithMe(i.register(e,t,n))}setCurrent(e){if(!this._injector.get(n.IRenderManagerService).getRenderUnitById(e))throw Error(`Unit not found`);this._univerInstanceService.setCurrentUnitForType(e)}addFonts(e){let t=this._injector.get(r.IFontService);e.forEach(e=>{t.addFont(e)})}};t.FUniver.extend(m);var h=class extends t.FEnum{get BuiltInUIPart(){return r.BuiltInUIPart}get KeyCode(){return r.KeyCode}};t.FEnum.extend(h)});
|