@univerjs-pro/boards-ui 1.0.0-alpha.8 → 1.0.0-beta.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/facade.js +1 -0
- 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 -0
- 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 -0
- package/lib/index.css +1 -79
- 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 +8 -0
- package/lib/types/commands/commands/capture-board-screenshot.command.d.ts +7 -0
- package/lib/types/common/shape-presets.d.ts +4 -0
- package/lib/types/config/config.d.ts +0 -4
- package/lib/types/controllers/board-connector-interaction.render-controller.d.ts +8 -3
- package/lib/types/controllers/board-element-selection.controller.d.ts +3 -1
- package/lib/types/controllers/board-element-transform.controller.d.ts +9 -1
- package/lib/types/controllers/board-render.controller.d.ts +5 -3
- package/lib/types/controllers/board-selection-overlay.render-controller.d.ts +1 -0
- package/lib/types/controllers/board-text-editing.render-controller.d.ts +3 -1
- package/lib/types/facade/f-board-layout.d.ts +51 -0
- package/lib/types/facade/index.d.ts +1 -0
- package/lib/types/index.d.ts +9 -1
- package/lib/types/locale/en-US.d.ts +0 -35
- package/lib/types/render-adapters/board-element-render-adapter.d.ts +13 -3
- package/lib/types/render-objects/board-connector-object.d.ts +27 -2
- package/lib/types/render-objects/board-element-render-layer.d.ts +65 -0
- package/lib/types/services/board-screenshot.service.d.ts +38 -0
- package/lib/types/services/board-selection.service.d.ts +5 -1
- package/lib/types/services/board-tool.service.d.ts +0 -1
- package/lib/types/services/board-viewport.service.d.ts +4 -1
- package/lib/types/utils/board-alignment-guides.util.d.ts +2 -0
- package/lib/types/utils/board-connector-router.util.d.ts +1 -0
- package/lib/types/utils/board-connector-routing.util.d.ts +18 -2
- package/lib/types/utils/board-container-spatial-index.util.d.ts +2 -0
- package/lib/types/utils/board-floating-toolbar-selection.util.d.ts +22 -1
- package/lib/types/utils/board-guide-candidates.util.d.ts +13 -0
- package/lib/types/utils/board-selection-geometry.util.d.ts +4 -1
- package/lib/types/utils/board-selection-hit-test.util.d.ts +2 -0
- package/lib/types/utils/board-selection-interaction.util.d.ts +2 -1
- package/lib/types/utils/board-snap-session.util.d.ts +2 -43
- package/lib/types/utils/board-spacing-guides.util.d.ts +2 -0
- package/lib/types/utils/board-viewport.util.d.ts +6 -0
- package/lib/types/views/BoardConnectorFloatingToolbar.d.ts +0 -4
- package/lib/types/views/BoardConnectorFloatingToolbarControls.d.ts +35 -0
- package/lib/types/views/BoardRenamePopup.d.ts +7 -0
- package/lib/types/views/BoardSettingsMenu.d.ts +1 -0
- package/lib/types/views/board-shape-floating-toolbar/BoardSwimlaneToolbarMenu.d.ts +12 -0
- package/lib/umd/facade.js +1 -0
- 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 +29 -20
- package/lib/types/common/settings-actions.d.ts +0 -26
- package/lib/types/controllers/board-mermaid-import.controller.d.ts +0 -9
- package/lib/types/services/board-mermaid-import.service.d.ts +0 -81
- package/lib/types/services/board-settings-action.service.d.ts +0 -21
- package/lib/types/utils/board-draft-insert-position.util.d.ts +0 -13
- package/lib/types/utils/board-mermaid-preview.util.d.ts +0 -4
- package/lib/types/views/BoardContainerRenamePopup.d.ts +0 -6
- package/lib/types/views/BoardMermaidImportDialog.d.ts +0 -1
- package/lib/types/views/BoardSwimlaneLaneRenamePopup.d.ts +0 -6
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
2
|
import type { IBoardSelectionPoint } from '../utils/board-selection-interaction.util';
|
|
3
3
|
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
5
|
import { IBoardElementStateService } from './board-element-state.service';
|
|
5
6
|
export interface IBoardPointerSelectionOptions {
|
|
6
7
|
boardModel: BoardModel | null | undefined;
|
|
@@ -13,7 +14,10 @@ export interface IBoardPointerSelectionOptions {
|
|
|
13
14
|
export declare class BoardSelectionService {
|
|
14
15
|
private readonly _boardElementService;
|
|
15
16
|
private readonly _elementStateService;
|
|
16
|
-
|
|
17
|
+
private readonly _renderManagerService;
|
|
18
|
+
constructor(_boardElementService: IBoardElementService, _elementStateService: IBoardElementStateService, _renderManagerService: Pick<IRenderManagerService, 'getRenderUnitById'>);
|
|
17
19
|
selectByPointerGesture(options: IBoardPointerSelectionOptions): boolean;
|
|
20
|
+
private _createRenderBoundsResolver;
|
|
21
|
+
private _createRenderHitTester;
|
|
18
22
|
private _resolveInvertedSelection;
|
|
19
23
|
}
|
|
@@ -71,7 +71,6 @@ export declare class BoardToolService {
|
|
|
71
71
|
root: IBoardToolMindMapBlueprintNode;
|
|
72
72
|
};
|
|
73
73
|
}): void;
|
|
74
|
-
private _beginImport;
|
|
75
74
|
private _resolveShapePendingInsert;
|
|
76
75
|
beginShapeInsert(shapeType: BoardShapeType | string, options?: IBoardShapeInsertOptions): void;
|
|
77
76
|
beginShapeInsertDrag(shapeType: BoardShapeType | string, options?: IBoardShapeInsertOptions): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
2
|
import type { IBoardViewportSize, IBoardViewportZoomConfig } from '../utils/board-viewport.util';
|
|
3
3
|
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
5
|
import { IBoardUIStateService } from './board-ui-state.service';
|
|
5
6
|
export interface IBoardViewportFitContentOptions {
|
|
6
7
|
viewportSize: IBoardViewportSize;
|
|
@@ -10,6 +11,8 @@ export interface IBoardViewportFitContentOptions {
|
|
|
10
11
|
export declare class BoardViewportService {
|
|
11
12
|
private readonly _boardElementService;
|
|
12
13
|
private readonly _uiStateService;
|
|
13
|
-
|
|
14
|
+
private readonly _renderManagerService;
|
|
15
|
+
constructor(_boardElementService: IBoardElementService, _uiStateService: IBoardUIStateService, _renderManagerService: Pick<IRenderManagerService, 'getRenderUnitById'>);
|
|
14
16
|
fitContent(boardModel: BoardModel | null | undefined, options: IBoardViewportFitContentOptions): boolean;
|
|
17
|
+
private _createRenderBoundsResolver;
|
|
15
18
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IBoardElementData } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardGuideCandidate } from './board-guide-candidates.util';
|
|
2
3
|
import type { IBoardSelectionRect } from './board-selection-geometry.util';
|
|
3
4
|
export interface IBoardAlignmentGuide {
|
|
4
5
|
position: number;
|
|
@@ -15,6 +16,7 @@ export interface IResolveBoardElementAlignmentGuidesOptions {
|
|
|
15
16
|
elementData: Record<string, IBoardElementData>;
|
|
16
17
|
elementOrder: string[];
|
|
17
18
|
threshold: number;
|
|
19
|
+
candidates?: readonly IBoardGuideCandidate[];
|
|
18
20
|
}
|
|
19
21
|
export interface IBoardAlignmentSnap {
|
|
20
22
|
delta: {
|
|
@@ -56,6 +56,7 @@ export interface IResolveBoardOrthogonalObstacleRouteOptions {
|
|
|
56
56
|
};
|
|
57
57
|
fallbackRoute?: () => IBoardConnectorPoint[];
|
|
58
58
|
}
|
|
59
|
+
export declare function createBoardConnectorRoutingObstaclesForElementIds(elementData: Record<string, IBoardElementData>, elementIds: Iterable<string>, clearance?: number): IBoardRoutingObstacle[];
|
|
59
60
|
export declare function createBoardConnectorRoutingObstacleIndex(elementData: Record<string, IBoardElementData> | undefined, options?: ICreateBoardConnectorRoutingObstaclesOptions): IBoardRoutingObstacleIndex;
|
|
60
61
|
export declare function isBoardRoutingPointInsideObstacle(point: IBoardConnectorPoint, obstacle: IBoardRoutingObstacle): boolean;
|
|
61
62
|
export declare function doesBoardRoutingSegmentIntersectObstacle(segment: IBoardRoutingSegment, obstacle: IBoardRoutingObstacle): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IBoardConnectorData, IBoardConnectorEndpoint, IBoardConnectorPoint, IBoardElementData, IBoardElementTransform } from '@univerjs-pro/boards';
|
|
2
|
-
import type { IBoardRoutingSegment } from './board-connector-router.util';
|
|
1
|
+
import type { IBoardConnectorData, IBoardConnectorElement, IBoardConnectorEndpoint, IBoardConnectorPoint, IBoardElementData, IBoardElementTransform } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardRoutingObstacleIndex, IBoardRoutingSegment } from './board-connector-router.util';
|
|
3
3
|
export interface IBoardConnectorRouteBounds {
|
|
4
4
|
left: number;
|
|
5
5
|
top: number;
|
|
@@ -44,13 +44,28 @@ export interface IResolveBoardConnectorRoutePointsOptions extends IResolveBoardC
|
|
|
44
44
|
tolerance?: number;
|
|
45
45
|
};
|
|
46
46
|
resolvedRoutePoints?: readonly IBoardConnectorPoint[];
|
|
47
|
+
routingCache?: BoardConnectorRoutingCache;
|
|
47
48
|
}
|
|
48
49
|
export declare const BOARD_CONNECTOR_MIN_BOUNDS_SIZE = 1;
|
|
50
|
+
type IBoardConnectorElementData = IBoardElementData & {
|
|
51
|
+
element: IBoardConnectorElement;
|
|
52
|
+
};
|
|
49
53
|
export declare function resolveBoardConnectorEndpointPoint(endpoint: IBoardConnectorEndpoint, options?: IResolveBoardConnectorEndpointPointOptions): IBoardConnectorPoint | null;
|
|
50
54
|
export declare function resolveBoardConnectorEndpoint(endpoint: IBoardConnectorEndpoint, options?: IResolveBoardConnectorEndpointOptions): IBoardConnectorResolvedEndpoint | null;
|
|
51
55
|
export declare function isBoardConnectorTerminalSegmentAlignedWithEndpointNormal(segment: IBoardRoutingSegment, endpoint: IBoardConnectorResolvedEndpoint, terminal: 'start' | 'end'): boolean;
|
|
52
56
|
export declare function isBoardConnectorRouteAlignedWithEndpoints(connectorData: IBoardConnectorData, routePoints: readonly IBoardConnectorPoint[] | undefined, options?: IResolveBoardConnectorEndpointPointOptions): routePoints is readonly IBoardConnectorPoint[];
|
|
53
57
|
export declare function normalizeBoardConnectorEndpointManualRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorEndpointOptions): IBoardConnectorData;
|
|
58
|
+
export declare class BoardConnectorRoutingCache {
|
|
59
|
+
private _elementData?;
|
|
60
|
+
private readonly _obstacleIndexesByExclusion;
|
|
61
|
+
private readonly _routePointsByConnectorId;
|
|
62
|
+
private readonly _crossingRoutePointsByConnectorId;
|
|
63
|
+
invalidate(elementData?: Record<string, IBoardElementData>, invalidatedElementIds?: Iterable<string>): string[];
|
|
64
|
+
getObstacleIndex(elementData: Record<string, IBoardElementData> | undefined, excludeElementIds: readonly string[]): IBoardRoutingObstacleIndex;
|
|
65
|
+
resolveRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): IBoardConnectorPoint[];
|
|
66
|
+
private _resolveRouteDependency;
|
|
67
|
+
resolveCrossingRoutePoints(item: IBoardConnectorElementData, elementData: Record<string, IBoardElementData>): IBoardConnectorPoint[];
|
|
68
|
+
}
|
|
54
69
|
export declare function resolveBoardConnectorRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): IBoardConnectorPoint[];
|
|
55
70
|
export declare function resolveBoardConnectorPathCommands(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): BoardConnectorPathCommand[];
|
|
56
71
|
export declare function resolveBoardConnectorPathBounds(commands: readonly BoardConnectorPathCommand[], fallbackTransform?: IBoardElementTransform): IBoardConnectorRouteBounds;
|
|
@@ -67,3 +82,4 @@ export declare function hitTestBoardConnectorPath(point: IBoardConnectorPoint, c
|
|
|
67
82
|
export declare function resolveBoardConnectorRouteBounds(points: readonly IBoardConnectorPoint[], fallbackTransform?: IBoardElementTransform): IBoardConnectorRouteBounds;
|
|
68
83
|
export declare function distanceToBoardConnectorSegment(point: IBoardConnectorPoint, start: IBoardConnectorPoint, end: IBoardConnectorPoint): number;
|
|
69
84
|
export declare function trimBoardConnectorRoute(points: readonly IBoardConnectorPoint[], startTrim: number, endTrim: number): IBoardConnectorPoint[];
|
|
85
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IBoardElementData, IBoardRect } from '@univerjs-pro/boards';
|
|
2
|
+
import { resolveBoardElementBounds } from './board-selection-geometry.util';
|
|
2
3
|
export interface IBoardPoint {
|
|
3
4
|
x: number;
|
|
4
5
|
y: number;
|
|
@@ -7,6 +8,7 @@ export interface ICreateBoardElementSpatialIndexOptions {
|
|
|
7
8
|
unitId: string;
|
|
8
9
|
subUnitId: string;
|
|
9
10
|
elementData: Record<string, IBoardElementData>;
|
|
11
|
+
resolveElementBounds?: Parameters<typeof resolveBoardElementBounds>[2];
|
|
10
12
|
}
|
|
11
13
|
export interface IBoardElementSpatialIndex {
|
|
12
14
|
queryIntersecting(bounds: IBoardRect): string[];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { BoardConnectorRouting, IBoardConnectorStyle, IBoardElementData } from '@univerjs-pro/boards';
|
|
1
|
+
import type { BoardConnectorRouting, IBoardConnectorStyle, IBoardContainerElement, IBoardElementData, IBoardSwimlaneLane, IBoardTextStyle } from '@univerjs-pro/boards';
|
|
2
2
|
import type { IShapeData } from '@univerjs-pro/engine-shape';
|
|
3
|
+
import type { buildShapeTextDataUpdate } from '@univerjs-pro/shape-editor-ui';
|
|
4
|
+
import type { ITextStyle } from '@univerjs/core';
|
|
5
|
+
import { HorizontalAlign, VerticalAlign } from '@univerjs/core';
|
|
3
6
|
export type BoardFloatingToolbarOwner = 'common' | 'connector' | 'mind-map' | 'none' | 'shape' | 'table';
|
|
4
7
|
export interface IBoardFloatingToolbarSelection {
|
|
5
8
|
elements: IBoardElementData[];
|
|
@@ -13,6 +16,24 @@ export interface IResolveBoardFloatingToolbarSelectionOptions {
|
|
|
13
16
|
selectedIds: readonly string[];
|
|
14
17
|
getElementById: (unitId: string, subUnitId: string, elementId: string) => IBoardElementData | null | undefined;
|
|
15
18
|
}
|
|
19
|
+
export interface IBoardSwimlaneLaneTypographyTarget {
|
|
20
|
+
container: IBoardContainerElement;
|
|
21
|
+
lane: IBoardSwimlaneLane;
|
|
22
|
+
}
|
|
23
|
+
export declare function boardTextStyleToToolbarTextStyle(style: IBoardTextStyle | undefined, fallbackFontSize: number): ITextStyle;
|
|
24
|
+
export declare function getContainerTitleStyle(element: IBoardContainerElement | undefined): IBoardTextStyle | undefined;
|
|
25
|
+
export declare function getSwimlaneLaneTypographyTarget(element: IBoardContainerElement | undefined, laneId: string | undefined): IBoardSwimlaneLaneTypographyTarget | null;
|
|
26
|
+
export declare function getSwimlaneLaneTitleTextModel(target: IBoardSwimlaneLaneTypographyTarget | null): {
|
|
27
|
+
ha?: HorizontalAlign;
|
|
28
|
+
va?: VerticalAlign;
|
|
29
|
+
} | null;
|
|
30
|
+
export declare function getSwimlaneContainerTitleTextModel(element: IBoardContainerElement | undefined): {
|
|
31
|
+
ha?: HorizontalAlign;
|
|
32
|
+
va?: VerticalAlign;
|
|
33
|
+
} | null;
|
|
34
|
+
export declare function isUnfocusedSwimlaneTypographyTarget(element: IBoardContainerElement, laneTarget: IBoardSwimlaneLaneTypographyTarget | null): boolean;
|
|
35
|
+
export declare function buildTitleStyleUpdate(currentStyle: IBoardTextStyle | undefined, params: Parameters<typeof buildShapeTextDataUpdate>[1]): IBoardTextStyle;
|
|
36
|
+
export declare function buildContainerTitleStyleUpdate(element: IBoardContainerElement, params: Parameters<typeof buildShapeTextDataUpdate>[1]): IBoardTextStyle;
|
|
16
37
|
/**
|
|
17
38
|
* Resolves one owner for the selection-level floating toolbar.
|
|
18
39
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IBoardElementData } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardSelectionRect } from './board-selection-geometry.util';
|
|
3
|
+
export interface IBoardGuideCandidate {
|
|
4
|
+
elementId: string;
|
|
5
|
+
rect: IBoardSelectionRect;
|
|
6
|
+
}
|
|
7
|
+
export interface ICreateBoardGuideCandidatesOptions {
|
|
8
|
+
activeIds: readonly string[];
|
|
9
|
+
bounds?: IBoardSelectionRect;
|
|
10
|
+
elementData: Record<string, IBoardElementData>;
|
|
11
|
+
elementOrder: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function createBoardGuideCandidates(options: ICreateBoardGuideCandidatesOptions): IBoardGuideCandidate[];
|
|
@@ -6,17 +6,20 @@ export interface IBoardSelectionRect {
|
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
8
8
|
}
|
|
9
|
+
export type BoardElementBoundsResolver = (elementDataItem: IBoardElementData) => IBoardSelectionRect | null | undefined;
|
|
9
10
|
export interface ISelectBoardElementsByRectOptions {
|
|
10
11
|
elementData: Record<string, IBoardElementData>;
|
|
11
12
|
elementOrder: string[];
|
|
12
13
|
rect: IBoardSelectionRect;
|
|
13
14
|
preciseSelection: boolean;
|
|
15
|
+
resolveElementBounds?: BoardElementBoundsResolver;
|
|
14
16
|
spatialIndex?: IBoardElementSpatialIndex;
|
|
15
17
|
}
|
|
16
18
|
export interface IResolveBoardElementsBoundsOptions {
|
|
17
19
|
elementData: Record<string, IBoardElementData>;
|
|
18
20
|
elementOrder: string[];
|
|
19
21
|
includeHidden?: boolean;
|
|
22
|
+
resolveElementBounds?: BoardElementBoundsResolver;
|
|
20
23
|
}
|
|
21
24
|
export interface IBoardElementSelectionResult {
|
|
22
25
|
unitId: string;
|
|
@@ -25,7 +28,7 @@ export interface IBoardElementSelectionResult {
|
|
|
25
28
|
element: IBoardElementData['element'];
|
|
26
29
|
transform: IBoardElementData['transform'];
|
|
27
30
|
}
|
|
28
|
-
export declare function resolveBoardElementBounds(elementDataItem: IBoardElementData, elementData: Record<string, IBoardElementData
|
|
31
|
+
export declare function resolveBoardElementBounds(elementDataItem: IBoardElementData, elementData: Record<string, IBoardElementData>, resolveElementBounds?: BoardElementBoundsResolver): IBoardSelectionRect;
|
|
29
32
|
export declare function isBoardElementVisibleInTree(elementData: Record<string, IBoardElementData>, elementDataItem: IBoardElementData | undefined): elementDataItem is IBoardElementData;
|
|
30
33
|
export declare function selectBoardElementsByRect(options: ISelectBoardElementsByRectOptions): IBoardElementSelectionResult[];
|
|
31
34
|
export declare function resolveBoardElementsBounds(options: IResolveBoardElementsBoundsOptions): IBoardSelectionRect | null;
|
|
@@ -5,8 +5,10 @@ export interface IHitTestBoardElementAtPointOptions {
|
|
|
5
5
|
elementData: Record<string, IBoardElementData>;
|
|
6
6
|
elementOrder: string[];
|
|
7
7
|
point: IBoardSelectionPoint;
|
|
8
|
+
hitTestElement?: BoardElementHitTester;
|
|
8
9
|
spatialIndex?: IBoardElementSpatialIndex;
|
|
9
10
|
}
|
|
11
|
+
export type BoardElementHitTester = (elementDataItem: IBoardElementData, point: IBoardSelectionPoint) => boolean | undefined;
|
|
10
12
|
export interface IBoardElementHitTestResult {
|
|
11
13
|
unitId: string;
|
|
12
14
|
subUnitId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IBoardElementData } from '@univerjs-pro/boards';
|
|
2
2
|
import type { IBoardElementSpatialIndex } from './board-container-spatial-index.util';
|
|
3
|
-
import type { IBoardSelectionRect } from './board-selection-geometry.util';
|
|
3
|
+
import type { BoardElementBoundsResolver, IBoardSelectionRect } from './board-selection-geometry.util';
|
|
4
4
|
export declare const BOARD_SELECTION_DRAG_THRESHOLD = 4;
|
|
5
5
|
export interface IBoardSelectionPoint {
|
|
6
6
|
x: number;
|
|
@@ -13,6 +13,7 @@ export interface IResolveBoardElementDragSelectionOptions {
|
|
|
13
13
|
end: IBoardSelectionPoint;
|
|
14
14
|
dragSelection: boolean;
|
|
15
15
|
preciseSelection: boolean;
|
|
16
|
+
resolveElementBounds?: BoardElementBoundsResolver;
|
|
16
17
|
spatialIndex?: IBoardElementSpatialIndex;
|
|
17
18
|
}
|
|
18
19
|
export interface IResolvedBoardDragSelection {
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface IBoardSnapGuide {
|
|
3
|
-
id: string;
|
|
4
|
-
axis: BoardSnapAxis;
|
|
5
|
-
position: number;
|
|
6
|
-
}
|
|
7
|
-
export interface IBoardSnapSessionConfig {
|
|
8
|
-
enterThreshold?: number;
|
|
9
|
-
exitThreshold?: number;
|
|
10
|
-
breakawayThreshold?: number;
|
|
11
|
-
softThreshold?: number;
|
|
12
|
-
hardThreshold?: number;
|
|
13
|
-
softMaxStrength?: number;
|
|
14
|
-
cooldownMs?: number;
|
|
15
|
-
}
|
|
16
|
-
export interface IBoardSnapAxisOptions {
|
|
17
|
-
axis: BoardSnapAxis;
|
|
18
|
-
value: number;
|
|
19
|
-
guide: IBoardSnapGuide | null;
|
|
20
|
-
now?: number;
|
|
21
|
-
}
|
|
22
|
-
export interface IBoardSnapAxisResult {
|
|
23
|
-
snapped: boolean;
|
|
24
|
-
value: number;
|
|
25
|
-
guide: IBoardSnapGuide | null;
|
|
26
|
-
}
|
|
1
|
+
import type { IAlignmentSnapGuide } from '@univerjs/engine-render';
|
|
27
2
|
export interface IBoardConnectorAxisSnapOptions {
|
|
28
3
|
anchor: {
|
|
29
4
|
x: number;
|
|
@@ -41,22 +16,6 @@ export interface IBoardConnectorAxisSnapResult {
|
|
|
41
16
|
y: number;
|
|
42
17
|
};
|
|
43
18
|
axis: 'horizontal' | 'vertical';
|
|
44
|
-
guide:
|
|
45
|
-
}
|
|
46
|
-
export declare class BoardSnapSession {
|
|
47
|
-
private readonly _enterThreshold;
|
|
48
|
-
private readonly _exitThreshold;
|
|
49
|
-
private readonly _breakawayThreshold;
|
|
50
|
-
private readonly _softThreshold;
|
|
51
|
-
private readonly _hardThreshold;
|
|
52
|
-
private readonly _softMaxStrength;
|
|
53
|
-
private readonly _cooldownMs;
|
|
54
|
-
private _activeGuideId;
|
|
55
|
-
private _activeGuideStartValue;
|
|
56
|
-
private readonly _releasedGuideUntil;
|
|
57
|
-
constructor(config?: IBoardSnapSessionConfig);
|
|
58
|
-
reset(): void;
|
|
59
|
-
resolveAxisSnap(options: IBoardSnapAxisOptions): IBoardSnapAxisResult;
|
|
60
|
-
private _resolveSnappedValue;
|
|
19
|
+
guide: IAlignmentSnapGuide;
|
|
61
20
|
}
|
|
62
21
|
export declare function resolveBoardConnectorAxisSnap(options: IBoardConnectorAxisSnapOptions): IBoardConnectorAxisSnapResult | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IBoardElementData } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardGuideCandidate } from './board-guide-candidates.util';
|
|
2
3
|
import type { IBoardSelectionRect } from './board-selection-geometry.util';
|
|
3
4
|
export type BoardSpacingGuideAxis = 'horizontal' | 'vertical';
|
|
4
5
|
export interface IBoardSpacingGuidePoint {
|
|
@@ -20,5 +21,6 @@ export interface IResolveBoardElementSpacingGuidesOptions {
|
|
|
20
21
|
elementData: Record<string, IBoardElementData>;
|
|
21
22
|
elementOrder: string[];
|
|
22
23
|
maxDistance?: number;
|
|
24
|
+
candidates?: readonly IBoardGuideCandidate[];
|
|
23
25
|
}
|
|
24
26
|
export declare function resolveBoardElementSpacingGuides(options: IResolveBoardElementSpacingGuidesOptions): IBoardSpacingGuide[];
|
|
@@ -36,9 +36,15 @@ export interface IResolveBoardViewportFitRectOptions {
|
|
|
36
36
|
padding?: number;
|
|
37
37
|
zoom?: IBoardViewportZoomConfig;
|
|
38
38
|
}
|
|
39
|
+
export interface IResolveBoardViewportWorldRectOptions {
|
|
40
|
+
viewport: IBoardViewportTransform;
|
|
41
|
+
viewportSize: IBoardViewportSize;
|
|
42
|
+
padding?: number;
|
|
43
|
+
}
|
|
39
44
|
export declare function clampBoardZoomRatio(zoomRatio: number, config?: IBoardViewportZoomConfig): number;
|
|
40
45
|
export declare function resolveBoardViewportZoomAtPoint(options: IResolveBoardViewportZoomAtPointOptions): IBoardViewportTransform;
|
|
41
46
|
export declare function resolveBoardViewportFitRect(options: IResolveBoardViewportFitRectOptions): IBoardViewportTransform;
|
|
47
|
+
export declare function resolveBoardViewportWorldRect(options: IResolveBoardViewportWorldRectOptions): IBoardViewportRect;
|
|
42
48
|
export declare function getBoardPointFromClient(element: HTMLElement, clientX: number, clientY: number, viewport: IBoardViewportTransform, zoom?: IBoardViewportZoomConfig): {
|
|
43
49
|
x: number;
|
|
44
50
|
y: number;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { IBoardConnectorStyle } from '@univerjs-pro/boards';
|
|
2
|
-
import type { IShapeData } from '@univerjs-pro/engine-shape';
|
|
3
1
|
export declare const BOARD_CONNECTOR_FLOATING_TOOLBAR_KEY = "board.connector.floating-toolbar";
|
|
4
|
-
export declare function connectorStyleToShapeStrokeData(style: IBoardConnectorStyle): IShapeData;
|
|
5
|
-
export declare function shapeStrokeToBoardConnectorStylePatch(shapeData?: IShapeData): Partial<IBoardConnectorStyle>;
|
|
6
2
|
export declare function BoardConnectorFloatingToolbar({ popup }: {
|
|
7
3
|
popup: {
|
|
8
4
|
extraProps?: {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BoardConnectorRouting, IBoardConnectorLabel, IBoardConnectorLabelStylePatch, IBoardConnectorMarker, IBoardConnectorStyle } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IShapeData } from '@univerjs-pro/engine-shape';
|
|
3
|
+
import type { ITextStyle } from '@univerjs/core';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import { HorizontalAlign, RichTextBuilder } from '@univerjs/core';
|
|
6
|
+
export declare function connectorStyleToShapeStrokeData(style: IBoardConnectorStyle): IShapeData;
|
|
7
|
+
export declare function shapeStrokeToBoardConnectorStylePatch(shapeData?: IShapeData): Partial<IBoardConnectorStyle>;
|
|
8
|
+
export declare function ToolbarButton(props: {
|
|
9
|
+
title?: string;
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function MarkerDropdown(props: {
|
|
16
|
+
label: string;
|
|
17
|
+
currentMarker?: IBoardConnectorMarker;
|
|
18
|
+
flipIcon?: boolean;
|
|
19
|
+
onSelect: (marker: IBoardConnectorMarker | undefined) => void;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare function SettingsDropdown(props: {
|
|
22
|
+
routing?: BoardConnectorRouting;
|
|
23
|
+
style: IBoardConnectorStyle;
|
|
24
|
+
onRouting: (routing: BoardConnectorRouting) => void;
|
|
25
|
+
onStyle: (style: Partial<IBoardConnectorStyle>) => void;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export declare function createConnectorLabelRichTextBuilder(label: IBoardConnectorLabel): RichTextBuilder;
|
|
28
|
+
export declare function ConnectorLabelSettingsDropdown(props: {
|
|
29
|
+
label: IBoardConnectorLabel;
|
|
30
|
+
onEditText: () => void;
|
|
31
|
+
onDeleteText: () => void;
|
|
32
|
+
onStyle: (patch: IBoardConnectorLabelStylePatch) => void;
|
|
33
|
+
onTextStyle: (patch: ITextStyle) => void;
|
|
34
|
+
onHorizontalAlign: (horizontalAlign: HorizontalAlign) => void;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface IBoardRenamePopupProps {
|
|
2
|
+
kind: 'container' | 'lane';
|
|
3
|
+
initialTitle: string;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
onSubmit: (title: string) => void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare function BoardRenamePopup(props: IBoardRenamePopupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface IBoardSwimlaneToolbarMenuAction {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
shortcut?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
children?: IBoardSwimlaneToolbarMenuAction[];
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function BoardSwimlaneToolbarMenu(props: {
|
|
10
|
+
kind: 'container' | 'lane';
|
|
11
|
+
actions: IBoardSwimlaneToolbarMenuAction[];
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x4345(){var _0x2fb38b=['UniverProBoardsFacade','3204aJNzRR','getActivePageId','55282BRTgqj','6335KDKxKH','FBoard','9968lTkksO','20xrgyoJ','1974isoSmg','13070QdnZGH','getScreenshot','_commandService','3905yaYyyY','@univerjs-pro/boards-ui','10790EidIha','_boardModel','amd','analyzeRenderedLayout','240664XuRlxN','924NejoPA','UniverProBoardsUi','2dizLng','syncExecuteCommand','function','1204797kuOrxV'];_0x4345=function(){return _0x2fb38b;};return _0x4345();}function _0x1e99(_0x423c4c,_0x36d9cf){_0x423c4c=_0x423c4c-0x110;var _0x4345a0=_0x4345();var _0x1e9945=_0x4345a0[_0x423c4c];return _0x1e9945;}(function(_0x20a493,_0x43010a){var _0x416a7c=_0x1e99,_0x138a51=_0x20a493();while(!![]){try{var _0x1419e3=parseInt(_0x416a7c(0x113))/0x1*(parseInt(_0x416a7c(0x11a))/0x2)+-parseInt(_0x416a7c(0x116))/0x3+parseInt(_0x416a7c(0x110))/0x4*(-parseInt(_0x416a7c(0x11e))/0x5)+-parseInt(_0x416a7c(0x11f))/0x6*(-parseInt(_0x416a7c(0x11b))/0x7)+parseInt(_0x416a7c(0x11d))/0x8*(parseInt(_0x416a7c(0x118))/0x9)+parseInt(_0x416a7c(0x120))/0xa*(parseInt(_0x416a7c(0x123))/0xb)+-parseInt(_0x416a7c(0x111))/0xc*(parseInt(_0x416a7c(0x125))/0xd);if(_0x1419e3===_0x43010a)break;else _0x138a51['push'](_0x138a51['shift']());}catch(_0x1ef42d){_0x138a51['push'](_0x138a51['shift']());}}}(_0x4345,0x875af),function(_0x5d2cc2,_0x1e6d04){var _0x2ea0b1=_0x1e99;typeof exports=='object'&&typeof module<'u'?_0x1e6d04(require('@univerjs-pro/boards-ui'),require('@univerjs-pro/boards/facade')):typeof define==_0x2ea0b1(0x115)&&define[_0x2ea0b1(0x127)]?define([_0x2ea0b1(0x124),'@univerjs-pro/boards/facade'],_0x1e6d04):(_0x5d2cc2=typeof globalThis<'u'?globalThis:_0x5d2cc2||self,_0x1e6d04(_0x5d2cc2[_0x2ea0b1(0x112)],_0x5d2cc2[_0x2ea0b1(0x117)]));}(this,function(_0x3618db,_0x46daf2){var _0x583279=_0x1e99,_0x8708cc=class extends _0x46daf2[_0x583279(0x11c)]{[_0x583279(0x128)](_0xc4fdbd){var _0x32d676=_0x583279;return this[_0x32d676(0x122)][_0x32d676(0x114)](_0x3618db['AnalyzeBoardRenderedLayoutCommand']['id'],{'unitId':this['id'],'subUnitId':this['_boardModel'][_0x32d676(0x119)](),'focusPadding':_0xc4fdbd});}[_0x583279(0x121)](_0x3fb9a3){var _0x46729e=_0x583279;return this[_0x46729e(0x122)]['executeCommand'](_0x3618db['CaptureBoardScreenshotCommand']['id'],{..._0x3fb9a3,'unitId':this['id'],'subUnitId':this[_0x46729e(0x126)][_0x46729e(0x119)]()});}};_0x46daf2[_0x583279(0x11c)]['extend'](_0x8708cc);}));
|