@inweb/markup 26.7.2 → 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`.
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/markup",
3
- "version": "26.7.2",
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.2",
30
- "@inweb/viewer-core": "~26.7.2"
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`.
@@ -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));
@@ -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));
@@ -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));