@univerjs/engine-render 0.2.12 → 0.2.13
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 +1 -19
- package/lib/es/index.js +18832 -20350
- package/lib/types/basics/range.d.ts +24 -14
- package/lib/types/basics/tools.d.ts +22 -2
- package/lib/types/basics/transform.d.ts +24 -24
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +3 -3
- package/lib/types/components/docs/layout/model/line.d.ts +1 -1
- package/lib/types/components/docs/layout/tools.d.ts +2 -1
- package/lib/types/components/sheets/extensions/background.d.ts +1 -1
- package/lib/types/components/sheets/extensions/border.d.ts +1 -1
- package/lib/types/components/sheets/extensions/custom.d.ts +1 -1
- package/lib/types/components/sheets/extensions/font.d.ts +2 -11
- package/lib/types/components/sheets/extensions/marker.d.ts +1 -1
- package/lib/types/components/sheets/extensions/row-header-layout.d.ts +2 -2
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +2 -2
- package/lib/types/components/sheets/interfaces.d.ts +2 -6
- package/lib/types/components/sheets/row-header.d.ts +1 -1
- package/lib/types/components/sheets/sheet-skeleton.d.ts +28 -14
- package/lib/types/components/sheets/spreadsheet.d.ts +3 -3
- package/lib/types/components/slides/slide.d.ts +1 -1
- package/lib/types/context.d.ts +7 -0
- package/lib/types/engine.d.ts +2 -2
- package/lib/types/index.d.ts +20 -27
- package/lib/types/render-engine.d.ts +2 -2
- package/lib/types/render-manager/render-manager.service.d.ts +5 -5
- package/lib/types/scene.d.ts +5 -5
- package/lib/types/shape/rect.d.ts +15 -6
- package/lib/types/viewport.d.ts +25 -13
- package/lib/umd/index.js +1 -19
- package/package.json +7 -7
- package/lib/types/components/docs/text-selection/convert-rect-range.d.ts +0 -29
- package/lib/types/components/docs/text-selection/convert-text-range.d.ts +0 -65
- package/lib/types/components/docs/text-selection/range-interface.d.ts +0 -21
- package/lib/types/components/docs/text-selection/rect-range.d.ts +0 -48
- package/lib/types/components/docs/text-selection/selection-utils.d.ts +0 -27
- package/lib/types/components/docs/text-selection/text-range.d.ts +0 -68
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +0 -193
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/engine-render",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UniverSheet normal base-render",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -47,23 +47,23 @@
|
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"rxjs": ">=7.0.0",
|
|
50
|
-
"@univerjs/core": "0.2.
|
|
50
|
+
"@univerjs/core": "0.2.13"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@floating-ui/dom": "^1.6.10",
|
|
54
54
|
"@floating-ui/utils": "^0.2.7",
|
|
55
55
|
"cjk-regex": "^3.1.0",
|
|
56
56
|
"franc-min": "^6.2.0",
|
|
57
|
-
"opentype.js": "^1.3.4"
|
|
57
|
+
"opentype.js": "^1.3.4",
|
|
58
|
+
"@univerjs/core": "0.2.13"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@types/opentype.js": "^1.3.8",
|
|
61
62
|
"rxjs": "^7.8.1",
|
|
62
|
-
"typescript": "^5.
|
|
63
|
-
"vite": "^5.4.
|
|
63
|
+
"typescript": "^5.6.2",
|
|
64
|
+
"vite": "^5.4.4",
|
|
64
65
|
"vitest": "^2.0.5",
|
|
65
|
-
"@univerjs/
|
|
66
|
-
"@univerjs/shared": "0.2.12"
|
|
66
|
+
"@univerjs-infra/shared": "0.2.13"
|
|
67
67
|
},
|
|
68
68
|
"browser": {
|
|
69
69
|
"fs": false
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import { INodePosition, IPoint } from '../../../basics';
|
|
3
|
-
import { IDocumentOffsetConfig } from '../document';
|
|
4
|
-
import { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
5
|
-
export declare function isValidRectRange(anchorNodePosition: INodePosition, focusNodePosition: INodePosition): boolean;
|
|
6
|
-
export declare function isInSameTableCell(anchorNodePosition: INodePosition, focusNodePosition: INodePosition): boolean;
|
|
7
|
-
export declare function compareNodePositionInTable(a: INodePosition, b: INodePosition): boolean;
|
|
8
|
-
interface IRectRangeNodePositions {
|
|
9
|
-
anchor: INodePosition;
|
|
10
|
-
focus: INodePosition;
|
|
11
|
-
}
|
|
12
|
-
export declare class NodePositionConvertToRectRange {
|
|
13
|
-
private _documentOffsetConfig;
|
|
14
|
-
private _docSkeleton;
|
|
15
|
-
private _liquid;
|
|
16
|
-
constructor(_documentOffsetConfig: IDocumentOffsetConfig, _docSkeleton: DocumentSkeleton);
|
|
17
|
-
getRangePointData(startNodePosition: INodePosition, endNodePosition: INodePosition): {
|
|
18
|
-
pointGroup: IPoint[][];
|
|
19
|
-
startRow: number;
|
|
20
|
-
startColumn: number;
|
|
21
|
-
endRow: number;
|
|
22
|
-
endColumn: number;
|
|
23
|
-
tableId: string;
|
|
24
|
-
} | undefined;
|
|
25
|
-
getNodePositionGroup(anchorNodePosition: INodePosition, focusNodePosition: INodePosition): Nullable<IRectRangeNodePositions[]>;
|
|
26
|
-
private _collectPositionGroup;
|
|
27
|
-
private _getTableRectRangeInfo;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { IPosition, ITextRange, Nullable } from '@univerjs/core';
|
|
2
|
-
import { IDocumentSkeletonCached, IDocumentSkeletonPage } from '../../../basics/i-document-skeleton-cached';
|
|
3
|
-
import { INodePosition } from '../../../basics/interfaces';
|
|
4
|
-
import { IPoint } from '../../../basics/vector2';
|
|
5
|
-
import { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
6
|
-
import { IDocumentOffsetConfig } from '../document';
|
|
7
|
-
export declare enum NodePositionStateType {
|
|
8
|
-
NORMAL = 0,
|
|
9
|
-
START = 1,
|
|
10
|
-
END = 2
|
|
11
|
-
}
|
|
12
|
-
export declare enum NodePositionType {
|
|
13
|
-
page = 0,
|
|
14
|
-
section = 1,
|
|
15
|
-
column = 2,
|
|
16
|
-
line = 3,
|
|
17
|
-
divide = 4,
|
|
18
|
-
glyph = 5
|
|
19
|
-
}
|
|
20
|
-
export interface ICurrentNodePositionState {
|
|
21
|
-
page: NodePositionStateType;
|
|
22
|
-
section: NodePositionStateType;
|
|
23
|
-
column: NodePositionStateType;
|
|
24
|
-
line: NodePositionStateType;
|
|
25
|
-
divide: NodePositionStateType;
|
|
26
|
-
glyph: NodePositionStateType;
|
|
27
|
-
}
|
|
28
|
-
export declare const NodePositionMap: {
|
|
29
|
-
page: number;
|
|
30
|
-
section: number;
|
|
31
|
-
column: number;
|
|
32
|
-
line: number;
|
|
33
|
-
divide: number;
|
|
34
|
-
glyph: number;
|
|
35
|
-
};
|
|
36
|
-
export declare function compareNodePositionLogic(pos1: INodePosition, pos2: INodePosition): boolean;
|
|
37
|
-
export declare function compareNodePosition(pos1: INodePosition, pos2: INodePosition): {
|
|
38
|
-
start: INodePosition;
|
|
39
|
-
end: INodePosition;
|
|
40
|
-
};
|
|
41
|
-
export declare function getOneTextSelectionRange(rangeList: ITextRange[]): Nullable<ITextRange>;
|
|
42
|
-
export declare function pushToPoints(position: IPosition): {
|
|
43
|
-
x: number;
|
|
44
|
-
y: number;
|
|
45
|
-
}[];
|
|
46
|
-
export declare function getPageFromPath(skeletonData: IDocumentSkeletonCached, path: (string | number)[]): Nullable<IDocumentSkeletonPage>;
|
|
47
|
-
export declare class NodePositionConvertToCursor {
|
|
48
|
-
private _documentOffsetConfig;
|
|
49
|
-
private _docSkeleton;
|
|
50
|
-
private _liquid;
|
|
51
|
-
private _currentStartState;
|
|
52
|
-
private _currentEndState;
|
|
53
|
-
constructor(_documentOffsetConfig: IDocumentOffsetConfig, _docSkeleton: DocumentSkeleton);
|
|
54
|
-
getRangePointData(startOrigin: Nullable<INodePosition>, endOrigin: Nullable<INodePosition>): {
|
|
55
|
-
borderBoxPointGroup: IPoint[][];
|
|
56
|
-
contentBoxPointGroup: IPoint[][];
|
|
57
|
-
cursorList: ITextRange[];
|
|
58
|
-
};
|
|
59
|
-
private _isValidPosition;
|
|
60
|
-
private _resetCurrentNodePositionState;
|
|
61
|
-
private _setNodePositionState;
|
|
62
|
-
private _checkPreviousNodePositionState;
|
|
63
|
-
private _getSelectionRuler;
|
|
64
|
-
private _selectionIterator;
|
|
65
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import { INodePosition, ITextSelectionStyle, RANGE_DIRECTION } from '../../../basics';
|
|
3
|
-
export declare enum DOC_RANGE_TYPE {
|
|
4
|
-
RECT = "RECT",
|
|
5
|
-
TEXT = "TEXT"
|
|
6
|
-
}
|
|
7
|
-
export interface IDocRange {
|
|
8
|
-
rangeType: DOC_RANGE_TYPE;
|
|
9
|
-
anchorNodePosition?: Nullable<INodePosition>;
|
|
10
|
-
focusNodePosition?: Nullable<INodePosition>;
|
|
11
|
-
style: ITextSelectionStyle;
|
|
12
|
-
get startOffset(): Nullable<number>;
|
|
13
|
-
get endOffset(): Nullable<number>;
|
|
14
|
-
get collapsed(): boolean;
|
|
15
|
-
get startNodePosition(): Nullable<INodePosition>;
|
|
16
|
-
get endNodePosition(): Nullable<INodePosition>;
|
|
17
|
-
get direction(): RANGE_DIRECTION;
|
|
18
|
-
isActive(): boolean;
|
|
19
|
-
dispose(): void;
|
|
20
|
-
refresh(): void;
|
|
21
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import { INodePosition, ITextSelectionStyle, RANGE_DIRECTION } from '../../../basics';
|
|
3
|
-
import { ThinScene } from '../../../thin-scene';
|
|
4
|
-
import { Documents } from '../document';
|
|
5
|
-
import { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
6
|
-
import { IDocRange, DOC_RANGE_TYPE } from './range-interface';
|
|
7
|
-
export declare function convertPositionsToRectRanges(scene: ThinScene, document: Documents, docSkeleton: DocumentSkeleton, anchorNodePosition: INodePosition, focusNodePosition: INodePosition, style?: ITextSelectionStyle, segmentId?: string): RectRange[];
|
|
8
|
-
export declare class RectRange implements IDocRange {
|
|
9
|
-
private _scene;
|
|
10
|
-
private _document;
|
|
11
|
-
private _docSkeleton;
|
|
12
|
-
anchorNodePosition: INodePosition;
|
|
13
|
-
focusNodePosition: INodePosition;
|
|
14
|
-
style: ITextSelectionStyle;
|
|
15
|
-
private _segmentId;
|
|
16
|
-
rangeType: DOC_RANGE_TYPE;
|
|
17
|
-
private _rangeShape;
|
|
18
|
-
private _current;
|
|
19
|
-
private _startRow;
|
|
20
|
-
private _startCol;
|
|
21
|
-
private _endRow;
|
|
22
|
-
private _endCol;
|
|
23
|
-
private _tableId;
|
|
24
|
-
constructor(_scene: ThinScene, _document: Documents, _docSkeleton: DocumentSkeleton, anchorNodePosition: INodePosition, focusNodePosition: INodePosition, style?: ITextSelectionStyle, _segmentId?: string);
|
|
25
|
-
get startOffset(): Nullable<number>;
|
|
26
|
-
get endOffset(): Nullable<number>;
|
|
27
|
-
get collapsed(): boolean;
|
|
28
|
-
get startRow(): number;
|
|
29
|
-
get startColumn(): number;
|
|
30
|
-
get endRow(): number;
|
|
31
|
-
get endColumn(): number;
|
|
32
|
-
get tableId(): string;
|
|
33
|
-
get segmentId(): string;
|
|
34
|
-
get spanEntireRow(): boolean;
|
|
35
|
-
get spanEntireColumn(): boolean;
|
|
36
|
-
get spanEntireTable(): boolean;
|
|
37
|
-
get startNodePosition(): INodePosition;
|
|
38
|
-
get endNodePosition(): INodePosition;
|
|
39
|
-
get direction(): RANGE_DIRECTION;
|
|
40
|
-
isActive(): boolean;
|
|
41
|
-
activate(): void;
|
|
42
|
-
deactivate(): void;
|
|
43
|
-
dispose(): void;
|
|
44
|
-
isIntersection(compareRange: RectRange): boolean;
|
|
45
|
-
refresh(): void;
|
|
46
|
-
private _updateTableInfo;
|
|
47
|
-
private _createOrUpdateRange;
|
|
48
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import { IDocumentSkeletonGlyph, INodePosition, ITextSelectionStyle } from '../../../basics';
|
|
3
|
-
import { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
4
|
-
import { Engine } from '../../../engine';
|
|
5
|
-
import { Documents } from '../document';
|
|
6
|
-
import { Scene } from '../../../scene';
|
|
7
|
-
import { RectRange } from './rect-range';
|
|
8
|
-
import { TextRange } from './text-range';
|
|
9
|
-
interface IDocRangeList {
|
|
10
|
-
textRanges: TextRange[];
|
|
11
|
-
rectRanges: RectRange[];
|
|
12
|
-
}
|
|
13
|
-
export declare function getTextRangeFromCharIndex(startOffset: number, endOffset: number, scene: Scene, document: Documents, skeleton: DocumentSkeleton, style: ITextSelectionStyle, segmentId: string, segmentPage: number): Nullable<TextRange>;
|
|
14
|
-
export declare function getRectRangeFromCharIndex(startOffset: number, endOffset: number, scene: Scene, document: Documents, skeleton: DocumentSkeleton, style: ITextSelectionStyle, segmentId: string, segmentPage: number): Nullable<RectRange>;
|
|
15
|
-
export declare function getRangeListFromCharIndex(startOffset: number, endOffset: number, scene: Scene, document: Documents, skeleton: DocumentSkeleton, style: ITextSelectionStyle, segmentId: string, segmentPage: number): Nullable<IDocRangeList>;
|
|
16
|
-
export declare function getRangeListFromSelection(anchorPosition: INodePosition, focusPosition: INodePosition, scene: Scene, document: Documents, skeleton: DocumentSkeleton, style: ITextSelectionStyle, segmentId: string, segmentPage: number): Nullable<IDocRangeList>;
|
|
17
|
-
export declare function getCanvasOffsetByEngine(engine: Nullable<Engine>): {
|
|
18
|
-
left: number;
|
|
19
|
-
top: number;
|
|
20
|
-
};
|
|
21
|
-
export declare function getParagraphInfoByGlyph(node: IDocumentSkeletonGlyph): {
|
|
22
|
-
st: number;
|
|
23
|
-
ed: number;
|
|
24
|
-
content: string;
|
|
25
|
-
nodeIndex: number;
|
|
26
|
-
} | undefined;
|
|
27
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import { INodePosition } from '../../../basics/interfaces';
|
|
3
|
-
import { ISuccinctDocRangeParam, ITextSelectionStyle, RANGE_DIRECTION } from '../../../basics/range';
|
|
4
|
-
import { IPoint } from '../../../basics/vector2';
|
|
5
|
-
import { Scene } from '../../../scene';
|
|
6
|
-
import { Rect } from '../../../shape/rect';
|
|
7
|
-
import { ThinScene } from '../../../thin-scene';
|
|
8
|
-
import { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
9
|
-
import { Documents } from '../document';
|
|
10
|
-
import { IDocRange, DOC_RANGE_TYPE } from './range-interface';
|
|
11
|
-
export declare const TEXT_RANGE_LAYER_INDEX = 3;
|
|
12
|
-
export declare function cursorConvertToTextRange(scene: Scene, range: ISuccinctDocRangeParam, docSkeleton: DocumentSkeleton, document: Documents): Nullable<TextRange>;
|
|
13
|
-
export declare function getAnchorBounding(pointsGroup: IPoint[][]): {
|
|
14
|
-
left: number;
|
|
15
|
-
top: number;
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
};
|
|
19
|
-
export declare function getLineBounding(pointsGroup: IPoint[][]): {
|
|
20
|
-
left: number;
|
|
21
|
-
right: number;
|
|
22
|
-
top: number;
|
|
23
|
-
bottom: number;
|
|
24
|
-
}[];
|
|
25
|
-
export declare class TextRange implements IDocRange {
|
|
26
|
-
private _scene;
|
|
27
|
-
private _document;
|
|
28
|
-
private _docSkeleton;
|
|
29
|
-
anchorNodePosition?: Nullable<INodePosition>;
|
|
30
|
-
focusNodePosition?: Nullable<INodePosition>;
|
|
31
|
-
style: ITextSelectionStyle;
|
|
32
|
-
private _segmentId;
|
|
33
|
-
rangeType: DOC_RANGE_TYPE;
|
|
34
|
-
private _current;
|
|
35
|
-
private _rangeShape;
|
|
36
|
-
private _anchorShape;
|
|
37
|
-
private _cursorList;
|
|
38
|
-
private _anchorBlinkTimer;
|
|
39
|
-
constructor(_scene: ThinScene, _document: Documents, _docSkeleton: DocumentSkeleton, anchorNodePosition?: Nullable<INodePosition>, focusNodePosition?: Nullable<INodePosition>, style?: ITextSelectionStyle, _segmentId?: string);
|
|
40
|
-
private _anchorBlink;
|
|
41
|
-
get startOffset(): number | undefined;
|
|
42
|
-
get endOffset(): number | undefined;
|
|
43
|
-
get collapsed(): boolean;
|
|
44
|
-
get startNodePosition(): INodePosition | null;
|
|
45
|
-
get endNodePosition(): Nullable<INodePosition>;
|
|
46
|
-
get direction(): RANGE_DIRECTION;
|
|
47
|
-
get segmentId(): string;
|
|
48
|
-
getAbsolutePosition(): {
|
|
49
|
-
left: number;
|
|
50
|
-
top: number;
|
|
51
|
-
width: number;
|
|
52
|
-
height: number;
|
|
53
|
-
} | undefined;
|
|
54
|
-
getAnchor(): Nullable<Rect<import('../../../shape/rect').IRectProps>>;
|
|
55
|
-
activeStatic(): void;
|
|
56
|
-
deactivateStatic(): void;
|
|
57
|
-
isActive(): boolean;
|
|
58
|
-
activate(): void;
|
|
59
|
-
deactivate(): void;
|
|
60
|
-
dispose(): void;
|
|
61
|
-
isIntersection(compareRange: TextRange): boolean;
|
|
62
|
-
refresh(): void;
|
|
63
|
-
private _isEmpty;
|
|
64
|
-
private _isCollapsed;
|
|
65
|
-
private _createOrUpdateRange;
|
|
66
|
-
private _createOrUpdateAnchor;
|
|
67
|
-
private _setCursorList;
|
|
68
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { Nullable, ILogService, RxDisposable } from '@univerjs/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { IMouseEvent, IPointerEvent } from '../../../basics/i-events';
|
|
4
|
-
import { INodePosition } from '../../../basics/interfaces';
|
|
5
|
-
import { ISuccinctDocRangeParam, ITextRangeWithStyle, ITextSelectionStyle, RANGE_DIRECTION } from '../../../basics/range';
|
|
6
|
-
import { Scene } from '../../../scene';
|
|
7
|
-
import { Viewport } from '../../../viewport';
|
|
8
|
-
import { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
9
|
-
import { Documents } from '../document';
|
|
10
|
-
import { TextRange } from './text-range';
|
|
11
|
-
import { RectRange } from './rect-range';
|
|
12
|
-
export interface ITextSelectionInnerParam {
|
|
13
|
-
textRanges: TextRange[];
|
|
14
|
-
rectRanges: RectRange[];
|
|
15
|
-
segmentId: string;
|
|
16
|
-
isEditing: boolean;
|
|
17
|
-
style: ITextSelectionStyle;
|
|
18
|
-
segmentPage: number;
|
|
19
|
-
options?: {
|
|
20
|
-
[key: string]: boolean;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface IActiveTextRange {
|
|
24
|
-
startOffset: number;
|
|
25
|
-
endOffset: number;
|
|
26
|
-
collapsed: boolean;
|
|
27
|
-
startNodePosition: Nullable<INodePosition>;
|
|
28
|
-
endNodePosition: Nullable<INodePosition>;
|
|
29
|
-
direction: RANGE_DIRECTION;
|
|
30
|
-
segmentId: string;
|
|
31
|
-
segmentPage: number;
|
|
32
|
-
style: ITextSelectionStyle;
|
|
33
|
-
}
|
|
34
|
-
export interface ITextSelectionRenderManager {
|
|
35
|
-
readonly onInputBefore$: Observable<Nullable<IEditorInputConfig>>;
|
|
36
|
-
readonly onKeydown$: Observable<Nullable<IEditorInputConfig>>;
|
|
37
|
-
readonly onInput$: Observable<Nullable<IEditorInputConfig>>;
|
|
38
|
-
readonly onPointerDown$: Observable<void>;
|
|
39
|
-
readonly onCompositionstart$: Observable<Nullable<IEditorInputConfig>>;
|
|
40
|
-
readonly onCompositionupdate$: Observable<Nullable<IEditorInputConfig>>;
|
|
41
|
-
readonly onCompositionend$: Observable<Nullable<IEditorInputConfig>>;
|
|
42
|
-
readonly onSelectionStart$: Observable<Nullable<INodePosition>>;
|
|
43
|
-
readonly onPaste$: Observable<Nullable<IEditorInputConfig>>;
|
|
44
|
-
readonly onFocus$: Observable<Nullable<IEditorInputConfig>>;
|
|
45
|
-
readonly onBlur$: Observable<Nullable<IEditorInputConfig>>;
|
|
46
|
-
readonly textSelectionInner$: Observable<Nullable<ITextSelectionInnerParam>>;
|
|
47
|
-
__getEditorContainer(): HTMLElement;
|
|
48
|
-
getViewPort(): Viewport;
|
|
49
|
-
enableSelection(): void;
|
|
50
|
-
disableSelection(): void;
|
|
51
|
-
setSegment(id: string): void;
|
|
52
|
-
getSegment(): string;
|
|
53
|
-
setSegmentPage(pageIndex: number): void;
|
|
54
|
-
getSegmentPage(): number;
|
|
55
|
-
setStyle(style: ITextSelectionStyle): void;
|
|
56
|
-
resetStyle(): void;
|
|
57
|
-
removeAllRanges(): void;
|
|
58
|
-
addDocRanges(ranges: ISuccinctDocRangeParam[], isEditing?: boolean, options?: {
|
|
59
|
-
[key: string]: boolean;
|
|
60
|
-
}): void;
|
|
61
|
-
sync(): void;
|
|
62
|
-
activate(x: number, y: number): void;
|
|
63
|
-
deactivate(): void;
|
|
64
|
-
hasFocus(): boolean;
|
|
65
|
-
focus(): void;
|
|
66
|
-
blur(): void;
|
|
67
|
-
focusEditor(): void;
|
|
68
|
-
blurEditor(): void;
|
|
69
|
-
changeRuntime(docSkeleton: DocumentSkeleton, scene: Scene, document: Documents): void;
|
|
70
|
-
dispose(): void;
|
|
71
|
-
handleDblClick(evt: IPointerEvent | IMouseEvent): void;
|
|
72
|
-
handleTripleClick(evt: IPointerEvent | IMouseEvent): void;
|
|
73
|
-
onPointDown(evt: IPointerEvent | IMouseEvent): void;
|
|
74
|
-
setCursorManually(evtOffsetX: number, evtOffsetY: number): void;
|
|
75
|
-
}
|
|
76
|
-
export interface IEditorInputConfig {
|
|
77
|
-
event: Event | CompositionEvent | KeyboardEvent;
|
|
78
|
-
content?: string;
|
|
79
|
-
activeRange?: Nullable<ITextRangeWithStyle>;
|
|
80
|
-
rangeList?: TextRange[];
|
|
81
|
-
}
|
|
82
|
-
export declare class TextSelectionRenderManager extends RxDisposable implements ITextSelectionRenderManager {
|
|
83
|
-
private readonly _logService;
|
|
84
|
-
private readonly _onInputBefore$;
|
|
85
|
-
readonly onInputBefore$: Observable<Nullable<IEditorInputConfig>>;
|
|
86
|
-
private readonly _onKeydown$;
|
|
87
|
-
readonly onKeydown$: Observable<Nullable<IEditorInputConfig>>;
|
|
88
|
-
private readonly _onInput$;
|
|
89
|
-
readonly onInput$: Observable<Nullable<IEditorInputConfig>>;
|
|
90
|
-
private readonly _onCompositionstart$;
|
|
91
|
-
readonly onCompositionstart$: Observable<Nullable<IEditorInputConfig>>;
|
|
92
|
-
private readonly _onCompositionupdate$;
|
|
93
|
-
readonly onCompositionupdate$: Observable<Nullable<IEditorInputConfig>>;
|
|
94
|
-
private readonly _onCompositionend$;
|
|
95
|
-
readonly onCompositionend$: Observable<Nullable<IEditorInputConfig>>;
|
|
96
|
-
private readonly _onSelectionStart$;
|
|
97
|
-
readonly onSelectionStart$: Observable<Nullable<INodePosition>>;
|
|
98
|
-
private readonly _onPaste$;
|
|
99
|
-
readonly onPaste$: Observable<Nullable<IEditorInputConfig>>;
|
|
100
|
-
private readonly _textSelectionInner$;
|
|
101
|
-
readonly textSelectionInner$: Observable<Nullable<ITextSelectionInnerParam>>;
|
|
102
|
-
private readonly _onFocus$;
|
|
103
|
-
readonly onFocus$: Observable<Nullable<IEditorInputConfig>>;
|
|
104
|
-
private readonly _onBlur$;
|
|
105
|
-
readonly onBlur$: Observable<Nullable<IEditorInputConfig>>;
|
|
106
|
-
private readonly _onPointerDown$;
|
|
107
|
-
readonly onPointerDown$: Observable<void>;
|
|
108
|
-
private _container;
|
|
109
|
-
private _inputParent;
|
|
110
|
-
private _input;
|
|
111
|
-
private _scrollTimers;
|
|
112
|
-
private _rangeList;
|
|
113
|
-
private _rangeListCache;
|
|
114
|
-
private _rectRangeList;
|
|
115
|
-
private _rectRangeListCache;
|
|
116
|
-
private _anchorNodePosition;
|
|
117
|
-
private _focusNodePosition;
|
|
118
|
-
private _currentSegmentId;
|
|
119
|
-
private _currentSegmentPage;
|
|
120
|
-
private _selectionStyle;
|
|
121
|
-
private _isSelectionEnabled;
|
|
122
|
-
private _viewPortObserverMap;
|
|
123
|
-
private _isIMEInputApply;
|
|
124
|
-
private _activeViewport;
|
|
125
|
-
private _docSkeleton;
|
|
126
|
-
private _scene;
|
|
127
|
-
private _document;
|
|
128
|
-
private _scenePointerMoveSubs;
|
|
129
|
-
private _scenePointerUpSubs;
|
|
130
|
-
private _editorFocusing;
|
|
131
|
-
constructor(_logService: ILogService);
|
|
132
|
-
__getEditorContainer(): HTMLElement;
|
|
133
|
-
getViewPort(): Viewport;
|
|
134
|
-
setSegment(id: string): void;
|
|
135
|
-
getSegment(): string;
|
|
136
|
-
setSegmentPage(pageIndex: number): void;
|
|
137
|
-
getSegmentPage(): number;
|
|
138
|
-
setStyle(style?: ITextSelectionStyle): void;
|
|
139
|
-
resetStyle(): void;
|
|
140
|
-
enableSelection(): void;
|
|
141
|
-
disableSelection(): void;
|
|
142
|
-
addDocRanges(ranges: ISuccinctDocRangeParam[], isEditing?: boolean, options?: {
|
|
143
|
-
[key: string]: boolean;
|
|
144
|
-
}): void;
|
|
145
|
-
setCursorManually(evtOffsetX: number, evtOffsetY: number): void;
|
|
146
|
-
sync(): void;
|
|
147
|
-
activate(x: number, y: number): void;
|
|
148
|
-
hasFocus(): boolean;
|
|
149
|
-
focus(): void;
|
|
150
|
-
blur(): void;
|
|
151
|
-
focusEditor(): void;
|
|
152
|
-
blurEditor(): void;
|
|
153
|
-
deactivate(): void;
|
|
154
|
-
changeRuntime(docSkeleton: DocumentSkeleton, scene: Scene, document: Documents): void;
|
|
155
|
-
handleDblClick(evt: IPointerEvent | IMouseEvent): void;
|
|
156
|
-
handleTripleClick(evt: IPointerEvent | IMouseEvent): void;
|
|
157
|
-
onPointDown(evt: IPointerEvent | IMouseEvent): void;
|
|
158
|
-
removeAllRanges(): void;
|
|
159
|
-
private _setSystemHighlightColorToStyle;
|
|
160
|
-
private _getAllTextRanges;
|
|
161
|
-
private _getAllRectRanges;
|
|
162
|
-
private _getActiveRange;
|
|
163
|
-
private _getActiveRangeInstance;
|
|
164
|
-
dispose(): void;
|
|
165
|
-
private _initDOM;
|
|
166
|
-
private _initInput;
|
|
167
|
-
private _getNodePosition;
|
|
168
|
-
private _interactTextRanges;
|
|
169
|
-
private _interactRectRanges;
|
|
170
|
-
private _removeAllRanges;
|
|
171
|
-
private _removeAllCacheRanges;
|
|
172
|
-
private _removeAllTextRanges;
|
|
173
|
-
private _removeAllRectRanges;
|
|
174
|
-
private _deactivateAllTextRanges;
|
|
175
|
-
private _deactivateAllRectRanges;
|
|
176
|
-
private _addTextRangesToCache;
|
|
177
|
-
private _addTextRange;
|
|
178
|
-
private _addRectRangesToCache;
|
|
179
|
-
private _addRectRanges;
|
|
180
|
-
private _createTextRangeByAnchorPosition;
|
|
181
|
-
private _updateActiveRangePosition;
|
|
182
|
-
private _isEmpty;
|
|
183
|
-
private _getCanvasOffset;
|
|
184
|
-
private _updateInputPosition;
|
|
185
|
-
private _moving;
|
|
186
|
-
private _attachScrollEvent;
|
|
187
|
-
private _initInputEvents;
|
|
188
|
-
private _eventHandle;
|
|
189
|
-
private _getTransformCoordForDocumentOffset;
|
|
190
|
-
private _findNodeByCoord;
|
|
191
|
-
private _detachEvent;
|
|
192
|
-
}
|
|
193
|
-
export declare const ITextSelectionRenderManager: import('@univerjs/core').IdentifierDecorator<TextSelectionRenderManager>;
|