@plait/draw 0.74.0 → 0.75.0-next.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/engines/uml/provided-interface.d.ts +5 -0
- package/esm2022/engines/uml/provided-interface.mjs +30 -12
- package/esm2022/interfaces/vector-line.mjs +1 -1
- package/esm2022/plugins/with-draw-hotkey.mjs +5 -5
- package/esm2022/plugins/with-draw-resize.mjs +3 -3
- package/esm2022/plugins/with-draw.mjs +4 -4
- package/esm2022/plugins/with-table.mjs +5 -5
- package/esm2022/plugins/with-vector-line-create.mjs +30 -67
- package/esm2022/utils/common.mjs +16 -13
- package/esm2022/utils/geometry.mjs +3 -9
- package/esm2022/utils/hit.mjs +28 -14
- package/esm2022/utils/selected.mjs +3 -3
- package/esm2022/utils/style/stroke.mjs +3 -3
- package/fesm2022/plait-draw.mjs +113 -121
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/interfaces/vector-line.d.ts +1 -7
- package/package.json +1 -1
- package/utils/common.d.ts +2 -2
- package/utils/hit.d.ts +3 -1
- package/utils/selected.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlaitElement, Point } from '@plait/core';
|
|
2
2
|
import { StrokeStyle } from '@plait/common';
|
|
3
3
|
export declare enum VectorLinePointerType {
|
|
4
4
|
vectorLine = "vectorLine"
|
|
@@ -7,12 +7,6 @@ export declare enum VectorLineShape {
|
|
|
7
7
|
straight = "straight",
|
|
8
8
|
curve = "curve"
|
|
9
9
|
}
|
|
10
|
-
export interface VectorLineRef {
|
|
11
|
-
start?: Point;
|
|
12
|
-
element?: PlaitVectorLine;
|
|
13
|
-
path?: Path;
|
|
14
|
-
shape: VectorLineShape;
|
|
15
|
-
}
|
|
16
10
|
export interface PlaitVectorLine extends PlaitElement {
|
|
17
11
|
type: 'vector-line';
|
|
18
12
|
shape: VectorLineShape;
|
package/package.json
CHANGED
package/utils/common.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ 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
|
|
18
|
-
export declare const
|
|
17
|
+
export declare const isClosedDrawElement: (element: PlaitElement) => boolean;
|
|
18
|
+
export declare const isClosedCustomGeometry: (board: PlaitBoard, value: PlaitElement) => value is PlaitCustomGeometry;
|
|
19
19
|
export declare const getSnappingShape: (board: PlaitBoard, point: Point) => PlaitShapeElement | null;
|
|
20
20
|
export declare const getSnappingRef: (board: PlaitBoard, hitElement: PlaitShapeElement, point: Point) => {
|
|
21
21
|
isHitEdge: boolean;
|
package/utils/hit.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const isHitArrowLine: (board: PlaitBoard, element: PlaitArrowLine
|
|
|
7
7
|
export declare const isHitVectorLine: (board: PlaitBoard, element: PlaitVectorLine, point: Point) => boolean;
|
|
8
8
|
export declare const isRectangleHitElementText: (element: PlaitCommonGeometry, rectangle: RectangleClient) => boolean;
|
|
9
9
|
export declare const isHitElementText: (element: PlaitCommonGeometry, point: Point) => boolean;
|
|
10
|
+
export declare const isEmptyTextElement: (element: PlaitCommonGeometry) => boolean;
|
|
10
11
|
export declare const isRectangleHitDrawElement: (board: PlaitBoard, element: PlaitElement, selection: Selection) => boolean | null;
|
|
11
12
|
export declare const isRectangleHitRotatedElement: (board: PlaitBoard, rectangle: RectangleClient, element: PlaitElement & {
|
|
12
13
|
points: Point[];
|
|
@@ -14,8 +15,9 @@ export declare const isRectangleHitRotatedElement: (board: PlaitBoard, rectangle
|
|
|
14
15
|
export declare const isRectangleHitRotatedPoints: (rectangle: RectangleClient, points: Point[], angle: number | undefined) => boolean;
|
|
15
16
|
export declare const getHitDrawElement: (board: PlaitBoard, elements: (PlaitDrawElement | PlaitCustomGeometry)[]) => PlaitElement;
|
|
16
17
|
export declare const getFirstFilledDrawElement: (board: PlaitBoard, elements: (PlaitDrawElement | PlaitCustomGeometry)[]) => PlaitGeometry | PlaitCustomGeometry<string, Point[], string> | null;
|
|
18
|
+
export declare const isFilledDrawElement: (board: PlaitBoard, element: PlaitDrawElement | PlaitCustomGeometry) => boolean;
|
|
17
19
|
export declare const getFirstTextOrLineElement: (elements: PlaitElement[]) => PlaitArrowLine | import("../interfaces").PlaitText | null;
|
|
18
|
-
export declare const isHitDrawElement: (board: PlaitBoard, element: PlaitElement, point: Point) => boolean | null;
|
|
20
|
+
export declare const isHitDrawElement: (board: PlaitBoard, element: PlaitElement, point: Point, isStrict?: boolean) => boolean | null;
|
|
19
21
|
export declare const isHitEdgeOfShape: (board: PlaitBoard, element: PlaitShapeElement, point: Point, hitDistanceBuffer: number) => boolean;
|
|
20
22
|
export declare const isInsideOfShape: (board: PlaitBoard, element: PlaitShapeElement, point: Point, hitDistanceBuffer: number) => boolean;
|
|
21
23
|
export declare const isHitElementInside: (board: PlaitBoard, element: PlaitElement, point: Point) => boolean | null;
|
package/utils/selected.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export declare const getSelectedArrowLineElements: (board: PlaitBoard) => PlaitA
|
|
|
8
8
|
export declare const getSelectedVectorLineElements: (board: PlaitBoard) => PlaitVectorLine[];
|
|
9
9
|
export declare const getSelectedImageElements: (board: PlaitBoard) => PlaitImage[];
|
|
10
10
|
export declare const isSingleSelectSwimlane: (board: PlaitBoard) => boolean;
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const isSingleSelectLine: (board: PlaitBoard) => boolean;
|
|
12
12
|
export declare const getSelectedSwimlane: (board: PlaitBoard) => PlaitSwimlane;
|