@abyss-project/main 1.0.71 → 1.0.72
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Endpoint, ICON_LIBRARY } from '../utils';
|
|
1
|
+
import { Endpoint, ICON_LIBRARY, CurvePoint } from '../utils';
|
|
2
2
|
export type DrawData = {
|
|
3
3
|
drawId: string | null;
|
|
4
4
|
shapes: DrawShapeToJsonResult[];
|
|
@@ -39,8 +39,12 @@ export interface DrawStyle {
|
|
|
39
39
|
cornerRadius: number;
|
|
40
40
|
fontSize: number;
|
|
41
41
|
fontFamily: string;
|
|
42
|
+
fontWeight?: number;
|
|
42
43
|
preserveAspectRatio: boolean;
|
|
43
44
|
rotation: number;
|
|
45
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
46
|
+
textVerticalPosition?: 'top' | 'center' | 'bottom';
|
|
47
|
+
textHorizontalPosition?: 'left' | 'center' | 'right';
|
|
44
48
|
}
|
|
45
49
|
export interface ShapeProperties {
|
|
46
50
|
position: Point;
|
|
@@ -56,10 +60,11 @@ export declare enum DrawShapeType {
|
|
|
56
60
|
ICON = "ICON",
|
|
57
61
|
IMAGE = "IMAGE",
|
|
58
62
|
COMMENT = "COMMENT",
|
|
59
|
-
ARROW = "ARROW"
|
|
63
|
+
ARROW = "ARROW",
|
|
64
|
+
PENCIL = "PENCIL"
|
|
60
65
|
}
|
|
61
66
|
export type ResizeShape = {
|
|
62
|
-
corner: 'se' | 'sw' | 'ne' | 'nw';
|
|
67
|
+
corner: 'se' | 'sw' | 'ne' | 'nw' | 'e' | 'w' | 'n' | 's';
|
|
63
68
|
startPos: Point;
|
|
64
69
|
originalSize: DrawSize;
|
|
65
70
|
originalPosition: Point;
|
|
@@ -71,6 +76,12 @@ export type RotationData = {
|
|
|
71
76
|
};
|
|
72
77
|
export type Id = string;
|
|
73
78
|
export type PortId = 'top' | 'right' | 'bottom' | 'left' | 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
79
|
+
export type TextAnchor = {
|
|
80
|
+
shapeId: string;
|
|
81
|
+
portId: PortId;
|
|
82
|
+
offsetX?: number;
|
|
83
|
+
offsetY?: number;
|
|
84
|
+
};
|
|
74
85
|
export type DrawShapeToJsonBaseResult = {
|
|
75
86
|
id: string;
|
|
76
87
|
type: DrawShapeType;
|
|
@@ -84,6 +95,7 @@ export type DrawShapeArrowToJsonResult = DrawShapeToJsonBaseResult & {
|
|
|
84
95
|
type: DrawShapeType.ARROW;
|
|
85
96
|
startEndpoint: Endpoint;
|
|
86
97
|
endEndpoint: Endpoint;
|
|
98
|
+
curvePoints?: CurvePoint[];
|
|
87
99
|
};
|
|
88
100
|
export type DrawShapeIconToJsonResult = DrawShapeToJsonBaseResult & {
|
|
89
101
|
type: DrawShapeType.ICON;
|
|
@@ -92,6 +104,7 @@ export type DrawShapeIconToJsonResult = DrawShapeToJsonBaseResult & {
|
|
|
92
104
|
export type DrawShapeTextToJsonResult = DrawShapeToJsonBaseResult & {
|
|
93
105
|
type: DrawShapeType.TEXT;
|
|
94
106
|
text: string;
|
|
107
|
+
anchor?: TextAnchor;
|
|
95
108
|
};
|
|
96
109
|
export type DrawShapeRectangleToJsonResult = {
|
|
97
110
|
type: DrawShapeType.RECTANGLE;
|
|
@@ -112,4 +125,8 @@ export type DrawShapeCommentToJsonResult = DrawShapeToJsonBaseResult & {
|
|
|
112
125
|
text: string;
|
|
113
126
|
date: string;
|
|
114
127
|
};
|
|
115
|
-
export type
|
|
128
|
+
export type DrawShapePencilToJsonResult = DrawShapeToJsonBaseResult & {
|
|
129
|
+
type: DrawShapeType.PENCIL;
|
|
130
|
+
points: number[];
|
|
131
|
+
};
|
|
132
|
+
export type DrawShapeToJsonResult = DrawShapeArrowToJsonResult | DrawShapeIconToJsonResult | DrawShapeTextToJsonResult | DrawShapeRectangleToJsonResult | DrawShapeDiamondToJsonResult | DrawShapeImageToJsonResult | DrawShapeCommentToJsonResult | DrawShapeEllipseToJsonResult | DrawShapePencilToJsonResult;
|
package/dist/types/draw.type.js
CHANGED
|
@@ -11,6 +11,9 @@ export type Endpoint = {
|
|
|
11
11
|
portId: PortId;
|
|
12
12
|
});
|
|
13
13
|
export type DrawArrowEndpointStyle = 'arrow' | 'circle' | 'square' | 'diamond' | 'none';
|
|
14
|
+
export type CurvePoint = Point & {
|
|
15
|
+
type: 'straight' | 'curved';
|
|
16
|
+
};
|
|
14
17
|
export declare const rectangleToSvg: (position: Point, size: DrawSize, style: DrawStyle) => string;
|
|
15
18
|
export declare const diamondToSvg: (position: Point, size: DrawSize, style: DrawStyle) => string;
|
|
16
19
|
export declare const ellipseToSvg: (position: Point, size: DrawSize, style: DrawStyle) => string;
|