@plait/draw 0.58.0 → 0.59.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 +2 -1
- package/esm2022/constants/geometry.mjs +3 -2
- package/esm2022/generators/text.generator.mjs +5 -13
- package/esm2022/plugins/with-draw-hotkey.mjs +3 -3
- package/esm2022/plugins/with-geometry-resize.mjs +3 -2
- package/esm2022/table.component.mjs +5 -3
- package/esm2022/utils/common.mjs +50 -21
- package/esm2022/utils/geometry.mjs +9 -3
- package/esm2022/utils/multi-text-geometry.mjs +6 -6
- package/esm2022/utils/table.mjs +1 -1
- package/fesm2022/plait-draw.mjs +360 -334
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/generators/text.generator.d.ts +0 -1
- package/package.json +1 -1
- package/utils/common.d.ts +5 -0
- package/utils/geometry.d.ts +3 -1
- package/utils/multi-text-geometry.d.ts +1 -1
|
@@ -27,7 +27,6 @@ export declare class TextGenerator<T extends PlaitElement = PlaitGeometry> {
|
|
|
27
27
|
get shape(): DrawShapes;
|
|
28
28
|
constructor(board: PlaitBoard, element: T, texts: PlaitDrawShapeText[], viewContainerRef: ViewContainerRef, options: TextGeneratorOptions<T>);
|
|
29
29
|
initialize(): void;
|
|
30
|
-
getTextKey(text: PlaitDrawShapeText): string;
|
|
31
30
|
draw(elementG: SVGElement): void;
|
|
32
31
|
update(element: T, previousDrawShapeTexts: PlaitDrawShapeText[], currentDrawShapeTexts: PlaitDrawShapeText[], elementG: SVGElement): void;
|
|
33
32
|
private createTextManage;
|
package/package.json
CHANGED
package/utils/common.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { PlaitBoard, PlaitElement, Point, RectangleClient } from '@plait/core';
|
|
|
2
2
|
import { DrawShapes, EngineExtraData, PlaitCommonGeometry, PlaitDrawElement, PlaitGeometry, PlaitShapeElement } from '../interfaces';
|
|
3
3
|
import { Options } from 'roughjs/bin/core';
|
|
4
4
|
import { PlaitTable } from '../interfaces/table';
|
|
5
|
+
import { PlaitDrawShapeText } from '../generators/text.generator';
|
|
6
|
+
import { Alignment } from '@plait/text';
|
|
5
7
|
export declare const getTextRectangle: <T extends PlaitElement = PlaitGeometry>(element: T) => {
|
|
6
8
|
height: any;
|
|
7
9
|
width: number;
|
|
@@ -10,6 +12,7 @@ export declare const getTextRectangle: <T extends PlaitElement = PlaitGeometry>(
|
|
|
10
12
|
};
|
|
11
13
|
export declare const getStrokeWidthByElement: (element: PlaitElement) => any;
|
|
12
14
|
export declare const insertElement: (board: PlaitBoard, element: PlaitCommonGeometry | PlaitTable) => void;
|
|
15
|
+
export declare const isDrawElementIncludeText: (element: PlaitDrawElement) => boolean;
|
|
13
16
|
export declare const isDrawElementsIncludeText: (elements: PlaitDrawElement[]) => boolean;
|
|
14
17
|
export declare const getSnappingShape: (board: PlaitBoard, point: Point) => PlaitShapeElement | null;
|
|
15
18
|
export declare const getSnappingRef: (board: PlaitBoard, hitElement: PlaitShapeElement, point: Point) => {
|
|
@@ -25,3 +28,5 @@ export declare const drawBoundReaction: (board: PlaitBoard, element: PlaitShapeE
|
|
|
25
28
|
hasMask: boolean;
|
|
26
29
|
hasConnector: boolean;
|
|
27
30
|
}) => SVGGElement;
|
|
31
|
+
export declare const getTextKey: <T extends PlaitElement = PlaitGeometry>(element: T, text: PlaitDrawShapeText) => string;
|
|
32
|
+
export declare const getGeometryAlign: (element: PlaitCommonGeometry | PlaitTable) => Alignment;
|
package/utils/geometry.d.ts
CHANGED
|
@@ -100,4 +100,6 @@ export declare const createTextElement: (board: PlaitBoard, points: [Point, Poin
|
|
|
100
100
|
export declare const createDefaultGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) => PlaitGeometry | import("../interfaces").PlaitMultipleTextGeometry;
|
|
101
101
|
export declare const editText: (board: PlaitBoard, element: PlaitGeometry, text?: PlaitDrawShapeText) => void;
|
|
102
102
|
export declare const rerenderGeometryActive: (board: PlaitBoard, element: PlaitGeometry) => void;
|
|
103
|
-
export declare const isGeometryIncludeText: (element: PlaitGeometry) => boolean
|
|
103
|
+
export declare const isGeometryIncludeText: (element: PlaitGeometry) => boolean;
|
|
104
|
+
export declare const isSingleTextShape: (shape: GeometryShapes) => boolean;
|
|
105
|
+
export declare const isSingleTextGeometry: (element: PlaitGeometry) => boolean;
|
|
@@ -11,4 +11,4 @@ export declare const buildDefaultTextsByShape: (shape: GeometryShapes, elementId
|
|
|
11
11
|
text: import("slate").BaseElement;
|
|
12
12
|
textHeight: any;
|
|
13
13
|
}[];
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const getHitMultipleGeometryText: (element: PlaitMultipleTextGeometry, point: Point) => PlaitDrawShapeText | undefined;
|