@plait/draw 0.62.0-next.6 → 0.62.0-next.8
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/arrow-line.component.d.ts +26 -0
- package/constants/geometry.d.ts +1 -0
- package/constants/pointer.d.ts +3 -3
- package/esm2022/arrow-line.component.mjs +157 -0
- package/esm2022/constants/geometry.mjs +10 -3
- package/esm2022/constants/pointer.mjs +4 -4
- package/esm2022/engines/basic-shapes/ellipse.mjs +5 -3
- package/esm2022/engines/basic-shapes/round-comment.mjs +5 -3
- package/esm2022/engines/flowchart/note-curly-left.mjs +2 -2
- package/esm2022/engines/flowchart/note-curly-right.mjs +7 -7
- package/esm2022/engines/flowchart/note-square.mjs +2 -2
- package/esm2022/engines/flowchart/or.mjs +5 -3
- package/esm2022/engines/flowchart/summing-junction.mjs +5 -3
- package/esm2022/engines/table/table.mjs +48 -26
- package/esm2022/engines/uml/deletion.mjs +3 -2
- package/esm2022/engines/uml/required-interface.mjs +3 -2
- package/esm2022/generators/arrow-line-active.generator.mjs +81 -0
- package/esm2022/generators/arrow-line-auto-complete.generator.mjs +46 -0
- package/esm2022/generators/arrow-line.generator.mjs +13 -0
- package/esm2022/generators/index.mjs +3 -3
- package/esm2022/geometry.component.mjs +4 -4
- package/esm2022/image.component.mjs +4 -4
- package/esm2022/interfaces/arrow-line.mjs +70 -0
- package/esm2022/interfaces/element.mjs +2 -2
- package/esm2022/interfaces/index.mjs +14 -7
- package/esm2022/interfaces/vector-line.mjs +6 -0
- package/esm2022/plugins/with-arrow-line-auto-complete-reaction.mjs +41 -0
- package/esm2022/plugins/with-arrow-line-auto-complete.mjs +74 -0
- package/esm2022/plugins/with-arrow-line-bound-reaction.mjs +53 -0
- package/esm2022/plugins/with-arrow-line-create.mjs +53 -0
- package/esm2022/plugins/with-arrow-line-resize.mjs +158 -0
- package/esm2022/plugins/with-arrow-line-text-move.mjs +53 -0
- package/esm2022/plugins/with-arrow-line-text.mjs +63 -0
- package/esm2022/plugins/with-draw-fragment.mjs +13 -13
- package/esm2022/plugins/with-draw-resize.mjs +12 -5
- package/esm2022/plugins/with-draw.mjs +27 -20
- package/esm2022/plugins/with-geometry-resize.mjs +1 -1
- package/esm2022/plugins/with-swimlane-create.mjs +4 -7
- package/esm2022/plugins/with-swimlane.mjs +1 -20
- package/esm2022/plugins/with-table.mjs +34 -7
- package/esm2022/public-api.mjs +3 -3
- package/esm2022/table.component.mjs +6 -6
- package/esm2022/transforms/arrow-line.mjs +66 -0
- package/esm2022/transforms/common.mjs +36 -0
- package/esm2022/transforms/geometry.mjs +6 -28
- package/esm2022/transforms/index.mjs +15 -13
- package/esm2022/transforms/swimlane.mjs +1 -29
- package/esm2022/transforms/table-text.mjs +5 -5
- package/esm2022/transforms/table.mjs +30 -0
- package/esm2022/utils/arrow-line/arrow-line-arrow.mjs +123 -0
- package/esm2022/utils/arrow-line/arrow-line-basic.mjs +257 -0
- package/esm2022/utils/arrow-line/arrow-line-common.mjs +162 -0
- package/esm2022/utils/arrow-line/arrow-line-resize.mjs +309 -0
- package/esm2022/utils/arrow-line/elbow.mjs +114 -0
- package/esm2022/utils/arrow-line/index.mjs +6 -0
- package/esm2022/utils/clipboard.mjs +10 -10
- package/esm2022/utils/common.mjs +14 -5
- package/esm2022/utils/geometry.mjs +17 -14
- package/esm2022/utils/hit.mjs +67 -44
- package/esm2022/utils/index.mjs +2 -2
- package/esm2022/utils/memorize.mjs +4 -5
- package/esm2022/utils/position/arrow-line.mjs +67 -0
- package/esm2022/utils/position/geometry.mjs +1 -1
- package/esm2022/utils/selected.mjs +3 -3
- package/esm2022/utils/style/stroke.mjs +6 -4
- package/esm2022/utils/swimlane.mjs +16 -7
- package/esm2022/utils/table-selected.mjs +3 -4
- package/esm2022/utils/table.mjs +28 -5
- package/fesm2022/plait-draw.mjs +668 -511
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/generators/arrow-line-active.generator.d.ts +13 -0
- package/generators/{line-auto-complete.generator.d.ts → arrow-line-auto-complete.generator.d.ts} +1 -1
- package/generators/arrow-line.generator.d.ts +8 -0
- package/generators/index.d.ts +2 -2
- package/geometry.component.d.ts +2 -2
- package/image.component.d.ts +2 -2
- package/interfaces/arrow-line.d.ts +75 -0
- package/interfaces/element.d.ts +1 -1
- package/interfaces/index.d.ts +6 -4
- package/interfaces/vector-line.d.ts +16 -0
- package/package.json +11 -1
- package/plugins/with-arrow-line-auto-complete-reaction.d.ts +2 -0
- package/plugins/with-arrow-line-auto-complete.d.ts +7 -0
- package/plugins/with-arrow-line-bound-reaction.d.ts +2 -0
- package/plugins/with-arrow-line-create.d.ts +2 -0
- package/plugins/with-arrow-line-resize.d.ts +2 -0
- package/plugins/with-arrow-line-text-move.d.ts +2 -0
- package/plugins/with-arrow-line-text.d.ts +2 -0
- package/plugins/with-draw-fragment.d.ts +2 -2
- package/plugins/with-swimlane.d.ts +1 -2
- package/public-api.d.ts +2 -2
- package/table.component.d.ts +2 -2
- package/transforms/arrow-line.d.ts +8 -0
- package/transforms/common.d.ts +3 -0
- package/transforms/geometry.d.ts +1 -2
- package/transforms/index.d.ts +9 -9
- package/transforms/swimlane.d.ts +1 -3
- package/transforms/table-text.d.ts +2 -3
- package/transforms/table.d.ts +3 -0
- package/utils/arrow-line/arrow-line-arrow.d.ts +4 -0
- package/utils/arrow-line/arrow-line-basic.d.ts +13 -0
- package/utils/{line/line-common.d.ts → arrow-line/arrow-line-common.d.ts} +8 -4
- package/utils/{line/line-resize.d.ts → arrow-line/arrow-line-resize.d.ts} +3 -3
- package/utils/{line → arrow-line}/elbow.d.ts +7 -7
- package/utils/arrow-line/index.d.ts +5 -0
- package/utils/clipboard.d.ts +4 -4
- package/utils/common.d.ts +1 -0
- package/utils/geometry.d.ts +2 -1
- package/utils/hit.d.ts +7 -4
- package/utils/index.d.ts +1 -1
- package/utils/position/arrow-line.d.ts +16 -0
- package/utils/selected.d.ts +2 -2
- package/utils/swimlane.d.ts +3 -2
- package/utils/table.d.ts +2 -0
- package/esm2022/generators/line-active.generator.mjs +0 -81
- package/esm2022/generators/line-auto-complete.generator.mjs +0 -46
- package/esm2022/generators/line.generator.mjs +0 -13
- package/esm2022/interfaces/line.mjs +0 -70
- package/esm2022/line.component.mjs +0 -155
- package/esm2022/plugins/with-line-auto-complete-reaction.mjs +0 -41
- package/esm2022/plugins/with-line-auto-complete.mjs +0 -75
- package/esm2022/plugins/with-line-bound-reaction.mjs +0 -53
- package/esm2022/plugins/with-line-create.mjs +0 -53
- package/esm2022/plugins/with-line-resize.mjs +0 -158
- package/esm2022/plugins/with-line-text-move.mjs +0 -53
- package/esm2022/plugins/with-line-text.mjs +0 -62
- package/esm2022/transforms/line.mjs +0 -100
- package/esm2022/utils/line/elbow.mjs +0 -114
- package/esm2022/utils/line/index.mjs +0 -6
- package/esm2022/utils/line/line-arrow.mjs +0 -123
- package/esm2022/utils/line/line-basic.mjs +0 -257
- package/esm2022/utils/line/line-common.mjs +0 -123
- package/esm2022/utils/line/line-resize.mjs +0 -309
- package/esm2022/utils/position/line.mjs +0 -67
- package/generators/line-active.generator.d.ts +0 -13
- package/generators/line.generator.d.ts +0 -8
- package/interfaces/line.d.ts +0 -75
- package/line.component.d.ts +0 -26
- package/plugins/with-line-auto-complete-reaction.d.ts +0 -2
- package/plugins/with-line-auto-complete.d.ts +0 -7
- package/plugins/with-line-bound-reaction.d.ts +0 -2
- package/plugins/with-line-create.d.ts +0 -2
- package/plugins/with-line-resize.d.ts +0 -2
- package/plugins/with-line-text-move.d.ts +0 -2
- package/plugins/with-line-text.d.ts +0 -2
- package/transforms/line.d.ts +0 -12
- package/utils/line/index.d.ts +0 -5
- package/utils/line/line-arrow.d.ts +0 -4
- package/utils/line/line-basic.d.ts +0 -13
- package/utils/position/line.d.ts +0 -16
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Point } from '@plait/core';
|
|
2
|
+
import { PlaitArrowLine } from '../interfaces';
|
|
3
|
+
import { Generator } from '@plait/common';
|
|
4
|
+
export interface ActiveData {
|
|
5
|
+
selected: boolean;
|
|
6
|
+
linePoints: Point[];
|
|
7
|
+
}
|
|
8
|
+
export declare class ArrowLineActiveGenerator extends Generator<PlaitArrowLine, ActiveData> {
|
|
9
|
+
onlySelectedCurrentLine: boolean;
|
|
10
|
+
canDraw(element: PlaitArrowLine, data: ActiveData): boolean;
|
|
11
|
+
draw(element: PlaitArrowLine, data: ActiveData): SVGGElement;
|
|
12
|
+
needUpdate(): boolean;
|
|
13
|
+
}
|
package/generators/{line-auto-complete.generator.d.ts → arrow-line-auto-complete.generator.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlaitBoard } from '@plait/core';
|
|
2
2
|
import { PlaitGeometry, PlaitShapeElement } from '../interfaces';
|
|
3
3
|
import { ActiveGeneratorExtraData, Generator } from '@plait/common';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class ArrowLineAutoCompleteGenerator<T extends PlaitShapeElement = PlaitGeometry> extends Generator<T, ActiveGeneratorExtraData> {
|
|
5
5
|
board: PlaitBoard;
|
|
6
6
|
static key: string;
|
|
7
7
|
autoCompleteG: SVGGElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PlaitArrowLine } from '../interfaces';
|
|
2
|
+
import { Generator } from '@plait/common';
|
|
3
|
+
export interface ShapeData {
|
|
4
|
+
}
|
|
5
|
+
export declare class ArrowLineShapeGenerator extends Generator<PlaitArrowLine, ShapeData> {
|
|
6
|
+
canDraw(element: PlaitArrowLine, data: ShapeData): boolean;
|
|
7
|
+
draw(element: PlaitArrowLine, data: ShapeData): SVGGElement;
|
|
8
|
+
}
|
package/generators/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './geometry-shape.generator';
|
|
2
|
-
export * from './line-active.generator';
|
|
3
|
-
export * from './line-auto-complete.generator';
|
|
2
|
+
export * from './arrow-line-active.generator';
|
|
3
|
+
export * from './arrow-line-auto-complete.generator';
|
|
4
4
|
export * from './single-text.generator';
|
|
5
5
|
export * from './text.generator';
|
|
6
6
|
export * from './table.generator';
|
package/geometry.component.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { PlaitBoard, PlaitPluginElementContext, OnContextChanged } from '@plait/
|
|
|
2
2
|
import { PlaitCommonGeometry, PlaitMultipleTextGeometry } from './interfaces/geometry';
|
|
3
3
|
import { GeometryShapeGenerator } from './generators/geometry-shape.generator';
|
|
4
4
|
import { ActiveGenerator, CommonElementFlavour } from '@plait/common';
|
|
5
|
-
import {
|
|
5
|
+
import { ArrowLineAutoCompleteGenerator } from './generators/arrow-line-auto-complete.generator';
|
|
6
6
|
import { TextGenerator } from './generators/text.generator';
|
|
7
7
|
import { SingleTextGenerator } from './generators/single-text.generator';
|
|
8
8
|
export declare class GeometryComponent extends CommonElementFlavour<PlaitCommonGeometry, PlaitBoard> implements OnContextChanged<PlaitCommonGeometry, PlaitBoard> {
|
|
9
9
|
activeGenerator: ActiveGenerator<PlaitCommonGeometry>;
|
|
10
|
-
lineAutoCompleteGenerator:
|
|
10
|
+
lineAutoCompleteGenerator: ArrowLineAutoCompleteGenerator;
|
|
11
11
|
shapeGenerator: GeometryShapeGenerator;
|
|
12
12
|
textGenerator: TextGenerator<PlaitMultipleTextGeometry> | SingleTextGenerator;
|
|
13
13
|
constructor();
|
package/image.component.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PlaitBoard, PlaitPluginElementContext, OnContextChanged } from '@plait/core';
|
|
2
2
|
import { CommonElementFlavour, ImageGenerator } from '@plait/common';
|
|
3
3
|
import { PlaitImage } from './interfaces/image';
|
|
4
|
-
import {
|
|
4
|
+
import { ArrowLineAutoCompleteGenerator } from './generators/arrow-line-auto-complete.generator';
|
|
5
5
|
export declare class ImageComponent extends CommonElementFlavour<PlaitImage, PlaitBoard> implements OnContextChanged<PlaitImage, PlaitBoard> {
|
|
6
6
|
imageGenerator: ImageGenerator<PlaitImage>;
|
|
7
|
-
lineAutoCompleteGenerator:
|
|
7
|
+
lineAutoCompleteGenerator: ArrowLineAutoCompleteGenerator<PlaitImage>;
|
|
8
8
|
constructor();
|
|
9
9
|
initializeGenerator(): void;
|
|
10
10
|
initialize(): void;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Direction, PlaitBoard, PlaitElement, Point, PointOfRectangle, Vector } from '@plait/core';
|
|
2
|
+
import { Element } from 'slate';
|
|
3
|
+
import { StrokeStyle } from './element';
|
|
4
|
+
import { PlaitShapeElement } from '.';
|
|
5
|
+
export declare enum ArrowLineMarkerType {
|
|
6
|
+
arrow = "arrow",
|
|
7
|
+
none = "none",
|
|
8
|
+
openTriangle = "open-triangle",
|
|
9
|
+
solidTriangle = "solid-triangle",
|
|
10
|
+
sharpArrow = "sharp-arrow",
|
|
11
|
+
oneSideUp = "one-side-up",
|
|
12
|
+
oneSideDown = "one-side-down",
|
|
13
|
+
hollowTriangle = "hollow-triangle",
|
|
14
|
+
singleSlash = "single-slash"
|
|
15
|
+
}
|
|
16
|
+
export declare enum ArrowLineShape {
|
|
17
|
+
straight = "straight",
|
|
18
|
+
curve = "curve",
|
|
19
|
+
elbow = "elbow"
|
|
20
|
+
}
|
|
21
|
+
export declare enum ArrowLineHandleKey {
|
|
22
|
+
source = "source",
|
|
23
|
+
target = "target"
|
|
24
|
+
}
|
|
25
|
+
export interface ArrowLineText {
|
|
26
|
+
text: Element;
|
|
27
|
+
position: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ArrowLineHandle {
|
|
32
|
+
boundId?: string;
|
|
33
|
+
connection?: PointOfRectangle;
|
|
34
|
+
marker: ArrowLineMarkerType;
|
|
35
|
+
}
|
|
36
|
+
export interface ArrowLineHandleRef {
|
|
37
|
+
key: ArrowLineHandleKey;
|
|
38
|
+
direction: Direction;
|
|
39
|
+
point: PointOfRectangle;
|
|
40
|
+
vector: Vector;
|
|
41
|
+
boundElement?: PlaitShapeElement;
|
|
42
|
+
}
|
|
43
|
+
export interface ArrowLineHandleRefPair {
|
|
44
|
+
source: ArrowLineHandleRef;
|
|
45
|
+
target: ArrowLineHandleRef;
|
|
46
|
+
}
|
|
47
|
+
export interface PlaitArrowLine extends PlaitElement {
|
|
48
|
+
type: 'arrow-line';
|
|
49
|
+
shape: ArrowLineShape;
|
|
50
|
+
points: Point[];
|
|
51
|
+
source: ArrowLineHandle;
|
|
52
|
+
target: ArrowLineHandle;
|
|
53
|
+
texts: ArrowLineText[];
|
|
54
|
+
strokeColor?: string;
|
|
55
|
+
strokeWidth?: number;
|
|
56
|
+
strokeStyle?: StrokeStyle;
|
|
57
|
+
opacity: number;
|
|
58
|
+
}
|
|
59
|
+
export interface PlaitStraightArrowLine extends PlaitArrowLine {
|
|
60
|
+
shape: ArrowLineShape.straight;
|
|
61
|
+
}
|
|
62
|
+
export interface PlaitCurveArrowLine extends PlaitArrowLine {
|
|
63
|
+
shape: ArrowLineShape.curve;
|
|
64
|
+
}
|
|
65
|
+
export interface PlaitElbowArrowLine extends PlaitArrowLine {
|
|
66
|
+
shape: ArrowLineShape.elbow;
|
|
67
|
+
}
|
|
68
|
+
export declare const PlaitArrowLine: {
|
|
69
|
+
isSourceMarkOrTargetMark(line: PlaitArrowLine, markType: ArrowLineMarkerType, handleKey: ArrowLineHandleKey): boolean;
|
|
70
|
+
isSourceMark(line: PlaitArrowLine, markType: ArrowLineMarkerType): boolean;
|
|
71
|
+
isTargetMark(line: PlaitArrowLine, markType: ArrowLineMarkerType): boolean;
|
|
72
|
+
isBoundElementOfSource(line: PlaitArrowLine, element: PlaitShapeElement): boolean;
|
|
73
|
+
isBoundElementOfTarget(line: PlaitArrowLine, element: PlaitShapeElement): boolean;
|
|
74
|
+
getPoints(board: PlaitBoard, line: PlaitArrowLine): Point[];
|
|
75
|
+
};
|
package/interfaces/element.d.ts
CHANGED
package/interfaces/index.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { GeometryShapes, PlaitGeometry } from './geometry';
|
|
2
2
|
import { PlaitImage } from './image';
|
|
3
|
-
import {
|
|
3
|
+
import { PlaitArrowLine } from './arrow-line';
|
|
4
4
|
import { PlaitSwimlane, SwimlaneSymbols } from './swimlane';
|
|
5
5
|
import { PlaitBaseTable, PlaitTable, TableSymbols } from './table';
|
|
6
6
|
import { PlaitText } from './text';
|
|
7
|
-
|
|
7
|
+
import { PlaitVectorLine } from './vector-line';
|
|
8
|
+
export * from './arrow-line';
|
|
8
9
|
export * from './geometry';
|
|
9
10
|
export * from './text';
|
|
10
11
|
export * from './element';
|
|
11
12
|
export * from './engine';
|
|
12
13
|
export * from './swimlane';
|
|
13
14
|
export * from './table';
|
|
14
|
-
export
|
|
15
|
+
export * from './vector-line';
|
|
16
|
+
export type PlaitDrawElement = PlaitGeometry | PlaitArrowLine | PlaitVectorLine | PlaitImage | PlaitBaseTable | PlaitSwimlane;
|
|
15
17
|
export type PlaitShapeElement = PlaitGeometry | PlaitImage | PlaitTable | PlaitSwimlane;
|
|
16
18
|
export type DrawShapes = GeometryShapes | TableSymbols | SwimlaneSymbols;
|
|
17
19
|
export declare const PlaitDrawElement: {
|
|
18
20
|
isGeometry: (value: any) => value is PlaitGeometry;
|
|
19
|
-
|
|
21
|
+
isArrowLine: (value: any) => value is PlaitArrowLine;
|
|
20
22
|
isText: (value: any) => value is PlaitText;
|
|
21
23
|
isImage: (value: any) => value is PlaitImage;
|
|
22
24
|
isTable: (value: any) => value is PlaitTable;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PlaitElement, Point } from '@plait/core';
|
|
2
|
+
import { StrokeStyle } from './element';
|
|
3
|
+
export declare enum VectorLineShape {
|
|
4
|
+
straight = "straight",
|
|
5
|
+
curve = "curve"
|
|
6
|
+
}
|
|
7
|
+
export interface PlaitVectorLine extends PlaitElement {
|
|
8
|
+
type: 'vector-line';
|
|
9
|
+
shape: VectorLineShape;
|
|
10
|
+
points: Point[];
|
|
11
|
+
strokeColor?: string;
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
strokeStyle?: StrokeStyle;
|
|
14
|
+
fill?: string;
|
|
15
|
+
opacity: number;
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plait/draw",
|
|
3
|
-
"version": "0.62.0-next.
|
|
3
|
+
"version": "0.62.0-next.8",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"is-hotkey": "^0.2.0"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"tslib": "^2.3.0"
|
|
9
9
|
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": "https://github.com/worktile/plait",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"drawing",
|
|
14
|
+
"draw",
|
|
15
|
+
"diagram",
|
|
16
|
+
"flow chart",
|
|
17
|
+
"whiteboard",
|
|
18
|
+
"open-source"
|
|
19
|
+
],
|
|
10
20
|
"module": "fesm2022/plait-draw.mjs",
|
|
11
21
|
"typings": "index.d.ts",
|
|
12
22
|
"exports": {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PlaitBoard } from '@plait/core';
|
|
2
|
+
import { PlaitArrowLine } from '../interfaces';
|
|
3
|
+
export declare const WithArrowLineAutoCompletePluginKey = "plait-arrow-line-auto-complete-plugin-key";
|
|
4
|
+
export interface ArrowLineAutoCompleteOptions {
|
|
5
|
+
afterComplete: (element: PlaitArrowLine) => {};
|
|
6
|
+
}
|
|
7
|
+
export declare const withArrowLineAutoComplete: (board: PlaitBoard) => PlaitBoard;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PlaitBoard } from '@plait/core';
|
|
2
|
-
import {
|
|
2
|
+
import { PlaitArrowLine, PlaitShapeElement } from '../interfaces';
|
|
3
3
|
export declare const withDrawFragment: (baseBoard: PlaitBoard) => PlaitBoard;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getBoundedArrowLineElements: (board: PlaitBoard, plaitShapes: PlaitShapeElement[]) => PlaitArrowLine[];
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { PlaitBoard } from '@plait/core';
|
|
2
1
|
import { PlaitTableBoard } from '../interfaces/table';
|
|
3
|
-
export declare const withSwimlane: (board: PlaitTableBoard) => PlaitBoard;
|
|
2
|
+
export declare const withSwimlane: (board: PlaitTableBoard) => import("@plait/core").PlaitBoard;
|
package/public-api.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './interfaces';
|
|
2
2
|
export * from './plugins/with-draw';
|
|
3
|
-
export * from './plugins/with-line-auto-complete';
|
|
3
|
+
export * from './plugins/with-arrow-line-auto-complete';
|
|
4
4
|
export * from './constants';
|
|
5
5
|
export * from './utils';
|
|
6
6
|
export * from './geometry.component';
|
|
7
|
-
export * from './line.component';
|
|
7
|
+
export * from './arrow-line.component';
|
|
8
8
|
export * from './transforms';
|
|
9
9
|
export * from './generators/index';
|
package/table.component.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import { ActiveGenerator, CommonElementFlavour } from '@plait/common';
|
|
|
3
3
|
import { PlaitTable, PlaitTableCell } from './interfaces/table';
|
|
4
4
|
import { PlaitDrawShapeText, TextGenerator } from './generators/text.generator';
|
|
5
5
|
import { TableGenerator } from './generators/table.generator';
|
|
6
|
-
import {
|
|
6
|
+
import { ArrowLineAutoCompleteGenerator } from './generators/arrow-line-auto-complete.generator';
|
|
7
7
|
export declare class TableComponent<T extends PlaitTable> extends CommonElementFlavour<T, PlaitBoard> implements OnContextChanged<T, PlaitBoard> {
|
|
8
8
|
activeGenerator: ActiveGenerator<T>;
|
|
9
9
|
tableGenerator: TableGenerator<T>;
|
|
10
10
|
textGenerator: TextGenerator<T>;
|
|
11
|
-
lineAutoCompleteGenerator:
|
|
11
|
+
lineAutoCompleteGenerator: ArrowLineAutoCompleteGenerator<PlaitTable>;
|
|
12
12
|
constructor();
|
|
13
13
|
initializeGenerator(): void;
|
|
14
14
|
initialize(): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Path, PlaitBoard } from '@plait/core';
|
|
2
|
+
import { ArrowLineHandleKey, ArrowLineMarkerType, ArrowLineText, PlaitArrowLine, PlaitShapeElement } from '../interfaces';
|
|
3
|
+
export declare const resizeArrowLine: (board: PlaitBoard, options: Partial<PlaitArrowLine>, path: Path) => void;
|
|
4
|
+
export declare const setArrowLineTexts: (board: PlaitBoard, element: PlaitArrowLine, texts: ArrowLineText[]) => void;
|
|
5
|
+
export declare const removeArrowLineText: (board: PlaitBoard, element: PlaitArrowLine, index: number) => void;
|
|
6
|
+
export declare const setArrowLineMark: (board: PlaitBoard, handleKey: ArrowLineHandleKey, marker: ArrowLineMarkerType) => void;
|
|
7
|
+
export declare const setArrowLineShape: (board: PlaitBoard, newProperties: Partial<PlaitArrowLine>) => void;
|
|
8
|
+
export declare const connectArrowLineToDraw: (board: PlaitBoard, lineElement: PlaitArrowLine, handle: ArrowLineHandleKey, geometryElement: PlaitShapeElement) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PlaitBoard, Vector, Point } from '@plait/core';
|
|
2
|
+
import { GeometryShapes, SwimlaneDrawSymbols } from '../interfaces';
|
|
3
|
+
export declare const insertDrawByVector: (board: PlaitBoard, point: Point, shape: GeometryShapes | SwimlaneDrawSymbols, vector: Vector) => import("../interfaces").PlaitCommonGeometry | import("../interfaces").PlaitSwimlane | null;
|
package/transforms/geometry.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { PlaitBoard, Point, Path
|
|
1
|
+
import { PlaitBoard, Point, Path } from '@plait/core';
|
|
2
2
|
import { GeometryShapes } from '../interfaces';
|
|
3
3
|
import { Element } from 'slate';
|
|
4
4
|
export declare const insertGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) => import("../interfaces").PlaitCommonGeometry;
|
|
5
|
-
export declare const insertGeometryByVector: (board: PlaitBoard, point: Point, shape: GeometryShapes, vector: Vector) => import("../interfaces").PlaitCommonGeometry | null;
|
|
6
5
|
export declare const insertText: (board: PlaitBoard, point: Point, text: string | Element) => void;
|
|
7
6
|
export declare const resizeGeometry: (board: PlaitBoard, points: [Point, Point], textHeight: number, path: Path) => void;
|
|
8
7
|
export declare const switchGeometryShape: (board: PlaitBoard, shape: GeometryShapes) => void;
|
package/transforms/index.d.ts
CHANGED
|
@@ -5,20 +5,20 @@ export declare const DrawTransforms: {
|
|
|
5
5
|
resizeGeometry: (board: import("@plait/core").PlaitBoard, points: [import("@plait/core").Point, import("@plait/core").Point], textHeight: number, path: import("@plait/core").Path) => void;
|
|
6
6
|
insertText: (board: import("@plait/core").PlaitBoard, point: import("@plait/core").Point, text: string | import("slate").BaseElement) => void;
|
|
7
7
|
setTextSize: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitGeometry, textWidth: number, textHeight: number) => void;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
resizeArrowLine: (board: import("@plait/core").PlaitBoard, options: Partial<import("@plait/draw").PlaitArrowLine>, path: import("@plait/core").Path) => void;
|
|
9
|
+
setArrowLineTexts: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitArrowLine, texts: import("@plait/draw").ArrowLineText[]) => void;
|
|
10
|
+
removeArrowLineText: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitArrowLine, index: number) => void;
|
|
11
|
+
setArrowLineMark: (board: import("@plait/core").PlaitBoard, handleKey: import("@plait/draw").ArrowLineHandleKey, marker: import("@plait/draw").ArrowLineMarkerType) => void;
|
|
12
|
+
setArrowLineShape: (board: import("@plait/core").PlaitBoard, newProperties: Partial<import("@plait/draw").PlaitArrowLine>) => void;
|
|
13
13
|
insertImage: (board: import("@plait/core").PlaitBoard, imageItem: import("@plait/common").CommonImageItem, startPoint?: import("@plait/core").Point | undefined) => void;
|
|
14
|
+
connectArrowLineToDraw: (board: import("@plait/core").PlaitBoard, lineElement: import("@plait/draw").PlaitArrowLine, handle: import("@plait/draw").ArrowLineHandleKey, geometryElement: import("@plait/draw").PlaitShapeElement) => void;
|
|
14
15
|
switchGeometryShape: (board: import("@plait/core").PlaitBoard, shape: import("@plait/draw").GeometryShapes) => void;
|
|
15
|
-
|
|
16
|
-
insertGeometryByVector: (board: import("@plait/core").PlaitBoard, point: import("@plait/core").Point, shape: import("@plait/draw").GeometryShapes, vector: import("@plait/core").Vector) => import("@plait/draw").PlaitCommonGeometry | null;
|
|
17
|
-
setTableText: (board: import("@plait/core").PlaitBoard, table: import("@plait/draw").PlaitTable, cellId: string, text: import("slate").BaseElement, textWidth: number, textHeight: number) => void;
|
|
16
|
+
setTableText: (board: import("@plait/core").PlaitBoard, path: import("@plait/core").Path, cellId: string, text: import("slate").BaseElement, textHeight: number) => void;
|
|
18
17
|
addSwimlaneRow: (board: import("@plait/core").PlaitBoard, swimlane: import("@plait/draw").PlaitSwimlane, index: number, count?: number) => void;
|
|
19
18
|
addSwimlaneColumn: (board: import("@plait/core").PlaitBoard, swimlane: import("@plait/draw").PlaitSwimlane, index: number, count?: number) => void;
|
|
20
19
|
removeSwimlaneRow: (board: import("@plait/core").PlaitBoard, swimlane: import("@plait/draw").PlaitSwimlane, index: number, count?: number) => void;
|
|
21
20
|
removeSwimlaneColumn: (board: import("@plait/core").PlaitBoard, swimlane: import("@plait/draw").PlaitSwimlane, index: number, count?: number) => void;
|
|
22
|
-
setSwimlaneFill: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitBaseTable, fill: string, path: import("@plait/core").Path) => void;
|
|
23
21
|
updateSwimlaneCount: (board: import("@plait/core").PlaitBoard, swimlane: import("@plait/draw").PlaitSwimlane, count: number) => void;
|
|
22
|
+
setTableFill: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitBaseTable, fill: string, path: import("@plait/core").Path) => void;
|
|
23
|
+
insertDrawByVector: (board: import("@plait/core").PlaitBoard, point: import("@plait/core").Point, shape: import("@plait/draw").GeometryShapes | import("@plait/draw").SwimlaneDrawSymbols, vector: import("@plait/core").Vector) => import("@plait/draw").PlaitCommonGeometry | import("@plait/draw").PlaitSwimlane | null;
|
|
24
24
|
};
|
package/transforms/swimlane.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlaitBoard } from '@plait/core';
|
|
2
2
|
import { PlaitSwimlane } from '../interfaces';
|
|
3
|
-
import { PlaitBaseTable } from '../interfaces/table';
|
|
4
3
|
export declare const updateSwimlaneCount: (board: PlaitBoard, swimlane: PlaitSwimlane, count: number) => void;
|
|
5
4
|
export declare const addSwimlaneRow: (board: PlaitBoard, swimlane: PlaitSwimlane, index: number, count?: number) => void;
|
|
6
5
|
export declare const addSwimlaneColumn: (board: PlaitBoard, swimlane: PlaitSwimlane, index: number, count?: number) => void;
|
|
7
6
|
export declare const removeSwimlaneRow: (board: PlaitBoard, swimlane: PlaitSwimlane, index: number, count?: number) => void;
|
|
8
7
|
export declare const removeSwimlaneColumn: (board: PlaitBoard, swimlane: PlaitSwimlane, index: number, count?: number) => void;
|
|
9
|
-
export declare const setSwimlaneFill: (board: PlaitBoard, element: PlaitBaseTable, fill: string, path: Path) => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PlaitBoard } from '@plait/core';
|
|
1
|
+
import { Path, PlaitBoard } from '@plait/core';
|
|
2
2
|
import { Element } from 'slate';
|
|
3
|
-
|
|
4
|
-
export declare const setTableText: (board: PlaitBoard, table: PlaitTable, cellId: string, text: Element, textWidth: number, textHeight: number) => void;
|
|
3
|
+
export declare const setTableText: (board: PlaitBoard, path: Path, cellId: string, text: Element, textHeight: number) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Point, PlaitBoard, RectangleClient } from '@plait/core';
|
|
2
|
+
import { ArrowLineHandle, ArrowLineShape, ArrowLineText, PlaitArrowLine, PlaitShapeElement } from '../../interfaces';
|
|
3
|
+
export declare const createArrowLineElement: (shape: ArrowLineShape, points: [Point, Point], source: ArrowLineHandle, target: ArrowLineHandle, texts?: ArrowLineText[], options?: Pick<PlaitArrowLine, 'strokeColor' | 'strokeWidth'>) => PlaitArrowLine;
|
|
4
|
+
export declare const getArrowLinePoints: (board: PlaitBoard, element: PlaitArrowLine) => Point[];
|
|
5
|
+
export declare const getCurvePoints: (board: PlaitBoard, element: PlaitArrowLine) => Point[];
|
|
6
|
+
export declare function getMiddlePoints(board: PlaitBoard, element: PlaitArrowLine): Point[];
|
|
7
|
+
export declare const drawArrowLine: (board: PlaitBoard, element: PlaitArrowLine) => SVGGElement;
|
|
8
|
+
export declare const getHitConnection: (board: PlaitBoard, point: Point, hitElement: PlaitShapeElement) => Point;
|
|
9
|
+
export declare const getHitConnectorPoint: (point: Point, hitElement: PlaitShapeElement) => Point | undefined;
|
|
10
|
+
export declare const getArrowLineTextRectangle: (board: PlaitBoard, element: PlaitArrowLine, index: number) => RectangleClient;
|
|
11
|
+
export declare const getArrowLines: (board: PlaitBoard) => PlaitArrowLine[];
|
|
12
|
+
export declare const Q2C: (points: Point[]) => Point[];
|
|
13
|
+
export declare const handleArrowLineCreating: (board: PlaitBoard, lineShape: ArrowLineShape, sourcePoint: Point, movingPoint: Point, sourceElement: PlaitShapeElement | null, lineShapeG: SVGGElement) => PlaitArrowLine;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Point, PlaitBoard, RectangleClient, PointOfRectangle, Direction, Vector } from '@plait/core';
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
1
|
+
import { Point, PlaitBoard, RectangleClient, PointOfRectangle, Direction, Vector, Path } from '@plait/core';
|
|
2
|
+
import { ArrowLineHandleRefPair, PlaitArrowLine, PlaitShapeElement } from '../../interfaces';
|
|
3
|
+
export declare const getArrowLineHandleRefPair: (board: PlaitBoard, element: PlaitArrowLine) => ArrowLineHandleRefPair;
|
|
4
4
|
export declare const getConnectionPoint: (geometry: PlaitShapeElement, connection: Point, direction?: Direction, delta?: number) => Point;
|
|
5
5
|
export declare const getVectorByConnection: (boundElement: PlaitShapeElement, connection: PointOfRectangle) => Vector;
|
|
6
|
-
export declare const getElbowLineRouteOptions: (board: PlaitBoard, element:
|
|
6
|
+
export declare const getElbowLineRouteOptions: (board: PlaitBoard, element: PlaitArrowLine, handleRefPair?: ArrowLineHandleRefPair) => {
|
|
7
7
|
sourcePoint: PointOfRectangle;
|
|
8
8
|
nextSourcePoint: Point;
|
|
9
9
|
sourceRectangle: RectangleClient;
|
|
@@ -23,3 +23,7 @@ export declare const getElbowLineRouteOptions: (board: PlaitBoard, element: Plai
|
|
|
23
23
|
height: number;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
+
export declare const collectArrowLineUpdatedRefsByGeometry: (board: PlaitBoard, element: PlaitShapeElement, refs: {
|
|
27
|
+
property: Partial<PlaitArrowLine>;
|
|
28
|
+
path: Path;
|
|
29
|
+
}[]) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElbowLineRouteOptions, ResizeState } from '@plait/common';
|
|
2
2
|
import { PlaitBoard, Point } from '@plait/core';
|
|
3
|
-
import {
|
|
3
|
+
import { PlaitArrowLine } from '../../interfaces';
|
|
4
4
|
export declare const alignPoints: (basePoint: Point, movingPoint: Point) => Point;
|
|
5
5
|
export declare function getResizedPreviousAndNextPoint(nextRenderPoints: Point[], sourcePoint: Point, targetPoint: Point, handleIndex: number): {
|
|
6
6
|
previous: Point | null;
|
|
@@ -10,7 +10,7 @@ export declare function alignElbowSegment(startKeyPoint: Point, endKeyPoint: Poi
|
|
|
10
10
|
previous: Point | null;
|
|
11
11
|
next: Point | null;
|
|
12
12
|
}): Point[];
|
|
13
|
-
export declare function getIndexAndDeleteCountByKeyPoint(board: PlaitBoard, element:
|
|
13
|
+
export declare function getIndexAndDeleteCountByKeyPoint(board: PlaitBoard, element: PlaitArrowLine, dataPoints: Point[], nextRenderPoints: Point[], handleIndex: number): {
|
|
14
14
|
index: null;
|
|
15
15
|
deleteCount: null;
|
|
16
16
|
} | {
|
|
@@ -18,6 +18,6 @@ export declare function getIndexAndDeleteCountByKeyPoint(board: PlaitBoard, elem
|
|
|
18
18
|
deleteCount: number | null;
|
|
19
19
|
};
|
|
20
20
|
export declare function getMirrorDataPoints(board: PlaitBoard, nextDataPoints: Point[], nextKeyPoints: Point[], params: ElbowLineRouteOptions): Point[];
|
|
21
|
-
export declare function isUpdatedHandleIndex(board: PlaitBoard, element:
|
|
21
|
+
export declare function isUpdatedHandleIndex(board: PlaitBoard, element: PlaitArrowLine, dataPoints: Point[], nextRenderPoints: Point[], handleIndex: number): boolean;
|
|
22
22
|
export declare function getMidKeyPoints(simplifiedNextKeyPoints: Point[], startPoint: Point, endPoint: Point): Point[];
|
|
23
23
|
export declare const hasIllegalElbowPoint: (midDataPoints: Point[]) => boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Point, PlaitBoard, RectangleClient } from '@plait/core';
|
|
2
2
|
import { ElbowLineRouteOptions } from '@plait/common';
|
|
3
|
-
import {
|
|
4
|
-
export declare const isSelfLoop: (element:
|
|
5
|
-
export declare const isUseDefaultOrthogonalRoute: (element:
|
|
6
|
-
export declare const getElbowPoints: (board: PlaitBoard, element:
|
|
7
|
-
export declare const getNextSourceAndTargetPoints: (board: PlaitBoard, element:
|
|
8
|
-
export declare const getSourceAndTargetRectangle: (board: PlaitBoard, element:
|
|
3
|
+
import { ArrowLineHandleRefPair, PlaitArrowLine } from '../../interfaces';
|
|
4
|
+
export declare const isSelfLoop: (element: PlaitArrowLine) => boolean | "" | undefined;
|
|
5
|
+
export declare const isUseDefaultOrthogonalRoute: (element: PlaitArrowLine, options: ElbowLineRouteOptions) => boolean;
|
|
6
|
+
export declare const getElbowPoints: (board: PlaitBoard, element: PlaitArrowLine) => Point[];
|
|
7
|
+
export declare const getNextSourceAndTargetPoints: (board: PlaitBoard, element: PlaitArrowLine) => Point[];
|
|
8
|
+
export declare const getSourceAndTargetRectangle: (board: PlaitBoard, element: PlaitArrowLine, handleRefPair: ArrowLineHandleRefPair) => {
|
|
9
9
|
sourceRectangle: RectangleClient;
|
|
10
10
|
targetRectangle: RectangleClient;
|
|
11
11
|
};
|
|
12
|
-
export declare function getNextRenderPoints(board: PlaitBoard, element:
|
|
12
|
+
export declare function getNextRenderPoints(board: PlaitBoard, element: PlaitArrowLine, renderPoints?: Point[]): Point[];
|
package/utils/clipboard.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlaitBoard, Point } from '@plait/core';
|
|
2
|
-
import { PlaitDrawElement, PlaitGeometry,
|
|
2
|
+
import { PlaitArrowLine, PlaitDrawElement, PlaitGeometry, PlaitShapeElement } from '../interfaces';
|
|
3
3
|
import { PlaitTable } from '../interfaces/table';
|
|
4
|
-
export declare const buildClipboardData: (board: PlaitBoard, elements: PlaitDrawElement[], startPoint: Point) => (PlaitGeometry | import("../interfaces").PlaitBaseTable |
|
|
4
|
+
export declare const buildClipboardData: (board: PlaitBoard, elements: PlaitDrawElement[], startPoint: Point) => (PlaitGeometry | import("../interfaces").PlaitBaseTable | PlaitArrowLine | import("../interfaces").PlaitVectorLine)[];
|
|
5
5
|
export declare const insertClipboardData: (board: PlaitBoard, elements: PlaitDrawElement[], startPoint: Point) => void;
|
|
6
|
-
export declare const insertClipboardTableData: (board: PlaitBoard, elements: PlaitTable[], startPoint: Point, lines:
|
|
7
|
-
export declare const
|
|
6
|
+
export declare const insertClipboardTableData: (board: PlaitBoard, elements: PlaitTable[], startPoint: Point, lines: PlaitArrowLine[]) => void;
|
|
7
|
+
export declare const updateBoundArrowLinesId: (element: PlaitShapeElement, lines: PlaitArrowLine[], newId: string) => void;
|
package/utils/common.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare const getStrokeWidthByElement: (element: PlaitElement) => any;
|
|
|
14
14
|
export declare const insertElement: (board: PlaitBoard, element: PlaitBaseGeometry | PlaitBaseTable) => void;
|
|
15
15
|
export declare const isDrawElementIncludeText: (element: PlaitDrawElement) => boolean;
|
|
16
16
|
export declare const isDrawElementsIncludeText: (elements: PlaitDrawElement[]) => boolean;
|
|
17
|
+
export declare const isDrawElementClosed: (element: PlaitDrawElement) => boolean;
|
|
17
18
|
export declare const getSnappingShape: (board: PlaitBoard, point: Point) => PlaitShapeElement | null;
|
|
18
19
|
export declare const getSnappingRef: (board: PlaitBoard, hitElement: PlaitShapeElement, point: Point) => {
|
|
19
20
|
isHitEdge: boolean;
|
package/utils/geometry.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ export declare const getDefaultUMLProperty: (shape: UMLSymbols) => {
|
|
|
122
122
|
align: Alignment;
|
|
123
123
|
}[];
|
|
124
124
|
};
|
|
125
|
-
export declare const createDefaultFlowchart: (point: Point) => (PlaitGeometry | import("../interfaces").
|
|
125
|
+
export declare const createDefaultFlowchart: (point: Point) => (PlaitGeometry | import("../interfaces").PlaitArrowLine)[];
|
|
126
126
|
export declare const getAutoCompletePoints: (element: PlaitShapeElement) => [Point, Point, Point, Point];
|
|
127
127
|
export declare const getHitIndexOfAutoCompletePoint: (movingPoint: Point, points: Point[]) => number;
|
|
128
128
|
export declare const getDrawDefaultStrokeColor: (theme: ThemeColorMode) => string;
|
|
@@ -144,3 +144,4 @@ export declare const rerenderGeometryActive: (board: PlaitBoard, element: PlaitG
|
|
|
144
144
|
export declare const isGeometryIncludeText: (element: PlaitGeometry) => boolean;
|
|
145
145
|
export declare const isSingleTextShape: (shape: GeometryShapes) => boolean;
|
|
146
146
|
export declare const isSingleTextGeometry: (element: PlaitGeometry) => boolean;
|
|
147
|
+
export declare const isGeometryClosed: (element: PlaitGeometry) => boolean;
|
package/utils/hit.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { PlaitElement, RectangleClient, Selection, PlaitBoard, Point } from '@plait/core';
|
|
2
|
-
import { PlaitCommonGeometry,
|
|
2
|
+
import { PlaitArrowLine, PlaitCommonGeometry, PlaitDrawElement, PlaitGeometry, PlaitShapeElement } from '../interfaces';
|
|
3
3
|
export declare const isTextExceedingBounds: (geometry: PlaitGeometry) => boolean;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const isHitArrowLineText: (board: PlaitBoard, element: PlaitArrowLine, point: Point) => boolean;
|
|
5
5
|
export declare const isHitPolyLine: (pathPoints: Point[], point: Point) => boolean;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const isHitElementText: (element: PlaitCommonGeometry, point: Point) => boolean;
|
|
6
|
+
export declare const isHitArrowLine: (board: PlaitBoard, element: PlaitArrowLine, point: Point) => boolean;
|
|
8
7
|
export declare const isRectangleHitElementText: (element: PlaitCommonGeometry, rectangle: RectangleClient) => boolean;
|
|
8
|
+
export declare const isHitElementText: (element: PlaitCommonGeometry, point: Point) => boolean;
|
|
9
9
|
export declare const isRectangleHitDrawElement: (board: PlaitBoard, element: PlaitElement, selection: Selection) => boolean | null;
|
|
10
|
+
export declare const getDrawHitElement: (board: PlaitBoard, elements: PlaitDrawElement[]) => PlaitElement;
|
|
11
|
+
export declare const getFirstFilledDrawElement: (board: PlaitBoard, elements: PlaitDrawElement[]) => PlaitGeometry | null;
|
|
12
|
+
export declare const getFirstTextOrLineElement: (elements: PlaitDrawElement[]) => PlaitGeometry | import("../interfaces").PlaitBaseTable | import("../interfaces/image").PlaitImage | PlaitArrowLine | import("../interfaces").PlaitVectorLine | null;
|
|
10
13
|
export declare const isHitDrawElement: (board: PlaitBoard, element: PlaitElement, point: Point) => boolean | null;
|
|
11
14
|
export declare const isHitEdgeOfShape: (board: PlaitBoard, element: PlaitShapeElement, point: Point, hitDistanceBuffer: number) => boolean;
|
|
12
15
|
export declare const isInsideOfShape: (board: PlaitBoard, element: PlaitShapeElement, point: Point, hitDistanceBuffer: number) => boolean;
|
package/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PlaitBoard, Point } from '@plait/core';
|
|
2
|
+
import { PlaitArrowLine } from '../../interfaces';
|
|
3
|
+
export declare enum ArrowLineResizeHandle {
|
|
4
|
+
'source' = "source",
|
|
5
|
+
'target' = "target",
|
|
6
|
+
'addHandle' = "addHandle"
|
|
7
|
+
}
|
|
8
|
+
export declare const getHitArrowLineResizeHandleRef: (board: PlaitBoard, element: PlaitArrowLine, point: Point) => {
|
|
9
|
+
handle: ArrowLineResizeHandle;
|
|
10
|
+
handleIndex: number;
|
|
11
|
+
} | {
|
|
12
|
+
handleIndex: number;
|
|
13
|
+
handle?: undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
export declare function getHitPointIndex(points: Point[], movingPoint: Point): number;
|
|
16
|
+
export declare const getHitArrowLineTextIndex: (board: PlaitBoard, element: PlaitArrowLine, point: Point) => number;
|
package/utils/selected.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PlaitBoard, PlaitElement } from '@plait/core';
|
|
2
|
-
import { PlaitDrawElement, PlaitGeometry,
|
|
2
|
+
import { PlaitArrowLine, PlaitDrawElement, PlaitGeometry, PlaitSwimlane } from '../interfaces';
|
|
3
3
|
import { PlaitImage } from '../interfaces/image';
|
|
4
4
|
export declare const getSelectedDrawElements: (board: PlaitBoard, elements?: PlaitElement[]) => PlaitDrawElement[];
|
|
5
5
|
export declare const getSelectedGeometryElements: (board: PlaitBoard) => PlaitGeometry[];
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const getSelectedArrowLineElements: (board: PlaitBoard) => PlaitArrowLine[];
|
|
7
7
|
export declare const getSelectedImageElements: (board: PlaitBoard) => PlaitImage[];
|
|
8
8
|
export declare const isSingleSelectSwimlane: (board: PlaitBoard) => boolean;
|
|
9
9
|
export declare const getSelectedSwimlane: (board: PlaitBoard) => PlaitSwimlane;
|