@inweb/markup 26.7.1 → 26.7.6

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.
@@ -34,7 +34,8 @@ export interface IMarkup {
34
34
  * @param container - Container element used to operate on. This is usually a `<canvas>` or `<div>` on
35
35
  * top of which the markup is drawn. If the `container` is a `<canvas>` element, its content will be
36
36
  * combined with the markup in the viewpoint snapshot.
37
- * @param containerEvents - List of container events, such as mouse events or
37
+ * @param containerEvents - Deprecated since `26.7`, can be null. List of container events, such as
38
+ * mouse events or
38
39
  * {@link https://developer.mozilla.org/docs/Web/API/Pointer_events#event_types_and_global_event_handlers | pointer events}
39
40
  * or {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
40
41
  * that the markup should redirect to the `viewer`.
@@ -26,7 +26,7 @@ export interface IMarkupCloud extends IMarkupObject, IMarkupColorable {
26
26
  /**
27
27
  * Returns the height of the cloud.
28
28
  */
29
- getHeigth(): number;
29
+ getHeight(): number;
30
30
  /**
31
31
  * Sets the height of the cloud.
32
32
  */
@@ -52,14 +52,14 @@ export interface IMarkupEllipseParams {
52
52
  y: number;
53
53
  };
54
54
  /**
55
- * Screen coordinates of the center point (position) of the ellipse.
55
+ * Screen coordinates of the point - X radius of the ellipse.
56
56
  */
57
57
  position2?: {
58
58
  x: number;
59
59
  y: number;
60
60
  };
61
61
  /**
62
- * Screen coordinates of the center point (position) of the ellipse.
62
+ * Screen coordinates of the point - Y radius of the ellipse.
63
63
  */
64
64
  position3?: {
65
65
  x: number;
@@ -57,7 +57,7 @@ export interface IMarkupImageParams {
57
57
  y: number;
58
58
  };
59
59
  /**
60
- * Screen coordinates of the bottom-right point (position) of the image. Specify 0 to set widt and
60
+ * Screen coordinates of the bottom-right point (position) of the image. Specify 0 to set width and
61
61
  * height of the source image.
62
62
  */
63
63
  position2?: {
@@ -26,7 +26,7 @@ export interface IMarkupRectangle extends IMarkupObject, IMarkupColorable {
26
26
  /**
27
27
  * Returns the height of the rectangle.
28
28
  */
29
- getHeigth(): number;
29
+ getHeight(): number;
30
30
  /**
31
31
  * Sets the height of the rectangle.
32
32
  */
@@ -19,7 +19,7 @@ export declare class KonvaCloud implements IMarkupCloud {
19
19
  setPosition(x: number, y: number): void;
20
20
  getWidth(): number;
21
21
  setWidth(w: number): void;
22
- getHeigth(): number;
22
+ getHeight(): number;
23
23
  setHeight(h: number): void;
24
24
  getLineWidth(): number;
25
25
  setLineWidth(size: number): void;
@@ -1,5 +1,5 @@
1
1
  import { IEventEmitter } from "@inweb/eventemitter2";
2
- import { ChangeActiveDraggerEvent, IViewpoint, PanEvent, ZoomAtEvent, ResizeEvent } from "@inweb/viewer-core";
2
+ import { ChangeActiveDraggerEvent, IViewpoint, ResizeEvent } from "@inweb/viewer-core";
3
3
  import { IMarkup, MarkupMode } from "../IMarkup";
4
4
  import { IWorldTransform } from "../IWorldTransform";
5
5
  import { IMarkupObject } from "../IMarkupObject";
@@ -35,8 +35,8 @@ export declare class KonvaMarkup implements IMarkup {
35
35
  changeActiveDragger: (event: ChangeActiveDraggerEvent) => void;
36
36
  resizeContainer: (entries: ResizeObserverEntry[]) => void;
37
37
  resizeViewer: (event: ResizeEvent) => void;
38
- pan: (event: PanEvent) => void;
39
- zoomAt: (event: ZoomAtEvent) => void;
38
+ pan: () => void;
39
+ zoomAt: () => void;
40
40
  redirectToViewer: (event: any) => void;
41
41
  syncOverlay(): void;
42
42
  clearOverlay(): void;
@@ -9,7 +9,7 @@ export declare class KonvaRectangle implements IMarkupRectangle {
9
9
  y: number;
10
10
  };
11
11
  getWidth(): number;
12
- getHeigth(): number;
12
+ getHeight(): number;
13
13
  setWidth(w: number): void;
14
14
  setHeight(h: number): void;
15
15
  setPosition(x: number, y: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/markup",
3
- "version": "26.7.1",
3
+ "version": "26.7.6",
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.7.1",
30
- "@inweb/viewer-core": "~26.7.1"
29
+ "@inweb/eventemitter2": "~26.7.6",
30
+ "@inweb/viewer-core": "~26.7.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "konva": "^9.3.18"
@@ -62,7 +62,8 @@ export interface IMarkup {
62
62
  * @param container - Container element used to operate on. This is usually a `<canvas>` or `<div>` on
63
63
  * top of which the markup is drawn. If the `container` is a `<canvas>` element, its content will be
64
64
  * combined with the markup in the viewpoint snapshot.
65
- * @param containerEvents - List of container events, such as mouse events or
65
+ * @param containerEvents - Deprecated since `26.7`, can be null. List of container events, such as
66
+ * mouse events or
66
67
  * {@link https://developer.mozilla.org/docs/Web/API/Pointer_events#event_types_and_global_event_handlers | pointer events}
67
68
  * or {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
68
69
  * that the markup should redirect to the `viewer`.
@@ -51,7 +51,7 @@ export interface IMarkupCloud extends IMarkupObject, IMarkupColorable {
51
51
  /**
52
52
  * Returns the height of the cloud.
53
53
  */
54
- getHeigth(): number;
54
+ getHeight(): number;
55
55
 
56
56
  /**
57
57
  * Sets the height of the cloud.
@@ -79,12 +79,12 @@ export interface IMarkupEllipseParams {
79
79
  position?: { x: number; y: number };
80
80
 
81
81
  /**
82
- * Screen coordinates of the center point (position) of the ellipse.
82
+ * Screen coordinates of the point - X radius of the ellipse.
83
83
  */
84
84
  position2?: { x: number; y: number };
85
85
 
86
86
  /**
87
- * Screen coordinates of the center point (position) of the ellipse.
87
+ * Screen coordinates of the point - Y radius of the ellipse.
88
88
  */
89
89
  position3?: { x: number; y: number };
90
90
 
@@ -84,7 +84,7 @@ export interface IMarkupImageParams {
84
84
  position?: { x: number; y: number };
85
85
 
86
86
  /**
87
- * Screen coordinates of the bottom-right point (position) of the image. Specify 0 to set widt and
87
+ * Screen coordinates of the bottom-right point (position) of the image. Specify 0 to set width and
88
88
  * height of the source image.
89
89
  */
90
90
  position2?: { x: number; y: number };
@@ -51,7 +51,7 @@ export interface IMarkupRectangle extends IMarkupObject, IMarkupColorable {
51
51
  /**
52
52
  * Returns the height of the rectangle.
53
53
  */
54
- getHeigth(): number;
54
+ getHeight(): number;
55
55
 
56
56
  /**
57
57
  * Sets the height of the rectangle.
@@ -198,7 +198,7 @@ export class KonvaCloud implements IMarkupCloud {
198
198
  );
199
199
  });
200
200
 
201
- this._ref.on("dragend", (e) => {
201
+ this._ref.on("dragend", () => {
202
202
  const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
203
203
  const position = absoluteTransform.point({ x: this._ref.x(), y: this._ref.y() });
204
204
  this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
@@ -289,7 +289,7 @@ export class KonvaCloud implements IMarkupCloud {
289
289
  this._ref.setAttr("wcsEnd", wcsRightLowerPoint);
290
290
  }
291
291
 
292
- getHeigth(): number {
292
+ getHeight(): number {
293
293
  return this._ref.height();
294
294
  }
295
295
 
@@ -129,7 +129,7 @@ export class KonvaEllipse implements IMarkupEllipse {
129
129
  this._ref.scale({ x: 1, y: 1 });
130
130
  });
131
131
 
132
- this._ref.on("transformend", (e) => {
132
+ this._ref.on("transformend", () => {
133
133
  const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
134
134
  const position = absoluteTransform.point({ x: this._ref.x(), y: this._ref.y() });
135
135
  this._ref.setAttr("wcsPosition", this._worldTransformer.screenToWorld(position));
@@ -139,7 +139,7 @@ export class KonvaEllipse implements IMarkupEllipse {
139
139
  this._ref.setAttr("wcsRadiusY", this._worldTransformer.screenToWorld(radiusY));
140
140
  });
141
141
 
142
- this._ref.on("dragend", (e) => {
142
+ this._ref.on("dragend", () => {
143
143
  const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
144
144
  const position = absoluteTransform.point({ x: this._ref.x(), y: this._ref.y() });
145
145
  this._ref.setAttr("wcsPosition", this._worldTransformer.screenToWorld(position));
@@ -165,7 +165,7 @@ export class KonvaImage implements IMarkupImage {
165
165
  this._ref.scale({ x: 1, y: 1 });
166
166
  });
167
167
 
168
- this._ref.on("transformend", (e) => {
168
+ this._ref.on("transformend", () => {
169
169
  const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
170
170
  const position = absoluteTransform.point({ x: this._ref.x(), y: this._ref.y() });
171
171
  this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
@@ -175,7 +175,7 @@ export class KonvaImage implements IMarkupImage {
175
175
  );
176
176
  });
177
177
 
178
- this._ref.on("dragend", (e) => {
178
+ this._ref.on("dragend", () => {
179
179
  const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
180
180
  const position = absoluteTransform.point({ x: this._ref.x(), y: this._ref.y() });
181
181
  this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
@@ -90,7 +90,7 @@ export class KonvaLine implements IMarkupLine {
90
90
  if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
91
91
  });
92
92
 
93
- this._ref.on("transformend", (e) => {
93
+ this._ref.on("transformend", () => {
94
94
  const absoluteTransform = this._ref.getAbsoluteTransform();
95
95
 
96
96
  const wcsPoints = [];
@@ -104,7 +104,7 @@ export class KonvaLine implements IMarkupLine {
104
104
  this._ref.setAttr("wcsPoints", wcsPoints);
105
105
  });
106
106
 
107
- this._ref.on("dragend", (e) => {
107
+ this._ref.on("dragend", () => {
108
108
  const absoluteTransform = this._ref.getAbsoluteTransform();
109
109
 
110
110
  const wcsPoints = [];
@@ -33,8 +33,6 @@ import {
33
33
  IRectangle,
34
34
  IText,
35
35
  IViewpoint,
36
- PanEvent,
37
- ZoomAtEvent,
38
36
  ResizeEvent,
39
37
  } from "@inweb/viewer-core";
40
38
 
@@ -236,13 +234,13 @@ export class KonvaMarkup implements IMarkup {
236
234
  });
237
235
  };
238
236
 
239
- pan = (event: PanEvent) => {
237
+ pan = () => {
240
238
  this.getObjects().forEach((markupObject) => {
241
239
  markupObject.updateScreenCoordinates();
242
240
  });
243
241
  };
244
242
 
245
- zoomAt = (event: ZoomAtEvent) => {
243
+ zoomAt = () => {
246
244
  this.getObjects().forEach((markupObject) => {
247
245
  markupObject.updateScreenCoordinates();
248
246
  });
@@ -516,7 +514,7 @@ export class KonvaMarkup implements IMarkup {
516
514
  }
517
515
  });
518
516
 
519
- stage.on("mouseup touchend", (e) => {
517
+ stage.on("mouseup touchend", () => {
520
518
  if (!this._markupIsActive) return;
521
519
 
522
520
  if (isPaint) {
@@ -546,7 +544,7 @@ export class KonvaMarkup implements IMarkup {
546
544
  isPaint = false;
547
545
  });
548
546
 
549
- stage.on("mousemove touchmove", (e) => {
547
+ stage.on("mousemove touchmove", () => {
550
548
  if (!this._markupIsActive) return;
551
549
  if (!isPaint) {
552
550
  return;
@@ -1006,7 +1004,7 @@ export class KonvaMarkup implements IMarkup {
1006
1004
  const base64 = await convertBase64(file);
1007
1005
  this.addImage({ x: this._imageInputPos.x, y: this._imageInputPos.y }, null, base64.toString(), 0, 0);
1008
1006
  };
1009
- this._imageInputRef.oncancel = (event) => {
1007
+ this._imageInputRef.oncancel = () => {
1010
1008
  this.removeImageInput();
1011
1009
  };
1012
1010
  document.body.appendChild(this._imageInputRef);
@@ -123,7 +123,7 @@ export class KonvaRectangle implements IMarkupRectangle {
123
123
  );
124
124
  });
125
125
 
126
- this._ref.on("dragend", (e) => {
126
+ this._ref.on("dragend", () => {
127
127
  const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
128
128
  const position = absoluteTransform.point({ x: this._ref.x(), y: this._ref.y() });
129
129
  this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
@@ -144,7 +144,7 @@ export class KonvaRectangle implements IMarkupRectangle {
144
144
  return this._ref.width();
145
145
  }
146
146
 
147
- getHeigth(): number {
147
+ getHeight(): number {
148
148
  return this._ref.height();
149
149
  }
150
150
 
@@ -100,7 +100,7 @@ export class KonvaText implements IMarkupText {
100
100
  this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
101
101
  });
102
102
 
103
- this._ref.on("dragend", (e) => {
103
+ this._ref.on("dragend", () => {
104
104
  const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
105
105
  const position = absoluteTransform.point({ x: this._ref.x(), y: this._ref.y() });
106
106
  this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));