@univerjs-pro/boards-ui 1.0.0-beta.0 → 1.0.0-beta.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/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/cjs/shape-preset-labels-C4G0G9GI.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/es/shape-preset-labels-092BdVw3.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.css +45 -40
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/shape-preset-labels-092BdVw3.js +1 -1
- package/lib/types/commands/commands/analyze-board-rendered-layout.command.d.ts +2 -1
- package/lib/types/commands/operations/board-chart-dialog.operation.d.ts +2 -2
- package/lib/types/commands/operations/board-pointer.operation.d.ts +8 -0
- package/lib/types/commands/operations/board-selection.operation.d.ts +4 -2
- package/lib/types/commands/operations/board-ui-control.operation.d.ts +30 -0
- package/lib/types/common/board-shortcuts.d.ts +1 -3
- package/lib/types/config/config.d.ts +29 -2
- package/lib/types/const.d.ts +2 -0
- package/lib/types/controllers/board-clipboard-shortcut.controller.d.ts +2 -21
- package/lib/types/controllers/board-connector-interaction.render-controller.d.ts +1 -0
- package/lib/types/controllers/board-element-selection.controller.d.ts +1 -0
- package/lib/types/controllers/board-element-transform.controller.d.ts +3 -0
- package/lib/types/controllers/board-element-transformer-config.util.d.ts +22 -21
- package/lib/types/controllers/board-grouping-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-history-shortcut.controller.d.ts +2 -8
- package/lib/types/controllers/board-layout-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-order-shortcut.controller.d.ts +2 -10
- package/lib/types/controllers/board-render.controller.d.ts +1 -0
- package/lib/types/controllers/board-selection-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-settings-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-shape-text-float-menu.render-controller.d.ts +5 -4
- package/lib/types/controllers/board-swimlane-lane-shortcut.controller.d.ts +5 -17
- package/lib/types/controllers/board-tool-shortcut.controller.d.ts +5 -16
- package/lib/types/controllers/board-unit-presence.controller.d.ts +6 -0
- package/lib/types/controllers/board-unit-presence.render-controller.d.ts +37 -0
- package/lib/types/controllers/board-view-shortcut.controller.d.ts +2 -23
- package/lib/types/controllers/board-viewport-bar.render-controller.d.ts +43 -0
- package/lib/types/controllers/board-viewport-input.render-controller.d.ts +8 -0
- package/lib/types/facade/f-board-ui.d.ts +19 -0
- package/lib/types/facade/index.d.ts +1 -0
- package/lib/types/index.d.ts +9 -4
- package/lib/types/locale/en-US.d.ts +2 -0
- package/lib/types/plugin.d.ts +7 -0
- package/lib/types/render-adapters/board-element-render-adapter.d.ts +3 -2
- package/lib/types/render-objects/board-connector-object.d.ts +17 -5
- package/lib/types/render-objects/board-shape-object.d.ts +1 -0
- package/lib/types/render-objects/board-viewport-bar-object.d.ts +33 -0
- package/lib/types/services/board-canvas-pop-manager.service.d.ts +3 -1
- package/lib/types/services/board-clipboard.service.d.ts +10 -3
- package/lib/types/services/board-element-edit.service.d.ts +2 -0
- package/lib/types/services/board-embed-integration.service.d.ts +9 -0
- package/lib/types/services/board-find.service.d.ts +1 -0
- package/lib/types/services/board-image-insert.service.d.ts +3 -1
- package/lib/types/services/board-pointer-state.service.d.ts +21 -0
- package/lib/types/services/board-screenshot.service.d.ts +3 -1
- package/lib/types/services/board-settings-menu-contribution.service.d.ts +37 -0
- package/lib/types/services/board-settings.service.d.ts +3 -5
- package/lib/types/services/board-shortcut-runtime.service.d.ts +32 -0
- package/lib/types/services/board-text-editing.service.d.ts +9 -4
- package/lib/types/services/board-tool.service.d.ts +3 -1
- package/lib/types/services/board-toolbar-contribution.service.d.ts +3 -2
- package/lib/types/services/board-ui-state.service.d.ts +2 -1
- package/lib/types/services/board-unit-presence-ui-adapter.service.d.ts +32 -0
- package/lib/types/services/board-viewport.service.d.ts +2 -1
- package/lib/types/utils/board-connector-hit-test.util.d.ts +2 -0
- package/lib/types/utils/board-connector-marker-anchor.util.d.ts +0 -1
- package/lib/types/utils/board-connector-marker.util.d.ts +21 -0
- package/lib/types/utils/board-connector-quick-connect.util.d.ts +1 -0
- package/lib/types/utils/board-connector-render-bounds.util.d.ts +0 -1
- package/lib/types/utils/board-connector-render-geometry.util.d.ts +33 -0
- package/lib/types/utils/board-connector-routing.util.d.ts +13 -1
- package/lib/types/utils/board-page-background-image.util.d.ts +15 -0
- package/lib/types/utils/board-render-page.util.d.ts +10 -5
- package/lib/types/utils/board-shortcut-preconditions.util.d.ts +4 -2
- package/lib/types/utils/board-viewport-bar.util.d.ts +55 -0
- package/lib/types/utils/board-viewport.util.d.ts +1 -0
- package/lib/types/views/BoardConnectorFloatingToolbarControls.d.ts +8 -2
- package/lib/types/views/BoardFloatingToolPanel.d.ts +1 -0
- package/lib/types/views/BoardPageBackgroundView.d.ts +8 -0
- package/lib/types/views/BoardSettingsMenu.d.ts +14 -0
- package/lib/types/views/BoardShapeFloatingToolbar.d.ts +2 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +19 -19
|
@@ -2,7 +2,8 @@ import type { IBoardConnectorElement, IBoardConnectorPoint, IBoardElementData }
|
|
|
2
2
|
import type { IDocumentData, LocaleService } from '@univerjs/core';
|
|
3
3
|
import type { IObjectFullState, IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
|
|
4
4
|
import type { IBoardConnectorLabelRect } from '../utils/board-connector-label.util';
|
|
5
|
-
import type {
|
|
5
|
+
import type { IBoardConnectorRenderGeometry } from '../utils/board-connector-render-geometry.util';
|
|
6
|
+
import type { BoardConnectorPathCommand, BoardConnectorRoutingCache } from '../utils/board-connector-routing.util';
|
|
6
7
|
import { BaseObject } from '@univerjs/engine-render';
|
|
7
8
|
import { resolveBoardConnectorPathBounds, resolveBoardConnectorPathCommands, resolveBoardConnectorRoutePoints } from '../utils/board-connector-routing.util';
|
|
8
9
|
export interface IBoardConnectorObjectProps {
|
|
@@ -24,6 +25,12 @@ export interface IBoardConnectorRouteCache {
|
|
|
24
25
|
routePoints: ReturnType<typeof resolveBoardConnectorRoutePoints>;
|
|
25
26
|
pathCommands: ReturnType<typeof resolveBoardConnectorPathCommands>;
|
|
26
27
|
bounds: ReturnType<typeof resolveBoardConnectorPathBounds>;
|
|
28
|
+
renderGeometry: IBoardConnectorRenderGeometry | null;
|
|
29
|
+
}
|
|
30
|
+
export interface IBoardConnectorObjectUpdateOptions {
|
|
31
|
+
preserveLineJumpCache?: boolean;
|
|
32
|
+
routeCache?: IBoardConnectorRouteCache;
|
|
33
|
+
skipLineJumps?: boolean;
|
|
27
34
|
}
|
|
28
35
|
interface IBoardConnectorLineJump {
|
|
29
36
|
x: number;
|
|
@@ -37,7 +44,9 @@ export declare class BoardConnectorLineJumpCache {
|
|
|
37
44
|
private readonly _routePointsByConnectorId;
|
|
38
45
|
private readonly _lineJumpsByConnectorId;
|
|
39
46
|
constructor(_resolveRoutePoints?: BoardConnectorRouteResolver);
|
|
40
|
-
invalidate(elementData?: Record<string, IBoardElementData
|
|
47
|
+
invalidate(elementData?: Record<string, IBoardElementData>, options?: {
|
|
48
|
+
force?: boolean;
|
|
49
|
+
}): void;
|
|
41
50
|
resolveLineJumpsForRoute(connectorId: string, routePoints: readonly IBoardConnectorPoint[]): readonly IBoardConnectorLineJump[][];
|
|
42
51
|
private _clear;
|
|
43
52
|
private _getRoutePoints;
|
|
@@ -51,28 +60,32 @@ export declare class BoardConnectorObject extends BaseObject {
|
|
|
51
60
|
private readonly _routingCache?;
|
|
52
61
|
private readonly _documentTextRenderCache;
|
|
53
62
|
private _routeCache;
|
|
63
|
+
private _labelGeometryCache;
|
|
54
64
|
private _routeStabilityHint;
|
|
55
65
|
private _isEditingLabel;
|
|
66
|
+
private _skipLineJumps;
|
|
56
67
|
isDrawingObject: boolean;
|
|
57
68
|
constructor(key: string, props: IBoardConnectorObjectProps);
|
|
58
|
-
updateElement(element: IBoardConnectorElement, elementData?: Record<string, IBoardElementData
|
|
69
|
+
updateElement(element: IBoardConnectorElement, elementData?: Record<string, IBoardElementData>, options?: IBoardConnectorObjectUpdateOptions): void;
|
|
59
70
|
getElement(): IBoardConnectorElement;
|
|
60
71
|
setEditing(isEditing: boolean): void;
|
|
61
72
|
getRoutePoints(): IBoardConnectorPoint[];
|
|
62
73
|
getCachedRoutePoints(): readonly IBoardConnectorPoint[] | null;
|
|
63
|
-
getPathCommands():
|
|
74
|
+
getPathCommands(): BoardConnectorPathCommand[];
|
|
64
75
|
getRenderBounds(): ReturnType<typeof resolveBoardConnectorPathBounds>;
|
|
65
76
|
getLabelPathPoints(): IBoardConnectorPoint[];
|
|
66
77
|
getLabelRect(): IBoardConnectorLabelRect | null;
|
|
67
78
|
measureLabelNaturalHeight(width: number, documentData?: IDocumentData): number | null;
|
|
68
79
|
isLabelHit(point: IBoardConnectorPoint): boolean;
|
|
69
80
|
private _getRouteCache;
|
|
81
|
+
private _getLabelGeometry;
|
|
70
82
|
private _getRenderBounds;
|
|
71
83
|
private _getCurrentRouteStabilityHint;
|
|
72
84
|
private _shouldUseRouteStabilityHint;
|
|
73
85
|
transformByState(option: IObjectFullState): this;
|
|
74
86
|
isHit(coord: Vector2): boolean;
|
|
75
87
|
hitTest(point: IBoardConnectorPoint): boolean;
|
|
88
|
+
getRenderGeometry(): IBoardConnectorRenderGeometry | null;
|
|
76
89
|
render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
|
|
77
90
|
private _clipRouteAroundLabel;
|
|
78
91
|
private _drawRoute;
|
|
@@ -80,7 +93,6 @@ export declare class BoardConnectorObject extends BaseObject {
|
|
|
80
93
|
private _drawRouteWithLineJumps;
|
|
81
94
|
private _drawPathCommands;
|
|
82
95
|
private _drawMarkers;
|
|
83
|
-
private _resolveEndpointVisualGap;
|
|
84
96
|
private _drawLabel;
|
|
85
97
|
private _drawLabelFrame;
|
|
86
98
|
}
|
|
@@ -60,6 +60,7 @@ export declare class BoardShapeObject extends Shape<IBoardShapeObjectProps> {
|
|
|
60
60
|
transformByState(option: IObjectFullState): this;
|
|
61
61
|
setEditing(isEditing: boolean): void;
|
|
62
62
|
setFillImage(image?: HTMLImageElement): void;
|
|
63
|
+
isImageFillLoaded(): boolean;
|
|
63
64
|
private _refreshFillImage;
|
|
64
65
|
getTextRect(width: number, height: number): IShapeRect;
|
|
65
66
|
_draw(ctx: UniverRenderingContext, _bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
|
|
2
|
+
import type { IBoardViewportBarRect } from '../utils/board-viewport-bar.util';
|
|
3
|
+
import { BaseObject } from '@univerjs/engine-render';
|
|
4
|
+
export type BoardViewportBarAxis = 'horizontal' | 'vertical';
|
|
5
|
+
export interface IBoardViewportBarObjectState {
|
|
6
|
+
activeAxis: BoardViewportBarAxis | null;
|
|
7
|
+
activeColor: string;
|
|
8
|
+
activeOpacity: number;
|
|
9
|
+
barSize: number;
|
|
10
|
+
hitSize: number;
|
|
11
|
+
horizontalRect: IBoardViewportBarRect | null;
|
|
12
|
+
hoverAxis: BoardViewportBarAxis | null;
|
|
13
|
+
hoverColor: string;
|
|
14
|
+
hoverOpacity: number;
|
|
15
|
+
idleColor: string;
|
|
16
|
+
idleOpacity: number;
|
|
17
|
+
verticalRect: IBoardViewportBarRect | null;
|
|
18
|
+
zoomRatio: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const BOARD_VIEWPORT_BAR_OBJECT_KEY = "board-viewport-bar-object";
|
|
21
|
+
export declare const BOARD_VIEWPORT_BAR_OBJECT_LAYER_INDEX: 8;
|
|
22
|
+
type BoardViewportBarPoint = Pick<Vector2, 'x' | 'y'>;
|
|
23
|
+
export declare class BoardViewportBarObject extends BaseObject {
|
|
24
|
+
private _state;
|
|
25
|
+
constructor(key: string | undefined, state: IBoardViewportBarObjectState);
|
|
26
|
+
getBarState(): IBoardViewportBarObjectState;
|
|
27
|
+
updateState(state: Partial<IBoardViewportBarObjectState>): void;
|
|
28
|
+
resolveHitAxis(coord: BoardViewportBarPoint): BoardViewportBarAxis | null;
|
|
29
|
+
isHit(coord: Vector2): boolean;
|
|
30
|
+
render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
|
|
31
|
+
private _syncVisibility;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -4,6 +4,7 @@ import type { IPopup } from '@univerjs/ui';
|
|
|
4
4
|
import { Disposable } from '@univerjs/core';
|
|
5
5
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
6
6
|
import { ICanvasPopupService } from '@univerjs/ui';
|
|
7
|
+
import { IBoardUIStateService } from './board-ui-state.service';
|
|
7
8
|
export interface IBoardCanvasPopup extends Pick<IPopup, 'componentKey' | 'direction' | 'excludeOutside' | 'hideOnInvisible' | 'offset' | 'onClickOutside'> {
|
|
8
9
|
anchorBoundResolver?: (targetObject: BaseObject) => IBoundRectNoAngle;
|
|
9
10
|
extraProps?: Record<string, unknown>;
|
|
@@ -12,7 +13,8 @@ export interface IBoardCanvasPopup extends Pick<IPopup, 'componentKey' | 'direct
|
|
|
12
13
|
export declare class BoardCanvasPopManagerService extends Disposable {
|
|
13
14
|
private readonly _globalPopupManagerService;
|
|
14
15
|
private readonly _renderManagerService;
|
|
15
|
-
|
|
16
|
+
private readonly _boardUIStateService;
|
|
17
|
+
constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _boardUIStateService: IBoardUIStateService);
|
|
16
18
|
private _createObjectPositionObserver;
|
|
17
19
|
attachPopupToObject(unitId: string, subUnitId: string, targetObject: BaseObject, popup: IBoardCanvasPopup): IDisposable;
|
|
18
20
|
attachPopupToPoint(unitId: string, subUnitId: string, point: {
|
|
@@ -29,15 +29,22 @@ export interface IBoardCopySelectionAsImageOptions {
|
|
|
29
29
|
};
|
|
30
30
|
padding?: number;
|
|
31
31
|
}
|
|
32
|
+
export declare class BoardClipboardStoreService {
|
|
33
|
+
private _payload;
|
|
34
|
+
private _stylePayload;
|
|
35
|
+
setPayload(payload: IBoardClipboardPayload | null | undefined): void;
|
|
36
|
+
getPayload(): IBoardClipboardPayload | null;
|
|
37
|
+
setStylePayload(payload: IBoardElementStylePayload | null | undefined): void;
|
|
38
|
+
getStylePayload(): IBoardElementStylePayload | null;
|
|
39
|
+
}
|
|
32
40
|
export declare class BoardClipboardService {
|
|
33
41
|
private readonly _boardElementService;
|
|
34
42
|
private readonly _elementInsertService;
|
|
35
43
|
private readonly _resourceAdapterService;
|
|
36
44
|
private readonly _commandService;
|
|
37
45
|
private readonly _undoRedoService;
|
|
38
|
-
private
|
|
39
|
-
|
|
40
|
-
constructor(_boardElementService: IBoardElementService, _elementInsertService: BoardElementInsertService, _resourceAdapterService: IBoardClipboardResourceAdapterService, _commandService: ICommandService, _undoRedoService: IUndoRedoService);
|
|
46
|
+
private readonly _storeService;
|
|
47
|
+
constructor(_boardElementService: IBoardElementService, _elementInsertService: BoardElementInsertService, _resourceAdapterService: IBoardClipboardResourceAdapterService, _commandService: ICommandService, _undoRedoService: IUndoRedoService, _storeService: BoardClipboardStoreService);
|
|
41
48
|
setPayload(payload: IBoardClipboardPayload | null | undefined): void;
|
|
42
49
|
getPayload(): IBoardClipboardPayload | null;
|
|
43
50
|
setStylePayload(payload: IBoardElementStylePayload | null | undefined): void;
|
|
@@ -39,6 +39,7 @@ export interface IBoardElementUpdateSelectedConnectorLabelOptions {
|
|
|
39
39
|
selectedIds: string[];
|
|
40
40
|
focusedId?: string | null;
|
|
41
41
|
label: IBoardConnectorLabel;
|
|
42
|
+
historyId?: string;
|
|
42
43
|
}
|
|
43
44
|
export interface IBoardElementWrapSelectedInContainerOptions {
|
|
44
45
|
selectedIds: string[];
|
|
@@ -80,6 +81,7 @@ export interface IBoardElementUpdateElementsOptions {
|
|
|
80
81
|
unitId: string;
|
|
81
82
|
subUnitId: string;
|
|
82
83
|
updates: IBoardElementUpdateElementsOperationItem[];
|
|
84
|
+
historyId?: string;
|
|
83
85
|
forceCaptureElementIds?: readonly string[];
|
|
84
86
|
membershipMode?: BoardContainerMembershipUpdateMode;
|
|
85
87
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { UniverInstanceType } from '@univerjs/core';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
1
3
|
/**
|
|
2
4
|
* Optional host-side bridge supplied by Embed UI.
|
|
3
5
|
*
|
|
@@ -5,6 +7,13 @@
|
|
|
5
7
|
* prevent the host canvas from reclaiming focus for a child-owned pointer event.
|
|
6
8
|
*/
|
|
7
9
|
export interface IBoardEmbedRuntimeFocusCoordinator {
|
|
10
|
+
readonly runtimeSessionChanged$?: Observable<void>;
|
|
11
|
+
resolveRuntimeScopeByChildUnitId?(childUnitId: string | undefined): {
|
|
12
|
+
embedId: string;
|
|
13
|
+
hostUnitId?: string;
|
|
14
|
+
childUnitId?: string;
|
|
15
|
+
childType?: UniverInstanceType;
|
|
16
|
+
} | undefined;
|
|
8
17
|
shouldSuppressHostInteraction(unitId: string | undefined, target?: EventTarget | null, event?: Event): boolean;
|
|
9
18
|
}
|
|
10
19
|
export declare const IBoardEmbedRuntimeFocusCoordinator: import("@wendellhu/redi").IdentifierDecorator<IBoardEmbedRuntimeFocusCoordinator>;
|
|
@@ -18,5 +18,6 @@ export declare class BoardFindService {
|
|
|
18
18
|
selectElementResult(boardModel: BoardModel | null | undefined, elementId: string): boolean;
|
|
19
19
|
selectResult(boardModel: BoardModel | null | undefined, elementId: string): boolean;
|
|
20
20
|
focusElementResult(boardModel: BoardModel | null | undefined, elementId: string, viewportPoint: IBoardViewportPoint): boolean;
|
|
21
|
+
getElementViewportPoint(boardModel: BoardModel | null | undefined, elementId: string): IBoardViewportPoint | null;
|
|
21
22
|
focusResult(boardModel: BoardModel | null | undefined, elementId: string, viewportPoint: IBoardViewportPoint): boolean;
|
|
22
23
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IConfigService, IImageIoService, ImageSourceType, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { BoardElementInsertService } from './board-element-insert.service';
|
|
3
|
+
import { BoardViewportService } from './board-viewport.service';
|
|
3
4
|
export interface IBoardImageInsertOptions {
|
|
4
5
|
point?: {
|
|
5
6
|
x: number;
|
|
@@ -10,8 +11,9 @@ export declare class BoardImageInsertService {
|
|
|
10
11
|
private readonly _instanceService;
|
|
11
12
|
private readonly _elementInsertService;
|
|
12
13
|
private readonly _configService;
|
|
14
|
+
private readonly _viewportService;
|
|
13
15
|
private readonly _imageIoService?;
|
|
14
|
-
constructor(_instanceService: IUniverInstanceService, _elementInsertService: BoardElementInsertService, _configService: IConfigService, _imageIoService?: IImageIoService | undefined);
|
|
16
|
+
constructor(_instanceService: IUniverInstanceService, _elementInsertService: BoardElementInsertService, _configService: IConfigService, _viewportService: BoardViewportService, _imageIoService?: IImageIoService | undefined);
|
|
15
17
|
insertImage(file: File, options?: IBoardImageInsertOptions): Promise<boolean>;
|
|
16
18
|
resolveImageSource(file: File): Promise<{
|
|
17
19
|
source: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Observable } from 'rxjs';
|
|
2
|
+
import type { IBoardViewportPoint } from '../utils/board-viewport.util';
|
|
3
|
+
import { Disposable } from '@univerjs/core';
|
|
4
|
+
export interface IBoardPointerStateSnapshot {
|
|
5
|
+
unitId: string;
|
|
6
|
+
subUnitId: string;
|
|
7
|
+
pointer: IBoardViewportPoint | null;
|
|
8
|
+
}
|
|
9
|
+
export interface IBoardPointerStateService {
|
|
10
|
+
readonly state$: Observable<IBoardPointerStateSnapshot | null>;
|
|
11
|
+
getSnapshot(): IBoardPointerStateSnapshot | null;
|
|
12
|
+
setPointer(state: IBoardPointerStateSnapshot): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const IBoardPointerStateService: import("@wendellhu/redi").IdentifierDecorator<IBoardPointerStateService>;
|
|
15
|
+
export declare class BoardPointerStateService extends Disposable implements IBoardPointerStateService {
|
|
16
|
+
private readonly _state$;
|
|
17
|
+
readonly state$: Observable<IBoardPointerStateSnapshot | null>;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
getSnapshot(): IBoardPointerStateSnapshot | null;
|
|
20
|
+
setPointer(state: IBoardPointerStateSnapshot): void;
|
|
21
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { IBoardRect } from '@univerjs-pro/boards';
|
|
|
2
2
|
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
3
3
|
import { IShapeHostAdapterRegistry } from '@univerjs-pro/engine-shape';
|
|
4
4
|
import { ShapeFormulaService } from '@univerjs-pro/shape-editor';
|
|
5
|
+
import { IUniverInstanceService } from '@univerjs/core';
|
|
5
6
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
6
7
|
import { IBoardElementStateService } from './board-element-state.service';
|
|
7
8
|
import { IBoardUIStateService } from './board-ui-state.service';
|
|
@@ -27,7 +28,8 @@ export declare class BoardScreenshotService {
|
|
|
27
28
|
private readonly _renderManagerService;
|
|
28
29
|
private readonly _shapeHostAdapterRegistry;
|
|
29
30
|
private readonly _shapeFormulaService;
|
|
30
|
-
|
|
31
|
+
private readonly _univerInstanceService;
|
|
32
|
+
constructor(_boardElementService: IBoardElementService, _boardElementStateService: IBoardElementStateService, _boardUIStateService: IBoardUIStateService, _renderManagerService: IRenderManagerService, _shapeHostAdapterRegistry: IShapeHostAdapterRegistry, _shapeFormulaService: ShapeFormulaService, _univerInstanceService: IUniverInstanceService);
|
|
31
33
|
capture(unitId: string, subUnitId: string, options: IBoardScreenshotOptions): Promise<IBoardScreenshotResult | false>;
|
|
32
34
|
private _prepareCaptureState;
|
|
33
35
|
private _restoreCaptureState;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ICommandService, IDisposable } from '@univerjs/core';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import type { Observable } from 'rxjs';
|
|
4
|
+
import { Disposable } from '@univerjs/core';
|
|
5
|
+
export type BoardSettingsMenuContributionGroup = 'import' | 'output';
|
|
6
|
+
export declare enum BoardSettingsMenuContributionSubmenu {
|
|
7
|
+
SaveAs = "save-as"
|
|
8
|
+
}
|
|
9
|
+
export interface IBoardSettingsMenuContribution {
|
|
10
|
+
id: string;
|
|
11
|
+
icon: ComponentType<{
|
|
12
|
+
className?: string;
|
|
13
|
+
}>;
|
|
14
|
+
label: () => string;
|
|
15
|
+
order: number;
|
|
16
|
+
group: BoardSettingsMenuContributionGroup;
|
|
17
|
+
submenu?: BoardSettingsMenuContributionSubmenu;
|
|
18
|
+
menuItemId?: string;
|
|
19
|
+
enabled?: boolean | (() => boolean);
|
|
20
|
+
onClick: (commandService: ICommandService) => void | Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export interface IBoardSettingsMenuContributionService {
|
|
23
|
+
readonly contributions$: Observable<readonly IBoardSettingsMenuContribution[]>;
|
|
24
|
+
register(contribution: IBoardSettingsMenuContribution): IDisposable;
|
|
25
|
+
getAll(): readonly IBoardSettingsMenuContribution[];
|
|
26
|
+
}
|
|
27
|
+
export declare const IBoardSettingsMenuContributionService: import("@wendellhu/redi").IdentifierDecorator<IBoardSettingsMenuContributionService>;
|
|
28
|
+
export declare class BoardSettingsMenuContributionService extends Disposable implements IBoardSettingsMenuContributionService {
|
|
29
|
+
private readonly _registrations;
|
|
30
|
+
private readonly _contributions$;
|
|
31
|
+
private _registrationIndex;
|
|
32
|
+
readonly contributions$: Observable<readonly IBoardSettingsMenuContribution[]>;
|
|
33
|
+
register(contribution: IBoardSettingsMenuContribution): IDisposable;
|
|
34
|
+
getAll(): readonly IBoardSettingsMenuContribution[];
|
|
35
|
+
dispose(): void;
|
|
36
|
+
private _publish;
|
|
37
|
+
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type { BoardModel
|
|
1
|
+
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardSettings } from '../config/config';
|
|
2
3
|
import { ICommandService, ThemeService } from '@univerjs/core';
|
|
3
|
-
import { IBoardUIStateService } from './board-ui-state.service';
|
|
4
4
|
export declare class BoardSettingsService {
|
|
5
5
|
private readonly _commandService;
|
|
6
|
-
private readonly _stateService;
|
|
7
6
|
private readonly _themeService;
|
|
8
|
-
constructor(_commandService: ICommandService,
|
|
7
|
+
constructor(_commandService: ICommandService, _themeService: ThemeService);
|
|
9
8
|
setSettings(boardModel: BoardModel | null | undefined, settings: Partial<IBoardSettings>): Promise<boolean>;
|
|
10
9
|
setTheme(boardModel: BoardModel | null | undefined, themeId: string): Promise<boolean>;
|
|
11
10
|
syncFollowUniverTheme(boardModel: BoardModel | null | undefined): Promise<boolean>;
|
|
12
|
-
syncFromBoardModel(boardModel: BoardModel | null | undefined): void;
|
|
13
11
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IAccessor, IExecutionOptions } from '@univerjs/core';
|
|
3
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
|
+
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
5
|
+
import { Disposable, ICommandService, IConfigService, IUniverInstanceService } from '@univerjs/core';
|
|
6
|
+
import { BoardClipboardService } from './board-clipboard.service';
|
|
7
|
+
import { BoardElementEditService } from './board-element-edit.service';
|
|
8
|
+
import { IBoardElementStateService } from './board-element-state.service';
|
|
9
|
+
import { BoardSettingsService } from './board-settings.service';
|
|
10
|
+
import { BoardSwimlaneLaneRenameService } from './board-swimlane-lane-rename.service';
|
|
11
|
+
import { BoardTextEditingService } from './board-text-editing.service';
|
|
12
|
+
import { BoardToolService } from './board-tool.service';
|
|
13
|
+
import { IBoardUIStateService } from './board-ui-state.service';
|
|
14
|
+
import { BoardViewportService } from './board-viewport.service';
|
|
15
|
+
export declare class BoardShortcutRuntimeService extends Disposable implements IRenderModule {
|
|
16
|
+
readonly renderContext: IRenderContext<BoardModel>;
|
|
17
|
+
readonly instanceService: IUniverInstanceService;
|
|
18
|
+
readonly commandService: ICommandService;
|
|
19
|
+
readonly configService: IConfigService;
|
|
20
|
+
readonly elementService: IBoardElementService;
|
|
21
|
+
readonly elementStateService: IBoardElementStateService;
|
|
22
|
+
readonly uiStateService: IBoardUIStateService;
|
|
23
|
+
readonly clipboardService: BoardClipboardService;
|
|
24
|
+
readonly elementEditService: BoardElementEditService;
|
|
25
|
+
readonly settingsService: BoardSettingsService;
|
|
26
|
+
readonly swimlaneLaneRenameService: BoardSwimlaneLaneRenameService;
|
|
27
|
+
readonly textEditingService: BoardTextEditingService;
|
|
28
|
+
readonly toolService: BoardToolService;
|
|
29
|
+
readonly viewportService: BoardViewportService;
|
|
30
|
+
constructor(renderContext: IRenderContext<BoardModel>, instanceService: IUniverInstanceService, commandService: ICommandService, configService: IConfigService, elementService: IBoardElementService, elementStateService: IBoardElementStateService, uiStateService: IBoardUIStateService, clipboardService: BoardClipboardService, elementEditService: BoardElementEditService, settingsService: BoardSettingsService, swimlaneLaneRenameService: BoardSwimlaneLaneRenameService, textEditingService: BoardTextEditingService, toolService: BoardToolService, viewportService: BoardViewportService);
|
|
31
|
+
}
|
|
32
|
+
export declare function resolveBoardShortcutRuntime(accessor: IAccessor, options?: IExecutionOptions): BoardShortcutRuntimeService | null;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import type { IShapeTextEditingParams, IShapeTextHostSizeUpdateParams, IShapeTextUpdateParams } from '@univerjs-pro/shape-editor-ui';
|
|
2
1
|
import type { Nullable } from '@univerjs/core';
|
|
3
2
|
import type { Observable } from 'rxjs';
|
|
4
3
|
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
|
+
import * as ShapeEditorUI from '@univerjs-pro/shape-editor-ui';
|
|
5
5
|
import { Disposable } from '@univerjs/core';
|
|
6
6
|
import { BoardElementEditService } from './board-element-edit.service';
|
|
7
7
|
import { BoardShapeIntrinsicSizeService } from './board-shape-intrinsic-size.service';
|
|
8
|
-
export interface IBoardTextEditingParams extends IShapeTextEditingParams {
|
|
8
|
+
export interface IBoardTextEditingParams extends ShapeEditorUI.IShapeTextEditingParams {
|
|
9
9
|
unitId: string;
|
|
10
10
|
subUnitId: string;
|
|
11
11
|
shapeId: string;
|
|
12
12
|
shapeKey: string;
|
|
13
13
|
visible: boolean;
|
|
14
14
|
}
|
|
15
|
+
type IBoardTextEditingKeyParams = Pick<IBoardTextEditingParams, 'shapeId' | 'subUnitId' | 'unitId'>;
|
|
15
16
|
export declare class BoardTextEditingService extends Disposable {
|
|
16
17
|
private readonly _boardElementService;
|
|
17
18
|
private readonly _editService;
|
|
@@ -23,18 +24,20 @@ export declare class BoardTextEditingService extends Disposable {
|
|
|
23
24
|
private _ignoreExternalFocusChangesUntil;
|
|
24
25
|
private _discardEditingKey;
|
|
25
26
|
private _externalCompletionPointerDownEvent;
|
|
27
|
+
private _connectorLabelHistory;
|
|
26
28
|
constructor(_boardElementService: IBoardElementService, _editService: BoardElementEditService, _intrinsicSizeService: BoardShapeIntrinsicSizeService);
|
|
27
29
|
dispose(): void;
|
|
28
30
|
setEditing(params: Nullable<IBoardTextEditingParams>): void;
|
|
29
31
|
setOnSavingEditorData(params: Nullable<boolean>): void;
|
|
30
32
|
getEditing(): Nullable<IBoardTextEditingParams>;
|
|
33
|
+
markConnectorLabelInsertion(params: IBoardTextEditingKeyParams, historyId: string): void;
|
|
31
34
|
ignoreExternalFocusChanges(duration?: number): void;
|
|
32
35
|
shouldIgnoreExternalFocusChanges(): boolean;
|
|
33
36
|
completeEditing(event?: PointerEvent): void;
|
|
34
37
|
shouldIgnoreSelectionPointerDown(evt: Event): boolean;
|
|
35
38
|
cancelEditing(): void;
|
|
36
|
-
updateShapeText(params: IShapeTextUpdateParams): boolean;
|
|
37
|
-
updatePlainTextShapeHostSize(params: IShapeTextHostSizeUpdateParams): boolean;
|
|
39
|
+
updateShapeText(params: ShapeEditorUI.IShapeTextUpdateParams): boolean;
|
|
40
|
+
updatePlainTextShapeHostSize(params: ShapeEditorUI.IShapeTextHostSizeUpdateParams): boolean;
|
|
38
41
|
private _updateConnectorLabelText;
|
|
39
42
|
private _resolveHostSize;
|
|
40
43
|
private _resolveConnectorLabelHostSize;
|
|
@@ -43,3 +46,5 @@ export declare class BoardTextEditingService extends Disposable {
|
|
|
43
46
|
private _ensureConnectorLabel;
|
|
44
47
|
private _shouldDiscardEditorUpdate;
|
|
45
48
|
}
|
|
49
|
+
export declare function areBoardShapeTextValuesEquivalent(first: unknown, second: unknown): boolean;
|
|
50
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import type { IBoardPendingInsert } from './board-ui-state.service';
|
|
|
3
3
|
import { BoardToolType } from '@univerjs-pro/boards';
|
|
4
4
|
import { ICommandService, IConfigService, IUniverInstanceService } from '@univerjs/core';
|
|
5
5
|
import { IBoardUIStateService } from './board-ui-state.service';
|
|
6
|
+
import { BoardViewportService } from './board-viewport.service';
|
|
6
7
|
export interface IBoardTableInsertOptions {
|
|
7
8
|
rows?: number;
|
|
8
9
|
columns?: number;
|
|
@@ -29,7 +30,8 @@ export declare class BoardToolService {
|
|
|
29
30
|
private readonly _commandService;
|
|
30
31
|
private readonly _instanceService;
|
|
31
32
|
private readonly _configService;
|
|
32
|
-
|
|
33
|
+
private readonly _viewportService;
|
|
34
|
+
constructor(_stateService: IBoardUIStateService, _commandService: ICommandService, _instanceService: IUniverInstanceService, _configService: IConfigService, _viewportService: BoardViewportService);
|
|
33
35
|
private _getInsertConfig;
|
|
34
36
|
private _isToolbarAvailable;
|
|
35
37
|
private _collapseInsertTools;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IDisposable } from '@univerjs/core';
|
|
1
|
+
import type { ICommandService, IDisposable } from '@univerjs/core';
|
|
2
2
|
import type { ComponentType } from 'react';
|
|
3
3
|
import type { Observable } from 'rxjs';
|
|
4
4
|
import { Disposable } from '@univerjs/core';
|
|
@@ -11,9 +11,10 @@ export interface IBoardToolbarContribution {
|
|
|
11
11
|
label: () => string;
|
|
12
12
|
order: number;
|
|
13
13
|
group: BoardToolbarContributionGroup;
|
|
14
|
+
menuItemId?: string;
|
|
14
15
|
enabled?: boolean | (() => boolean);
|
|
15
16
|
active?: () => boolean;
|
|
16
|
-
onClick: () => void
|
|
17
|
+
onClick: (commandService: ICommandService) => void | Promise<void>;
|
|
17
18
|
}
|
|
18
19
|
export interface IBoardToolbarContributionService {
|
|
19
20
|
readonly contributions$: Observable<readonly IBoardToolbarContribution[]>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BoardConnectorRouting, BoardShapeType, IBoardConnectorStyle,
|
|
1
|
+
import type { BoardConnectorRouting, BoardShapeType, IBoardConnectorStyle, IBoardSwimlaneData } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardSettings } from '../config/config';
|
|
2
3
|
import type { IBoardInsertRect } from '../utils/board-insert.util';
|
|
3
4
|
import type { IBoardViewportPoint, IBoardViewportTransform } from '../utils/board-viewport.util';
|
|
4
5
|
import { BoardToolType } from '@univerjs-pro/boards';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ILocalUnitPresenceState, IRemoteUnitPresenceState, IUnitPresenceUIAdapter } from '@univerjs/ui';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
import { IUniverInstanceService, RxDisposable, UniverInstanceType } from '@univerjs/core';
|
|
4
|
+
import { IBoardElementStateService } from './board-element-state.service';
|
|
5
|
+
import { IBoardPointerStateService } from './board-pointer-state.service';
|
|
6
|
+
import { IBoardUIStateService } from './board-ui-state.service';
|
|
7
|
+
export declare class BoardUnitPresenceUIAdapter extends RxDisposable implements IUnitPresenceUIAdapter {
|
|
8
|
+
private readonly _boardElementStateService;
|
|
9
|
+
private readonly _boardPointerStateService;
|
|
10
|
+
private readonly _boardUIStateService;
|
|
11
|
+
private readonly _univerInstanceService;
|
|
12
|
+
readonly unitType = UniverInstanceType.UNIVER_BOARD;
|
|
13
|
+
readonly presenceKind = "board-element-selection";
|
|
14
|
+
readonly statusUIPart = "board.top-right-menu.leading";
|
|
15
|
+
private readonly _active$;
|
|
16
|
+
private _activationCount;
|
|
17
|
+
readonly active$: Observable<boolean>;
|
|
18
|
+
readonly localPresence$: Observable<ILocalUnitPresenceState>;
|
|
19
|
+
private readonly _remotePresences;
|
|
20
|
+
constructor(_boardElementStateService: IBoardElementStateService, _boardPointerStateService: IBoardPointerStateService, _boardUIStateService: IBoardUIStateService, _univerInstanceService: IUniverInstanceService);
|
|
21
|
+
dispose(): void;
|
|
22
|
+
activate(): import("@wendellhu/redi").IDisposable;
|
|
23
|
+
isActive(): boolean;
|
|
24
|
+
getLocalPresence(unitId: string): ILocalUnitPresenceState | null;
|
|
25
|
+
getRemotePresences$(unitId: string): Observable<ReadonlyMap<string, IRemoteUnitPresenceState>>;
|
|
26
|
+
setRemotePresence(state: IRemoteUnitPresenceState): void;
|
|
27
|
+
removeRemotePresence(unitId: string, memberId: string): void;
|
|
28
|
+
clearRemotePresences(unitId: string): void;
|
|
29
|
+
private _getShareInterval;
|
|
30
|
+
private _getOrCreateRemotePresenceSubject;
|
|
31
|
+
private _disposeRemotePresenceSubject;
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
|
-
import type { IBoardViewportSize, IBoardViewportZoomConfig } from '../utils/board-viewport.util';
|
|
2
|
+
import type { IBoardViewportPoint, IBoardViewportSize, IBoardViewportZoomConfig } from '../utils/board-viewport.util';
|
|
3
3
|
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
4
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
5
5
|
import { IBoardUIStateService } from './board-ui-state.service';
|
|
@@ -14,5 +14,6 @@ export declare class BoardViewportService {
|
|
|
14
14
|
private readonly _renderManagerService;
|
|
15
15
|
constructor(_boardElementService: IBoardElementService, _uiStateService: IBoardUIStateService, _renderManagerService: Pick<IRenderManagerService, 'getRenderUnitById'>);
|
|
16
16
|
fitContent(boardModel: BoardModel | null | undefined, options: IBoardViewportFitContentOptions): boolean;
|
|
17
|
+
getViewportCenterPoint(boardModel: BoardModel | null | undefined): IBoardViewportPoint | null;
|
|
17
18
|
private _createRenderBoundsResolver;
|
|
18
19
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IBoardConnectorData, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardConnectorRenderGeometry } from './board-connector-render-geometry.util';
|
|
2
3
|
import type { BoardConnectorPathCommand } from './board-connector-routing.util';
|
|
3
4
|
export interface IHitTestBoardConnectorElementOptions {
|
|
4
5
|
connectorData: IBoardConnectorData;
|
|
@@ -7,6 +8,7 @@ export interface IHitTestBoardConnectorElementOptions {
|
|
|
7
8
|
connectorId?: string;
|
|
8
9
|
pathCommands?: readonly BoardConnectorPathCommand[];
|
|
9
10
|
routePoints?: readonly IBoardConnectorPoint[];
|
|
11
|
+
renderGeometry?: IBoardConnectorRenderGeometry | null;
|
|
10
12
|
pathTolerance?: number;
|
|
11
13
|
}
|
|
12
14
|
export declare const BOARD_CONNECTOR_DEFAULT_HIT_TOLERANCE = 8;
|
|
@@ -13,5 +13,4 @@ export interface IResolveBoardConnectorMarkerAnchorsOptions {
|
|
|
13
13
|
elementData?: Record<string, IBoardElementData>;
|
|
14
14
|
endpointGap?: number;
|
|
15
15
|
}
|
|
16
|
-
export declare const BOARD_CONNECTOR_ENDPOINT_VISUAL_GAP = 5;
|
|
17
16
|
export declare function resolveBoardConnectorMarkerAnchors(_routing: BoardConnectorRouting, points: readonly IBoardConnectorPoint[], pathCommands: readonly BoardConnectorPathCommand[], options?: IResolveBoardConnectorMarkerAnchorsOptions): IBoardConnectorMarkerAnchors | null;
|
|
@@ -2,7 +2,28 @@ import type { IBoardConnectorMarker, IBoardConnectorPoint } from '@univerjs-pro/
|
|
|
2
2
|
import type { UniverRenderingContext } from '@univerjs/engine-render';
|
|
3
3
|
export declare const BOARD_CONNECTOR_DEFAULT_MARKER_SIZE = 12;
|
|
4
4
|
export declare const BOARD_CONNECTOR_DEFAULT_MARKER_COLOR = "#1f2937";
|
|
5
|
+
export declare const BOARD_CONNECTOR_ENDPOINT_VISUAL_GAP = 5;
|
|
6
|
+
export type BoardConnectorMarkerUnderlayPolicy = 'continue-to-tip' | 'stop-at-base';
|
|
7
|
+
export interface IBoardConnectorMarkerGeometry {
|
|
8
|
+
size: number;
|
|
9
|
+
tipOffset: number;
|
|
10
|
+
strokeCutback: number;
|
|
11
|
+
rearExtent: number;
|
|
12
|
+
forwardExtent: number;
|
|
13
|
+
lateralExtent: number;
|
|
14
|
+
strokeOutset: number;
|
|
15
|
+
underlayPolicy: BoardConnectorMarkerUnderlayPolicy;
|
|
16
|
+
}
|
|
17
|
+
export interface IBoardConnectorMarkerPaintBounds {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
5
23
|
export declare function resolveBoardConnectorMarkerSize(marker: IBoardConnectorMarker, strokeWidth: number): number;
|
|
24
|
+
export declare function resolveBoardConnectorMarkerGeometry(marker: IBoardConnectorMarker | undefined, strokeWidth: number): IBoardConnectorMarkerGeometry;
|
|
25
|
+
export declare function resolveBoardConnectorMarkerPaintBounds(marker: IBoardConnectorMarker | undefined, point: IBoardConnectorPoint, tangent: IBoardConnectorPoint, strokeWidth: number): IBoardConnectorMarkerPaintBounds | null;
|
|
26
|
+
export declare function resolveBoardConnectorMarkerTerminalLength(marker: IBoardConnectorMarker | undefined, strokeWidth: number, endpointGap: number, cornerExit: number): number;
|
|
6
27
|
export declare function getBoardConnectorMarkerTrim(marker: IBoardConnectorMarker | undefined, strokeWidth: number): number;
|
|
7
28
|
export declare function hitTestBoardConnectorMarker(marker: IBoardConnectorMarker | undefined, point: IBoardConnectorPoint, markerPoint: IBoardConnectorPoint, tangent: IBoardConnectorPoint, style: {
|
|
8
29
|
strokeWidth: number;
|
|
@@ -10,6 +10,7 @@ export interface ICreateBoardConnectorQuickConnectElementsOptions {
|
|
|
10
10
|
style: IBoardConnectorStyle;
|
|
11
11
|
targetPoint?: IBoardConnectorPoint;
|
|
12
12
|
shapeType?: ShapeTypeEnum | string;
|
|
13
|
+
sourceShape?: IBoardShapeElement;
|
|
13
14
|
sourceSize?: {
|
|
14
15
|
width?: number;
|
|
15
16
|
height?: number;
|
|
@@ -7,5 +7,4 @@ export interface IResolveBoardConnectorRenderBoundsOptions {
|
|
|
7
7
|
stabilityHint?: IResolveBoardConnectorRoutePointsOptions['stabilityHint'];
|
|
8
8
|
}
|
|
9
9
|
export declare function expandBoardConnectorBounds(bounds: IBoardConnectorRouteBounds, padding: number): IBoardConnectorRouteBounds;
|
|
10
|
-
export declare function resolveBoardConnectorMarkerBoundsPadding(connectorData: IBoardConnectorData): number;
|
|
11
10
|
export declare function resolveBoardConnectorRenderBounds(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRenderBoundsOptions): IBoardConnectorRouteBounds;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IBoardConnectorData, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardConnectorMarkerAnchors } from './board-connector-marker-anchor.util';
|
|
3
|
+
import type { IBoardConnectorMarkerGeometry, IBoardConnectorMarkerPaintBounds } from './board-connector-marker.util';
|
|
4
|
+
import type { BoardConnectorPathCommand, IBoardConnectorRouteBounds } from './board-connector-routing.util';
|
|
5
|
+
export interface IBoardConnectorTerminalRenderGeometry {
|
|
6
|
+
anchor: IBoardConnectorMarkerAnchors['start'];
|
|
7
|
+
marker: IBoardConnectorMarkerGeometry;
|
|
8
|
+
markerBounds: IBoardConnectorMarkerPaintBounds | null;
|
|
9
|
+
endpointGap: number;
|
|
10
|
+
strokeTrim: number;
|
|
11
|
+
terminalSegmentLength: number;
|
|
12
|
+
requiredTerminalLength: number;
|
|
13
|
+
}
|
|
14
|
+
export interface IBoardConnectorRenderGeometry {
|
|
15
|
+
routePoints: readonly IBoardConnectorPoint[];
|
|
16
|
+
pathCommands: readonly BoardConnectorPathCommand[];
|
|
17
|
+
strokeRoutePoints: readonly IBoardConnectorPoint[];
|
|
18
|
+
strokePathCommands: readonly BoardConnectorPathCommand[];
|
|
19
|
+
start: IBoardConnectorTerminalRenderGeometry;
|
|
20
|
+
end: IBoardConnectorTerminalRenderGeometry;
|
|
21
|
+
strokePathLength: number;
|
|
22
|
+
dashOffset: number;
|
|
23
|
+
bounds: IBoardConnectorRouteBounds;
|
|
24
|
+
}
|
|
25
|
+
export interface IResolveBoardConnectorRenderGeometryOptions {
|
|
26
|
+
connectorData: IBoardConnectorData;
|
|
27
|
+
routePoints: readonly IBoardConnectorPoint[];
|
|
28
|
+
pathCommands: readonly BoardConnectorPathCommand[];
|
|
29
|
+
elementData?: Record<string, IBoardElementData>;
|
|
30
|
+
fallbackBounds?: IBoardConnectorRouteBounds;
|
|
31
|
+
}
|
|
32
|
+
export declare function resolveBoardConnectorDashOffset(dash: readonly number[] | undefined, pathLength: number, hasStartMarker: boolean, hasEndMarker: boolean): number;
|
|
33
|
+
export declare function resolveBoardConnectorRenderGeometry(options: IResolveBoardConnectorRenderGeometryOptions): IBoardConnectorRenderGeometry | null;
|