@plait/draw 0.54.0 → 0.55.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/geometry.d.ts +22 -0
- package/engines/basic-shapes/circle.d.ts +8 -0
- package/engines/basic-shapes/cloud.d.ts +2 -0
- package/engines/flowchart/off-page.d.ts +4 -0
- package/engines/flowchart/or.d.ts +2 -0
- package/engines/flowchart/predefined-process.d.ts +2 -0
- package/engines/flowchart/summing-junction.d.ts +2 -0
- package/esm2022/constants/geometry.mjs +12 -2
- package/esm2022/engines/basic-shapes/circle.mjs +51 -0
- package/esm2022/engines/basic-shapes/cloud.mjs +57 -0
- package/esm2022/engines/basic-shapes/ellipse.mjs +3 -41
- package/esm2022/engines/flowchart/off-page.mjs +32 -0
- package/esm2022/engines/flowchart/or.mjs +25 -0
- package/esm2022/engines/flowchart/predefined-process.mjs +47 -0
- package/esm2022/engines/flowchart/summing-junction.mjs +28 -0
- package/esm2022/engines/index.mjs +12 -2
- package/esm2022/geometry.component.mjs +7 -8
- package/esm2022/image.component.mjs +6 -7
- package/esm2022/interfaces/element.mjs +2 -1
- package/esm2022/interfaces/geometry.mjs +6 -1
- package/esm2022/line.component.mjs +8 -9
- package/esm2022/plugins/with-draw-fragment.mjs +7 -7
- package/esm2022/plugins/with-draw-hotkey.mjs +1 -1
- package/esm2022/plugins/with-draw-resize.mjs +23 -23
- package/esm2022/plugins/with-draw-rotate.mjs +127 -0
- package/esm2022/plugins/with-draw.mjs +3 -2
- package/esm2022/plugins/with-geometry-create.mjs +21 -5
- package/esm2022/plugins/with-geometry-resize.mjs +15 -14
- package/esm2022/plugins/with-line-auto-complete.mjs +4 -3
- package/esm2022/utils/geometry.mjs +5 -2
- package/esm2022/utils/line/line-basic.mjs +6 -3
- package/esm2022/utils/position/geometry.mjs +10 -2
- package/esm2022/utils/snap-resizing.mjs +185 -0
- package/esm2022/utils/style/stroke.mjs +9 -2
- package/fesm2022/plait-draw.mjs +1126 -942
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/geometry.component.d.ts +2 -3
- package/image.component.d.ts +2 -3
- package/interfaces/element.d.ts +2 -1
- package/interfaces/geometry.d.ts +7 -2
- package/line.component.d.ts +2 -3
- package/package.json +1 -1
- package/plugins/with-draw-resize.d.ts +3 -5
- package/plugins/with-draw-rotate.d.ts +2 -0
- package/utils/position/geometry.d.ts +6 -0
- package/utils/snap-resizing.d.ts +25 -0
- package/esm2022/utils/resize-snap.mjs +0 -361
- package/utils/resize-snap.d.ts +0 -49
package/utils/resize-snap.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ResizeRef, ResizeState } from '@plait/common';
|
|
2
|
-
import { DirectionFactors, PlaitBoard, PlaitElement, Point, RectangleClient } from '@plait/core';
|
|
3
|
-
import { PlaitDrawElement } from '../interfaces';
|
|
4
|
-
export declare const debugGenerator: import("@plait/core").DebugGenerator;
|
|
5
|
-
export interface ResizeAlignDelta {
|
|
6
|
-
deltaX: number;
|
|
7
|
-
deltaY: number;
|
|
8
|
-
}
|
|
9
|
-
export interface SnapRef extends ResizeAlignDelta {
|
|
10
|
-
xZoom: number;
|
|
11
|
-
yZoom: number;
|
|
12
|
-
activePoints: Point[];
|
|
13
|
-
}
|
|
14
|
-
export interface ResizeSnapRef extends SnapRef {
|
|
15
|
-
alignG: SVGGElement;
|
|
16
|
-
}
|
|
17
|
-
export interface ResizeSnapOptions {
|
|
18
|
-
resizeState: ResizeState;
|
|
19
|
-
resizeOriginPoints: Point[];
|
|
20
|
-
activeRectangle: RectangleClient;
|
|
21
|
-
directionFactors: DirectionFactors;
|
|
22
|
-
originPoint: Point;
|
|
23
|
-
handlePoint: Point;
|
|
24
|
-
isFromCorner: boolean;
|
|
25
|
-
isAspectRatio: boolean;
|
|
26
|
-
}
|
|
27
|
-
type TripleAlignAxis = [number, number, number];
|
|
28
|
-
export declare class ResizeSnapReaction {
|
|
29
|
-
private board;
|
|
30
|
-
private activeElements;
|
|
31
|
-
alignRectangles: RectangleClient[];
|
|
32
|
-
angle: number;
|
|
33
|
-
constructor(board: PlaitBoard, activeElements: PlaitElement[]);
|
|
34
|
-
getAlignRectangle(): RectangleClient[];
|
|
35
|
-
getSnapRef(resizeAlignDelta: ResizeAlignDelta, resizeSnapOptions: ResizeSnapOptions): SnapRef;
|
|
36
|
-
getEqualLineDelta(resizeSnapOptions: ResizeSnapOptions): ResizeAlignDelta;
|
|
37
|
-
drawEqualLines(activePoints: Point[], resizeSnapOptions: ResizeSnapOptions): SVGGElement;
|
|
38
|
-
getAlignLineDelta(resizeSnapOptions: ResizeSnapOptions): ResizeAlignDelta;
|
|
39
|
-
drawAlignLines(activePoints: Point[], resizeSnapOptions: ResizeSnapOptions): SVGGElement;
|
|
40
|
-
handleResizeSnap(resizeSnapOptions: ResizeSnapOptions): ResizeSnapRef;
|
|
41
|
-
}
|
|
42
|
-
export declare const getTripleAlignAxis: (rectangle: RectangleClient, isHorizontal: boolean) => TripleAlignAxis;
|
|
43
|
-
export declare const isAlign: (axis: number, rectangle: RectangleClient, isHorizontal: boolean) => boolean;
|
|
44
|
-
export declare const getClosestDelta: (axis: number, rectangle: RectangleClient, isHorizontal: boolean) => number;
|
|
45
|
-
export declare function getResizeSnapRef(board: PlaitBoard, resizeRef: ResizeRef<PlaitDrawElement | PlaitDrawElement[]>, resizeState: ResizeState, resizeOriginPointAndHandlePoint: {
|
|
46
|
-
originPoint: Point;
|
|
47
|
-
handlePoint: Point;
|
|
48
|
-
}, isAspectRatio: boolean, isFromCorner: boolean): ResizeSnapRef;
|
|
49
|
-
export {};
|