@plait/draw 0.29.0 → 0.30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/draw",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.0.0",
6
6
  "@angular/core": "^16.0.0",
@@ -1,7 +1,8 @@
1
- import { PlaitBoard } from '@plait/core';
1
+ import { PlaitBoard, Point } from '@plait/core';
2
2
  import { DrawPointerType } from '../constants';
3
3
  export declare const withGeometryCreateByDrag: (board: PlaitBoard) => PlaitBoard;
4
4
  export declare const withGeometryCreateByDrawing: (board: PlaitBoard) => PlaitBoard;
5
+ export declare const getDefaultGeometryPoints: (pointer: DrawPointerType, targetPoint: Point) => [Point, Point];
5
6
  export declare const getGeometryDefaultProperty: (pointer: DrawPointerType) => {
6
7
  width: number;
7
8
  height: number;
@@ -34,3 +34,4 @@ export declare const getDefaultFlowchartProperty: (symbol: FlowchartSymbols) =>
34
34
  width: number;
35
35
  height: number;
36
36
  };
37
+ export declare const createDefaultFlowchart: (point: Point) => (PlaitGeometry | import("../interfaces").PlaitLine)[];
package/utils/hit.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { PlaitElement, Selection, PlaitBoard, Point } from '@plait/core';
2
+ export declare const isRectangleHitDrawElement: (board: PlaitBoard, element: PlaitElement, selection: Selection) => boolean | null;
3
+ export declare const isHitDrawElement: (board: PlaitBoard, element: PlaitElement, point: Point) => boolean | null;
package/utils/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './line';
2
2
  export * from './geometry';
3
3
  export * from './selected';
4
4
  export * from './style';
5
+ export * from './hit';
package/utils/line.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Point, PlaitBoard, RectangleClient, PointOfRectangle, Direction, Vector } from '@plait/core';
2
- import { LineHandle, LineHandleRef, LineShape, PlaitGeometry, PlaitLine } from '../interfaces';
2
+ import { LineHandle, LineHandleRef, LineShape, LineText, PlaitGeometry, PlaitLine } from '../interfaces';
3
3
  import { Op } from 'roughjs/bin/core';
4
- export declare const createLineElement: (shape: LineShape, points: [Point, Point], source: LineHandle, target: LineHandle, options?: Pick<PlaitLine, 'strokeColor' | 'strokeWidth'>) => PlaitLine;
4
+ export declare const createLineElement: (shape: LineShape, points: [Point, Point], source: LineHandle, target: LineHandle, texts?: LineText[], options?: Pick<PlaitLine, 'strokeColor' | 'strokeWidth'>) => PlaitLine;
5
5
  export declare const getLinePoints: (board: PlaitBoard, element: PlaitLine) => Point[];
6
6
  export declare const getLineHandleRefPair: (board: PlaitBoard, element: PlaitLine) => {
7
7
  source: LineHandleRef;
@@ -19,7 +19,6 @@ export declare const transformPointToConnection: (board: PlaitBoard, point: Poin
19
19
  export declare const getHitConnectorPoint: (movingPoint: Point, hitElement: PlaitGeometry, 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[];
22
- export declare const removeDuplicatePoints: (points: Point[]) => Point[];
23
22
  export declare const getExtendPoint: (source: Point, target: Point, extendDistance: number) => Point;
24
23
  export declare const Q2C: (points: Point[]) => Point[];
25
24
  export declare const getVectorByConnection: (boundElement: PlaitGeometry, connection: PointOfRectangle) => Vector;