@univerjs/docs-ui 0.2.12 → 0.2.14
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 +28 -6
- package/lib/es/index.js +8694 -3109
- package/lib/index.css +1 -1
- package/lib/types/basics/__tests__/plain-text.spec.d.ts +16 -0
- package/lib/types/basics/component-tools.d.ts +17 -0
- package/lib/types/basics/const/plugin-name.d.ts +1 -1
- package/lib/types/basics/custom-decoration-factory.d.ts +24 -0
- package/lib/types/basics/custom-range-factory.d.ts +25 -0
- package/lib/types/basics/docs-view-key.d.ts +30 -0
- package/lib/types/basics/paragraph.d.ts +2 -0
- package/lib/types/basics/plain-text.d.ts +11 -0
- package/lib/types/basics/replace.d.ts +20 -0
- package/lib/types/basics/table.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/clipboard.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/core-editing.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +34 -0
- package/lib/types/commands/commands/__tests__/inline-format.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/replace-content.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/auto-format.command.d.ts +7 -0
- package/lib/types/commands/commands/break-line.command.d.ts +3 -0
- package/lib/types/commands/commands/clipboard.inner.command.d.ts +16 -0
- package/lib/types/commands/commands/core-editing.command.d.ts +44 -0
- package/lib/types/commands/commands/delete.command.d.ts +19 -0
- package/lib/types/commands/commands/ime-input.command.d.ts +9 -0
- package/lib/types/commands/commands/inline-format.command.d.ts +17 -0
- package/lib/types/commands/commands/list.command.d.ts +42 -0
- package/lib/types/commands/commands/paragraph-align.command.d.ts +18 -0
- package/lib/types/commands/commands/replace-content.command.d.ts +26 -0
- package/lib/types/commands/commands/set-doc-zoom-ratio.command.d.ts +6 -0
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +10 -0
- package/lib/types/commands/commands/table/doc-table-delete.command.d.ts +10 -0
- package/lib/types/commands/commands/table/doc-table-insert.command.d.ts +34 -0
- package/lib/types/commands/commands/table/doc-table-tab.command.d.ts +5 -0
- package/lib/types/commands/commands/table/table.d.ts +93 -0
- package/lib/types/commands/operations/doc-cursor.operation.d.ts +12 -0
- package/lib/types/commands/operations/select-all.operation.d.ts +5 -0
- package/lib/types/commands/operations/set-doc-zoom-ratio.operation.d.ts +7 -0
- package/lib/types/commands/util.d.ts +9 -0
- package/lib/types/controllers/app-ui-controller.d.ts +1 -6
- package/lib/types/controllers/doc-auto-format.controller.d.ts +1 -1
- package/lib/types/controllers/doc-header-footer.controller.d.ts +6 -5
- package/lib/types/controllers/doc-move-cursor.controller.d.ts +20 -0
- package/lib/types/controllers/menu/menu.d.ts +1 -1
- package/lib/types/controllers/render-controllers/back-scroll.render-controller.d.ts +4 -4
- package/lib/types/controllers/render-controllers/doc-checklist.render-controller.d.ts +3 -3
- package/lib/types/controllers/render-controllers/doc-clipboard.controller.d.ts +14 -0
- package/lib/types/controllers/render-controllers/{contextmenu.render-controller.d.ts → doc-contextmenu.render-controller.d.ts} +3 -5
- package/lib/types/controllers/render-controllers/doc-editor-bridge.controller.d.ts +27 -0
- package/lib/types/controllers/render-controllers/doc-ime-input.controller.d.ts +25 -0
- package/lib/types/controllers/render-controllers/doc-input.controller.d.ts +15 -0
- package/lib/types/controllers/render-controllers/doc-resize.render-controller.d.ts +2 -2
- package/lib/types/controllers/render-controllers/{text-selection.render-controller.d.ts → doc-selection-render.controller.d.ts} +9 -6
- package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +2 -2
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +4 -4
- package/lib/types/docs-ui-plugin.d.ts +1 -1
- package/lib/types/index.d.ts +62 -11
- package/lib/types/services/clipboard/clipboard.service.d.ts +5 -5
- package/lib/types/services/doc-auto-format.service.d.ts +38 -0
- package/lib/types/services/doc-event-manager.service.d.ts +3 -1
- package/lib/types/services/doc-ime-input-manager.service.d.ts +30 -0
- package/lib/types/services/doc-page-layout.service.d.ts +1 -1
- package/lib/types/services/doc-popup-manager.service.d.ts +4 -4
- package/lib/types/services/doc-state-change-manager.service.d.ts +23 -0
- package/lib/types/services/selection/convert-rect-range.d.ts +27 -0
- package/lib/types/services/selection/convert-text-range.d.ts +60 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +121 -0
- package/lib/types/services/selection/range-interface.d.ts +19 -0
- package/lib/types/services/selection/rect-range.d.ts +47 -0
- package/lib/types/services/selection/selection-utils.d.ts +26 -0
- package/lib/types/services/selection/text-range.d.ts +63 -0
- package/lib/types/types/const/padding.d.ts +16 -0
- package/lib/types/types/delete-direction.d.ts +19 -0
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +1 -1
- package/lib/umd/index.js +28 -6
- package/package.json +16 -16
- package/lib/types/controllers/clipboard.controller.d.ts +0 -14
- package/lib/types/controllers/doc-editor-bridge.controller.d.ts +0 -23
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { IParagraph, ISectionBreak, ITable, ITableCell, ITableColumn, ITableRow, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DocumentViewModel, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
export declare enum INSERT_ROW_POSITION {
|
|
4
|
+
ABOVE = 0,
|
|
5
|
+
BELLOW = 1
|
|
6
|
+
}
|
|
7
|
+
export declare enum INSERT_COLUMN_POSITION {
|
|
8
|
+
LEFT = 0,
|
|
9
|
+
RIGHT = 1
|
|
10
|
+
}
|
|
11
|
+
export declare function genEmptyTable(rowCount: number, colCount: number): {
|
|
12
|
+
dataStream: string;
|
|
13
|
+
paragraphs: IParagraph[];
|
|
14
|
+
sectionBreaks: ISectionBreak[];
|
|
15
|
+
};
|
|
16
|
+
export declare function getEmptyTableCell(): ITableCell;
|
|
17
|
+
export declare function getEmptyTableRow(col: number): ITableRow;
|
|
18
|
+
export declare function getTableColumn(width: number): ITableColumn;
|
|
19
|
+
export declare function genTableSource(rowCount: number, colCount: number, pageContentWidth: number): ITable;
|
|
20
|
+
interface IRangeInfo {
|
|
21
|
+
startOffset: number;
|
|
22
|
+
endOffset: number;
|
|
23
|
+
segmentId: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function getRangeInfoFromRanges(textRange: Nullable<ITextRangeWithStyle>, rectRanges: Readonly<Nullable<ITextRangeWithStyle[]>>): Nullable<IRangeInfo>;
|
|
26
|
+
export declare function getInsertRowBody(col: number): {
|
|
27
|
+
dataStream: string;
|
|
28
|
+
paragraphs: IParagraph[];
|
|
29
|
+
sectionBreaks: ISectionBreak[];
|
|
30
|
+
};
|
|
31
|
+
export declare function getInsertColumnBody(): {
|
|
32
|
+
dataStream: string;
|
|
33
|
+
paragraphs: IParagraph[];
|
|
34
|
+
sectionBreaks: ISectionBreak[];
|
|
35
|
+
};
|
|
36
|
+
export declare function getInsertRowActionsParams(rangeInfo: IRangeInfo, position: INSERT_ROW_POSITION, viewModel: DocumentViewModel): {
|
|
37
|
+
offset: number;
|
|
38
|
+
colCount: number;
|
|
39
|
+
tableId: string;
|
|
40
|
+
insertRowIndex: number;
|
|
41
|
+
} | null;
|
|
42
|
+
export declare function getInsertColumnActionsParams(rangeInfo: IRangeInfo, position: INSERT_COLUMN_POSITION, viewModel: DocumentViewModel): {
|
|
43
|
+
offsets: number[];
|
|
44
|
+
tableId: string;
|
|
45
|
+
columnIndex: number;
|
|
46
|
+
rowCount: number;
|
|
47
|
+
} | null;
|
|
48
|
+
export declare function getColumnWidths(pageWidth: number, tableColumns: ITableColumn[], insertColumnIndex: number): {
|
|
49
|
+
widths: number[];
|
|
50
|
+
newColWidth: number;
|
|
51
|
+
};
|
|
52
|
+
export declare function getDeleteRowsActionsParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
53
|
+
tableId: string;
|
|
54
|
+
rowIndexes: number[];
|
|
55
|
+
offset: number;
|
|
56
|
+
len: number;
|
|
57
|
+
cursor: number;
|
|
58
|
+
selectWholeTable: boolean;
|
|
59
|
+
} | null;
|
|
60
|
+
interface IRetainDeleteOffset {
|
|
61
|
+
retain: number;
|
|
62
|
+
delete: number;
|
|
63
|
+
}
|
|
64
|
+
export declare function getDeleteColumnsActionParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
65
|
+
offsets: IRetainDeleteOffset[];
|
|
66
|
+
tableId: string;
|
|
67
|
+
columnIndexes: number[];
|
|
68
|
+
cursor: number;
|
|
69
|
+
selectWholeTable: boolean;
|
|
70
|
+
rowCount: number;
|
|
71
|
+
} | null;
|
|
72
|
+
export declare function getDeleteTableActionParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
73
|
+
tableId: string;
|
|
74
|
+
offset: number;
|
|
75
|
+
len: number;
|
|
76
|
+
cursor: number;
|
|
77
|
+
} | null;
|
|
78
|
+
export declare function getDeleteRowContentActionParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
79
|
+
offsets: IRetainDeleteOffset[];
|
|
80
|
+
tableId: string;
|
|
81
|
+
cursor: number;
|
|
82
|
+
rowCount: number;
|
|
83
|
+
} | null;
|
|
84
|
+
export interface IOffsets {
|
|
85
|
+
startOffset: number;
|
|
86
|
+
endOffset: number;
|
|
87
|
+
}
|
|
88
|
+
export declare enum CellPosition {
|
|
89
|
+
NEXT = 0,
|
|
90
|
+
PREV = 1
|
|
91
|
+
}
|
|
92
|
+
export declare function getCellOffsets(viewModel: DocumentViewModel, range: ITextRangeWithStyle, position: CellPosition): Nullable<IOffsets>;
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Direction, IOperation } from '@univerjs/core';
|
|
2
|
+
export interface IMoveCursorOperationParams {
|
|
3
|
+
direction: Direction;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The operation to move cursor in the current document.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MoveCursorOperation: IOperation<IMoveCursorOperationParams>;
|
|
9
|
+
/**
|
|
10
|
+
* The operation to move selection in the current document.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MoveSelectionOperation: IOperation<IMoveCursorOperationParams>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IAccessor, IOperation } from '@univerjs/core';
|
|
2
|
+
export interface ISetDocZoomRatioOperationParams {
|
|
3
|
+
zoomRatio: number;
|
|
4
|
+
unitId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const SetDocZoomRatioUndoMutationFactory: (accessor: IAccessor, params: ISetDocZoomRatioOperationParams) => ISetDocZoomRatioOperationParams;
|
|
7
|
+
export declare const SetDocZoomRatioOperation: IOperation<ISetDocZoomRatioOperationParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
2
|
+
import { DocumentDataModel, IAccessor } from '@univerjs/core';
|
|
3
|
+
/**
|
|
4
|
+
* Get the skeleton of the command's target.
|
|
5
|
+
* @param accessor The injection accessor.
|
|
6
|
+
* @param unitId Unit ID.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCommandSkeleton(accessor: IAccessor, unitId: string): DocSkeletonManagerService | undefined;
|
|
9
|
+
export declare function getRichTextEditPath(docDataModel: DocumentDataModel, segmentId?: string): string[];
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { Injector, RxDisposable } from '@univerjs/core';
|
|
2
|
-
import { ILayoutService } from '@univerjs/ui';
|
|
3
|
-
import { ITextSelectionRenderManager } from '@univerjs/engine-render';
|
|
4
2
|
export declare class AppUIController extends RxDisposable {
|
|
5
3
|
private readonly _injector;
|
|
6
|
-
private readonly _textSelectionRenderManager;
|
|
7
|
-
private readonly _layoutService?;
|
|
8
4
|
private _docContainerController;
|
|
9
|
-
constructor(_injector: Injector
|
|
10
|
-
private _registerContainer;
|
|
5
|
+
constructor(_injector: Injector);
|
|
11
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Disposable } from '@univerjs/core';
|
|
2
|
-
import { DocAutoFormatService } from '
|
|
2
|
+
import { DocAutoFormatService } from '../services/doc-auto-format.service';
|
|
3
3
|
export declare class DocAutoFormatController extends Disposable {
|
|
4
4
|
private readonly _docAutoFormatService;
|
|
5
5
|
constructor(_docAutoFormatService: DocAutoFormatService);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IRenderContext, IRenderModule, IRenderManagerService, ITextSelectionRenderManager } from '@univerjs/engine-render';
|
|
3
|
-
import { ComponentManager, IEditorService } from '@univerjs/ui';
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService, LocaleService, DocumentDataModel } from '@univerjs/core';
|
|
4
2
|
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
|
+
import { IRenderManagerService, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
|
+
import { ComponentManager, IEditorService } from '@univerjs/ui';
|
|
5
|
+
import { DocSelectionRenderService } from '../services/selection/doc-selection-render.service';
|
|
5
6
|
export declare enum HeaderFooterType {
|
|
6
7
|
FIRST_PAGE_HEADER = 0,
|
|
7
8
|
FIRST_PAGE_FOOTER = 1,
|
|
@@ -17,11 +18,11 @@ export declare class DocHeaderFooterController extends Disposable implements IRe
|
|
|
17
18
|
private readonly _instanceSrv;
|
|
18
19
|
private readonly _renderManagerService;
|
|
19
20
|
private readonly _docSkeletonManagerService;
|
|
20
|
-
private readonly
|
|
21
|
+
private readonly _docSelectionRenderService;
|
|
21
22
|
private readonly _localeService;
|
|
22
23
|
private readonly _componentManager;
|
|
23
24
|
private _loadedMap;
|
|
24
|
-
constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _docSkeletonManagerService: DocSkeletonManagerService,
|
|
25
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _docSkeletonManagerService: DocSkeletonManagerService, _docSelectionRenderService: DocSelectionRenderService, _localeService: LocaleService, _componentManager: ComponentManager);
|
|
25
26
|
private _initialize;
|
|
26
27
|
private _initCustomComponents;
|
|
27
28
|
private _init;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
3
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
|
+
export declare class DocMoveCursorController extends Disposable {
|
|
5
|
+
private readonly _univerInstanceService;
|
|
6
|
+
private readonly _renderManagerService;
|
|
7
|
+
private readonly _textSelectionManagerService;
|
|
8
|
+
private readonly _commandService;
|
|
9
|
+
private _onInputSubscription;
|
|
10
|
+
constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _textSelectionManagerService: DocSelectionManagerService, _commandService: ICommandService);
|
|
11
|
+
dispose(): void;
|
|
12
|
+
private _commandExecutedListener;
|
|
13
|
+
private _handleShiftMoveSelection;
|
|
14
|
+
private _handleMoveCursor;
|
|
15
|
+
private _getTopOrBottomPosition;
|
|
16
|
+
private _getGlyphLeftOffsetInLine;
|
|
17
|
+
private _matchPositionByLeftOffset;
|
|
18
|
+
private _getNextOrPrevLine;
|
|
19
|
+
private _getDocObject;
|
|
20
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
1
|
import { IAccessor, PresetListType } from '@univerjs/core';
|
|
2
|
+
import { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
3
3
|
export declare function BoldMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
4
4
|
export declare function ItalicMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
5
5
|
export declare function UnderlineMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { INodePosition, IRenderContext, IRenderModule
|
|
1
|
+
import { IUniverInstanceService, RxDisposable, DocumentDataModel, ITextRange, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
3
|
+
import { IRenderManagerService, INodePosition, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
4
|
import { IEditorService } from '@univerjs/ui';
|
|
5
5
|
export declare class DocBackScrollRenderController extends RxDisposable implements IRenderModule {
|
|
6
6
|
private readonly _context;
|
|
@@ -8,7 +8,7 @@ export declare class DocBackScrollRenderController extends RxDisposable implemen
|
|
|
8
8
|
private readonly _editorService;
|
|
9
9
|
private readonly _univerInstanceService;
|
|
10
10
|
private readonly _renderManagerService;
|
|
11
|
-
constructor(_context: IRenderContext<DocumentDataModel>, _textSelectionManagerService:
|
|
11
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _textSelectionManagerService: DocSelectionManagerService, _editorService: IEditorService, _univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
|
|
12
12
|
private _init;
|
|
13
13
|
scrollToRange(unitId: string, range: ITextRange): void;
|
|
14
14
|
scrollToNode(unitId: string, startNodePosition: Nullable<INodePosition>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Disposable, ICommandService, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
1
3
|
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
2
|
-
import { DocumentDataModel, Disposable, ICommandService } from '@univerjs/core';
|
|
3
|
-
import { DocSkeletonManagerService, TextSelectionManagerService } from '@univerjs/docs';
|
|
4
4
|
import { DocEventManagerService } from '../../services/doc-event-manager.service';
|
|
5
5
|
export declare class DocChecklistRenderController extends Disposable implements IRenderModule {
|
|
6
6
|
private _context;
|
|
@@ -8,7 +8,7 @@ export declare class DocChecklistRenderController extends Disposable implements
|
|
|
8
8
|
private readonly _commandService;
|
|
9
9
|
private readonly _docEventManagerService;
|
|
10
10
|
private readonly _textSelectionManagerService;
|
|
11
|
-
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService, _docEventManagerService: DocEventManagerService, _textSelectionManagerService:
|
|
11
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService, _docEventManagerService: DocEventManagerService, _textSelectionManagerService: DocSelectionManagerService);
|
|
12
12
|
private _initPointerDownObserver;
|
|
13
13
|
private _initHoverCursor;
|
|
14
14
|
private _getTransformCoordForDocumentOffset;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICommandService, IContextService, RxDisposable, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { IDocClipboardService } from '../../services/clipboard/clipboard.service';
|
|
4
|
+
import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
|
|
5
|
+
export declare class DocClipboardController extends RxDisposable implements IRenderModule {
|
|
6
|
+
private readonly _context;
|
|
7
|
+
private readonly _commandService;
|
|
8
|
+
private readonly _docClipboardService;
|
|
9
|
+
private readonly _docSelectionRenderService;
|
|
10
|
+
private readonly _contextService;
|
|
11
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _docClipboardService: IDocClipboardService, _docSelectionRenderService: DocSelectionRenderService, _contextService: IContextService);
|
|
12
|
+
private _init;
|
|
13
|
+
private _initLegacyPasteCommand;
|
|
14
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TextSelectionManagerService } from '@univerjs/docs';
|
|
3
|
-
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
1
|
+
import { Disposable, ICommandService, Workbook } from '@univerjs/core';
|
|
4
2
|
import { IContextMenuService } from '@univerjs/ui';
|
|
3
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
5
4
|
/**
|
|
6
5
|
* This controller subscribe to context menu events in sheet rendering views and invoke context menu at a correct
|
|
7
6
|
* position and with correct menu type.
|
|
@@ -9,9 +8,8 @@ import { IContextMenuService } from '@univerjs/ui';
|
|
|
9
8
|
export declare class DocContextMenuRenderController extends Disposable implements IRenderModule {
|
|
10
9
|
private readonly _context;
|
|
11
10
|
private readonly _contextMenuService;
|
|
12
|
-
private readonly _textSelectionManagerService;
|
|
13
11
|
private readonly _commandService;
|
|
14
|
-
constructor(_context: IRenderContext<Workbook>, _contextMenuService: IContextMenuService,
|
|
12
|
+
constructor(_context: IRenderContext<Workbook>, _contextMenuService: IContextMenuService, _commandService: ICommandService);
|
|
15
13
|
private _initPointerDown;
|
|
16
14
|
private _initEditChange;
|
|
17
15
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
|
+
import { IRenderManagerService, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
|
+
import { IEditorService } from '@univerjs/ui';
|
|
5
|
+
import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
|
|
6
|
+
export declare class DocEditorBridgeController extends Disposable implements IRenderModule {
|
|
7
|
+
private readonly _context;
|
|
8
|
+
private readonly _univerInstanceService;
|
|
9
|
+
private readonly _editorService;
|
|
10
|
+
private readonly _commandService;
|
|
11
|
+
private readonly _docSelectionRenderService;
|
|
12
|
+
private readonly _docSkeletonManagerService;
|
|
13
|
+
private readonly _renderManagerService;
|
|
14
|
+
private _initialEditors;
|
|
15
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _univerInstanceService: IUniverInstanceService, _editorService: IEditorService, _commandService: ICommandService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _renderManagerService: IRenderManagerService);
|
|
16
|
+
private _initialize;
|
|
17
|
+
private _resize;
|
|
18
|
+
private _initialSetValue;
|
|
19
|
+
private _initialBlur;
|
|
20
|
+
private _initialFocus;
|
|
21
|
+
private _initialValueChange;
|
|
22
|
+
private _valueChange;
|
|
23
|
+
/**
|
|
24
|
+
* Listen to document edits to refresh the size of the formula editor.
|
|
25
|
+
*/
|
|
26
|
+
private _commandExecutedListener;
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { IRenderManagerService, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { DocIMEInputManagerService } from '../../services/doc-ime-input-manager.service';
|
|
4
|
+
import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
|
|
5
|
+
export declare class DocIMEInputController extends Disposable implements IRenderModule {
|
|
6
|
+
private readonly _context;
|
|
7
|
+
private readonly _univerInstanceService;
|
|
8
|
+
private readonly _renderManagerSrv;
|
|
9
|
+
private readonly _docSelectionRenderService;
|
|
10
|
+
private readonly _docImeInputManagerService;
|
|
11
|
+
private readonly _commandService;
|
|
12
|
+
private _previousIMEContent;
|
|
13
|
+
private _isCompositionStart;
|
|
14
|
+
private _onStartSubscription;
|
|
15
|
+
private _onUpdateSubscription;
|
|
16
|
+
private _onEndSubscription;
|
|
17
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _univerInstanceService: IUniverInstanceService, _renderManagerSrv: IRenderManagerService, _docSelectionRenderService: DocSelectionRenderService, _docImeInputManagerService: DocIMEInputManagerService, _commandService: ICommandService);
|
|
18
|
+
dispose(): void;
|
|
19
|
+
private _initialize;
|
|
20
|
+
private _initialOnCompositionstart;
|
|
21
|
+
private _initialOnCompositionUpdate;
|
|
22
|
+
private _initialOnCompositionend;
|
|
23
|
+
private _updateContent;
|
|
24
|
+
private _resetIME;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Disposable, ICommandService, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
|
+
import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
|
|
5
|
+
export declare class DocInputController extends Disposable implements IRenderModule {
|
|
6
|
+
private readonly _context;
|
|
7
|
+
private readonly _docSelectionRenderService;
|
|
8
|
+
private readonly _docSkeletonManagerService;
|
|
9
|
+
private readonly _commandService;
|
|
10
|
+
private _onInputSubscription;
|
|
11
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService);
|
|
12
|
+
dispose(): void;
|
|
13
|
+
private _init;
|
|
14
|
+
private _initialNormalInput;
|
|
15
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
2
3
|
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
-
import { TextSelectionManagerService } from '@univerjs/docs';
|
|
4
4
|
import { DocPageLayoutService } from '../../services/doc-page-layout.service';
|
|
5
5
|
export declare class DocResizeRenderController extends Disposable implements IRenderModule {
|
|
6
6
|
private _context;
|
|
7
7
|
private readonly _docPageLayoutService;
|
|
8
8
|
private readonly _textSelectionManagerService;
|
|
9
|
-
constructor(_context: IRenderContext, _docPageLayoutService: DocPageLayoutService, _textSelectionManagerService:
|
|
9
|
+
constructor(_context: IRenderContext, _docPageLayoutService: DocPageLayoutService, _textSelectionManagerService: DocSelectionManagerService);
|
|
10
10
|
private _initResize;
|
|
11
11
|
}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
3
|
import { IEditorService } from '@univerjs/ui';
|
|
4
|
-
import {
|
|
4
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
5
|
+
import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
|
|
5
6
|
export declare class DocTextSelectionRenderController extends Disposable implements IRenderModule {
|
|
6
7
|
private readonly _context;
|
|
7
8
|
private readonly _commandService;
|
|
8
9
|
private readonly _editorService;
|
|
9
10
|
private readonly _instanceSrv;
|
|
10
|
-
private readonly
|
|
11
|
+
private readonly _docSelectionRenderService;
|
|
11
12
|
private readonly _docSkeletonManagerService;
|
|
12
|
-
private readonly
|
|
13
|
+
private readonly _docSelectionManagerService;
|
|
13
14
|
private _loadedMap;
|
|
14
|
-
constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService,
|
|
15
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _docSelectionManagerService: DocSelectionManagerService);
|
|
15
16
|
private _initialize;
|
|
16
17
|
private _init;
|
|
18
|
+
private _refreshListener;
|
|
19
|
+
private _syncSelection;
|
|
17
20
|
private _initialMain;
|
|
18
21
|
private _getTransformCoordForDocumentOffset;
|
|
19
22
|
private _isEditorReadOnly;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICommandService, IConfigService, IContextService, RxDisposable, DocumentDataModel } from '@univerjs/core';
|
|
2
2
|
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
|
-
import { IRenderContext, IRenderModule
|
|
3
|
+
import { IRenderManagerService, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
4
|
import { IEditorService } from '@univerjs/ui';
|
|
5
5
|
export declare class DocRenderController extends RxDisposable implements IRenderModule {
|
|
6
6
|
private readonly _context;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
1
|
+
import { Disposable, ICommandService, IContextService, IUniverInstanceService, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
4
3
|
import { IEditorService } from '@univerjs/ui';
|
|
4
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
5
5
|
import { DocPageLayoutService } from '../../services/doc-page-layout.service';
|
|
6
6
|
export declare class DocZoomRenderController extends Disposable implements IRenderModule {
|
|
7
7
|
private readonly _context;
|
|
@@ -12,7 +12,7 @@ export declare class DocZoomRenderController extends Disposable implements IRend
|
|
|
12
12
|
private readonly _textSelectionManagerService;
|
|
13
13
|
private readonly _editorService;
|
|
14
14
|
private readonly _docPageLayoutService;
|
|
15
|
-
constructor(_context: IRenderContext<DocumentDataModel>, _contextService: IContextService, _docSkeletonManagerService: DocSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _textSelectionManagerService:
|
|
15
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _contextService: IContextService, _docSkeletonManagerService: DocSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _textSelectionManagerService: DocSelectionManagerService, _editorService: IEditorService, _docPageLayoutService: DocPageLayoutService);
|
|
16
16
|
private _initRenderRefresher;
|
|
17
17
|
private _initSkeletonListener;
|
|
18
18
|
private _initCommandExecutedListener;
|
|
@@ -10,7 +10,7 @@ export declare class UniverDocsUIPlugin extends Plugin {
|
|
|
10
10
|
private readonly _configService;
|
|
11
11
|
static pluginName: string;
|
|
12
12
|
static type: UniverInstanceType;
|
|
13
|
-
constructor(_config: Partial<IUniverDocsUIConfig
|
|
13
|
+
constructor(_config: Partial<IUniverDocsUIConfig> | undefined, _injector: Injector, _renderManagerSrv: IRenderManagerService, _commandService: ICommandService, _logService: ILogService, _configService: IConfigService);
|
|
14
14
|
onReady(): void;
|
|
15
15
|
onRendered(): void;
|
|
16
16
|
private _initCommand;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,18 +13,69 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
export { IDocClipboardService } from './services/clipboard/clipboard.service';
|
|
18
|
-
export { DocBackScrollRenderController } from './controllers/render-controllers/back-scroll.render-controller';
|
|
16
|
+
export { DocAutoFormatService } from '../../docs-ui/src/services/doc-auto-format.service';
|
|
19
17
|
export * from './basics';
|
|
20
|
-
export
|
|
21
|
-
export {
|
|
22
|
-
export
|
|
23
|
-
export {
|
|
24
|
-
export
|
|
18
|
+
export type { IDocObjectParam } from './basics/component-tools';
|
|
19
|
+
export { getDocObject, getDocObjectById, neoGetDocObject } from './basics/component-tools';
|
|
20
|
+
export { addCustomDecorationBySelectionFactory, addCustomDecorationFactory, deleteCustomDecorationFactory } from './basics/custom-decoration-factory';
|
|
21
|
+
export { addCustomRangeBySelectionFactory, addCustomRangeFactory, deleteCustomRangeFactory } from './basics/custom-range-factory';
|
|
22
|
+
export * from './basics/docs-view-key';
|
|
23
|
+
export { hasParagraphInTable } from './basics/paragraph';
|
|
24
|
+
export { getPlainText, getPlainTextFormBody, getPlainTextFormDocument, getSelectionText } from './basics/plain-text';
|
|
25
|
+
export { replaceSelectionFactory } from './basics/replace';
|
|
25
26
|
export { docDrawingPositionToTransform, transformToDocDrawingPosition } from './basics/transform-position';
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
27
|
+
export { AfterSpaceCommand, EnterCommand, type ITabCommandParams, TabCommand } from './commands/commands/auto-format.command';
|
|
28
|
+
export { BreakLineCommand } from './commands/commands/break-line.command';
|
|
29
|
+
export { generateParagraphs } from './commands/commands/break-line.command';
|
|
29
30
|
export { DocCopyCommand, DocCutCommand, DocPasteCommand } from './commands/commands/clipboard.command';
|
|
31
|
+
export { CutContentCommand, InnerPasteCommand } from './commands/commands/clipboard.inner.command';
|
|
32
|
+
export type { IInnerCutCommandParams } from './commands/commands/clipboard.inner.command';
|
|
33
|
+
export { getCustomBlockIdsInSelections, getCutActionsFromDocRanges } from './commands/commands/clipboard.inner.command';
|
|
34
|
+
export { DeleteCommand, EditorInsertTextCommandId, type ICoverCommandParams, type IDeleteCommandParams, type IInsertCommandParams, InsertCommand, type IUpdateCommandParams, UpdateCommand, } from './commands/commands/core-editing.command';
|
|
35
|
+
export { DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, type IDeleteCustomBlockParams, MergeTwoParagraphCommand } from './commands/commands/delete.command';
|
|
36
|
+
export { getCursorWhenDelete } from './commands/commands/delete.command';
|
|
37
|
+
export { IMEInputCommand } from './commands/commands/ime-input.command';
|
|
38
|
+
export { ResetInlineFormatTextBackgroundColorCommand, SetInlineFormatBoldCommand, SetInlineFormatCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatFontSizeCommand, SetInlineFormatItalicCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatTextBackgroundColorCommand, SetInlineFormatTextColorCommand, SetInlineFormatUnderlineCommand, } from './commands/commands/inline-format.command';
|
|
39
|
+
export { getParagraphsInRange, getParagraphsInRanges } from './commands/commands/list.command';
|
|
40
|
+
export { BulletListCommand, ChangeListNestingLevelCommand, ChangeListTypeCommand, CheckListCommand, ListOperationCommand, OrderListCommand, QuickListCommand, ToggleCheckListCommand, } from './commands/commands/list.command';
|
|
41
|
+
export { ChangeListNestingLevelType } from './commands/commands/list.command';
|
|
42
|
+
export { AlignCenterCommand, AlignJustifyCommand, AlignLeftCommand, AlignOperationCommand, AlignRightCommand, } from './commands/commands/paragraph-align.command';
|
|
43
|
+
export { CoverContentCommand, ReplaceContentCommand } from './commands/commands/replace-content.command';
|
|
44
|
+
export { SetDocZoomRatioCommand } from './commands/commands/set-doc-zoom-ratio.command';
|
|
45
|
+
export { CreateDocTableCommand, type ICreateDocTableCommandParams } from './commands/commands/table/doc-table-create.command';
|
|
46
|
+
export { DocTableDeleteColumnsCommand, DocTableDeleteRowsCommand, DocTableDeleteTableCommand } from './commands/commands/table/doc-table-delete.command';
|
|
47
|
+
export type { IDocTableDeleteColumnsCommandParams, IDocTableDeleteRowsCommandParams, IDocTableDeleteTableCommandParams } from './commands/commands/table/doc-table-delete.command';
|
|
48
|
+
export type { IDocTableInsertColumnCommandParams, IDocTableInsertColumnLeftCommandParams, IDocTableInsertColumnRightCommandParams, IDocTableInsertRowAboveCommandParams, IDocTableInsertRowBellowCommandParams, IDocTableInsertRowCommandParams } from './commands/commands/table/doc-table-insert.command';
|
|
49
|
+
export { DocTableInsertColumnCommand, DocTableInsertColumnLeftCommand, DocTableInsertColumnRightCommand, DocTableInsertRowAboveCommand, DocTableInsertRowBellowCommand, DocTableInsertRowCommand } from './commands/commands/table/doc-table-insert.command';
|
|
50
|
+
export type { IDocTableTabCommandParams } from './commands/commands/table/doc-table-tab.command';
|
|
51
|
+
export { DocTableTabCommand } from './commands/commands/table/doc-table-tab.command';
|
|
52
|
+
export { genTableSource, getEmptyTableCell, getEmptyTableRow, getTableColumn } from './commands/commands/table/table';
|
|
30
53
|
export { DocCreateTableOperation } from './commands/operations/doc-create-table.operation';
|
|
54
|
+
export { MoveSelectionOperation } from './commands/operations/doc-cursor.operation';
|
|
55
|
+
export { MoveCursorOperation } from './commands/operations/doc-cursor.operation';
|
|
56
|
+
export { SelectAllOperation } from './commands/operations/select-all.operation';
|
|
57
|
+
export { type ISetDocZoomRatioOperationParams, SetDocZoomRatioOperation } from './commands/operations/set-doc-zoom-ratio.operation';
|
|
58
|
+
export { getCommandSkeleton, getRichTextEditPath } from './commands/util';
|
|
59
|
+
export { DocUIController } from './controllers/doc-ui.controller';
|
|
60
|
+
export { menuSchema } from './controllers/menu.schema';
|
|
61
|
+
export { DocBackScrollRenderController } from './controllers/render-controllers/back-scroll.render-controller';
|
|
62
|
+
export { DocRenderController } from './controllers/render-controllers/doc.render-controller';
|
|
63
|
+
export * from './docs-ui-plugin';
|
|
64
|
+
export * from './services';
|
|
65
|
+
export { IDocClipboardService } from './services/clipboard/clipboard.service';
|
|
66
|
+
export { DocEventManagerService } from './services/doc-event-manager.service';
|
|
67
|
+
export { DocIMEInputManagerService } from './services/doc-ime-input-manager.service';
|
|
68
|
+
export { DocCanvasPopManagerService } from './services/doc-popup-manager.service';
|
|
69
|
+
export { DocStateChangeManagerService } from './services/doc-state-change-manager.service';
|
|
70
|
+
export { DocsRenderService } from './services/docs-render.service';
|
|
71
|
+
export { isInSameTableCell, isValidRectRange, NodePositionConvertToRectRange } from './services/selection/convert-rect-range';
|
|
72
|
+
export { NodePositionConvertToCursor } from './services/selection/convert-text-range';
|
|
73
|
+
export { getOneTextSelectionRange } from './services/selection/convert-text-range';
|
|
74
|
+
export type { IEditorInputConfig } from './services/selection/doc-selection-render.service';
|
|
75
|
+
export { DocSelectionRenderService } from './services/selection/doc-selection-render.service';
|
|
76
|
+
export type { IDocRange } from './services/selection/range-interface';
|
|
77
|
+
export { convertPositionsToRectRanges, RectRange } from './services/selection/rect-range';
|
|
78
|
+
export { getCanvasOffsetByEngine } from './services/selection/selection-utils';
|
|
79
|
+
export { getAnchorBounding, getLineBounding, TEXT_RANGE_LAYER_INDEX, TextRange } from './services/selection/text-range';
|
|
80
|
+
export { whenDocAndEditorFocused } from './shortcuts/utils';
|
|
81
|
+
export { DOC_VERTICAL_PADDING } from './types/const/padding';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Disposable, ICommandService, ILogService, IUniverInstanceService, SliceBodyType, IDisposable, IDocumentBody } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
2
3
|
import { IClipboardInterfaceService } from '@univerjs/ui';
|
|
3
|
-
import { TextSelectionManagerService } from '@univerjs/docs';
|
|
4
4
|
export interface IClipboardPropertyItem {
|
|
5
5
|
}
|
|
6
6
|
export interface IDocClipboardHook {
|
|
@@ -15,17 +15,17 @@ export interface IDocClipboardService {
|
|
|
15
15
|
legacyPaste(html?: string, text?: string): Promise<boolean>;
|
|
16
16
|
addClipboardHook(hook: IDocClipboardHook): IDisposable;
|
|
17
17
|
}
|
|
18
|
-
export declare const IDocClipboardService: import('@
|
|
18
|
+
export declare const IDocClipboardService: import('@wendellhu/redi').IdentifierDecorator<IDocClipboardService>;
|
|
19
19
|
export declare class DocClipboardService extends Disposable implements IDocClipboardService {
|
|
20
20
|
private readonly _univerInstanceService;
|
|
21
21
|
private readonly _logService;
|
|
22
22
|
private readonly _commandService;
|
|
23
23
|
private readonly _clipboardInterfaceService;
|
|
24
|
-
private readonly
|
|
24
|
+
private readonly _docSelectionManagerService;
|
|
25
25
|
private _clipboardHooks;
|
|
26
26
|
private _htmlToUDM;
|
|
27
27
|
private _umdToHtml;
|
|
28
|
-
constructor(_univerInstanceService: IUniverInstanceService, _logService: ILogService, _commandService: ICommandService, _clipboardInterfaceService: IClipboardInterfaceService,
|
|
28
|
+
constructor(_univerInstanceService: IUniverInstanceService, _logService: ILogService, _commandService: ICommandService, _clipboardInterfaceService: IClipboardInterfaceService, _docSelectionManagerService: DocSelectionManagerService);
|
|
29
29
|
copy(sliceType?: SliceBodyType): Promise<boolean>;
|
|
30
30
|
cut(): Promise<boolean>;
|
|
31
31
|
paste(items: ClipboardItem[]): Promise<boolean>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Disposable, IUniverInstanceService, DocumentDataModel, ICommandInfo, ICustomRange, IDisposable, IParagraphRange, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
3
|
+
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
4
|
+
export interface IAutoFormatContext {
|
|
5
|
+
unit: DocumentDataModel;
|
|
6
|
+
selection: ITextRangeWithStyle;
|
|
7
|
+
/**
|
|
8
|
+
* is selection at doc body
|
|
9
|
+
*/
|
|
10
|
+
isBody: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* selection relative paragraphs
|
|
13
|
+
*/
|
|
14
|
+
paragraphs: IParagraphRange[];
|
|
15
|
+
/**
|
|
16
|
+
* selection relative custom ranges
|
|
17
|
+
*/
|
|
18
|
+
customRanges: ICustomRange[];
|
|
19
|
+
commandId: string;
|
|
20
|
+
commandParams: Nullable<object>;
|
|
21
|
+
}
|
|
22
|
+
export interface IAutoFormat {
|
|
23
|
+
id: string;
|
|
24
|
+
match: (context: IAutoFormatContext) => boolean;
|
|
25
|
+
getMutations: (context: IAutoFormatContext) => ICommandInfo[];
|
|
26
|
+
priority?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* service for auto-formatting, handle shortcut like `Space` or `Tab`.
|
|
30
|
+
*/
|
|
31
|
+
export declare class DocAutoFormatService extends Disposable {
|
|
32
|
+
private readonly _univerInstanceService;
|
|
33
|
+
private readonly _textSelectionManagerService;
|
|
34
|
+
private _matches;
|
|
35
|
+
constructor(_univerInstanceService: IUniverInstanceService, _textSelectionManagerService: DocSelectionManagerService);
|
|
36
|
+
registerAutoFormat(match: IAutoFormat): IDisposable;
|
|
37
|
+
onAutoFormat(id: string, params: Nullable<object>): ICommandInfo[];
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentDataModel, ICustomRange, IParagraph, Nullable
|
|
1
|
+
import { Disposable, DocumentDataModel, ICustomRange, IParagraph, Nullable } from '@univerjs/core';
|
|
2
2
|
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
3
|
import { Documents, DocumentSkeleton, IBoundRectNoAngle, IDocumentSkeletonGlyph, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
4
|
export declare const calcDocGlyphPosition: (glyph: IDocumentSkeletonGlyph, documents: Documents, skeleton: DocumentSkeleton, pageIndex?: number) => IBoundRectNoAngle | undefined;
|
|
@@ -6,11 +6,13 @@ interface ICustomRangeActive {
|
|
|
6
6
|
range: ICustomRange;
|
|
7
7
|
segmentId?: string;
|
|
8
8
|
segmentPageIndex: number;
|
|
9
|
+
rects: IBoundRectNoAngle[];
|
|
9
10
|
}
|
|
10
11
|
interface IBulletActive {
|
|
11
12
|
paragraph: IParagraph;
|
|
12
13
|
segmentId?: string;
|
|
13
14
|
segmentPageIndex: number;
|
|
15
|
+
rect: IBoundRectNoAngle;
|
|
14
16
|
}
|
|
15
17
|
export declare class DocEventManagerService extends Disposable implements IRenderModule {
|
|
16
18
|
private _context;
|