@univerjs/docs-ui 1.0.0-alpha.0 → 1.0.0-alpha.2
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/index.js +1553 -1129
- package/lib/es/index.js +1554 -1133
- package/lib/index.js +1554 -1133
- package/lib/types/commands/commands/doc-delete.command.d.ts +6 -2
- package/lib/types/commands/commands/doc-header-footer.command.d.ts +3 -9
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +2 -1
- package/lib/types/commands/operations/doc-cursor.operation.d.ts +1 -1
- package/lib/types/controllers/doc-header-footer.controller.d.ts +0 -8
- package/lib/types/controllers/doc-move-cursor.controller.d.ts +27 -1
- package/lib/types/index.d.ts +5 -3
- package/lib/types/menu/menu.d.ts +1 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +3 -2
- package/lib/types/services/clipboard/udm-to-html/convertor.d.ts +3 -0
- package/lib/types/services/clipboard/udm-to-html/doc-html-export.service.d.ts +23 -0
- package/lib/types/services/doc-paragraph-menu.service.d.ts +3 -4
- package/lib/types/services/index.d.ts +1 -0
- package/lib/types/shortcuts/core-editing.shortcut.d.ts +1 -0
- package/lib/types/shortcuts/cursor.shortcut.d.ts +4 -0
- package/lib/types/views/ParagraphMenu.d.ts +13 -0
- package/lib/types/views/paragraph-setting/line-spacing.d.ts +2 -14
- package/lib/umd/index.js +8 -9
- package/package.json +11 -11
|
@@ -13,7 +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 { ICommand, IDocumentBody, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { ICommand, IDocumentBlockRange, IDocumentBody, IMultiCommand, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
18
18
|
import { DeleteDirection } from '@univerjs/core';
|
|
19
19
|
export interface IDeleteCustomBlockParams {
|
|
@@ -33,5 +33,9 @@ export declare function getCursorWhenDelete(textRanges: Readonly<Nullable<ITextR
|
|
|
33
33
|
export declare function isDeleteOffsetInsideBlockRange(body: IDocumentBody, offset: number): boolean;
|
|
34
34
|
export declare const DeleteLeftCommand: ICommand;
|
|
35
35
|
export declare const DeleteRightCommand: ICommand;
|
|
36
|
-
export
|
|
36
|
+
export interface IDeleteCurrentParagraphCommandParams {
|
|
37
|
+
unitId?: string;
|
|
38
|
+
blockRange?: IDocumentBlockRange;
|
|
39
|
+
}
|
|
40
|
+
export declare const DeleteCurrentParagraphCommand: IMultiCommand<IDeleteCurrentParagraphCommandParams>;
|
|
37
41
|
export {};
|
|
@@ -14,14 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand } from '@univerjs/core';
|
|
17
|
-
import {
|
|
18
|
-
import { HeaderFooterType } from '
|
|
19
|
-
export interface IHeaderFooterProps {
|
|
20
|
-
marginHeader?: number;
|
|
21
|
-
marginFooter?: number;
|
|
22
|
-
useFirstPageHeaderFooter?: BooleanNumber;
|
|
23
|
-
evenAndOddHeaders?: BooleanNumber;
|
|
24
|
-
}
|
|
17
|
+
import type { IHeaderFooterProps } from '@univerjs/docs';
|
|
18
|
+
import { HeaderFooterType } from '@univerjs/docs';
|
|
25
19
|
export interface ICoreHeaderFooterParams {
|
|
26
20
|
unitId: string;
|
|
27
21
|
createType?: HeaderFooterType;
|
|
@@ -37,7 +31,7 @@ interface IOpenHeaderFooterPanelParams {
|
|
|
37
31
|
}
|
|
38
32
|
export declare const OpenHeaderFooterPanelCommand: ICommand<IOpenHeaderFooterPanelParams>;
|
|
39
33
|
interface ICloseHeaderFooterParams {
|
|
40
|
-
unitId
|
|
34
|
+
unitId?: string;
|
|
41
35
|
}
|
|
42
36
|
export declare const CloseHeaderFooterCommand: ICommand<ICloseHeaderFooterParams>;
|
|
43
37
|
export {};
|
|
@@ -13,7 +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 { ICommand, IParagraph, ISectionBreak, ITextRun } from '@univerjs/core';
|
|
16
|
+
import type { ICommand, IDocumentBody, IParagraph, ISectionBreak, ITextRun } from '@univerjs/core';
|
|
17
17
|
export declare const CreateDocTableCommandId = "doc.command.create-table";
|
|
18
18
|
export interface ICreateDocTableCommandParams {
|
|
19
19
|
rowCount: number;
|
|
@@ -49,6 +49,7 @@ export declare function shouldCreateParagraphBeforeTable(body: {
|
|
|
49
49
|
export declare function normalizeTableInsertOffset(body: {
|
|
50
50
|
dataStream: string;
|
|
51
51
|
}, startOffset: number): number;
|
|
52
|
+
export declare function canInsertTableAtOffset(body: Pick<IDocumentBody, 'tables' | 'blockRanges' | 'customBlocks'>, offset: number): boolean;
|
|
52
53
|
/**
|
|
53
54
|
* The command to create a table at cursor point.
|
|
54
55
|
*/
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Direction, IOperation } from '@univerjs/core';
|
|
17
|
-
export type DocCursorMoveGranularity = 'character' | 'word' | 'line' | 'document';
|
|
17
|
+
export type DocCursorMoveGranularity = 'character' | 'word' | 'line' | 'paragraph' | 'document';
|
|
18
18
|
export interface IMoveCursorOperationParams {
|
|
19
19
|
direction: Direction;
|
|
20
20
|
granularity?: DocCursorMoveGranularity;
|
|
@@ -20,14 +20,6 @@ import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
|
20
20
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
21
21
|
import { IEditorService } from '../services/editor/editor-manager.service';
|
|
22
22
|
import { DocSelectionRenderService } from '../services/selection/doc-selection-render.service';
|
|
23
|
-
export declare enum HeaderFooterType {
|
|
24
|
-
FIRST_PAGE_HEADER = 0,
|
|
25
|
-
FIRST_PAGE_FOOTER = 1,
|
|
26
|
-
DEFAULT_HEADER = 2,
|
|
27
|
-
DEFAULT_FOOTER = 3,
|
|
28
|
-
EVEN_PAGE_HEADER = 4,
|
|
29
|
-
EVEN_PAGE_FOOTER = 5
|
|
30
|
-
}
|
|
31
23
|
export declare class DocHeaderFooterController extends Disposable implements IRenderModule {
|
|
32
24
|
private readonly _context;
|
|
33
25
|
private readonly _commandService;
|
|
@@ -28,18 +28,44 @@ export declare class DocMoveCursorController extends Disposable {
|
|
|
28
28
|
private _handleShiftMoveSelection;
|
|
29
29
|
private _handleMoveCursor;
|
|
30
30
|
private _getCursorOffsetByGranularity;
|
|
31
|
+
private _getParagraphBoundaryOffset;
|
|
32
|
+
private _getCurrentParagraphStartOffset;
|
|
31
33
|
private _getWordBoundaryOffset;
|
|
32
34
|
private _getLineBoundaryOffset;
|
|
33
35
|
private _getFirstCursorGlyphInLine;
|
|
34
36
|
private _getLastCursorGlyphInLine;
|
|
35
37
|
private _isCursorAddressableGlyph;
|
|
36
38
|
private _normalizeCursorOffset;
|
|
39
|
+
private _normalizeRenderableCursorOffset;
|
|
40
|
+
private _findNearestRenderableCursorOffset;
|
|
41
|
+
private _isRenderableCursorOffset;
|
|
37
42
|
private _normalizeWholeEntityRanges;
|
|
38
43
|
private _getCursorSkipTokens;
|
|
44
|
+
private _getNonRenderableCursorTokens;
|
|
39
45
|
private _getTopOrBottomPosition;
|
|
40
46
|
private _getGlyphLeftOffsetInLine;
|
|
41
47
|
private _matchPositionByLeftOffset;
|
|
42
|
-
private
|
|
48
|
+
private _getNextOrPrevLineTarget;
|
|
49
|
+
private _getTableLineTargetFromPageLine;
|
|
50
|
+
private _getTableBoundaryLineTarget;
|
|
51
|
+
private _getAdjacentTableCellLineTarget;
|
|
52
|
+
private _findAdjacentTableRow;
|
|
53
|
+
private _findAdjacentTableSliceRow;
|
|
54
|
+
private _getNearestTableCellLineTarget;
|
|
55
|
+
private _findLineAroundTable;
|
|
56
|
+
private _getDistanceToTableCell;
|
|
57
|
+
private _getTableCellHostOffsetLeft;
|
|
58
|
+
private _getTableCellContentWidth;
|
|
59
|
+
private _isTableCellContentPage;
|
|
60
|
+
private _getColumnGroupLineTargetFromBlockLine;
|
|
61
|
+
private _getColumnGroupContentLineTarget;
|
|
62
|
+
private _getColumnGroupExitLineTarget;
|
|
63
|
+
private _findColumnGroupByBlockLine;
|
|
64
|
+
private _findColumnGroupBlockLine;
|
|
65
|
+
private _getAdjacentLineAroundBlockLine;
|
|
66
|
+
private _getColumnGroupColumnBoundaryLine;
|
|
67
|
+
private _getDistanceToColumnGroupColumn;
|
|
68
|
+
private _isColumnGroupContentPage;
|
|
43
69
|
private _scrollToFocusNodePosition;
|
|
44
70
|
private _getDocObject;
|
|
45
71
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export type { IInnerCutCommandParams } from './commands/commands/clipboard.inner
|
|
|
31
31
|
export { getCustomBlockIdsInSelections, getCutActionsFromDocRanges } from './commands/commands/clipboard.inner.command';
|
|
32
32
|
export { buildMoveDocBlockActions, MoveDocBlockCommand } from './commands/commands/doc-block-move.command';
|
|
33
33
|
export type { IMoveDocBlockCommandParams } from './commands/commands/doc-block-move.command';
|
|
34
|
-
export { DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
|
|
35
|
-
export type { IDeleteCustomBlockParams } from './commands/commands/doc-delete.command';
|
|
34
|
+
export { DeleteCurrentParagraphCommand, DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
|
|
35
|
+
export type { IDeleteCurrentParagraphCommandParams, IDeleteCustomBlockParams } from './commands/commands/doc-delete.command';
|
|
36
36
|
export { getCursorWhenDelete } from './commands/commands/doc-delete.command';
|
|
37
37
|
export { HorizontalLineCommand } from './commands/commands/doc-horizontal-line.command';
|
|
38
38
|
export { DocSelectAllCommand } from './commands/commands/doc-select-all.command';
|
|
@@ -72,13 +72,15 @@ export { DocBackScrollRenderController } from './controllers/render-controllers/
|
|
|
72
72
|
export { DocParagraphPlaceholderRenderController, } from './controllers/render-controllers/doc-paragraph-placeholder.render-controller';
|
|
73
73
|
export { DocRenderController } from './controllers/render-controllers/doc.render-controller';
|
|
74
74
|
export { DocUIController } from './controllers/ui.controller';
|
|
75
|
-
export { AlignMenuItemFactory, BackgroundColorSelectorMenuItemFactory, BoldMenuItemFactory, FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, FloatTextStyleMenuItemFactory, FontFamilySelectorMenuItemFactory, FontSizeSelectorMenuItemFactory, hideMenuWhenSelectionInBlockRange, isTextRangeInAnyBlockRange, ItalicMenuItemFactory, StrikeThroughMenuItemFactory, TextColorSelectorMenuItemFactory, UnderlineMenuItemFactory, } from './menu/menu';
|
|
75
|
+
export { AlignMenuItemFactory, BackgroundColorSelectorMenuItemFactory, BoldMenuItemFactory, disableMenuWhenHeaderFooterEditing, FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, FloatTextStyleMenuItemFactory, FontFamilySelectorMenuItemFactory, FontSizeSelectorMenuItemFactory, hideMenuWhenSelectionInBlockRange, isTextRangeInAnyBlockRange, ItalicMenuItemFactory, StrikeThroughMenuItemFactory, TextColorSelectorMenuItemFactory, UnderlineMenuItemFactory, } from './menu/menu';
|
|
76
76
|
export { DOC_CONTENT_INSERT_MENU_ID, DOC_PARAGRAPH_T_ALIGN_MENU_ID, DOC_PARAGRAPH_T_COLORS_MENU_ID, DOC_PARAGRAPH_T_DIVIDER_MENU_ID, DOC_PARAGRAPH_T_EDIT_MENU_ID, DOC_PARAGRAPH_T_INSERT_BELOW_MENU_ID, DOC_PARAGRAPH_T_INSERT_MENU_ID, DOC_TABLE_BLOCK_MENU_ID, EMPTY_PARAGRAPH_MENU_ID, getDocBlockRangeMenuId, INSERT_BELLOW_MENU_ID, ParagraphMenuInsertBelowSubmenuItemFactory, } from './menu/paragraph-menu';
|
|
77
77
|
export { menuSchema as DocsUIMenuSchema } from './menu/schema';
|
|
78
78
|
export { UniverDocsUIPlugin } from './plugin';
|
|
79
79
|
export * from './services';
|
|
80
80
|
export { IDocClipboardService } from './services/clipboard/clipboard.service';
|
|
81
81
|
export { convertBodyToHtml } from './services/clipboard/udm-to-html/convertor';
|
|
82
|
+
export { DocHtmlExportService } from './services/clipboard/udm-to-html/doc-html-export.service';
|
|
83
|
+
export type { DocHtmlExportTransformer } from './services/clipboard/udm-to-html/doc-html-export.service';
|
|
82
84
|
export { DocAutoFormatService } from './services/doc-auto-format.service';
|
|
83
85
|
export { DocEventManagerService, getListMarkerFallbackBound, getListParagraphContextMenuHit, } from './services/doc-event-manager.service';
|
|
84
86
|
export type { IBulletBound, IMutiPageParagraphBound } from './services/doc-event-manager.service';
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui
|
|
|
18
18
|
import type { LocaleKey } from '../locale/types';
|
|
19
19
|
import { HorizontalAlign, NamedStyleType, PresetListType } from '@univerjs/core';
|
|
20
20
|
import { Observable } from 'rxjs';
|
|
21
|
+
export declare function disableMenuWhenHeaderFooterEditing(accessor: IAccessor): Observable<boolean>;
|
|
21
22
|
export declare function disableMenuWhenNoDocRange(accessor: IAccessor): Observable<boolean>;
|
|
22
23
|
export declare function isTextRangeInAnyBlockRange(document: Nullable<DocumentDataModel>, range: ITextRangeParam): boolean;
|
|
23
24
|
export declare function hideMenuWhenSelectionInBlockRange(accessor: IAccessor): Observable<boolean>;
|
|
@@ -19,6 +19,7 @@ import { Disposable, ICommandService, ILogService, IUniverInstanceService, Slice
|
|
|
19
19
|
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
20
20
|
import { ImageSourceType } from '@univerjs/drawing';
|
|
21
21
|
import { IClipboardInterfaceService } from '@univerjs/ui';
|
|
22
|
+
import { DocHtmlExportService } from './udm-to-html/doc-html-export.service';
|
|
22
23
|
export interface IClipboardPropertyItem {
|
|
23
24
|
}
|
|
24
25
|
export interface IDocClipboardHook {
|
|
@@ -52,8 +53,8 @@ export declare class DocClipboardService extends Disposable implements IDocClipb
|
|
|
52
53
|
private readonly _docSelectionManagerService;
|
|
53
54
|
private _clipboardHooks;
|
|
54
55
|
private _htmlToUDM;
|
|
55
|
-
private _umdToHtml;
|
|
56
|
-
constructor(_univerInstanceService: IUniverInstanceService, _logService: ILogService, _commandService: ICommandService, _clipboardInterfaceService: IClipboardInterfaceService, _docSelectionManagerService: DocSelectionManagerService);
|
|
56
|
+
private readonly _umdToHtml;
|
|
57
|
+
constructor(_univerInstanceService: IUniverInstanceService, _logService: ILogService, _commandService: ICommandService, _clipboardInterfaceService: IClipboardInterfaceService, docHtmlExportService: DocHtmlExportService, _docSelectionManagerService: DocSelectionManagerService);
|
|
57
58
|
copy(sliceType?: SliceBodyType, ranges?: ITextRangeWithStyle[]): Promise<boolean>;
|
|
58
59
|
cut(ranges?: ITextRangeWithStyle[]): Promise<boolean>;
|
|
59
60
|
paste(items: ClipboardItem[]): Promise<boolean>;
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IDocumentData, ITextRun } from '@univerjs/core';
|
|
17
|
+
import type { DocHtmlExportService } from './doc-html-export.service';
|
|
17
18
|
export declare function covertTextRunToHtml(dataStream: string, textRun: ITextRun): string;
|
|
18
19
|
export declare function getBodySliceHtml(doc: IDocumentData, startIndex: number, endIndex: number): string;
|
|
19
20
|
export declare function convertBodyToHtml(doc: IDocumentData): string;
|
|
20
21
|
export declare class UDMToHtmlService {
|
|
22
|
+
private readonly _docHtmlExportService?;
|
|
23
|
+
constructor(_docHtmlExportService?: Pick<DocHtmlExportService, "transformDocumentForHtmlExport"> | undefined);
|
|
21
24
|
convert(docList: IDocumentData[]): string;
|
|
22
25
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { IDisposable, IDocumentData } from '@univerjs/core';
|
|
17
|
+
import { Disposable } from '@univerjs/core';
|
|
18
|
+
export type DocHtmlExportTransformer = (documentData: IDocumentData) => IDocumentData;
|
|
19
|
+
export declare class DocHtmlExportService extends Disposable {
|
|
20
|
+
private readonly _transformers;
|
|
21
|
+
registerTransformer(transformer: DocHtmlExportTransformer): IDisposable;
|
|
22
|
+
transformDocumentForHtmlExport(documentData: IDocumentData): IDocumentData;
|
|
23
|
+
}
|
|
@@ -16,15 +16,14 @@
|
|
|
16
16
|
import type { DocumentDataModel, ICustomBlock, ICustomTable, IDocumentBlockRange } from '@univerjs/core';
|
|
17
17
|
import type { IBoundRectNoAngle, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
18
|
import type { IMutiPageParagraphBound, ITableBound } from './doc-event-manager.service';
|
|
19
|
-
import { Disposable } from '@univerjs/core';
|
|
19
|
+
import { Disposable, DocumentBlockType } from '@univerjs/core';
|
|
20
20
|
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
21
21
|
import { DocEventManagerService } from './doc-event-manager.service';
|
|
22
22
|
import { DocCanvasPopManagerService } from './doc-popup-manager.service';
|
|
23
23
|
import { DocFloatMenuService } from './float-menu.service';
|
|
24
24
|
import { DocSelectionRenderService } from './selection/doc-selection-render.service';
|
|
25
|
-
export type DocBlockMenuTargetKind = 'paragraph' | 'blockRange' | 'table' | 'customBlock';
|
|
26
25
|
export interface IDocBlockMenuTarget {
|
|
27
|
-
kind:
|
|
26
|
+
kind: Exclude<DocumentBlockType, DocumentBlockType.COLUMN_GROUP>;
|
|
28
27
|
key: string;
|
|
29
28
|
paragraph?: IMutiPageParagraphBound;
|
|
30
29
|
blockRange?: IDocumentBlockRange;
|
|
@@ -69,7 +68,7 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
|
|
|
69
68
|
private _docSkeletonManagerService;
|
|
70
69
|
private _floatMenuService;
|
|
71
70
|
private _docSelectionRenderService;
|
|
72
|
-
private
|
|
71
|
+
private _paragraphMenu;
|
|
73
72
|
private readonly _activeTarget$;
|
|
74
73
|
readonly activeTarget$: import("rxjs").Observable<IDocBlockMenuTarget | null>;
|
|
75
74
|
private readonly _slashMenuRequest$;
|
|
@@ -17,5 +17,6 @@ export { default as PastePluginLark } from './clipboard/html-to-udm/paste-plugin
|
|
|
17
17
|
export { default as PastePluginUniver } from './clipboard/html-to-udm/paste-plugins/plugin-univer';
|
|
18
18
|
export { default as PastePluginWord } from './clipboard/html-to-udm/paste-plugins/plugin-word';
|
|
19
19
|
export { type IPastePlugin } from './clipboard/html-to-udm/paste-plugins/type';
|
|
20
|
+
export type { IDocBlockMenuTarget } from './doc-paragraph-menu.service';
|
|
20
21
|
export { calcDocFitToWidthScale, DocViewScaleService, normalizeDocFitToWidthOptions, resolveDocFitBaseWidth, resolveDocViewScale } from './doc-view-scale';
|
|
21
22
|
export type { ICalcDocFitToWidthScaleParams, IResolveDocFitBaseWidthParams } from './doc-view-scale';
|
|
@@ -18,3 +18,4 @@ export declare const BreakLineShortcut: IShortcutItem;
|
|
|
18
18
|
export declare const SoftBreakLineShortcut: IShortcutItem;
|
|
19
19
|
export declare const DeleteLeftShortcut: IShortcutItem;
|
|
20
20
|
export declare const DeleteRightShortcut: IShortcutItem;
|
|
21
|
+
export declare const CloseHeaderFooterShortcut: IShortcutItem;
|
|
@@ -34,4 +34,8 @@ export declare const MoveCursorWordLeftShortcut: IShortcutItem<object>;
|
|
|
34
34
|
export declare const MoveCursorWordRightShortcut: IShortcutItem<object>;
|
|
35
35
|
export declare const MoveSelectionWordLeftShortcut: IShortcutItem<object>;
|
|
36
36
|
export declare const MoveSelectionWordRightShortcut: IShortcutItem<object>;
|
|
37
|
+
export declare const MoveCursorParagraphUpShortcut: IShortcutItem<object>;
|
|
38
|
+
export declare const MoveCursorParagraphDownShortcut: IShortcutItem<object>;
|
|
39
|
+
export declare const MoveSelectionParagraphUpShortcut: IShortcutItem<object>;
|
|
40
|
+
export declare const MoveSelectionParagraphDownShortcut: IShortcutItem<object>;
|
|
37
41
|
export declare const SelectAllShortcut: IShortcutItem;
|
|
@@ -13,17 +13,21 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { IDocumentBlockRange, IDocumentBody } from '@univerjs/core';
|
|
17
|
+
import type { IDocBlockMoveValidationContext } from '@univerjs/docs';
|
|
16
18
|
import type { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
17
19
|
import type { IPopup, IValueOption } from '@univerjs/ui';
|
|
18
20
|
import type { CSSProperties } from 'react';
|
|
19
21
|
import type { IMutiPageParagraphBound } from '../services/doc-event-manager.service';
|
|
20
22
|
import type { IDocBlockMenuTarget } from '../services/doc-paragraph-menu.service';
|
|
21
23
|
import { NamedStyleType } from '@univerjs/core';
|
|
24
|
+
import { DocBlockMoveValidatorService } from '@univerjs/docs';
|
|
22
25
|
import { ILayoutService } from '@univerjs/ui';
|
|
23
26
|
import { DocParagraphMenuService } from '../services/doc-paragraph-menu.service';
|
|
24
27
|
export { DOC_PARAGRAPH_MENU_COMPONENT_KEY, DOC_TABLE_BLOCK_MENU_COMPONENT_KEY } from './paragraph-menu/component-keys';
|
|
25
28
|
export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number): 'left' | 'right';
|
|
26
29
|
export declare const PARAGRAPH_MENU_HOVER_OPEN_DELAY = 800;
|
|
30
|
+
export declare function shouldExecuteParagraphMenuMove(validatorService: Pick<DocBlockMoveValidatorService, 'canMoveBlock'>, context: IDocBlockMoveValidationContext): boolean;
|
|
27
31
|
export declare function createParagraphMenuHoverOpenScheduler(openMenu: () => void, delay?: number): {
|
|
28
32
|
schedule(): void;
|
|
29
33
|
cancel: () => void;
|
|
@@ -48,8 +52,17 @@ export declare function getParagraphMenuResolvedCommand(option: IValueOption, ta
|
|
|
48
52
|
commandId?: string;
|
|
49
53
|
params?: object;
|
|
50
54
|
};
|
|
55
|
+
export declare function getParagraphMenuCommandParams(commandId: string | undefined, commandParams: Record<string, unknown> | undefined, target: IDocBlockMenuTarget | null | undefined, unitId: string): Record<string, unknown> | undefined;
|
|
51
56
|
export declare function shouldShowParagraphSettingMenu(target: IDocBlockMenuTarget | null | undefined): boolean;
|
|
52
57
|
export declare function getParagraphMenuHiddenItemIds(menuType: string, target: IDocBlockMenuTarget | null | undefined, namedStyleType?: NamedStyleType): string[];
|
|
58
|
+
export declare function unwrapBlockRangeBody(documentBody: IDocumentBody, blockRange: IDocumentBlockRange): {
|
|
59
|
+
body: IDocumentBody;
|
|
60
|
+
range: {
|
|
61
|
+
startOffset: number;
|
|
62
|
+
endOffset: number;
|
|
63
|
+
collapsed: boolean;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
53
66
|
export declare function getParagraphFormattingRange(target: IDocBlockMenuTarget | null | undefined, paragraph?: IMutiPageParagraphBound | null): ITextRangeWithStyle | null;
|
|
54
67
|
export declare function getParagraphMenuCommandTargetRange(commandId: string | undefined, targetRange?: ITextRangeWithStyle | null, formattingRange?: ITextRangeWithStyle | null): ITextRangeWithStyle | null | undefined;
|
|
55
68
|
export declare function finishParagraphMenuCommand(docParagraphMenuService: Pick<DocParagraphMenuService, 'hideParagraphMenu'> | null | undefined, layoutService: Pick<ILayoutService, 'focus'>, hideMenu: () => void): void;
|
|
@@ -14,24 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { LocaleService } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonLine } from '@univerjs/engine-render';
|
|
17
18
|
import { SpacingRule } from '@univerjs/core';
|
|
18
19
|
interface ILineSpacingMetrics {
|
|
19
20
|
glyphLineHeight: number;
|
|
20
21
|
renderedLineHeight: number;
|
|
21
22
|
}
|
|
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
23
|
export declare function getLineSpacingRuleOptions(localeService: LocaleService): {
|
|
36
24
|
label: string;
|
|
37
25
|
value: string;
|
|
@@ -46,6 +34,6 @@ export declare function getLineSpacingInputConfig(spacingRule: SpacingRule): {
|
|
|
46
34
|
};
|
|
47
35
|
export declare function convertStoredLineSpacingToDisplayValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
48
36
|
export declare function convertDisplayLineSpacingToStoredValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
49
|
-
export declare function getLineSpacingMetrics(lineNode?:
|
|
37
|
+
export declare function getLineSpacingMetrics(lineNode?: IDocumentSkeletonLine): ILineSpacingMetrics | null;
|
|
50
38
|
export declare function convertLineSpacingForRuleChange(currentStoredValue: number, currentRule: SpacingRule, nextRule: SpacingRule, metrics?: ILineSpacingMetrics | null): number;
|
|
51
39
|
export {};
|