@plait/draw 0.39.0 → 0.41.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/engines/flowchart/stored-data.mjs +2 -2
- package/esm2022/generators/line-active.generator.mjs +9 -2
- package/esm2022/geometry.component.mjs +1 -1
- package/esm2022/line.component.mjs +1 -1
- package/esm2022/plugins/with-draw.mjs +3 -2
- package/esm2022/plugins/with-line-auto-complete.mjs +3 -3
- package/esm2022/plugins/with-line-resize.mjs +15 -11
- package/esm2022/plugins/with-line-text-move.mjs +52 -0
- package/esm2022/public-api.mjs +2 -1
- package/esm2022/transforms/geometry.mjs +40 -7
- package/esm2022/transforms/index.mjs +6 -4
- package/esm2022/transforms/line.mjs +63 -3
- package/esm2022/utils/line.mjs +54 -41
- package/fesm2022/plait-draw.mjs +242 -80
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/package.json +1 -1
- package/plugins/with-line-auto-complete.d.ts +1 -1
- package/plugins/with-line-text-move.d.ts +2 -0
- package/public-api.d.ts +1 -0
- package/styles/styles.scss +4 -0
- package/transforms/geometry.d.ts +5 -4
- package/transforms/index.d.ts +4 -2
- package/transforms/line.d.ts +6 -1
- package/utils/clipboard.d.ts +1 -1
- package/utils/geometry.d.ts +1 -1
- package/utils/line.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlaitBoard } from '@plait/core';
|
|
2
2
|
import { PlaitLine } from '../interfaces';
|
|
3
|
+
export declare const WithLineAutoCompletePluginKey = "plait-line-auto-complete-plugin-key";
|
|
3
4
|
export interface LineAutoCompleteOptions {
|
|
4
5
|
afterComplete: (element: PlaitLine) => {};
|
|
5
6
|
}
|
|
6
|
-
export declare const withLineAutoCompletePluginKey = "plait-line-auto-complete-plugin-key";
|
|
7
7
|
export declare const withLineAutoComplete: (board: PlaitBoard) => PlaitBoard;
|
package/public-api.d.ts
CHANGED
package/styles/styles.scss
CHANGED
package/transforms/geometry.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { PlaitBoard, Point, Path } from '@plait/core';
|
|
2
|
-
import {
|
|
1
|
+
import { PlaitBoard, Point, Path, Vector } from '@plait/core';
|
|
2
|
+
import { GeometryShapes } from '../interfaces';
|
|
3
3
|
import { Element } from 'slate';
|
|
4
|
-
export declare const insertGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) =>
|
|
4
|
+
export declare const insertGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) => import("../interfaces").PlaitGeometry;
|
|
5
|
+
export declare const insertGeometryByVector: (board: PlaitBoard, point: Point, shape: GeometryShapes, vector: Vector) => import("../interfaces").PlaitGeometry | null;
|
|
5
6
|
export declare const insertText: (board: PlaitBoard, points: [Point, Point], text?: string | Element) => void;
|
|
6
7
|
export declare const resizeGeometry: (board: PlaitBoard, points: [Point, Point], textHeight: number, path: Path) => void;
|
|
7
|
-
export declare const
|
|
8
|
+
export declare const switchGeometryShape: (board: PlaitBoard, shape: GeometryShapes) => void;
|
package/transforms/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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
|
-
insertGeometry: (board: import("@plait/core").PlaitBoard, points: [import("@plait/core").Point, import("@plait/core").Point], shape: import("@plait/draw").GeometryShapes) =>
|
|
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
5
|
insertText: (board: import("@plait/core").PlaitBoard, points: [import("@plait/core").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;
|
|
@@ -9,5 +9,7 @@ export declare const DrawTransforms: {
|
|
|
9
9
|
removeLineText: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitLine, index: number) => void;
|
|
10
10
|
setLineMark: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitLine, handleKey: import("@plait/draw").LineHandleKey, marker: import("@plait/draw").LineMarkerType) => void;
|
|
11
11
|
insertImage: (board: import("@plait/core").PlaitBoard, imageItem: import("@plait/common").CommonImageItem, startPoint?: import("@plait/core").Point | undefined) => void;
|
|
12
|
-
|
|
12
|
+
switchGeometryShape: (board: import("@plait/core").PlaitBoard, shape: import("@plait/draw").GeometryShapes) => void;
|
|
13
|
+
connectLineToGeometry: (board: import("@plait/core").PlaitBoard, lineElement: import("@plait/draw").PlaitLine, handle: import("@plait/draw").LineHandleKey, geometryElement: import("@plait/draw").PlaitGeometry) => void;
|
|
14
|
+
insertGeometryByVector: (board: import("@plait/core").PlaitBoard, point: import("@plait/core").Point, shape: import("@plait/draw").GeometryShapes, vector: import("@plait/core").Vector) => import("@plait/draw").PlaitGeometry | null;
|
|
13
15
|
};
|
package/transforms/line.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Path, PlaitBoard } from '@plait/core';
|
|
2
|
-
import { LineHandleKey, LineMarkerType, LineText, PlaitLine } from '../interfaces';
|
|
2
|
+
import { LineHandleKey, LineMarkerType, LineText, PlaitGeometry, PlaitLine } from '../interfaces';
|
|
3
3
|
export declare const resizeLine: (board: PlaitBoard, options: Partial<PlaitLine>, path: Path) => void;
|
|
4
4
|
export declare const setLineTexts: (board: PlaitBoard, element: PlaitLine, texts: LineText[]) => void;
|
|
5
5
|
export declare const removeLineText: (board: PlaitBoard, element: PlaitLine, index: number) => void;
|
|
6
6
|
export declare const setLineMark: (board: PlaitBoard, element: PlaitLine, handleKey: LineHandleKey, marker: LineMarkerType) => void;
|
|
7
|
+
export declare const collectLineUpdatedRefsByGeometry: (board: PlaitBoard, geometry: PlaitGeometry, refs: {
|
|
8
|
+
property: Partial<PlaitLine>;
|
|
9
|
+
path: Path;
|
|
10
|
+
}[]) => void;
|
|
11
|
+
export declare const connectLineToGeometry: (board: PlaitBoard, lineElement: PlaitLine, handle: LineHandleKey, geometryElement: PlaitGeometry) => 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) => (PlaitLine | PlaitGeometry)[];
|
|
4
4
|
export declare const insertClipboardData: (board: PlaitBoard, elements: PlaitDrawElement[], startPoint: Point) => void;
|
package/utils/geometry.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare const getDefaultFlowchartProperty: (symbol: FlowchartSymbols) =>
|
|
|
42
42
|
width: number;
|
|
43
43
|
height: number;
|
|
44
44
|
};
|
|
45
|
-
export declare const createDefaultFlowchart: (point: Point) => (
|
|
45
|
+
export declare const createDefaultFlowchart: (point: Point) => (import("../interfaces").PlaitLine | PlaitGeometry)[];
|
|
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;
|
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) => Point;
|
|
18
|
+
export declare const transformPointToConnection: (board: PlaitBoard, point: Point, hitElement: PlaitShape, tolerance?: number) => 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[];
|