@plait/draw 0.43.0 → 0.45.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/esm2022/interfaces/geometry.mjs +2 -14
- package/esm2022/interfaces/line.mjs +2 -15
- package/esm2022/line.component.mjs +16 -17
- package/esm2022/plugins/with-draw-fragment.mjs +1 -1
- package/esm2022/plugins/with-draw.mjs +13 -2
- package/esm2022/plugins/with-geometry-create.mjs +4 -4
- package/esm2022/plugins/with-geometry-resize.mjs +3 -4
- package/esm2022/plugins/with-line-auto-complete.mjs +4 -4
- package/esm2022/plugins/with-line-create.mjs +4 -4
- package/esm2022/plugins/with-line-text-move.mjs +2 -2
- package/esm2022/plugins/with-line-text.mjs +3 -3
- package/esm2022/transforms/geometry-text.mjs +3 -3
- package/esm2022/utils/clipboard.mjs +16 -8
- package/esm2022/utils/line.mjs +3 -2
- package/fesm2022/plait-draw.mjs +58 -65
- package/fesm2022/plait-draw.mjs.map +1 -1
- package/interfaces/geometry.d.ts +1 -4
- package/interfaces/line.d.ts +0 -1
- package/line.component.d.ts +4 -5
- package/package.json +1 -1
package/interfaces/geometry.d.ts
CHANGED
|
@@ -60,10 +60,7 @@ export interface PlaitEllipse extends PlaitGeometry {
|
|
|
60
60
|
export interface PlaitDiamond extends PlaitGeometry {
|
|
61
61
|
shape: BasicShapes.diamond;
|
|
62
62
|
}
|
|
63
|
-
export declare const PlaitGeometry: {
|
|
64
|
-
getTextEditor(element: PlaitGeometry): import("slate").BaseEditor & import("slate-angular").AngularEditor & import("slate-history").HistoryEditor;
|
|
65
|
-
getTextManage(element: PlaitGeometry): import("@plait/text").TextManage;
|
|
66
|
-
};
|
|
63
|
+
export declare const PlaitGeometry: {};
|
|
67
64
|
export interface ShapeEngine {
|
|
68
65
|
isHit: (rectangle: RectangleClient, point: Point) => boolean;
|
|
69
66
|
getNearestPoint: (rectangle: RectangleClient, point: Point) => Point;
|
package/interfaces/line.d.ts
CHANGED
|
@@ -63,7 +63,6 @@ export interface PlaitElbowLine extends PlaitLine {
|
|
|
63
63
|
shape: LineShape.elbow;
|
|
64
64
|
}
|
|
65
65
|
export declare const PlaitLine: {
|
|
66
|
-
getTextEditors(element: PlaitLine): (import("slate").BaseEditor & import("slate-angular").AngularEditor & import("slate-history").HistoryEditor)[];
|
|
67
66
|
isSourceMarkOrTargetMark(line: PlaitLine, markType: LineMarkerType, handleKey: LineHandleKey): boolean;
|
|
68
67
|
isSourceMark(line: PlaitLine, markType: LineMarkerType): boolean;
|
|
69
68
|
isTargetMark(line: PlaitLine, markType: LineMarkerType): boolean;
|
package/line.component.d.ts
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { ChangeDetectorRef, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { PlaitBoard,
|
|
2
|
+
import { PlaitBoard, PlaitPluginElementContext, OnContextChanged } from '@plait/core';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { LineText, PlaitGeometry, PlaitLine } from './interfaces';
|
|
5
5
|
import { TextManage } from '@plait/text';
|
|
6
6
|
import { LineShapeGenerator } from './generators/line.generator';
|
|
7
7
|
import { LineActiveGenerator } from './generators/line-active.generator';
|
|
8
|
+
import { CommonPluginElement } from '@plait/common';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
interface BoundedElements {
|
|
10
11
|
source?: PlaitGeometry;
|
|
11
12
|
target?: PlaitGeometry;
|
|
12
13
|
}
|
|
13
|
-
export declare class LineComponent extends
|
|
14
|
+
export declare class LineComponent extends CommonPluginElement<PlaitLine, PlaitBoard> implements OnInit, OnDestroy, OnContextChanged<PlaitLine, PlaitBoard> {
|
|
14
15
|
private viewContainerRef;
|
|
15
16
|
protected cdr: ChangeDetectorRef;
|
|
16
17
|
destroy$: Subject<void>;
|
|
17
18
|
shapeGenerator: LineShapeGenerator;
|
|
18
19
|
activeGenerator: LineActiveGenerator;
|
|
19
|
-
textManages: TextManage[];
|
|
20
20
|
boundedElements: BoundedElements;
|
|
21
21
|
constructor(viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef);
|
|
22
22
|
initializeGenerator(): void;
|
|
23
23
|
ngOnInit(): void;
|
|
24
24
|
getBoundedElements(): BoundedElements;
|
|
25
25
|
onContextChanged(value: PlaitPluginElementContext<PlaitLine, PlaitBoard>, previous: PlaitPluginElementContext<PlaitLine, PlaitBoard>): void;
|
|
26
|
-
|
|
27
|
-
destroyTextManages(): void;
|
|
26
|
+
initializeTextManagesByElement(): void;
|
|
28
27
|
drawText(): void;
|
|
29
28
|
createTextManage(text: LineText, index: number): TextManage;
|
|
30
29
|
updateText(previousTexts: LineText[], currentTexts: LineText[]): void;
|