@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/draw",
3
- "version": "0.58.0",
3
+ "version": "0.59.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.2.4",
6
6
  "@angular/core": "^17.2.4",
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;
@@ -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 | 0 | undefined;
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 getHitText: (element: PlaitMultipleTextGeometry, point: Point) => PlaitDrawShapeText | undefined;
14
+ export declare const getHitMultipleGeometryText: (element: PlaitMultipleTextGeometry, point: Point) => PlaitDrawShapeText | undefined;