@univerjs/docs-ui 0.2.14 → 0.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +20 -20
- package/lib/es/index.js +6852 -5910
- package/lib/index.css +1 -1
- package/lib/types/basics/{__tests__/plain-text.spec.d.ts → editor.d.ts} +1 -1
- package/lib/types/commands/commands/list.command.d.ts +1 -0
- package/lib/types/components/editor/TextEditor.d.ts +36 -0
- package/lib/types/components/range-selector/RangeSelector.d.ts +21 -0
- package/lib/types/controllers/doc-header-footer.controller.d.ts +2 -1
- package/lib/types/controllers/doc-move-cursor.controller.d.ts +1 -0
- package/lib/types/controllers/render-controllers/back-scroll.render-controller.d.ts +8 -10
- package/lib/types/controllers/render-controllers/doc-editor-bridge.controller.d.ts +1 -1
- package/lib/types/controllers/render-controllers/doc-selection-render.controller.d.ts +2 -2
- package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +6 -4
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +1 -1
- package/lib/types/docs-ui-plugin.d.ts +1 -2
- package/lib/types/index.d.ts +32 -28
- package/lib/types/services/clipboard/clipboard.service.d.ts +0 -1
- package/lib/types/services/editor/editor-manager.service.d.ts +157 -0
- package/lib/types/services/editor/editor.d.ts +177 -0
- package/lib/types/services/range-selector/range-selector.service.d.ts +32 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +31 -18
- package/lib/umd/index.js +20 -20
- package/package.json +17 -18
- package/lib/types/basics/plain-text.d.ts +0 -11
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Disposable, IDisposable, IUnitRange, Nullable } from '@univerjs/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export interface IRangeSelectorRange extends IUnitRange {
|
|
4
|
+
sheetName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IRangeSelectorService {
|
|
7
|
+
selectionChange$: Observable<IRangeSelectorRange[]>;
|
|
8
|
+
selectionChange(ranges: IRangeSelectorRange[]): void;
|
|
9
|
+
setCurrentSelectorId(id: Nullable<string>): void;
|
|
10
|
+
getCurrentSelectorId(): Nullable<string>;
|
|
11
|
+
openSelector$: Observable<unknown>;
|
|
12
|
+
openSelector(): void;
|
|
13
|
+
selectorModalVisible$: Observable<boolean>;
|
|
14
|
+
get selectorModalVisible(): boolean;
|
|
15
|
+
triggerModalVisibleChange(visible: boolean): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class RangeSelectorService extends Disposable implements IRangeSelectorService, IDisposable {
|
|
18
|
+
private _currentSelectorId;
|
|
19
|
+
private readonly _selectionChange$;
|
|
20
|
+
readonly selectionChange$: Observable<IRangeSelectorRange[]>;
|
|
21
|
+
private readonly _openSelector$;
|
|
22
|
+
readonly openSelector$: Observable<unknown>;
|
|
23
|
+
private readonly _selectorModalVisible$;
|
|
24
|
+
readonly selectorModalVisible$: Observable<boolean>;
|
|
25
|
+
get selectorModalVisible(): boolean;
|
|
26
|
+
setCurrentSelectorId(id: Nullable<string>): void;
|
|
27
|
+
getCurrentSelectorId(): Nullable<string>;
|
|
28
|
+
selectionChange(range: IRangeSelectorRange[]): void;
|
|
29
|
+
openSelector(): void;
|
|
30
|
+
triggerModalVisibleChange(visible: boolean): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const IRangeSelectorService: import('@wendellhu/redi').IdentifierDecorator<IRangeSelectorService>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ILogService, RxDisposable, DocumentDataModel, Nullable } from '@univerjs/core';
|
|
1
|
+
import { ILogService, IUniverInstanceService, RxDisposable, DocumentDataModel, Nullable } from '@univerjs/core';
|
|
2
2
|
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
3
|
import { ILayoutService } from '@univerjs/ui';
|
|
4
|
-
import { IDocSelectionInnerParam, IMouseEvent, INodePosition, IPointerEvent, IRenderContext, IRenderModule, ISuccinctDocRangeParam, ITextRangeWithStyle
|
|
4
|
+
import { IDocSelectionInnerParam, IMouseEvent, INodePosition, IPointerEvent, IRenderContext, IRenderModule, ISuccinctDocRangeParam, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
5
5
|
import { TextRange } from './text-range';
|
|
6
6
|
export interface IEditorInputConfig {
|
|
7
7
|
event: Event | CompositionEvent | KeyboardEvent;
|
|
@@ -13,13 +13,14 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
13
13
|
private readonly _context;
|
|
14
14
|
private readonly _layoutService;
|
|
15
15
|
private readonly _logService;
|
|
16
|
+
private readonly _univerInstanceService;
|
|
16
17
|
private readonly _docSkeletonManagerService;
|
|
17
18
|
private readonly _onInputBefore$;
|
|
18
19
|
readonly onInputBefore$: import('rxjs').Observable<Nullable<IEditorInputConfig>>;
|
|
19
20
|
private readonly _onKeydown$;
|
|
20
|
-
readonly onKeydown$: import('rxjs').Observable<
|
|
21
|
+
readonly onKeydown$: import('rxjs').Observable<IEditorInputConfig>;
|
|
21
22
|
private readonly _onInput$;
|
|
22
|
-
readonly onInput$: import('rxjs').Observable<
|
|
23
|
+
readonly onInput$: import('rxjs').Observable<IEditorInputConfig>;
|
|
23
24
|
private readonly _onCompositionstart$;
|
|
24
25
|
readonly onCompositionstart$: import('rxjs').Observable<Nullable<IEditorInputConfig>>;
|
|
25
26
|
private readonly _onCompositionupdate$;
|
|
@@ -29,13 +30,13 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
29
30
|
private readonly _onSelectionStart$;
|
|
30
31
|
readonly onSelectionStart$: import('rxjs').Observable<Nullable<INodePosition>>;
|
|
31
32
|
private readonly _onPaste$;
|
|
32
|
-
readonly onPaste$: import('rxjs').Observable<
|
|
33
|
+
readonly onPaste$: import('rxjs').Observable<IEditorInputConfig>;
|
|
33
34
|
private readonly _textSelectionInner$;
|
|
34
35
|
readonly textSelectionInner$: import('rxjs').Observable<Nullable<IDocSelectionInnerParam>>;
|
|
35
36
|
private readonly _onFocus$;
|
|
36
|
-
readonly onFocus$: import('rxjs').Observable<
|
|
37
|
+
readonly onFocus$: import('rxjs').Observable<IEditorInputConfig>;
|
|
37
38
|
private readonly _onBlur$;
|
|
38
|
-
readonly onBlur$: import('rxjs').Observable<
|
|
39
|
+
readonly onBlur$: import('rxjs').Observable<IEditorInputConfig>;
|
|
39
40
|
private readonly _onPointerDown$;
|
|
40
41
|
readonly onPointerDown$: import('rxjs').Observable<void>;
|
|
41
42
|
private _container;
|
|
@@ -51,37 +52,48 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
51
52
|
private _currentSegmentId;
|
|
52
53
|
private _currentSegmentPage;
|
|
53
54
|
private _selectionStyle;
|
|
54
|
-
private _isSelectionEnabled;
|
|
55
55
|
private _viewPortObserverMap;
|
|
56
56
|
private _isIMEInputApply;
|
|
57
57
|
private _scenePointerMoveSubs;
|
|
58
58
|
private _scenePointerUpSubs;
|
|
59
59
|
private _editorFocusing;
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
private _reserveRanges;
|
|
61
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _layoutService: ILayoutService, _logService: ILogService, _univerInstanceService: IUniverInstanceService, _docSkeletonManagerService: DocSkeletonManagerService);
|
|
62
|
+
private _listenCurrentUnitChange;
|
|
63
|
+
get activeViewPort(): import('@univerjs/engine-render').Viewport;
|
|
62
64
|
setSegment(id: string): void;
|
|
63
65
|
getSegment(): string;
|
|
64
66
|
setSegmentPage(pageIndex: number): void;
|
|
65
67
|
getSegmentPage(): number;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
enableSelection(): void;
|
|
69
|
-
disableSelection(): void;
|
|
68
|
+
setReserveRangesStatus(status: boolean): void;
|
|
69
|
+
private _setRangeStyle;
|
|
70
70
|
addDocRanges(ranges: ISuccinctDocRangeParam[], isEditing?: boolean, options?: {
|
|
71
71
|
[key: string]: boolean;
|
|
72
72
|
}): void;
|
|
73
73
|
setCursorManually(evtOffsetX: number, evtOffsetY: number): void;
|
|
74
74
|
sync(): void;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated
|
|
77
|
+
*/
|
|
75
78
|
activate(x: number, y: number, force?: boolean): void;
|
|
76
79
|
hasFocus(): boolean;
|
|
77
80
|
focus(): void;
|
|
78
81
|
blur(): void;
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated
|
|
84
|
+
*/
|
|
79
85
|
focusEditor(): void;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated
|
|
88
|
+
*/
|
|
80
89
|
blurEditor(): void;
|
|
90
|
+
/**
|
|
91
|
+
* @deprecated
|
|
92
|
+
*/
|
|
81
93
|
deactivate(): void;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
__handleDblClick(evt: IPointerEvent | IMouseEvent): void;
|
|
95
|
+
__handleTripleClick(evt: IPointerEvent | IMouseEvent): void;
|
|
96
|
+
__onPointDown(evt: IPointerEvent | IMouseEvent): void;
|
|
85
97
|
removeAllRanges(): void;
|
|
86
98
|
getActiveTextRange(): TextRange | undefined;
|
|
87
99
|
private _setSystemHighlightColorToStyle;
|
|
@@ -96,6 +108,7 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
96
108
|
private _getNodePosition;
|
|
97
109
|
private _interactTextRanges;
|
|
98
110
|
private _interactRectRanges;
|
|
111
|
+
private _removeCollapsedTextRange;
|
|
99
112
|
private _removeAllRanges;
|
|
100
113
|
private _removeAllCacheRanges;
|
|
101
114
|
private _removeAllTextRanges;
|
|
@@ -112,7 +125,7 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
112
125
|
private _getCanvasOffset;
|
|
113
126
|
private _updateInputPosition;
|
|
114
127
|
private _moving;
|
|
115
|
-
|
|
128
|
+
__attachScrollEvent(): void;
|
|
116
129
|
private _initInputEvents;
|
|
117
130
|
private _eventHandle;
|
|
118
131
|
private _getTransformCoordForDocumentOffset;
|