@univerjs/docs-ui 0.2.8 → 0.2.9
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 +5 -5
- package/lib/es/index.js +575 -470
- package/lib/types/controllers/render-controllers/doc-checklist.render-controller.d.ts +5 -4
- package/lib/types/docs-ui-plugin.d.ts +0 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/doc-event-manager.service.d.ts +52 -0
- package/lib/types/services/doc-popup-manager.service.d.ts +8 -3
- package/lib/umd/index.js +5 -5
- package/package.json +13 -13
- package/lib/types/commands/commands/doc-tab.command.d.ts +0 -7
- package/lib/types/controllers/render-controllers/doc-hover.render-controller.d.ts +0 -10
- package/lib/types/services/doc-hover-manager.service.d.ts +0 -19
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
2
2
|
import { DocumentDataModel, Disposable, ICommandService } from '@univerjs/core';
|
|
3
|
-
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
4
|
-
import {
|
|
3
|
+
import { DocSkeletonManagerService, TextSelectionManagerService } from '@univerjs/docs';
|
|
4
|
+
import { DocEventManagerService } from '../../services/doc-event-manager.service';
|
|
5
5
|
export declare class DocChecklistRenderController extends Disposable implements IRenderModule {
|
|
6
6
|
private _context;
|
|
7
7
|
private readonly _docSkeletonManagerService;
|
|
8
8
|
private readonly _commandService;
|
|
9
|
-
private readonly
|
|
10
|
-
|
|
9
|
+
private readonly _docEventManagerService;
|
|
10
|
+
private readonly _textSelectionManagerService;
|
|
11
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService, _docEventManagerService: DocEventManagerService, _textSelectionManagerService: TextSelectionManagerService);
|
|
11
12
|
private _initPointerDownObserver;
|
|
12
13
|
private _initHoverCursor;
|
|
13
14
|
private _getTransformCoordForDocumentOffset;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export * from './services';
|
|
|
23
23
|
export { DocsRenderService } from './services/docs-render.service';
|
|
24
24
|
export { DocCanvasPopManagerService } from './services/doc-popup-manager.service';
|
|
25
25
|
export { docDrawingPositionToTransform, transformToDocDrawingPosition } from './basics/transform-position';
|
|
26
|
-
export {
|
|
26
|
+
export { DocEventManagerService } from './services/doc-event-manager.service';
|
|
27
27
|
export { DocUIController } from './controllers/doc-ui.controller';
|
|
28
28
|
export { DocCopyCommand, DocCutCommand, DocPasteCommand } from './commands/commands/clipboard.command';
|
|
29
29
|
export { DocCreateTableOperation } from './commands/operations/doc-create-table.operation';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DocumentDataModel, ICustomRange, IParagraph, Nullable, Disposable } from '@univerjs/core';
|
|
2
|
+
import { DocSkeletonManagerService } from '@univerjs/docs';
|
|
3
|
+
import { Documents, DocumentSkeleton, IBoundRectNoAngle, IDocumentSkeletonGlyph, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
|
+
export declare const calcDocGlyphPosition: (glyph: IDocumentSkeletonGlyph, documents: Documents, skeleton: DocumentSkeleton, pageIndex?: number) => IBoundRectNoAngle | undefined;
|
|
5
|
+
interface ICustomRangeActive {
|
|
6
|
+
range: ICustomRange;
|
|
7
|
+
segmentId?: string;
|
|
8
|
+
segmentPageIndex: number;
|
|
9
|
+
}
|
|
10
|
+
interface IBulletActive {
|
|
11
|
+
paragraph: IParagraph;
|
|
12
|
+
segmentId?: string;
|
|
13
|
+
segmentPageIndex: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class DocEventManagerService extends Disposable implements IRenderModule {
|
|
16
|
+
private _context;
|
|
17
|
+
private readonly _docSkeletonManagerService;
|
|
18
|
+
private readonly _hoverCustomRanges$;
|
|
19
|
+
readonly hoverCustomRanges$: import('rxjs').Observable<ICustomRangeActive[]>;
|
|
20
|
+
private readonly _clickCustomRanges$;
|
|
21
|
+
readonly clickCustomRanges$: import('rxjs').Observable<ICustomRangeActive>;
|
|
22
|
+
private readonly _hoverBullet$;
|
|
23
|
+
readonly hoverBullet$: import('rxjs').Observable<Nullable<IBulletActive>>;
|
|
24
|
+
private readonly _clickBullet$;
|
|
25
|
+
readonly clickBullets$: import('rxjs').Observable<IBulletActive>;
|
|
26
|
+
private _customRangeDirty;
|
|
27
|
+
private _bulletDirty;
|
|
28
|
+
/**
|
|
29
|
+
* cache the bounding of custom ranges,
|
|
30
|
+
* it will be updated when the doc-skeleton is recalculated
|
|
31
|
+
*/
|
|
32
|
+
private _customRangeBounds;
|
|
33
|
+
/**
|
|
34
|
+
* cache the bounding of bullets,
|
|
35
|
+
* it will be updated when the doc-skeleton is recalculated
|
|
36
|
+
*/
|
|
37
|
+
private _bulletBounds;
|
|
38
|
+
private get _skeleton();
|
|
39
|
+
private get _documents();
|
|
40
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService);
|
|
41
|
+
dispose(): void;
|
|
42
|
+
private _initPointer;
|
|
43
|
+
private _initResetDirty;
|
|
44
|
+
private _initEvents;
|
|
45
|
+
private _buildCustomRangeBoundsBySegment;
|
|
46
|
+
private _buildCustomRangeBounds;
|
|
47
|
+
private _calcActiveRanges;
|
|
48
|
+
private _buildBulletBoundsBySegment;
|
|
49
|
+
private _buildBulletBounds;
|
|
50
|
+
private _calcActiveBullet;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { IDisposable,
|
|
2
|
-
import { IRenderManagerService, BaseObject, IBoundRectNoAngle, Scene } from '@univerjs/engine-render';
|
|
1
|
+
import { IDisposable, ITextRangeParam, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { IRenderManagerService, BaseObject, IBoundRectNoAngle, IRender, Scene } from '@univerjs/engine-render';
|
|
3
3
|
import { IPopup, ICanvasPopupService } from '@univerjs/ui';
|
|
4
4
|
export declare function transformBound2OffsetBound(originBound: IBoundRectNoAngle, scene: Scene): IBoundRectNoAngle;
|
|
5
5
|
export declare function transformPosition2Offset(x: number, y: number, scene: Scene): {
|
|
6
6
|
x: number;
|
|
7
7
|
y: number;
|
|
8
8
|
};
|
|
9
|
+
export declare function transformOffset2Bound(offsetX: number, offsetY: number, scene: Scene): {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
9
13
|
export interface IDocCanvasPopup extends Pick<IPopup, 'direction' | 'excludeOutside' | 'closeOnSelfTarget' | 'componentKey' | 'offset' | 'onClickOutside' | 'hideOnInvisible'> {
|
|
10
14
|
mask?: boolean;
|
|
11
15
|
extraProps?: Record<string, any>;
|
|
12
16
|
}
|
|
17
|
+
export declare const calcDocRangePositions: (range: ITextRangeParam, currentRender: IRender) => IBoundRectNoAngle[] | undefined;
|
|
13
18
|
export declare class DocCanvasPopManagerService extends Disposable {
|
|
14
19
|
private readonly _globalPopupManagerService;
|
|
15
20
|
private readonly _renderManagerService;
|
|
@@ -25,5 +30,5 @@ export declare class DocCanvasPopManagerService extends Disposable {
|
|
|
25
30
|
* @returns disposable
|
|
26
31
|
*/
|
|
27
32
|
attachPopupToObject(targetObject: BaseObject, popup: IDocCanvasPopup): IDisposable;
|
|
28
|
-
attachPopupToRange(range:
|
|
33
|
+
attachPopupToRange(range: ITextRangeParam, popup: IDocCanvasPopup): IDisposable;
|
|
29
34
|
}
|