@inweb/markup 26.1.2 → 26.1.4

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.
@@ -31,17 +31,18 @@ export interface IMarkup {
31
31
  /**
32
32
  * Initializes the markup instance. Call {@link dispose | dispose()} to release allocated resources.
33
33
  *
34
- * @param container - Container element used to operate on. This is usually a `<canvas>` or `<div>` on
35
- * top of which the markup is drawn. If the `container` is a `<canvas>` element, its content will be
36
- * combined with the markup in the viewpoint snapshot.
34
+ * @param container - Container element used to operate on. This is usually a `<canvas>` or
35
+ * `<div>` on top of which the markup is drawn. If the `container` is a `<canvas>` element,
36
+ * its content will be combined with the markup in the viewpoint snapshot.
37
37
  * @param containerEvents - List of container events, such as mouse events or
38
38
  * {@link https://developer.mozilla.org/docs/Web/API/Pointer_events#event_types_and_global_event_handlers | pointer events}
39
- * or {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
39
+ * or
40
+ * {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
40
41
  * that the markup should redirect to the `viewer`.
41
42
  * @param viewer - `Viewer` instance that receives pointing device events.
42
- * @param worldTransformer - Transformer of screen space into the `viewer` world space and vice versa.
43
- * If a transformer is defined, markup objects will be stored at the viewpoint in world coordinates,
44
- * otherwise in screen coordinates.
43
+ * @param worldTransformer - Transformer of screen space into the `viewer` world space and
44
+ * vice versa. If a transformer is defined, markup objects will be stored at the viewpoint
45
+ * in world coordinates, otherwise in screen coordinates.
45
46
  */
46
47
  initialize(container: HTMLElement, containerEvents?: string[], viewer?: IEventEmitter, worldTransformer?: IWorldTransform): void;
47
48
  /**
@@ -101,15 +102,15 @@ export interface IMarkup {
101
102
  /**
102
103
  * Enables mouse interactions to select or draw markups.
103
104
  *
104
- * @param mode - Edit mode. Matches the type of markup object being created. Specify `false` to exit
105
- * edit mode.
105
+ * @param mode - Edit mode. Matches the type of markup object being created. Specify `false`
106
+ * to exit edit mode.
106
107
  */
107
108
  enableEditMode(mode: MarkupMode | false): this;
108
109
  /**
109
110
  * Creates a markup object.
110
111
  *
111
- * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`, `Image` or
112
- * `Cloud`.
112
+ * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`,
113
+ * `Image` or `Cloud`.
113
114
  * @param params - Parameters for creating a markup object. Must match the object type:
114
115
  *
115
116
  * - `Line` - {@link IMarkupLineParams}
@@ -62,8 +62,8 @@ export interface IMarkupArrowParams {
62
62
  y: number;
63
63
  };
64
64
  /**
65
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
66
- * (red, green, blue) written as hexadecimal numbers.
65
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
66
+ * components (red, green, blue) written as hexadecimal numbers.
67
67
  *
68
68
  * @default "#ff0000"
69
69
  */
@@ -70,8 +70,8 @@ export interface IMarkupCloudParams {
70
70
  */
71
71
  lineWidth?: number;
72
72
  /**
73
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
74
- * (red, green, blue) written as hexadecimal numbers.
73
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
74
+ * components (red, green, blue) written as hexadecimal numbers.
75
75
  *
76
76
  * @default "#ff0000"
77
77
  */
@@ -3,8 +3,8 @@
3
3
  */
4
4
  export interface IMarkupColorable {
5
5
  /**
6
- * Returns the foreground color of an object's line or text as a string in hexadecimal color syntax
7
- * `#RGB` using its primary color components (red, green, blue) written as hexadecimal numbers.
6
+ * Returns the foreground color of an object's line or text as a string in hexadecimal color
7
+ * syntax `#RGB` using its primary color components (red, green, blue) written as hexadecimal numbers.
8
8
  */
9
9
  getColor(): string;
10
10
  /**
@@ -67,8 +67,8 @@ export interface IMarkupEllipseParams {
67
67
  */
68
68
  lineWidth?: number;
69
69
  /**
70
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
71
- * (red, green, blue) written as hexadecimal numbers.
70
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
71
+ * components (red, green, blue) written as hexadecimal numbers.
72
72
  *
73
73
  * @default "#ff0000"
74
74
  */
@@ -31,8 +31,8 @@ export interface IMarkupImage extends IMarkupObject {
31
31
  */
32
32
  getWidth(): number;
33
33
  /**
34
- * Sets the width of the image. The image height will be automatically updated to match its aspect
35
- * ratio.
34
+ * Sets the width of the image. The image height will be automatically updated to match its
35
+ * aspect ratio.
36
36
  */
37
37
  setWidth(w: number): void;
38
38
  /**
@@ -40,8 +40,8 @@ export interface IMarkupImage extends IMarkupObject {
40
40
  */
41
41
  getHeight(): number;
42
42
  /**
43
- * Sets the height of the image. The image width will be automatically updated to match its aspect
44
- * ratio.
43
+ * Sets the height of the image. The image width will be automatically updated to match its
44
+ * aspect ratio.
45
45
  */
46
46
  setHeight(h: number): void;
47
47
  }
@@ -62,27 +62,27 @@ export interface IMarkupImageParams {
62
62
  */
63
63
  src?: string;
64
64
  /**
65
- * Width of the image. The original image is scaled to this width. Specify 0 to set width of the source
66
- * image.
65
+ * Width of the image. The original image is scaled to this width. Specify 0 to set width of
66
+ * the source image.
67
67
  *
68
68
  * @default 0
69
69
  */
70
70
  width?: number;
71
71
  /**
72
- * Height of the image. The original image is scaled to this height. Specify 0 to set height of the
73
- * source image.
72
+ * Height of the image. The original image is scaled to this height. Specify 0 to set height
73
+ * of the source image.
74
74
  *
75
75
  * @default 0
76
76
  */
77
77
  height?: number;
78
78
  /**
79
- * Maximum width of the image. Specify a max width if you want to set the width to the original image
80
- * but not more than the max.
79
+ * Maximum width of the image. Specify a max width if you want to set the width to the
80
+ * original image but not more than the max.
81
81
  */
82
82
  maxWidth?: number;
83
83
  /**
84
- * Maximum height of the image. Specify a max height if you want to set the height to the original
85
- * image but not more than the max.
84
+ * Maximum height of the image. Specify a max height if you want to set the height to the
85
+ * original image but not more than the max.
86
86
  */
87
87
  maxHeight?: number;
88
88
  /**
@@ -64,8 +64,8 @@ export interface IMarkupLineParams {
64
64
  */
65
65
  width?: number;
66
66
  /**
67
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
68
- * (red, green, blue) written as hexadecimal numbers.
67
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
68
+ * components (red, green, blue) written as hexadecimal numbers.
69
69
  *
70
70
  * @default "#ff0000"
71
71
  */
@@ -70,8 +70,8 @@ export interface IMarkupRectangleParams {
70
70
  */
71
71
  lineWidth?: number;
72
72
  /**
73
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
74
- * (red, green, blue) written as hexadecimal numbers.
73
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
74
+ * components (red, green, blue) written as hexadecimal numbers.
75
75
  *
76
76
  * @default "#ff0000"
77
77
  */
@@ -60,8 +60,8 @@ export interface IMarkupTextParams {
60
60
  */
61
61
  fontSize?: number;
62
62
  /**
63
- * Text color as a string in hexadecimal color syntax `#RGB` color using its primary color components
64
- * (red, green, blue) written as hexadecimal numbers.
63
+ * Text color as a string in hexadecimal color syntax `#RGB` color using its primary color
64
+ * components (red, green, blue) written as hexadecimal numbers.
65
65
  *
66
66
  * @default "#ff0000"
67
67
  */
@@ -15,8 +15,8 @@ export declare class MarkupColor {
15
15
  */
16
16
  constructor(r: number, g: number, b: number);
17
17
  /**
18
- * Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color components
19
- * (red, green, blue) written as hexadecimal numbers.
18
+ * Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color
19
+ * components (red, green, blue) written as hexadecimal numbers.
20
20
  */
21
21
  asHex(): string;
22
22
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/markup",
3
- "version": "26.1.2",
3
+ "version": "26.1.4",
4
4
  "description": "JavaScript 2D markups",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -26,11 +26,11 @@
26
26
  "docs": "typedoc"
27
27
  },
28
28
  "dependencies": {
29
- "@inweb/eventemitter2": "~26.1.2",
30
- "@inweb/viewer-core": "~26.1.2"
29
+ "@inweb/eventemitter2": "~26.1.4",
30
+ "@inweb/viewer-core": "~26.1.4"
31
31
  },
32
32
  "devDependencies": {
33
- "konva": "^9.3.18"
33
+ "konva": "^9.3.16"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "konva": "^9.3.14"
@@ -59,17 +59,18 @@ export interface IMarkup {
59
59
  /**
60
60
  * Initializes the markup instance. Call {@link dispose | dispose()} to release allocated resources.
61
61
  *
62
- * @param container - Container element used to operate on. This is usually a `<canvas>` or `<div>` on
63
- * top of which the markup is drawn. If the `container` is a `<canvas>` element, its content will be
64
- * combined with the markup in the viewpoint snapshot.
62
+ * @param container - Container element used to operate on. This is usually a `<canvas>` or
63
+ * `<div>` on top of which the markup is drawn. If the `container` is a `<canvas>` element,
64
+ * its content will be combined with the markup in the viewpoint snapshot.
65
65
  * @param containerEvents - List of container events, such as mouse events or
66
66
  * {@link https://developer.mozilla.org/docs/Web/API/Pointer_events#event_types_and_global_event_handlers | pointer events}
67
- * or {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
67
+ * or
68
+ * {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
68
69
  * that the markup should redirect to the `viewer`.
69
70
  * @param viewer - `Viewer` instance that receives pointing device events.
70
- * @param worldTransformer - Transformer of screen space into the `viewer` world space and vice versa.
71
- * If a transformer is defined, markup objects will be stored at the viewpoint in world coordinates,
72
- * otherwise in screen coordinates.
71
+ * @param worldTransformer - Transformer of screen space into the `viewer` world space and
72
+ * vice versa. If a transformer is defined, markup objects will be stored at the viewpoint
73
+ * in world coordinates, otherwise in screen coordinates.
73
74
  */
74
75
  initialize(
75
76
  container: HTMLElement,
@@ -140,16 +141,16 @@ export interface IMarkup {
140
141
  /**
141
142
  * Enables mouse interactions to select or draw markups.
142
143
  *
143
- * @param mode - Edit mode. Matches the type of markup object being created. Specify `false` to exit
144
- * edit mode.
144
+ * @param mode - Edit mode. Matches the type of markup object being created. Specify `false`
145
+ * to exit edit mode.
145
146
  */
146
147
  enableEditMode(mode: MarkupMode | false): this;
147
148
 
148
149
  /**
149
150
  * Creates a markup object.
150
151
  *
151
- * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`, `Image` or
152
- * `Cloud`.
152
+ * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`,
153
+ * `Image` or `Cloud`.
153
154
  * @param params - Parameters for creating a markup object. Must match the object type:
154
155
  *
155
156
  * - `Line` - {@link IMarkupLineParams}
@@ -76,8 +76,8 @@ export interface IMarkupArrowParams {
76
76
  end?: { x: number; y: number };
77
77
 
78
78
  /**
79
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
80
- * (red, green, blue) written as hexadecimal numbers.
79
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
80
+ * components (red, green, blue) written as hexadecimal numbers.
81
81
  *
82
82
  * @default "#ff0000"
83
83
  */
@@ -100,8 +100,8 @@ export interface IMarkupCloudParams {
100
100
  lineWidth?: number;
101
101
 
102
102
  /**
103
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
104
- * (red, green, blue) written as hexadecimal numbers.
103
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
104
+ * components (red, green, blue) written as hexadecimal numbers.
105
105
  *
106
106
  * @default "#ff0000"
107
107
  */
@@ -26,8 +26,8 @@
26
26
  */
27
27
  export interface IMarkupColorable {
28
28
  /**
29
- * Returns the foreground color of an object's line or text as a string in hexadecimal color syntax
30
- * `#RGB` using its primary color components (red, green, blue) written as hexadecimal numbers.
29
+ * Returns the foreground color of an object's line or text as a string in hexadecimal color
30
+ * syntax `#RGB` using its primary color components (red, green, blue) written as hexadecimal numbers.
31
31
  */
32
32
  getColor(): string;
33
33
 
@@ -93,8 +93,8 @@ export interface IMarkupEllipseParams {
93
93
  lineWidth?: number;
94
94
 
95
95
  /**
96
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
97
- * (red, green, blue) written as hexadecimal numbers.
96
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
97
+ * components (red, green, blue) written as hexadecimal numbers.
98
98
  *
99
99
  * @default "#ff0000"
100
100
  */
@@ -57,8 +57,8 @@ export interface IMarkupImage extends IMarkupObject {
57
57
  getWidth(): number;
58
58
 
59
59
  /**
60
- * Sets the width of the image. The image height will be automatically updated to match its aspect
61
- * ratio.
60
+ * Sets the width of the image. The image height will be automatically updated to match its
61
+ * aspect ratio.
62
62
  */
63
63
  setWidth(w: number): void;
64
64
 
@@ -68,8 +68,8 @@ export interface IMarkupImage extends IMarkupObject {
68
68
  getHeight(): number;
69
69
 
70
70
  /**
71
- * Sets the height of the image. The image width will be automatically updated to match its aspect
72
- * ratio.
71
+ * Sets the height of the image. The image width will be automatically updated to match its
72
+ * aspect ratio.
73
73
  */
74
74
  setHeight(h: number): void;
75
75
  }
@@ -90,30 +90,30 @@ export interface IMarkupImageParams {
90
90
  src?: string;
91
91
 
92
92
  /**
93
- * Width of the image. The original image is scaled to this width. Specify 0 to set width of the source
94
- * image.
93
+ * Width of the image. The original image is scaled to this width. Specify 0 to set width of
94
+ * the source image.
95
95
  *
96
96
  * @default 0
97
97
  */
98
98
  width?: number;
99
99
 
100
100
  /**
101
- * Height of the image. The original image is scaled to this height. Specify 0 to set height of the
102
- * source image.
101
+ * Height of the image. The original image is scaled to this height. Specify 0 to set height
102
+ * of the source image.
103
103
  *
104
104
  * @default 0
105
105
  */
106
106
  height?: number;
107
107
 
108
108
  /**
109
- * Maximum width of the image. Specify a max width if you want to set the width to the original image
110
- * but not more than the max.
109
+ * Maximum width of the image. Specify a max width if you want to set the width to the
110
+ * original image but not more than the max.
111
111
  */
112
112
  maxWidth?: number;
113
113
 
114
114
  /**
115
- * Maximum height of the image. Specify a max height if you want to set the height to the original
116
- * image but not more than the max.
115
+ * Maximum height of the image. Specify a max height if you want to set the height to the
116
+ * original image but not more than the max.
117
117
  */
118
118
  maxHeight?: number;
119
119
 
@@ -92,8 +92,8 @@ export interface IMarkupLineParams {
92
92
  width?: number;
93
93
 
94
94
  /**
95
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
96
- * (red, green, blue) written as hexadecimal numbers.
95
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
96
+ * components (red, green, blue) written as hexadecimal numbers.
97
97
  *
98
98
  * @default "#ff0000"
99
99
  */
@@ -100,8 +100,8 @@ export interface IMarkupRectangleParams {
100
100
  lineWidth?: number;
101
101
 
102
102
  /**
103
- * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color components
104
- * (red, green, blue) written as hexadecimal numbers.
103
+ * Line color as a string in hexadecimal color syntax `#RGB` color using its primary color
104
+ * components (red, green, blue) written as hexadecimal numbers.
105
105
  *
106
106
  * @default "#ff0000"
107
107
  */
@@ -88,8 +88,8 @@ export interface IMarkupTextParams {
88
88
  fontSize?: number;
89
89
 
90
90
  /**
91
- * Text color as a string in hexadecimal color syntax `#RGB` color using its primary color components
92
- * (red, green, blue) written as hexadecimal numbers.
91
+ * Text color as a string in hexadecimal color syntax `#RGB` color using its primary color
92
+ * components (red, green, blue) written as hexadecimal numbers.
93
93
  *
94
94
  * @default "#ff0000"
95
95
  */
@@ -42,8 +42,8 @@ export class MarkupColor {
42
42
  }
43
43
 
44
44
  /**
45
- * Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color components
46
- * (red, green, blue) written as hexadecimal numbers.
45
+ * Returns the color as a string in hexadecimal color syntax `#RGB` using its primary color
46
+ * components (red, green, blue) written as hexadecimal numbers.
47
47
  */
48
48
  public asHex(): string {
49
49
  return "#" + this.HEX;