@univerjs/docs-ui 0.25.0 → 1.0.0-alpha.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 +23 -183
- package/lib/cjs/index.js +7475 -5364
- package/lib/cjs/locale/ar-SA.js +35 -1
- package/lib/cjs/locale/ca-ES.js +35 -1
- package/lib/cjs/locale/de-DE.js +35 -1
- package/lib/cjs/locale/en-US.js +35 -1
- package/lib/cjs/locale/es-ES.js +35 -1
- package/lib/cjs/locale/fa-IR.js +35 -1
- package/lib/cjs/locale/fr-FR.js +35 -1
- package/lib/cjs/locale/id-ID.js +35 -1
- package/lib/cjs/locale/it-IT.js +35 -1
- package/lib/cjs/locale/ja-JP.js +35 -1
- package/lib/cjs/locale/ko-KR.js +35 -1
- package/lib/cjs/locale/pl-PL.js +35 -1
- package/lib/cjs/locale/pt-BR.js +35 -1
- package/lib/cjs/locale/ru-RU.js +35 -1
- package/lib/cjs/locale/sk-SK.js +35 -1
- package/lib/cjs/locale/vi-VN.js +35 -1
- package/lib/cjs/locale/zh-CN.js +35 -1
- package/lib/cjs/locale/zh-HK.js +35 -1
- package/lib/cjs/locale/zh-TW.js +35 -1
- package/lib/es/facade.js +25 -178
- package/lib/es/index.js +7934 -5853
- package/lib/es/locale/ar-SA.js +35 -1
- package/lib/es/locale/ca-ES.js +35 -1
- package/lib/es/locale/de-DE.js +35 -1
- package/lib/es/locale/en-US.js +35 -1
- package/lib/es/locale/es-ES.js +35 -1
- package/lib/es/locale/fa-IR.js +35 -1
- package/lib/es/locale/fr-FR.js +35 -1
- package/lib/es/locale/id-ID.js +35 -1
- package/lib/es/locale/it-IT.js +35 -1
- package/lib/es/locale/ja-JP.js +35 -1
- package/lib/es/locale/ko-KR.js +35 -1
- package/lib/es/locale/pl-PL.js +35 -1
- package/lib/es/locale/pt-BR.js +35 -1
- package/lib/es/locale/ru-RU.js +35 -1
- package/lib/es/locale/sk-SK.js +35 -1
- package/lib/es/locale/vi-VN.js +35 -1
- package/lib/es/locale/zh-CN.js +35 -1
- package/lib/es/locale/zh-HK.js +35 -1
- package/lib/es/locale/zh-TW.js +35 -1
- package/lib/facade.js +25 -178
- package/lib/index.css +25 -35
- package/lib/index.js +7934 -5853
- package/lib/locale/ar-SA.js +35 -1
- package/lib/locale/ca-ES.js +35 -1
- package/lib/locale/de-DE.js +35 -1
- package/lib/locale/en-US.js +35 -1
- package/lib/locale/es-ES.js +35 -1
- package/lib/locale/fa-IR.js +35 -1
- package/lib/locale/fr-FR.js +35 -1
- package/lib/locale/id-ID.js +35 -1
- package/lib/locale/it-IT.js +35 -1
- package/lib/locale/ja-JP.js +35 -1
- package/lib/locale/ko-KR.js +35 -1
- package/lib/locale/pl-PL.js +35 -1
- package/lib/locale/pt-BR.js +35 -1
- package/lib/locale/ru-RU.js +35 -1
- package/lib/locale/sk-SK.js +35 -1
- package/lib/locale/vi-VN.js +35 -1
- package/lib/locale/zh-CN.js +35 -1
- package/lib/locale/zh-HK.js +35 -1
- package/lib/locale/zh-TW.js +35 -1
- package/lib/types/commands/commands/doc-delete.command.d.ts +1 -1
- package/lib/types/commands/commands/inline-format.command.d.ts +3 -1
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +31 -1
- package/lib/types/commands/operations/doc-cursor.operation.d.ts +2 -0
- package/lib/types/commands/util.d.ts +1 -2
- package/lib/types/config/config.d.ts +15 -0
- package/lib/types/controllers/components.controller.d.ts +25 -0
- package/lib/types/controllers/doc-header-footer.controller.d.ts +1 -4
- package/lib/types/controllers/doc-move-cursor.controller.d.ts +9 -0
- package/lib/types/controllers/doc-paragraph-setting.controller.d.ts +2 -4
- package/lib/types/controllers/doc-table.controller.d.ts +1 -4
- package/lib/types/controllers/render-controllers/doc-paragraph-placeholder.render-controller.d.ts +51 -0
- package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +5 -2
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -1
- package/lib/types/controllers/{doc-ui.controller.d.ts → ui.controller.d.ts} +2 -4
- package/lib/types/facade/f-document.d.ts +11 -43
- package/lib/types/facade/index.d.ts +2 -3
- package/lib/types/index.d.ts +39 -26
- package/lib/types/locale/en-US.d.ts +34 -0
- package/lib/types/{views/side-menu/index.d.ts → locale/types.d.ts} +3 -1
- package/lib/types/menu/context-menu.d.ts +15 -14
- package/lib/types/menu/menu.d.ts +31 -29
- package/lib/types/menu/paragraph-menu.d.ts +68 -38
- package/lib/types/services/clipboard/html-to-udm/converter.d.ts +1 -0
- package/lib/types/services/doc-event-manager.service.d.ts +15 -0
- package/lib/types/services/doc-ime-state-change-interceptor.service.d.ts +23 -0
- package/lib/types/services/doc-page-layout.service.d.ts +3 -1
- package/lib/types/services/doc-paragraph-menu.service.d.ts +26 -2
- package/lib/types/services/doc-render-background.d.ts +29 -0
- package/lib/types/services/doc-view-scale.d.ts +54 -0
- package/lib/types/services/doc-zoom.d.ts +20 -0
- package/lib/types/services/docs-render.service.d.ts +5 -2
- package/lib/types/services/editor/editor-manager.service.d.ts +8 -1
- package/lib/types/services/index.d.ts +2 -0
- package/lib/types/services/selection/selection-utils.d.ts +0 -15
- package/lib/types/services/{doc-content-insert.service.d.ts → selection/word-boundary.d.ts} +4 -10
- package/lib/types/shortcuts/core-editing.shortcut.d.ts +1 -0
- package/lib/types/shortcuts/cursor.shortcut.d.ts +12 -0
- package/lib/types/shortcuts/heading.shortcut.d.ts +22 -0
- package/lib/types/{types/delete-direction.d.ts → views/DocSideMenu.d.ts} +1 -4
- package/lib/types/views/Icon.d.ts +49 -0
- package/lib/types/views/{page-settings/index.d.ts → PageSettings.d.ts} +1 -1
- package/lib/types/views/ParagraphMenu.d.ts +62 -0
- package/lib/types/views/{rich-text-editor/index.d.ts → RichTextEditor.d.ts} +3 -3
- package/lib/types/{components/side-menu/index.d.ts → views/SideMenu.d.ts} +4 -3
- package/lib/types/views/count-bar/CountBar.d.ts +1 -1
- package/lib/types/views/count-bar/ZoomSlider.d.ts +1 -1
- package/lib/types/views/doc-footer/DocFooter.d.ts +1 -1
- package/lib/types/views/float-toolbar/FloatToolbar.d.ts +25 -0
- package/lib/types/{components → views}/float-toolbar/FloatToolbar.stories.d.ts +1 -1
- package/lib/types/views/header-footer/panel/DocHeaderFooterOptions.d.ts +1 -1
- package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +1 -1
- package/lib/types/{components → views}/list-type-picker/Picker.d.ts +3 -3
- package/lib/types/{components/float-toolbar/FloatToolbar.d.ts → views/paragraph-menu/component-keys.d.ts} +2 -5
- package/lib/types/views/paragraph-menu/theme-color.d.ts +17 -0
- package/lib/types/views/paragraph-setting/Setting.d.ts +1 -1
- package/lib/types/views/paragraph-setting/index.d.ts +1 -1
- package/lib/types/views/paragraph-setting/line-spacing.d.ts +51 -0
- package/lib/types/views/rich-text-editor/hooks/editor-undo-redo-keyboard.d.ts +32 -0
- package/lib/types/views/rich-text-editor/hooks/index.d.ts +1 -0
- package/lib/types/views/rich-text-editor/hooks/use-editor-click-outside.d.ts +2 -1
- package/lib/types/{components → views}/side-menu/SideMenu.stories.d.ts +5 -5
- package/lib/types/views/table/create/TableCreate.d.ts +1 -1
- package/lib/umd/facade.js +1 -5
- package/lib/umd/index.js +11 -26
- 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
- package/lib/types/commands/commands/core-editing.command.d.ts +0 -58
- package/lib/types/components/paragraph-menu/index.d.ts +0 -41
- package/lib/types/facade/f-univer.d.ts +0 -52
- package/lib/types/services/doc-state-change-manager.service.d.ts +0 -50
- /package/lib/types/{components → views}/const.d.ts +0 -0
- /package/lib/types/{components → views}/editor/utils.d.ts +0 -0
- /package/lib/types/{components → views}/list-type-picker/index.d.ts +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
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 { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
17
|
+
import type { IPopup, IValueOption } from '@univerjs/ui';
|
|
18
|
+
import type { CSSProperties } from 'react';
|
|
19
|
+
import type { IMutiPageParagraphBound } from '../services/doc-event-manager.service';
|
|
20
|
+
import type { IDocBlockMenuTarget } from '../services/doc-paragraph-menu.service';
|
|
21
|
+
import { NamedStyleType } from '@univerjs/core';
|
|
22
|
+
import { ILayoutService } from '@univerjs/ui';
|
|
23
|
+
import { DocParagraphMenuService } from '../services/doc-paragraph-menu.service';
|
|
24
|
+
export { DOC_PARAGRAPH_MENU_COMPONENT_KEY, DOC_TABLE_BLOCK_MENU_COMPONENT_KEY } from './paragraph-menu/component-keys';
|
|
25
|
+
export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number): 'left' | 'right';
|
|
26
|
+
export declare const PARAGRAPH_MENU_HOVER_OPEN_DELAY = 800;
|
|
27
|
+
export declare function createParagraphMenuHoverOpenScheduler(openMenu: () => void, delay?: number): {
|
|
28
|
+
schedule(): void;
|
|
29
|
+
cancel: () => void;
|
|
30
|
+
openNow(): void;
|
|
31
|
+
};
|
|
32
|
+
export declare function setParagraphMenuInteractionActive(docParagraphMenuService: Pick<DocParagraphMenuService, 'setParagraphMenuActive'> | null | undefined, active: boolean): void;
|
|
33
|
+
export declare function isEmptyParagraphMenuTarget(dataStream: string, paragraph?: IMutiPageParagraphBound | null | void): boolean;
|
|
34
|
+
export declare function getParagraphMenuTargetRange(paragraph?: IMutiPageParagraphBound | null | void): ITextRangeWithStyle | null;
|
|
35
|
+
export declare function getParagraphMenuHoverBridgeStyle(anchorRect: {
|
|
36
|
+
left: number;
|
|
37
|
+
right: number;
|
|
38
|
+
top: number;
|
|
39
|
+
bottom: number;
|
|
40
|
+
} | null | undefined, direction: 'left' | 'right', edgeOverlap?: number, verticalPadding?: number): CSSProperties | undefined;
|
|
41
|
+
export declare function getParagraphMenuActiveHeadingCommandId(namedStyleType?: NamedStyleType): string;
|
|
42
|
+
export declare function getParagraphMenuHiddenHeadingCommandIds(namedStyleType?: NamedStyleType): string[];
|
|
43
|
+
export declare function getParagraphMenuCommand(params: IValueOption, targetRange?: ITextRangeWithStyle | null): {
|
|
44
|
+
commandId?: string;
|
|
45
|
+
params?: object;
|
|
46
|
+
};
|
|
47
|
+
export declare function getParagraphMenuResolvedCommand(option: IValueOption, targetRange?: ITextRangeWithStyle | null): {
|
|
48
|
+
commandId?: string;
|
|
49
|
+
params?: object;
|
|
50
|
+
};
|
|
51
|
+
export declare function shouldShowParagraphSettingMenu(target: IDocBlockMenuTarget | null | undefined): boolean;
|
|
52
|
+
export declare function getParagraphMenuHiddenItemIds(menuType: string, target: IDocBlockMenuTarget | null | undefined, namedStyleType?: NamedStyleType): string[];
|
|
53
|
+
export declare function getParagraphFormattingRange(target: IDocBlockMenuTarget | null | undefined, paragraph?: IMutiPageParagraphBound | null): ITextRangeWithStyle | null;
|
|
54
|
+
export declare function getParagraphMenuCommandTargetRange(commandId: string | undefined, targetRange?: ITextRangeWithStyle | null, formattingRange?: ITextRangeWithStyle | null): ITextRangeWithStyle | null | undefined;
|
|
55
|
+
export declare function finishParagraphMenuCommand(docParagraphMenuService: Pick<DocParagraphMenuService, 'hideParagraphMenu'> | null | undefined, layoutService: Pick<ILayoutService, 'focus'>, hideMenu: () => void): void;
|
|
56
|
+
export declare const ParagraphMenu: ({ popup }: {
|
|
57
|
+
popup: IPopup;
|
|
58
|
+
}) => import("react").JSX.Element;
|
|
59
|
+
export declare const TableBlockMenu: ({ popup }: {
|
|
60
|
+
popup: IPopup;
|
|
61
|
+
}) => import("react").JSX.Element;
|
|
62
|
+
export declare function shouldUseInsertBelowRange(commandId: string, params: IValueOption): boolean;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IDocumentData } from '@univerjs/core';
|
|
17
17
|
import type { CSSProperties, ReactNode, RefObject } from 'react';
|
|
18
|
-
import type { Editor } from '
|
|
19
|
-
import type { IKeyboardEventConfig } from './hooks';
|
|
18
|
+
import type { Editor } from '../services/editor/editor';
|
|
19
|
+
import type { IKeyboardEventConfig } from './rich-text-editor/hooks';
|
|
20
20
|
export interface IRichTextEditorProps {
|
|
21
21
|
className?: string;
|
|
22
22
|
autoFocus?: boolean;
|
|
@@ -37,4 +37,4 @@ export interface IRichTextEditorProps {
|
|
|
37
37
|
editorRef?: RefObject<Editor | null> | ((editor: Editor | null) => void);
|
|
38
38
|
noStyle?: boolean;
|
|
39
39
|
}
|
|
40
|
-
export declare const RichTextEditor: (props: IRichTextEditorProps) => import("react
|
|
40
|
+
export declare const RichTextEditor: (props: IRichTextEditorProps) => 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 { CSSProperties } from 'react';
|
|
16
17
|
export interface ISideMenuItem {
|
|
17
18
|
text: string;
|
|
18
19
|
level: number;
|
|
@@ -23,7 +24,7 @@ export interface ISideMenuProps {
|
|
|
23
24
|
menus?: ISideMenuItem[];
|
|
24
25
|
onClick?: (menu: ISideMenuItem) => void;
|
|
25
26
|
className?: string;
|
|
26
|
-
style?:
|
|
27
|
+
style?: CSSProperties;
|
|
27
28
|
mode?: 'float' | 'side-bar';
|
|
28
29
|
maxHeight: number;
|
|
29
30
|
activeId?: string;
|
|
@@ -31,9 +32,9 @@ export interface ISideMenuProps {
|
|
|
31
32
|
onOpenChange?: (open: boolean) => void;
|
|
32
33
|
maxWidth?: number;
|
|
33
34
|
wrapperClass?: string;
|
|
34
|
-
wrapperStyle?:
|
|
35
|
+
wrapperStyle?: CSSProperties;
|
|
35
36
|
iconClass?: string;
|
|
36
|
-
iconStyle?:
|
|
37
|
+
iconStyle?: CSSProperties;
|
|
37
38
|
}
|
|
38
39
|
export interface ISideMenuInstance {
|
|
39
40
|
scrollTo: (id: string) => void;
|
|
@@ -17,5 +17,5 @@ interface ICountBarProps {
|
|
|
17
17
|
changeRatio?: (ratio: string) => void;
|
|
18
18
|
onChange?: (value: string) => void;
|
|
19
19
|
}
|
|
20
|
-
export declare function CountBar(_props: ICountBarProps): import("react
|
|
20
|
+
export declare function CountBar(_props: ICountBarProps): import("react").JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function DocFooter(): import("react
|
|
16
|
+
export declare function DocFooter(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { IMenuManagerService as IMenuManagerServiceType, IMenuSchema } from '@univerjs/ui';
|
|
17
|
+
interface IFloatToolbarProps {
|
|
18
|
+
avaliableMenus?: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare function resolveFloatToolbarMenus(menuManagerService: IMenuManagerServiceType, avaliableMenus: string[]): {
|
|
21
|
+
menus: IMenuSchema[];
|
|
22
|
+
extraMenus: IMenuSchema[];
|
|
23
|
+
};
|
|
24
|
+
export declare function FloatToolbar(props: IFloatToolbarProps): import("react").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
export interface IDocHeaderFooterOptionsProps {
|
|
17
17
|
unitId: string;
|
|
18
18
|
}
|
|
19
|
-
export declare const DocHeaderFooterOptions: (props: IDocHeaderFooterOptionsProps) => import("react
|
|
19
|
+
export declare const DocHeaderFooterOptions: (props: IDocHeaderFooterOptionsProps) => import("react").JSX.Element;
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare const DocHeaderFooterPanel: () => import("react
|
|
16
|
+
export declare const DocHeaderFooterPanel: () => import("react").JSX.Element;
|
|
@@ -24,7 +24,7 @@ interface IListTypePickerProps extends IListTypePickerBaseProps {
|
|
|
24
24
|
img: string;
|
|
25
25
|
}[];
|
|
26
26
|
}
|
|
27
|
-
export declare const ListTypePicker: (props: IListTypePickerProps) => import("react
|
|
28
|
-
export declare const OrderListTypePicker: (props: IListTypePickerBaseProps) => import("react
|
|
29
|
-
export declare const BulletListTypePicker: (props: IListTypePickerBaseProps) => import("react
|
|
27
|
+
export declare const ListTypePicker: (props: IListTypePickerProps) => import("react").JSX.Element;
|
|
28
|
+
export declare const OrderListTypePicker: (props: IListTypePickerBaseProps) => import("react").JSX.Element;
|
|
29
|
+
export declare const BulletListTypePicker: (props: IListTypePickerBaseProps) => import("react").JSX.Element;
|
|
30
30
|
export {};
|
|
@@ -13,8 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export declare function FloatToolbar(props: IFloatToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
16
|
+
export declare const DOC_PARAGRAPH_MENU_COMPONENT_KEY = "doc.paragraph.menu";
|
|
17
|
+
export declare const DOC_TABLE_BLOCK_MENU_COMPONENT_KEY = "doc.table-block.menu";
|
|
@@ -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 { ThemeService } from '@univerjs/core';
|
|
17
|
+
export declare function getHighlightBackgroundColor(themeService: ThemeService, index: number): string;
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function ParagraphSetting(): import("react
|
|
16
|
+
export declare function ParagraphSetting(): import("react").JSX.Element;
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function ParagraphSettingIndex(): import("react
|
|
16
|
+
export declare function ParagraphSettingIndex(): import("react").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { LocaleService } from '@univerjs/core';
|
|
17
|
+
import { SpacingRule } from '@univerjs/core';
|
|
18
|
+
interface ILineSpacingMetrics {
|
|
19
|
+
glyphLineHeight: number;
|
|
20
|
+
renderedLineHeight: number;
|
|
21
|
+
}
|
|
22
|
+
interface ILineSpacingLike {
|
|
23
|
+
contentHeight?: number;
|
|
24
|
+
paddingTop?: number;
|
|
25
|
+
paddingBottom?: number;
|
|
26
|
+
divides?: Array<{
|
|
27
|
+
glyphGroup?: Array<{
|
|
28
|
+
bBox?: {
|
|
29
|
+
ba?: number;
|
|
30
|
+
bd?: number;
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export declare function getLineSpacingRuleOptions(localeService: LocaleService): {
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}[];
|
|
39
|
+
export declare function getLineSpacingInputConfig(spacingRule: SpacingRule): {
|
|
40
|
+
readonly min: 1;
|
|
41
|
+
readonly max: 5;
|
|
42
|
+
readonly step: 0.1;
|
|
43
|
+
} | {
|
|
44
|
+
readonly min: 1;
|
|
45
|
+
readonly max: 100;
|
|
46
|
+
};
|
|
47
|
+
export declare function convertStoredLineSpacingToDisplayValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
48
|
+
export declare function convertDisplayLineSpacingToStoredValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
49
|
+
export declare function getLineSpacingMetrics(lineNode?: ILineSpacingLike | null): ILineSpacingMetrics | null;
|
|
50
|
+
export declare function convertLineSpacingForRuleChange(currentStoredValue: number, currentRule: SpacingRule, nextRule: SpacingRule, metrics?: ILineSpacingMetrics | null): number;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
17
|
+
import type { IKeyboardEventConfig } from './use-keyboard-event';
|
|
18
|
+
export interface IExecuteEditorUndoRedoCommandOptions {
|
|
19
|
+
commandId: string;
|
|
20
|
+
commandService: ICommandService;
|
|
21
|
+
editorUnitId: string;
|
|
22
|
+
univerInstanceService: IUniverInstanceService;
|
|
23
|
+
}
|
|
24
|
+
export interface ICreateEditorUndoRedoKeyboardConfigOptions {
|
|
25
|
+
commandService: ICommandService;
|
|
26
|
+
univerInstanceService: IUniverInstanceService;
|
|
27
|
+
editorUnitId: string;
|
|
28
|
+
keyCodes?: IKeyboardEventConfig['keyCodes'];
|
|
29
|
+
handler?: IKeyboardEventConfig['handler'];
|
|
30
|
+
}
|
|
31
|
+
export declare function executeEditorUndoRedoCommand(options: IExecuteEditorUndoRedoCommandOptions): void;
|
|
32
|
+
export declare function createEditorUndoRedoKeyboardConfig(options: ICreateEditorUndoRedoKeyboardConfigOptions): IKeyboardEventConfig;
|
|
@@ -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
|
+
export { createEditorUndoRedoKeyboardConfig, executeEditorUndoRedoCommand, type ICreateEditorUndoRedoKeyboardConfigOptions, type IExecuteEditorUndoRedoCommandOptions } from './editor-undo-redo-keyboard';
|
|
16
17
|
export { useEditor } from './use-editor';
|
|
17
18
|
export { useEditorClickOutside } from './use-editor-click-outside';
|
|
18
19
|
export { useIsFocusing } from './use-is-focusing';
|
|
@@ -13,4 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
import type { RefObject } from 'react';
|
|
17
|
+
export declare const useEditorClickOutside: (editorId: string, containerRef: RefObject<HTMLElement | null>, onClickOutside?: () => void) => void;
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Meta } from '@storybook/react';
|
|
17
|
-
import { SideMenu } from '
|
|
17
|
+
import { SideMenu } from '../SideMenu';
|
|
18
18
|
declare const meta: Meta<typeof SideMenu>;
|
|
19
19
|
export default meta;
|
|
20
20
|
export declare const SideMenuBasic: {
|
|
21
|
-
render(): import("react
|
|
21
|
+
render(): import("react").JSX.Element;
|
|
22
22
|
};
|
|
23
23
|
export declare const EmptySideMenu: {
|
|
24
|
-
render(): import("react
|
|
24
|
+
render(): import("react").JSX.Element;
|
|
25
25
|
};
|
|
26
26
|
export declare const CustomStyledSideMenu: {
|
|
27
|
-
render(): import("react
|
|
27
|
+
render(): import("react").JSX.Element;
|
|
28
28
|
};
|
|
29
29
|
export declare const MultiLevelSideMenu: {
|
|
30
|
-
render(): import("react
|
|
30
|
+
render(): import("react").JSX.Element;
|
|
31
31
|
};
|
|
@@ -20,5 +20,5 @@ interface IDocCreateTableConfirmProps {
|
|
|
20
20
|
colCount: number;
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
export declare const DocCreateTableConfirm: ({ handleRowColChange, tableCreateParams, }: IDocCreateTableConfirmProps) => import("react
|
|
23
|
+
export declare const DocCreateTableConfirm: ({ handleRowColChange, tableCreateParams, }: IDocCreateTableConfirmProps) => import("react").JSX.Element;
|
|
24
24
|
export {};
|
package/lib/umd/facade.js
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(
|
|
2
|
-
`).replace(/\r/g,`
|
|
3
|
-
`).split(`
|
|
4
|
-
`).join(`\r
|
|
5
|
-
`)}\r\n`;return this.insertText(r,{...t,cursorOffset:(n=t.cursorOffset)==null?r.length:n})}setSelection(e,n){var i;let a=(i=this._renderManagerService.getRenderById(this.getId()))==null?void 0:i.with(r.DocSelectionRenderService);a==null||a.removeAllRanges(),a==null||a.addDocRanges([{startOffset:e,endOffset:n,rangeType:t.DOC_RANGE_TYPE.TEXT}],!0)}};d=u([l(1,(0,t.Inject)(t.Injector)),l(2,t.IUniverInstanceService),l(3,t.ICommandService),l(4,t.IResourceManagerService),l(5,i.IRenderManagerService)],d);var f=class extends n.FUniver{createUniverDoc(e){let n=this._univerInstanceService.createUnit(t.UniverInstanceType.UNIVER_DOC,e);return this._injector.createInstance(d,n)}getActiveDocument(){let e=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC);return e?this._injector.createInstance(d,e):null}getUniverDoc(e){let t=this._univerInstanceService.getUniverDocInstance(e);return t?this._injector.createInstance(d,t):null}};n.FUniver.extend(f),Object.defineProperty(e,"FDocument",{enumerable:!0,get:function(){return d}})});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core"),require("@univerjs/docs-ui"),require("@univerjs/docs/facade"),require("@univerjs/engine-render")):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/docs-ui`,`@univerjs/docs/facade`,`@univerjs/engine-render`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverDocsUi,e.UniverDocsFacade,e.UniverEngineRender))})(this,function(e,t,n,r){var i=class extends n.FDocument{setSelection(n,i){var a;let o=(a=this._injector.get(r.IRenderManagerService).getRenderUnitById(this.getId()))==null?void 0:a.with(t.DocSelectionRenderService);o==null||o.removeAllRanges(),o==null||o.addDocRanges([{startOffset:n,endOffset:i,rangeType:e.DOC_RANGE_TYPE.TEXT}],!0)}};n.FDocument.extend(i)});
|