@inweb/markup 26.3.3 → 26.4.1
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/dist/markup.js +698 -285
- package/dist/markup.js.map +1 -1
- package/dist/markup.min.js +1 -1
- package/dist/markup.module.js +709 -175
- package/dist/markup.module.js.map +1 -1
- package/lib/markup/IMarkupArrow.d.ts +8 -8
- package/lib/markup/IMarkupCloud.d.ts +12 -5
- package/lib/markup/IMarkupEllipse.d.ts +4 -4
- package/lib/markup/IMarkupImage.d.ts +3 -3
- package/lib/markup/IMarkupLine.d.ts +2 -2
- package/lib/markup/IMarkupObject.d.ts +4 -0
- package/lib/markup/IMarkupRectangle.d.ts +10 -3
- package/lib/markup/IMarkupText.d.ts +3 -3
- package/lib/markup/Konva/KonvaArrow.d.ts +4 -1
- package/lib/markup/Konva/KonvaCloud.d.ts +4 -1
- package/lib/markup/Konva/KonvaEllipse.d.ts +4 -1
- package/lib/markup/Konva/KonvaImage.d.ts +4 -1
- package/lib/markup/Konva/KonvaLine.d.ts +4 -1
- package/lib/markup/Konva/KonvaMarkup.d.ts +2 -2
- package/lib/markup/Konva/KonvaRectangle.d.ts +4 -1
- package/lib/markup/Konva/KonvaText.d.ts +4 -1
- package/package.json +3 -3
- package/src/markup/IMarkupArrow.ts +8 -8
- package/src/markup/IMarkupCloud.ts +10 -5
- package/src/markup/IMarkupEllipse.ts +4 -4
- package/src/markup/IMarkupImage.ts +3 -3
- package/src/markup/IMarkupLine.ts +2 -2
- package/src/markup/IMarkupObject.ts +5 -0
- package/src/markup/IMarkupRectangle.ts +8 -3
- package/src/markup/IMarkupText.ts +3 -3
- package/src/markup/Konva/KonvaArrow.ts +49 -4
- package/src/markup/Konva/KonvaCloud.ts +110 -11
- package/src/markup/Konva/KonvaEllipse.ts +102 -2
- package/src/markup/Konva/KonvaImage.ts +60 -2
- package/src/markup/Konva/KonvaLine.ts +97 -3
- package/src/markup/Konva/KonvaMarkup.ts +182 -166
- package/src/markup/Konva/KonvaRectangle.ts +103 -4
- package/src/markup/Konva/KonvaText.ts +61 -2
|
@@ -5,14 +5,14 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface IMarkupArrow extends IMarkupObject, IMarkupColorable {
|
|
7
7
|
/**
|
|
8
|
-
* Returns the
|
|
8
|
+
* Returns the coordinates of the start and end points of arrow.
|
|
9
9
|
*/
|
|
10
10
|
getPoints(): {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
}[];
|
|
14
14
|
/**
|
|
15
|
-
* Sets the
|
|
15
|
+
* Sets the coordinates of the start and end points of the arrow.
|
|
16
16
|
*
|
|
17
17
|
* @param {{ x: number; y: number }} points - Array of points.
|
|
18
18
|
*/
|
|
@@ -21,25 +21,25 @@ export interface IMarkupArrow extends IMarkupObject, IMarkupColorable {
|
|
|
21
21
|
y: number;
|
|
22
22
|
}[]): void;
|
|
23
23
|
/**
|
|
24
|
-
* Returns the
|
|
24
|
+
* Returns the coordinates of the start point of arrow.
|
|
25
25
|
*/
|
|
26
26
|
getStartPoint(): {
|
|
27
27
|
x: number;
|
|
28
28
|
y: number;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* Sets the
|
|
31
|
+
* Sets the coordinates of the start point of the arrow.
|
|
32
32
|
*/
|
|
33
33
|
setStartPoint(x: number, y: number): void;
|
|
34
34
|
/**
|
|
35
|
-
* Returns the
|
|
35
|
+
* Returns the coordinates of the end point of arrow.
|
|
36
36
|
*/
|
|
37
37
|
getEndPoint(): {
|
|
38
38
|
x: number;
|
|
39
39
|
y: number;
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
-
* Sets the
|
|
42
|
+
* Sets the coordinates of the end point of the arrow.
|
|
43
43
|
*/
|
|
44
44
|
setEndPoint(x: number, y: number): void;
|
|
45
45
|
}
|
|
@@ -48,14 +48,14 @@ export interface IMarkupArrow extends IMarkupObject, IMarkupColorable {
|
|
|
48
48
|
*/
|
|
49
49
|
export interface IMarkupArrowParams {
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Screen coordinates of the start point of arrow.
|
|
52
52
|
*/
|
|
53
53
|
start?: {
|
|
54
54
|
x: number;
|
|
55
55
|
y: number;
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Screen coordinates of the end point of arrow.
|
|
59
59
|
*/
|
|
60
60
|
end?: {
|
|
61
61
|
x: number;
|
|
@@ -5,14 +5,14 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface IMarkupCloud extends IMarkupObject, IMarkupColorable {
|
|
7
7
|
/**
|
|
8
|
-
* Returns the coordinates of the top-left point (position) of the cloud.
|
|
8
|
+
* Returns the screen coordinates of the top-left point (position) of the cloud.
|
|
9
9
|
*/
|
|
10
10
|
getPosition(): {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Sets the coordinates of the top-left point (position) of the cloud.
|
|
15
|
+
* Sets the screen coordinates of the top-left point (position) of the cloud.
|
|
16
16
|
*/
|
|
17
17
|
setPosition(x: number, y: number): void;
|
|
18
18
|
/**
|
|
@@ -45,20 +45,27 @@ export interface IMarkupCloud extends IMarkupObject, IMarkupColorable {
|
|
|
45
45
|
*/
|
|
46
46
|
export interface IMarkupCloudParams {
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Screen coordinates of the top-left point of the cloud.
|
|
49
49
|
*/
|
|
50
50
|
position?: {
|
|
51
51
|
x: number;
|
|
52
52
|
y: number;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Screen coordinates of the bottom-right point of the cloud.
|
|
56
|
+
*/
|
|
57
|
+
position2?: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Screen width of the cloud. Ignored if {@link position2} is defined.
|
|
56
63
|
*
|
|
57
64
|
* @default 200
|
|
58
65
|
*/
|
|
59
66
|
width?: number;
|
|
60
67
|
/**
|
|
61
|
-
*
|
|
68
|
+
* Screen height of the cloud. Ignored if {@link position2} is defined.
|
|
62
69
|
*
|
|
63
70
|
* @default 200
|
|
64
71
|
*/
|
|
@@ -5,14 +5,14 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface IMarkupEllipse extends IMarkupObject, IMarkupColorable {
|
|
7
7
|
/**
|
|
8
|
-
* Returns the coordinates of the center point (position) of the ellipse.
|
|
8
|
+
* Returns the screen coordinates of the center point (position) of the ellipse.
|
|
9
9
|
*/
|
|
10
10
|
getPosition(): {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Sets the coordinates of the top-left point (position) of the ellipse.
|
|
15
|
+
* Sets the screen coordinates of the top-left point (position) of the ellipse.
|
|
16
16
|
*/
|
|
17
17
|
setPosition(x: number, y: number): void;
|
|
18
18
|
/**
|
|
@@ -45,14 +45,14 @@ export interface IMarkupEllipse extends IMarkupObject, IMarkupColorable {
|
|
|
45
45
|
*/
|
|
46
46
|
export interface IMarkupEllipseParams {
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Screen coordinates of the center point (position) of the ellipse.
|
|
49
49
|
*/
|
|
50
50
|
position?: {
|
|
51
51
|
x: number;
|
|
52
52
|
y: number;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Screen radius of the ellipse along the X and Y axes.
|
|
56
56
|
*
|
|
57
57
|
* @default 25
|
|
58
58
|
*/
|
|
@@ -4,14 +4,14 @@ import { IMarkupObject } from "./IMarkupObject";
|
|
|
4
4
|
*/
|
|
5
5
|
export interface IMarkupImage extends IMarkupObject {
|
|
6
6
|
/**
|
|
7
|
-
* Returns the coordinates of the top-left point (position) of the image.
|
|
7
|
+
* Returns the screen coordinates of the top-left point (position) of the image.
|
|
8
8
|
*/
|
|
9
9
|
getPosition(): {
|
|
10
10
|
x: number;
|
|
11
11
|
y: number;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* Sets the coordinates of the top-left point (position) of the image.
|
|
14
|
+
* Sets the screen coordinates of the top-left point (position) of the image.
|
|
15
15
|
*/
|
|
16
16
|
setPosition(x: number, y: number): void;
|
|
17
17
|
/**
|
|
@@ -50,7 +50,7 @@ export interface IMarkupImage extends IMarkupObject {
|
|
|
50
50
|
*/
|
|
51
51
|
export interface IMarkupImageParams {
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Screen coordinates of the top-left point (position) of the image.
|
|
54
54
|
*/
|
|
55
55
|
position?: {
|
|
56
56
|
x: number;
|
|
@@ -9,7 +9,7 @@ export type MarkupLineType = "solid" | "dot" | "dash";
|
|
|
9
9
|
*/
|
|
10
10
|
export interface IMarkupLine extends IMarkupObject, IMarkupColorable {
|
|
11
11
|
/**
|
|
12
|
-
* Returns the coordinates of the line points as a flat array [x1, y1, x2, y2, ...].
|
|
12
|
+
* Returns the screen coordinates of the line points as a flat array [x1, y1, x2, y2, ...].
|
|
13
13
|
*/
|
|
14
14
|
getPoints(): number[];
|
|
15
15
|
/**
|
|
@@ -45,7 +45,7 @@ export interface IMarkupLine extends IMarkupObject, IMarkupColorable {
|
|
|
45
45
|
*/
|
|
46
46
|
export interface IMarkupLineParams {
|
|
47
47
|
/**
|
|
48
|
-
* Array of
|
|
48
|
+
* Array of screen points of the line.
|
|
49
49
|
*/
|
|
50
50
|
points?: {
|
|
51
51
|
x: number;
|
|
@@ -50,6 +50,10 @@ export interface IMarkupObject {
|
|
|
50
50
|
* @param zIndex - An integer value of Z-Index.
|
|
51
51
|
*/
|
|
52
52
|
setZIndex(zIndex: number): void;
|
|
53
|
+
/**
|
|
54
|
+
* Update current screen coordinates with internal WCS-based. Only for resize.
|
|
55
|
+
*/
|
|
56
|
+
updateScreenCoordinates(): void;
|
|
53
57
|
/**
|
|
54
58
|
* Deletes the current object.
|
|
55
59
|
*/
|
|
@@ -5,14 +5,14 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface IMarkupRectangle extends IMarkupObject, IMarkupColorable {
|
|
7
7
|
/**
|
|
8
|
-
* Returns the coordinates of the top-left point (position) of the rectangle.
|
|
8
|
+
* Returns the screen coordinates of the top-left point (position) of the rectangle.
|
|
9
9
|
*/
|
|
10
10
|
getPosition(): {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Sets the coordinates of the top-left point (position) of the rectangle.
|
|
15
|
+
* Sets the screen coordinates of the top-left point (position) of the rectangle.
|
|
16
16
|
*/
|
|
17
17
|
setPosition(x: number, y: number): void;
|
|
18
18
|
/**
|
|
@@ -45,12 +45,19 @@ export interface IMarkupRectangle extends IMarkupObject, IMarkupColorable {
|
|
|
45
45
|
*/
|
|
46
46
|
export interface IMarkupRectangleParams {
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Screen coordinates of the top-left point (position) of the rectangle.
|
|
49
49
|
*/
|
|
50
50
|
position?: {
|
|
51
51
|
x: number;
|
|
52
52
|
y: number;
|
|
53
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Screen coordinates of the bottom-right point (position) of the rectangle.
|
|
56
|
+
*/
|
|
57
|
+
position2?: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
};
|
|
54
61
|
/**
|
|
55
62
|
* Width of the rectangle.
|
|
56
63
|
*
|
|
@@ -13,14 +13,14 @@ export interface IMarkupText extends IMarkupObject, IMarkupColorable {
|
|
|
13
13
|
*/
|
|
14
14
|
setText(text: string): void;
|
|
15
15
|
/**
|
|
16
|
-
* Returns the coordinates of the top-left point (position) of the text.
|
|
16
|
+
* Returns the screen coordinates of the top-left point (position) of the text.
|
|
17
17
|
*/
|
|
18
18
|
getPosition(): {
|
|
19
19
|
x: number;
|
|
20
20
|
y: number;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* Sets the coordinates of the top-left point (position) of the text.
|
|
23
|
+
* Sets the screen coordinates of the top-left point (position) of the text.
|
|
24
24
|
*/
|
|
25
25
|
setPosition(x: number, y: number): void;
|
|
26
26
|
/**
|
|
@@ -37,7 +37,7 @@ export interface IMarkupText extends IMarkupObject, IMarkupColorable {
|
|
|
37
37
|
*/
|
|
38
38
|
export interface IMarkupTextParams {
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Screen coordinates of the top-left point (position) of the text.
|
|
41
41
|
*/
|
|
42
42
|
position?: {
|
|
43
43
|
x: number;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IMarkupArrow, IMarkupArrowParams } from "../IMarkupArrow";
|
|
2
|
+
import { WorldTransform } from "../WorldTransform";
|
|
2
3
|
export declare class KonvaArrow implements IMarkupArrow {
|
|
3
4
|
private _ref;
|
|
4
|
-
|
|
5
|
+
private _worldTransformer;
|
|
6
|
+
constructor(params: IMarkupArrowParams, ref?: any, worldTransformer?: WorldTransform);
|
|
5
7
|
ref(): import("konva/lib/shapes/Arrow").Arrow;
|
|
6
8
|
id(): string;
|
|
7
9
|
enableMouseEditing(value: boolean): void;
|
|
@@ -31,4 +33,5 @@ export declare class KonvaArrow implements IMarkupArrow {
|
|
|
31
33
|
y: number;
|
|
32
34
|
};
|
|
33
35
|
setEndPoint(x: number, y: number): void;
|
|
36
|
+
updateScreenCoordinates(): void;
|
|
34
37
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IMarkupCloud, IMarkupCloudParams } from "../IMarkupCloud";
|
|
2
|
+
import { WorldTransform } from "../WorldTransform";
|
|
2
3
|
export declare class KonvaCloud implements IMarkupCloud {
|
|
3
4
|
private _ref;
|
|
4
|
-
|
|
5
|
+
private _worldTransformer;
|
|
6
|
+
constructor(params: IMarkupCloudParams, ref?: any, worldTransformer?: WorldTransform);
|
|
5
7
|
ref(): import("konva/lib/Shape").Shape<import("konva/lib/Shape").ShapeConfig>;
|
|
6
8
|
id(): string;
|
|
7
9
|
enableMouseEditing(value: boolean): void;
|
|
@@ -21,4 +23,5 @@ export declare class KonvaCloud implements IMarkupCloud {
|
|
|
21
23
|
setHeight(h: number): void;
|
|
22
24
|
getLineWidth(): number;
|
|
23
25
|
setLineWidth(size: number): void;
|
|
26
|
+
updateScreenCoordinates(): void;
|
|
24
27
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IMarkupEllipse, IMarkupEllipseParams } from "../IMarkupEllipse";
|
|
2
|
+
import { WorldTransform } from "../WorldTransform";
|
|
2
3
|
export declare class KonvaEllipse implements IMarkupEllipse {
|
|
3
4
|
private _ref;
|
|
4
|
-
|
|
5
|
+
private _worldTransformer;
|
|
6
|
+
constructor(params: IMarkupEllipseParams, ref?: any, worldTransformer?: WorldTransform);
|
|
5
7
|
getPosition(): {
|
|
6
8
|
x: number;
|
|
7
9
|
y: number;
|
|
@@ -24,4 +26,5 @@ export declare class KonvaEllipse implements IMarkupEllipse {
|
|
|
24
26
|
getZIndex(): number;
|
|
25
27
|
setZIndex(zIndex: number): void;
|
|
26
28
|
delete(): void;
|
|
29
|
+
updateScreenCoordinates(): void;
|
|
27
30
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IMarkupImage, IMarkupImageParams } from "../IMarkupImage";
|
|
2
|
+
import { WorldTransform } from "../WorldTransform";
|
|
2
3
|
export declare class KonvaImage implements IMarkupImage {
|
|
3
4
|
private _ref;
|
|
4
5
|
private _canvasImage;
|
|
@@ -6,7 +7,8 @@ export declare class KonvaImage implements IMarkupImage {
|
|
|
6
7
|
private readonly EPSILON;
|
|
7
8
|
private readonly BASE64_HEADER_START;
|
|
8
9
|
private readonly BASE64_NOT_FOUND;
|
|
9
|
-
|
|
10
|
+
private _worldTransformer;
|
|
11
|
+
constructor(params: IMarkupImageParams, ref?: any, worldTransformer?: WorldTransform);
|
|
10
12
|
getSrc(): string;
|
|
11
13
|
setSrc(src: any): void;
|
|
12
14
|
getWidth(): number;
|
|
@@ -27,4 +29,5 @@ export declare class KonvaImage implements IMarkupImage {
|
|
|
27
29
|
y: number;
|
|
28
30
|
};
|
|
29
31
|
setPosition(x: number, y: number): void;
|
|
32
|
+
updateScreenCoordinates(): void;
|
|
30
33
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IMarkupLine, IMarkupLineParams } from "../IMarkupLine";
|
|
2
|
+
import { WorldTransform } from "../WorldTransform";
|
|
2
3
|
export declare class KonvaLine implements IMarkupLine {
|
|
3
4
|
private _ref;
|
|
4
|
-
|
|
5
|
+
private _worldTransformer;
|
|
6
|
+
constructor(params: IMarkupLineParams, ref?: any, worldTransformer?: WorldTransform);
|
|
5
7
|
ref(): import("konva/lib/shapes/Line").Line<import("konva/lib/shapes/Line").LineConfig>;
|
|
6
8
|
id(): string;
|
|
7
9
|
enableMouseEditing(value: boolean): void;
|
|
@@ -22,4 +24,5 @@ export declare class KonvaLine implements IMarkupLine {
|
|
|
22
24
|
x: number;
|
|
23
25
|
y: number;
|
|
24
26
|
}]): void;
|
|
27
|
+
updateScreenCoordinates(): void;
|
|
25
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IEventEmitter } from "@inweb/eventemitter2";
|
|
2
|
-
import { ChangeActiveDraggerEvent, IViewpoint, PanEvent, ZoomAtEvent } from "@inweb/viewer-core";
|
|
2
|
+
import { ChangeActiveDraggerEvent, IViewpoint, PanEvent, ZoomAtEvent, ResizeEvent } from "@inweb/viewer-core";
|
|
3
3
|
import { IMarkup, MarkupMode } from "../IMarkup";
|
|
4
4
|
import { IWorldTransform } from "../IWorldTransform";
|
|
5
5
|
import { IMarkupObject } from "../IMarkupObject";
|
|
@@ -11,7 +11,6 @@ export declare class KonvaMarkup implements IMarkup {
|
|
|
11
11
|
private _viewer;
|
|
12
12
|
private _worldTransformer;
|
|
13
13
|
private _container;
|
|
14
|
-
private _containerEvents;
|
|
15
14
|
private _markupIsActive;
|
|
16
15
|
private _markupMode;
|
|
17
16
|
private _markupColor;
|
|
@@ -35,6 +34,7 @@ export declare class KonvaMarkup implements IMarkup {
|
|
|
35
34
|
dispose(): void;
|
|
36
35
|
changeActiveDragger: (event: ChangeActiveDraggerEvent) => void;
|
|
37
36
|
resizeContainer: (entries: ResizeObserverEntry[]) => void;
|
|
37
|
+
resizeViewer: (event: ResizeEvent) => void;
|
|
38
38
|
pan: (event: PanEvent) => void;
|
|
39
39
|
zoomAt: (event: ZoomAtEvent) => void;
|
|
40
40
|
redirectToViewer: (event: any) => void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IMarkupRectangle, IMarkupRectangleParams } from "../IMarkupRectangle";
|
|
2
|
+
import { WorldTransform } from "../WorldTransform";
|
|
2
3
|
export declare class KonvaRectangle implements IMarkupRectangle {
|
|
3
4
|
private _ref;
|
|
4
|
-
|
|
5
|
+
private _worldTransformer;
|
|
6
|
+
constructor(params: IMarkupRectangleParams, ref?: any, worldTransformer?: WorldTransform);
|
|
5
7
|
getPosition(): {
|
|
6
8
|
x: number;
|
|
7
9
|
y: number;
|
|
@@ -24,4 +26,5 @@ export declare class KonvaRectangle implements IMarkupRectangle {
|
|
|
24
26
|
delete(): void;
|
|
25
27
|
setLineWidth(size: number): void;
|
|
26
28
|
getLineWidth(): number;
|
|
29
|
+
updateScreenCoordinates(): void;
|
|
27
30
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IMarkupText, IMarkupTextParams } from "../IMarkupText";
|
|
2
|
+
import { WorldTransform } from "../WorldTransform";
|
|
2
3
|
export declare class KonvaText implements IMarkupText {
|
|
3
4
|
private _ref;
|
|
5
|
+
private _worldTransformer;
|
|
4
6
|
private readonly TEXT_FONT_FAMILY;
|
|
5
|
-
constructor(params: IMarkupTextParams, ref?: any);
|
|
7
|
+
constructor(params: IMarkupTextParams, ref?: any, worldTransformer?: WorldTransform);
|
|
6
8
|
ref(): import("konva/lib/shapes/Text").Text;
|
|
7
9
|
id(): string;
|
|
8
10
|
enableMouseEditing(value: boolean): void;
|
|
@@ -23,4 +25,5 @@ export declare class KonvaText implements IMarkupText {
|
|
|
23
25
|
setPosition(x: number, y: number): void;
|
|
24
26
|
getFontSize(): number;
|
|
25
27
|
setFontSize(size: number): void;
|
|
28
|
+
updateScreenCoordinates(): void;
|
|
26
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/markup",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.4.1",
|
|
4
4
|
"description": "JavaScript 2D markups",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"docs": "typedoc"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "~26.
|
|
30
|
-
"@inweb/viewer-core": "~26.
|
|
29
|
+
"@inweb/eventemitter2": "~26.4.1",
|
|
30
|
+
"@inweb/viewer-core": "~26.4.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"konva": "^9.3.18"
|
|
@@ -29,34 +29,34 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
29
29
|
*/
|
|
30
30
|
export interface IMarkupArrow extends IMarkupObject, IMarkupColorable {
|
|
31
31
|
/**
|
|
32
|
-
* Returns the
|
|
32
|
+
* Returns the coordinates of the start and end points of arrow.
|
|
33
33
|
*/
|
|
34
34
|
getPoints(): { x: number; y: number }[];
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Sets the
|
|
37
|
+
* Sets the coordinates of the start and end points of the arrow.
|
|
38
38
|
*
|
|
39
39
|
* @param {{ x: number; y: number }} points - Array of points.
|
|
40
40
|
*/
|
|
41
41
|
setPoints(points: { x: number; y: number }[]): void;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Returns the
|
|
44
|
+
* Returns the coordinates of the start point of arrow.
|
|
45
45
|
*/
|
|
46
46
|
getStartPoint(): { x: number; y: number };
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* Sets the
|
|
49
|
+
* Sets the coordinates of the start point of the arrow.
|
|
50
50
|
*/
|
|
51
51
|
setStartPoint(x: number, y: number): void;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Returns the
|
|
54
|
+
* Returns the coordinates of the end point of arrow.
|
|
55
55
|
*/
|
|
56
56
|
getEndPoint(): { x: number; y: number };
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* Sets the
|
|
59
|
+
* Sets the coordinates of the end point of the arrow.
|
|
60
60
|
*/
|
|
61
61
|
setEndPoint(x: number, y: number): void;
|
|
62
62
|
}
|
|
@@ -66,12 +66,12 @@ export interface IMarkupArrow extends IMarkupObject, IMarkupColorable {
|
|
|
66
66
|
*/
|
|
67
67
|
export interface IMarkupArrowParams {
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Screen coordinates of the start point of arrow.
|
|
70
70
|
*/
|
|
71
71
|
start?: { x: number; y: number };
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Screen coordinates of the end point of arrow.
|
|
75
75
|
*/
|
|
76
76
|
end?: { x: number; y: number };
|
|
77
77
|
|
|
@@ -29,12 +29,12 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
29
29
|
*/
|
|
30
30
|
export interface IMarkupCloud extends IMarkupObject, IMarkupColorable {
|
|
31
31
|
/**
|
|
32
|
-
* Returns the coordinates of the top-left point (position) of the cloud.
|
|
32
|
+
* Returns the screen coordinates of the top-left point (position) of the cloud.
|
|
33
33
|
*/
|
|
34
34
|
getPosition(): { x: number; y: number };
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Sets the coordinates of the top-left point (position) of the cloud.
|
|
37
|
+
* Sets the screen coordinates of the top-left point (position) of the cloud.
|
|
38
38
|
*/
|
|
39
39
|
setPosition(x: number, y: number): void;
|
|
40
40
|
|
|
@@ -74,19 +74,24 @@ export interface IMarkupCloud extends IMarkupObject, IMarkupColorable {
|
|
|
74
74
|
*/
|
|
75
75
|
export interface IMarkupCloudParams {
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Screen coordinates of the top-left point of the cloud.
|
|
78
78
|
*/
|
|
79
79
|
position?: { x: number; y: number };
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Screen coordinates of the bottom-right point of the cloud.
|
|
83
|
+
*/
|
|
84
|
+
position2?: { x: number; y: number };
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Screen width of the cloud. Ignored if {@link position2} is defined.
|
|
83
88
|
*
|
|
84
89
|
* @default 200
|
|
85
90
|
*/
|
|
86
91
|
width?: number;
|
|
87
92
|
|
|
88
93
|
/**
|
|
89
|
-
*
|
|
94
|
+
* Screen height of the cloud. Ignored if {@link position2} is defined.
|
|
90
95
|
*
|
|
91
96
|
* @default 200
|
|
92
97
|
*/
|
|
@@ -29,12 +29,12 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
29
29
|
*/
|
|
30
30
|
export interface IMarkupEllipse extends IMarkupObject, IMarkupColorable {
|
|
31
31
|
/**
|
|
32
|
-
* Returns the coordinates of the center point (position) of the ellipse.
|
|
32
|
+
* Returns the screen coordinates of the center point (position) of the ellipse.
|
|
33
33
|
*/
|
|
34
34
|
getPosition(): { x: number; y: number };
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Sets the coordinates of the top-left point (position) of the ellipse.
|
|
37
|
+
* Sets the screen coordinates of the top-left point (position) of the ellipse.
|
|
38
38
|
*/
|
|
39
39
|
setPosition(x: number, y: number): void;
|
|
40
40
|
|
|
@@ -74,12 +74,12 @@ export interface IMarkupEllipse extends IMarkupObject, IMarkupColorable {
|
|
|
74
74
|
*/
|
|
75
75
|
export interface IMarkupEllipseParams {
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Screen coordinates of the center point (position) of the ellipse.
|
|
78
78
|
*/
|
|
79
79
|
position?: { x: number; y: number };
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Screen radius of the ellipse along the X and Y axes.
|
|
83
83
|
*
|
|
84
84
|
* @default 25
|
|
85
85
|
*/
|
|
@@ -28,12 +28,12 @@ import { IMarkupObject } from "./IMarkupObject";
|
|
|
28
28
|
*/
|
|
29
29
|
export interface IMarkupImage extends IMarkupObject {
|
|
30
30
|
/**
|
|
31
|
-
* Returns the coordinates of the top-left point (position) of the image.
|
|
31
|
+
* Returns the screen coordinates of the top-left point (position) of the image.
|
|
32
32
|
*/
|
|
33
33
|
getPosition(): { x: number; y: number };
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Sets the coordinates of the top-left point (position) of the image.
|
|
36
|
+
* Sets the screen coordinates of the top-left point (position) of the image.
|
|
37
37
|
*/
|
|
38
38
|
setPosition(x: number, y: number): void;
|
|
39
39
|
|
|
@@ -79,7 +79,7 @@ export interface IMarkupImage extends IMarkupObject {
|
|
|
79
79
|
*/
|
|
80
80
|
export interface IMarkupImageParams {
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Screen coordinates of the top-left point (position) of the image.
|
|
83
83
|
*/
|
|
84
84
|
position?: { x: number; y: number };
|
|
85
85
|
|
|
@@ -34,7 +34,7 @@ export type MarkupLineType = "solid" | "dot" | "dash";
|
|
|
34
34
|
*/
|
|
35
35
|
export interface IMarkupLine extends IMarkupObject, IMarkupColorable {
|
|
36
36
|
/**
|
|
37
|
-
* Returns the coordinates of the line points as a flat array [x1, y1, x2, y2, ...].
|
|
37
|
+
* Returns the screen coordinates of the line points as a flat array [x1, y1, x2, y2, ...].
|
|
38
38
|
*/
|
|
39
39
|
getPoints(): number[];
|
|
40
40
|
|
|
@@ -73,7 +73,7 @@ export interface IMarkupLine extends IMarkupObject, IMarkupColorable {
|
|
|
73
73
|
*/
|
|
74
74
|
export interface IMarkupLineParams {
|
|
75
75
|
/**
|
|
76
|
-
* Array of
|
|
76
|
+
* Array of screen points of the line.
|
|
77
77
|
*/
|
|
78
78
|
points?: { x: number; y: number }[];
|
|
79
79
|
|
|
@@ -81,6 +81,11 @@ export interface IMarkupObject {
|
|
|
81
81
|
*/
|
|
82
82
|
setZIndex(zIndex: number): void;
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Update current screen coordinates with internal WCS-based. Only for resize.
|
|
86
|
+
*/
|
|
87
|
+
updateScreenCoordinates(): void;
|
|
88
|
+
|
|
84
89
|
/**
|
|
85
90
|
* Deletes the current object.
|
|
86
91
|
*/
|
|
@@ -29,12 +29,12 @@ import { IMarkupColorable } from "./IMarkupColorable";
|
|
|
29
29
|
*/
|
|
30
30
|
export interface IMarkupRectangle extends IMarkupObject, IMarkupColorable {
|
|
31
31
|
/**
|
|
32
|
-
* Returns the coordinates of the top-left point (position) of the rectangle.
|
|
32
|
+
* Returns the screen coordinates of the top-left point (position) of the rectangle.
|
|
33
33
|
*/
|
|
34
34
|
getPosition(): { x: number; y: number };
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Sets the coordinates of the top-left point (position) of the rectangle.
|
|
37
|
+
* Sets the screen coordinates of the top-left point (position) of the rectangle.
|
|
38
38
|
*/
|
|
39
39
|
setPosition(x: number, y: number): void;
|
|
40
40
|
|
|
@@ -74,10 +74,15 @@ export interface IMarkupRectangle extends IMarkupObject, IMarkupColorable {
|
|
|
74
74
|
*/
|
|
75
75
|
export interface IMarkupRectangleParams {
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Screen coordinates of the top-left point (position) of the rectangle.
|
|
78
78
|
*/
|
|
79
79
|
position?: { x: number; y: number };
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Screen coordinates of the bottom-right point (position) of the rectangle.
|
|
83
|
+
*/
|
|
84
|
+
position2?: { x: number; y: number };
|
|
85
|
+
|
|
81
86
|
/**
|
|
82
87
|
* Width of the rectangle.
|
|
83
88
|
*
|