@plait/draw 0.72.0 → 0.74.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/index.d.ts +2 -2
- package/engines/uml/combined-fragment.d.ts +2 -2
- package/engines/uml/package.d.ts +2 -2
- package/esm2022/engines/index.mjs +1 -1
- package/esm2022/engines/uml/combined-fragment.mjs +1 -1
- package/esm2022/engines/uml/package.mjs +1 -1
- package/esm2022/generators/text.generator.mjs +1 -1
- package/esm2022/interfaces/engine.mjs +1 -1
- package/esm2022/interfaces/table.mjs +1 -1
- package/esm2022/plugins/with-draw-resize.mjs +2 -2
- package/esm2022/plugins/with-draw-rotate.mjs +3 -2
- package/esm2022/table.component.mjs +2 -2
- package/esm2022/utils/common.mjs +2 -2
- package/esm2022/utils/geometry.mjs +2 -2
- package/esm2022/utils/style/stroke.mjs +6 -5
- package/fesm2022/plait-draw.mjs +9 -8
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/generators/text.generator.d.ts +2 -4
- package/interfaces/engine.d.ts +7 -2
- package/interfaces/table.d.ts +2 -2
- package/package.json +1 -1
- package/utils/common.d.ts +2 -2
- package/utils/geometry.d.ts +1 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ParagraphElement, TextManage, TextManageChangeData } from '@plait/common';
|
|
2
2
|
import { PlaitBoard, PlaitElement, RectangleClient } from '@plait/core';
|
|
3
|
-
import { DrawShapes,
|
|
4
|
-
export interface DrawTextInfo extends
|
|
5
|
-
id: string;
|
|
3
|
+
import { DrawShapes, PlaitGeometry, TextRectangleOptions } from '../interfaces';
|
|
4
|
+
export interface DrawTextInfo extends TextRectangleOptions {
|
|
6
5
|
text: ParagraphElement;
|
|
7
6
|
textHeight: number;
|
|
8
|
-
board?: PlaitBoard;
|
|
9
7
|
}
|
|
10
8
|
export interface TextGeneratorOptions<T> {
|
|
11
9
|
onChange: (element: T, textChangeRef: TextManageChangeData, text: DrawTextInfo) => void;
|
package/interfaces/engine.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { RectangleClient, PointOfRectangle, Vector, PlaitBoard, Point, PlaitElement } from '@plait/core';
|
|
2
2
|
import { Options } from 'roughjs/bin/core';
|
|
3
3
|
import { PlaitGeometry } from './geometry';
|
|
4
|
-
export interface
|
|
4
|
+
export interface DrawOptions {
|
|
5
|
+
element: PlaitElement;
|
|
5
6
|
}
|
|
6
|
-
export interface
|
|
7
|
+
export interface TextRectangleOptions {
|
|
8
|
+
id: string;
|
|
9
|
+
board?: PlaitBoard;
|
|
10
|
+
}
|
|
11
|
+
export interface ShapeEngine<T extends PlaitElement = PlaitGeometry, P extends DrawOptions = DrawOptions, K extends TextRectangleOptions = TextRectangleOptions> {
|
|
7
12
|
isInsidePoint: (rectangle: RectangleClient, point: Point) => boolean;
|
|
8
13
|
getNearestPoint: (rectangle: RectangleClient, point: Point) => Point;
|
|
9
14
|
getNearestCrossingPoint?: (rectangle: RectangleClient, point: Point) => Point;
|
package/interfaces/table.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlaitBoard, PlaitElement, Point } from '@plait/core';
|
|
2
|
-
import { EngineExtraData } from './engine';
|
|
3
2
|
import { ParagraphElement } from '@plait/common';
|
|
3
|
+
import { DrawOptions } from './engine';
|
|
4
4
|
export declare enum TableSymbols {
|
|
5
5
|
table = "table"
|
|
6
6
|
}
|
|
@@ -34,7 +34,7 @@ export interface PlaitTableCell {
|
|
|
34
34
|
textHeight?: number;
|
|
35
35
|
fill?: string;
|
|
36
36
|
}
|
|
37
|
-
export interface PlaitTableDrawOptions extends
|
|
37
|
+
export interface PlaitTableDrawOptions extends DrawOptions {
|
|
38
38
|
element: PlaitTable;
|
|
39
39
|
}
|
|
40
40
|
export interface PlaitTableCellWithPoints extends PlaitTableCell {
|
package/package.json
CHANGED
package/utils/common.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlaitBoard, PlaitElement, Point, RectangleClient } from '@plait/core';
|
|
2
|
-
import {
|
|
2
|
+
import { DrawOptions, DrawShapes, PlaitBaseGeometry, PlaitCommonGeometry, PlaitCustomGeometry, PlaitDrawElement, PlaitGeometry, PlaitShapeElement } from '../interfaces';
|
|
3
3
|
import { Alignment } from '@plait/common';
|
|
4
4
|
import { Options } from 'roughjs/bin/core';
|
|
5
5
|
import { PlaitBaseTable } from '../interfaces/table';
|
|
@@ -25,7 +25,7 @@ export declare const getSnappingRef: (board: PlaitBoard, hitElement: PlaitShapeE
|
|
|
25
25
|
};
|
|
26
26
|
export declare const getHitShape: (board: PlaitBoard, point: Point, offset?: number) => PlaitShapeElement | null;
|
|
27
27
|
export declare const traverseDrawShapes: (board: PlaitBoard, callback: (element: PlaitShapeElement) => void) => void;
|
|
28
|
-
export declare const drawShape: (board: PlaitBoard, outerRectangle: RectangleClient, shape: DrawShapes, roughOptions: Options, drawOptions
|
|
28
|
+
export declare const drawShape: (board: PlaitBoard, outerRectangle: RectangleClient, shape: DrawShapes, roughOptions: Options, drawOptions?: DrawOptions) => SVGGElement;
|
|
29
29
|
export declare const drawBoundReaction: (board: PlaitBoard, element: PlaitShapeElement, roughOptions?: {
|
|
30
30
|
hasMask: boolean;
|
|
31
31
|
hasConnector: boolean;
|
package/utils/geometry.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ export declare const createDefaultFlowchart: (point: Point) => (PlaitGeometry |
|
|
|
126
126
|
export declare const getAutoCompletePoints: (element: PlaitShapeElement) => [Point, Point, Point, Point];
|
|
127
127
|
export declare const getHitIndexOfAutoCompletePoint: (movingPoint: Point, points: Point[]) => number;
|
|
128
128
|
export declare const getDrawDefaultStrokeColor: (theme: ThemeColorMode) => string;
|
|
129
|
-
export declare const
|
|
129
|
+
export declare const getFlowchartDefaultFill: (theme: ThemeColorMode) => string;
|
|
130
130
|
export declare const getTextShapeProperty: (board: PlaitBoard, text?: string | Element, fontSize?: number | string) => {
|
|
131
131
|
width: number;
|
|
132
132
|
height: number;
|