/** * Copyright 2023-present DreamNum Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { IDocumentBlockRange, IDocumentBody, JSONXActions } from '@univerjs/core'; import type { IDocBlockMoveValidationContext } from '@univerjs/docs'; import type { ITextRangeWithStyle } from '@univerjs/engine-render'; import type { IPopup, IValueOption } from '@univerjs/ui'; import type { CSSProperties } from 'react'; import type { IMutiPageParagraphBound } from '../services/doc-event-manager.service'; import type { IDocBlockMenuTarget } from '../services/doc-paragraph-menu.service'; import { NamedStyleType } from '@univerjs/core'; import { DocBlockMoveValidatorService } from '@univerjs/docs'; import { DocParagraphMenuService } from '../services/doc-paragraph-menu.service'; export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number, options?: { anchorRight?: number; direction?: 'ltr' | 'rtl'; viewportWidth?: number; }): 'left' | 'right'; export declare const PARAGRAPH_MENU_HOVER_OPEN_DELAY = 800; export declare function shouldExecuteParagraphMenuMove(validatorService: Pick, context: IDocBlockMoveValidationContext): boolean; export declare function createParagraphMenuHoverOpenScheduler(openMenu: () => void, delay?: number): { schedule(): void; cancel: () => void; openNow(): void; }; export declare function setParagraphMenuInteractionActive(docParagraphMenuService: Pick | null | undefined, active: boolean): void; export declare function isEmptyParagraphMenuTarget(dataStream: string, paragraph?: IMutiPageParagraphBound | null | void): boolean; export declare function getParagraphMenuTargetRange(paragraph?: IMutiPageParagraphBound | null | void): ITextRangeWithStyle | null; export declare function getParagraphMenuHoverBridgeStyle(anchorRect: { left: number; right: number; top: number; bottom: number; } | null | undefined, direction: 'left' | 'right', edgeOverlap?: number, verticalPadding?: number): CSSProperties | undefined; export declare function getParagraphMenuActiveHeadingCommandId(namedStyleType?: NamedStyleType): string; export declare function getParagraphMenuHiddenHeadingCommandIds(namedStyleType?: NamedStyleType): string[]; export declare function getParagraphMenuCommand(params: IValueOption, targetRange?: ITextRangeWithStyle | null): { commandId?: string; params?: object; }; export declare function getParagraphMenuResolvedCommand(option: IValueOption, targetRange?: ITextRangeWithStyle | null): { commandId?: string; params?: object; }; export declare function getParagraphMenuCommandParams(commandId: string | undefined, commandParams: Record | undefined, target: IDocBlockMenuTarget | null | undefined, unitId: string): Record | undefined; export declare function shouldShowParagraphSettingMenu(target: IDocBlockMenuTarget | null | undefined): boolean; export declare function getParagraphMenuHiddenItemIds(menuType: string, target: IDocBlockMenuTarget | null | undefined, namedStyleType?: NamedStyleType): string[]; export declare function unwrapBlockRangeBody(documentBody: IDocumentBody, blockRange: IDocumentBlockRange): { body: IDocumentBody; range: { startOffset: number; endOffset: number; collapsed: boolean; }; }; export declare function buildUnwrapBlockRangeActions(previousBody: IDocumentBody, nextBody: IDocumentBody, blockRange: IDocumentBlockRange): JSONXActions | null; export declare function getParagraphFormattingRange(target: IDocBlockMenuTarget | null | undefined, paragraph?: IMutiPageParagraphBound | null): ITextRangeWithStyle | null; export declare function getParagraphMenuCommandTargetRange(commandId: string | undefined, targetRange?: ITextRangeWithStyle | null, formattingRange?: ITextRangeWithStyle | null): ITextRangeWithStyle | null | undefined; export declare function finishParagraphMenuCommand(docParagraphMenuService: Pick | null | undefined, hideMenu: () => void): void; export declare function getBlockRangeClipboardTargetRange(commandId: string, target: IDocBlockMenuTarget | null | undefined, paragraph?: IMutiPageParagraphBound | null | void): ITextRangeWithStyle | null; export declare const ParagraphMenu: ({ popup }: { popup: IPopup; }) => import("react").JSX.Element; export declare const TableBlockMenu: ({ popup }: { popup: IPopup; }) => import("react").JSX.Element; export declare function shouldUseInsertBelowRange(commandId: string, params: IValueOption): boolean;