@plait/draw 0.75.0 → 0.77.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/constants/default.d.ts +4 -0
- package/constants/index.d.ts +1 -0
- package/esm2022/arrow-line.component.mjs +14 -7
- package/esm2022/constants/default.mjs +6 -1
- package/esm2022/constants/index.mjs +2 -1
- package/esm2022/generators/arrow-line-auto-complete.generator.mjs +3 -3
- package/esm2022/generators/line-active.generator.mjs +14 -10
- package/esm2022/geometry.component.mjs +20 -11
- package/esm2022/image.component.mjs +12 -8
- package/esm2022/plugins/with-arrow-line-auto-complete-reaction.mjs +9 -7
- package/esm2022/plugins/with-arrow-line-auto-complete.mjs +9 -8
- package/esm2022/plugins/with-arrow-line-bound-reaction.mjs +4 -4
- package/esm2022/plugins/with-arrow-line-text.mjs +20 -8
- package/esm2022/plugins/with-draw-resize.mjs +28 -21
- package/esm2022/plugins/with-draw-rotate.mjs +23 -18
- package/esm2022/plugins/with-geometry-create.mjs +10 -10
- package/esm2022/plugins/with-swimlane-create.mjs +4 -4
- package/esm2022/plugins/with-table-resize.mjs +15 -11
- package/esm2022/plugins/with-table.mjs +8 -5
- package/esm2022/table.component.mjs +19 -12
- package/esm2022/utils/arrow-line/arrow-line-basic.mjs +3 -3
- package/esm2022/utils/common.mjs +14 -11
- package/esm2022/utils/geometry.mjs +12 -74
- package/esm2022/utils/hit.mjs +3 -3
- package/esm2022/utils/table-selected.mjs +1 -5
- package/esm2022/utils/table.mjs +3 -3
- package/esm2022/utils/uml.mjs +7 -5
- package/esm2022/utils/vector-line.mjs +2 -2
- package/esm2022/vector-line.component.mjs +12 -5
- package/fesm2022/plait-draw.mjs +1516 -1502
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/generators/line-active.generator.d.ts +5 -1
- package/package.json +1 -1
- package/plugins/with-arrow-line-text.d.ts +1 -0
- package/plugins/with-draw-resize.d.ts +1 -0
- package/utils/common.d.ts +1 -0
- package/utils/geometry.d.ts +19 -21
- package/utils/table-selected.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Point } from '@plait/core';
|
|
1
|
+
import { PlaitBoard, Point } from '@plait/core';
|
|
2
2
|
import { Generator } from '@plait/common';
|
|
3
3
|
import { PlaitLine } from '../interfaces/line';
|
|
4
4
|
export interface ActiveData {
|
|
@@ -6,7 +6,11 @@ export interface ActiveData {
|
|
|
6
6
|
linePoints: Point[];
|
|
7
7
|
}
|
|
8
8
|
export declare class LineActiveGenerator extends Generator<PlaitLine, ActiveData> {
|
|
9
|
+
protected board: PlaitBoard;
|
|
9
10
|
onlySelectedCurrentLine: boolean;
|
|
11
|
+
constructor(board: PlaitBoard, options?: {
|
|
12
|
+
active: boolean;
|
|
13
|
+
});
|
|
10
14
|
canDraw(element: PlaitLine, data: ActiveData): boolean;
|
|
11
15
|
draw(element: PlaitLine, data: ActiveData): SVGGElement;
|
|
12
16
|
needUpdate(): boolean;
|
package/package.json
CHANGED
|
@@ -21,3 +21,4 @@ export declare const movePointByZoomAndOriginPoint: (p: Point, resizeOriginPoint
|
|
|
21
21
|
* 3. Reverse rotate the scaled points by 90°
|
|
22
22
|
*/
|
|
23
23
|
export declare const getResizePointsByOtherwiseAxis: (board: PlaitBoard, points: Point[], resizeOriginPoint: Point, xZoom: number, yZoom: number) => Point[];
|
|
24
|
+
export declare const generatorResizeHandles: (board: PlaitBoard, resizeActivePoints?: Point[], needCustomActiveRectangle?: boolean) => SVGGElement;
|
package/utils/common.d.ts
CHANGED
|
@@ -33,3 +33,4 @@ export declare const drawBoundReaction: (board: PlaitBoard, element: PlaitShapeE
|
|
|
33
33
|
export declare const getTextKey: (element: PlaitElement | undefined, text: Pick<DrawTextInfo, "id">) => string;
|
|
34
34
|
export declare const getGeometryAlign: (board: PlaitBoard, element: PlaitCommonGeometry | PlaitBaseTable) => Alignment;
|
|
35
35
|
export declare const isClosedPoints: (points: Point[]) => boolean;
|
|
36
|
+
export declare const getDefaultGeometryText: (board: PlaitBoard) => string;
|
package/utils/geometry.d.ts
CHANGED
|
@@ -67,6 +67,9 @@ export declare const getDefaultUMLProperty: (shape: UMLSymbols) => {
|
|
|
67
67
|
} | {
|
|
68
68
|
width: number;
|
|
69
69
|
height: number;
|
|
70
|
+
} | {
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
70
73
|
} | {
|
|
71
74
|
width: number;
|
|
72
75
|
height: number;
|
|
@@ -78,12 +81,25 @@ export declare const getDefaultUMLProperty: (shape: UMLSymbols) => {
|
|
|
78
81
|
} | {
|
|
79
82
|
width: number;
|
|
80
83
|
height: number;
|
|
84
|
+
texts: {
|
|
85
|
+
id: import("../interfaces").GeometryCommonTextKeys;
|
|
86
|
+
text: string;
|
|
87
|
+
align: Alignment;
|
|
88
|
+
}[];
|
|
81
89
|
} | {
|
|
82
90
|
width: number;
|
|
83
91
|
height: number;
|
|
92
|
+
texts: {
|
|
93
|
+
text: string;
|
|
94
|
+
align: Alignment;
|
|
95
|
+
}[];
|
|
84
96
|
} | {
|
|
85
97
|
width: number;
|
|
86
98
|
height: number;
|
|
99
|
+
texts: {
|
|
100
|
+
text: string;
|
|
101
|
+
align: Alignment;
|
|
102
|
+
}[];
|
|
87
103
|
} | {
|
|
88
104
|
width: number;
|
|
89
105
|
height: number;
|
|
@@ -102,32 +118,15 @@ export declare const getDefaultUMLProperty: (shape: UMLSymbols) => {
|
|
|
102
118
|
} | {
|
|
103
119
|
width: number;
|
|
104
120
|
height: number;
|
|
105
|
-
texts: {
|
|
106
|
-
id: import("../interfaces").GeometryCommonTextKeys;
|
|
107
|
-
text: string;
|
|
108
|
-
align: Alignment;
|
|
109
|
-
}[];
|
|
110
|
-
} | {
|
|
111
|
-
width: number;
|
|
112
|
-
height: number;
|
|
113
|
-
texts: {
|
|
114
|
-
text: string;
|
|
115
|
-
align: Alignment;
|
|
116
|
-
}[];
|
|
117
121
|
} | {
|
|
118
122
|
width: number;
|
|
119
123
|
height: number;
|
|
120
|
-
texts: {
|
|
121
|
-
text: string;
|
|
122
|
-
align: Alignment;
|
|
123
|
-
}[];
|
|
124
124
|
};
|
|
125
|
-
export declare const
|
|
126
|
-
export declare const getAutoCompletePoints: (element: PlaitShapeElement) => [Point, Point, Point, Point];
|
|
125
|
+
export declare const getAutoCompletePoints: (board: PlaitBoard, element: PlaitShapeElement, isToActive?: boolean) => [Point, Point, Point, Point];
|
|
127
126
|
export declare const getHitIndexOfAutoCompletePoint: (movingPoint: Point, points: Point[]) => number;
|
|
128
127
|
export declare const getDrawDefaultStrokeColor: (theme: ThemeColorMode) => string;
|
|
129
128
|
export declare const getFlowchartDefaultFill: (theme: ThemeColorMode) => string;
|
|
130
|
-
export declare const getTextShapeProperty: (board: PlaitBoard, text
|
|
129
|
+
export declare const getTextShapeProperty: (board: PlaitBoard, text: string | Element, fontSize?: number | string) => {
|
|
131
130
|
width: number;
|
|
132
131
|
height: number;
|
|
133
132
|
};
|
|
@@ -137,10 +136,9 @@ export declare const getDefaultGeometryProperty: (pointer: DrawPointerType) => {
|
|
|
137
136
|
height: number;
|
|
138
137
|
};
|
|
139
138
|
export declare const getDefaultTextPoints: (board: PlaitBoard, centerPoint: Point, fontSize?: number | string) => [Point, Point];
|
|
140
|
-
export declare const createTextElement: (board: PlaitBoard, points: [Point, Point], text
|
|
139
|
+
export declare const createTextElement: (board: PlaitBoard, points: [Point, Point], text: string | Element, textHeight?: number) => PlaitGeometry;
|
|
141
140
|
export declare const createDefaultGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) => import("../interfaces").PlaitCommonGeometry<"geometry", [Point, Point], GeometryShapes>;
|
|
142
141
|
export declare const editText: (board: PlaitBoard, element: PlaitGeometry, text?: DrawTextInfo) => void;
|
|
143
|
-
export declare const rerenderGeometryActive: (board: PlaitBoard, element: PlaitGeometry) => void;
|
|
144
142
|
export declare const isGeometryIncludeText: (element: PlaitGeometry) => boolean;
|
|
145
143
|
export declare const isSingleTextShape: (shape: GeometryShapes) => boolean;
|
|
146
144
|
export declare const isSingleTextGeometry: (element: PlaitGeometry) => boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PlaitBoard, PlaitElement } from '@plait/core';
|
|
2
2
|
import { PlaitTableCell, PlaitBaseTable, PlaitTable } from '../interfaces/table';
|
|
3
3
|
export declare const isSingleSelectTable: (board: PlaitBoard) => boolean;
|
|
4
|
-
export declare const isSingleSelectElementByTable: (board: PlaitBoard) => boolean;
|
|
5
4
|
export declare const getSelectedTableElements: (board: PlaitBoard, elements?: PlaitElement[]) => PlaitTable[];
|
|
6
5
|
export declare const SELECTED_CELLS: WeakMap<PlaitBaseTable, PlaitTableCell[]>;
|
|
7
6
|
export declare function getSelectedCells(element: PlaitBaseTable): PlaitTableCell[] | undefined;
|