@plait/draw 0.41.0 → 0.43.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/esm2022/geometry.component.mjs +1 -1
- package/esm2022/plugins/with-draw-fragment.mjs +3 -4
- package/esm2022/plugins/with-geometry-create.mjs +7 -7
- package/esm2022/transforms/geometry.mjs +8 -5
- package/esm2022/transforms/line.mjs +2 -2
- package/esm2022/utils/geometry.mjs +12 -10
- package/esm2022/utils/line.mjs +10 -4
- package/fesm2022/plait-draw.mjs +32 -22
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/package.json +1 -1
- package/transforms/geometry.d.ts +1 -1
- package/transforms/index.d.ts +1 -1
- package/utils/clipboard.d.ts +1 -1
- package/utils/geometry.d.ts +3 -4
- package/utils/line.d.ts +1 -1
package/package.json
CHANGED
package/transforms/geometry.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ 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").PlaitGeometry;
|
|
5
5
|
export declare const insertGeometryByVector: (board: PlaitBoard, point: Point, shape: GeometryShapes, vector: Vector) => import("../interfaces").PlaitGeometry | null;
|
|
6
|
-
export declare const insertText: (board: PlaitBoard,
|
|
6
|
+
export declare const insertText: (board: PlaitBoard, point: Point, text: string | Element) => void;
|
|
7
7
|
export declare const resizeGeometry: (board: PlaitBoard, points: [Point, Point], textHeight: number, path: Path) => void;
|
|
8
8
|
export declare const switchGeometryShape: (board: PlaitBoard, shape: GeometryShapes) => void;
|
package/transforms/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const DrawTransforms: {
|
|
|
2
2
|
setText: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitGeometry, text: import("slate").BaseElement, width: number, textHeight: number) => void;
|
|
3
3
|
insertGeometry: (board: import("@plait/core").PlaitBoard, points: [import("@plait/core").Point, import("@plait/core").Point], shape: import("@plait/draw").GeometryShapes) => import("@plait/draw").PlaitGeometry;
|
|
4
4
|
resizeGeometry: (board: import("@plait/core").PlaitBoard, points: [import("@plait/core").Point, import("@plait/core").Point], textHeight: number, path: import("@plait/core").Path) => void;
|
|
5
|
-
insertText: (board: import("@plait/core").PlaitBoard,
|
|
5
|
+
insertText: (board: import("@plait/core").PlaitBoard, point: import("@plait/core").Point, text: string | import("slate").BaseElement) => void;
|
|
6
6
|
setTextSize: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitGeometry, textWidth: number, textHeight: number) => void;
|
|
7
7
|
resizeLine: (board: import("@plait/core").PlaitBoard, options: Partial<import("@plait/draw").PlaitLine>, path: import("@plait/core").Path) => void;
|
|
8
8
|
setLineTexts: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitLine, texts: import("@plait/draw").LineText[]) => void;
|
package/utils/clipboard.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PlaitBoard, Point } from '@plait/core';
|
|
2
2
|
import { PlaitDrawElement, PlaitGeometry, PlaitLine } from '../interfaces';
|
|
3
|
-
export declare const buildClipboardData: (board: PlaitBoard, elements: PlaitDrawElement[], startPoint: Point) => (
|
|
3
|
+
export declare const buildClipboardData: (board: PlaitBoard, elements: PlaitDrawElement[], startPoint: Point) => (PlaitGeometry | PlaitLine)[];
|
|
4
4
|
export declare const insertClipboardData: (board: PlaitBoard, elements: PlaitDrawElement[], startPoint: Point) => void;
|
package/utils/geometry.d.ts
CHANGED
|
@@ -42,15 +42,14 @@ export declare const getDefaultFlowchartProperty: (symbol: FlowchartSymbols) =>
|
|
|
42
42
|
width: number;
|
|
43
43
|
height: number;
|
|
44
44
|
};
|
|
45
|
-
export declare const createDefaultFlowchart: (point: Point) => (import("../interfaces").PlaitLine
|
|
45
|
+
export declare const createDefaultFlowchart: (point: Point) => (PlaitGeometry | import("../interfaces").PlaitLine)[];
|
|
46
46
|
export declare const getAutoCompletePoints: (element: PlaitShape) => [Point, Point, Point, Point];
|
|
47
47
|
export declare const getHitIndexOfAutoCompletePoint: (movingPoint: Point, points: Point[]) => number;
|
|
48
48
|
export declare const getDrawDefaultStrokeColor: (theme: ThemeColorMode) => string;
|
|
49
49
|
export declare const getFlowchartDefaultFill: (theme: ThemeColorMode) => string;
|
|
50
|
-
export declare const
|
|
50
|
+
export declare const getTextShapeProperty: (board: PlaitBoard, text?: string | Element, fontSize?: number | string) => {
|
|
51
51
|
width: number;
|
|
52
52
|
height: number;
|
|
53
|
-
text: string;
|
|
54
53
|
};
|
|
55
54
|
export declare const getDefaultGeometryPoints: (pointer: DrawPointerType, centerPoint: Point) => [Point, Point];
|
|
56
55
|
export declare const getDefaultGeometryProperty: (pointer: DrawPointerType) => {
|
|
@@ -59,5 +58,5 @@ export declare const getDefaultGeometryProperty: (pointer: DrawPointerType) => {
|
|
|
59
58
|
};
|
|
60
59
|
export declare const getDefaultTextPoints: (board: PlaitBoard, centerPoint: Point, fontSize?: number | string) => [Point, Point];
|
|
61
60
|
export declare const insertElement: (board: PlaitBoard, element: PlaitGeometry) => void;
|
|
62
|
-
export declare const
|
|
61
|
+
export declare const createTextElement: (board: PlaitBoard, points: [Point, Point], text?: string | Element, textHeight?: number) => PlaitGeometry;
|
|
63
62
|
export declare const createDefaultGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) => PlaitGeometry;
|
package/utils/line.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const getHitLineTextIndex: (board: PlaitBoard, element: PlaitLine
|
|
|
15
15
|
export declare const isHitLineText: (board: PlaitBoard, element: PlaitLine, point: Point) => boolean;
|
|
16
16
|
export declare const drawLine: (board: PlaitBoard, element: PlaitLine) => SVGGElement;
|
|
17
17
|
export declare const getConnectionPoint: (geometry: PlaitGeometry, connection: Point, direction?: Direction, delta?: number) => Point;
|
|
18
|
-
export declare const transformPointToConnection: (board: PlaitBoard, point: Point, hitElement: PlaitShape
|
|
18
|
+
export declare const transformPointToConnection: (board: PlaitBoard, point: Point, hitElement: PlaitShape) => Point;
|
|
19
19
|
export declare const getHitConnectorPoint: (movingPoint: Point, hitElement: PlaitShape, rectangle: RectangleClient) => Point | undefined;
|
|
20
20
|
export declare const getLineTextRectangle: (board: PlaitBoard, element: PlaitLine, index: number) => RectangleClient;
|
|
21
21
|
export declare const getBoardLines: (board: PlaitBoard) => PlaitLine[];
|