@inweb/markup 26.1.0 → 26.1.2

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,18 +31,17 @@ 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
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.
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.
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
40
- * {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
39
+ * or {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
41
40
  * that the markup should redirect to the `viewer`.
42
41
  * @param viewer - `Viewer` instance that receives pointing device events.
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.
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.
46
45
  */
47
46
  initialize(container: HTMLElement, containerEvents?: string[], viewer?: IEventEmitter, worldTransformer?: IWorldTransform): void;
48
47
  /**
@@ -102,15 +101,15 @@ export interface IMarkup {
102
101
  /**
103
102
  * Enables mouse interactions to select or draw markups.
104
103
  *
105
- * @param mode - Edit mode. Matches the type of markup object being created. Specify `false`
106
- * to exit edit mode.
104
+ * @param mode - Edit mode. Matches the type of markup object being created. Specify `false` to exit
105
+ * edit mode.
107
106
  */
108
107
  enableEditMode(mode: MarkupMode | false): this;
109
108
  /**
110
109
  * Creates a markup object.
111
110
  *
112
- * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`,
113
- * `Image` or `Cloud`.
111
+ * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`, `Image` or
112
+ * `Cloud`.
114
113
  * @param params - Parameters for creating a markup object. Must match the object type:
115
114
  *
116
115
  * - `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
66
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
74
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
7
- * syntax `#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 syntax
7
+ * `#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
71
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
35
- * aspect ratio.
34
+ * Sets the width of the image. The image height will be automatically updated to match its aspect
35
+ * 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
44
- * aspect ratio.
43
+ * Sets the height of the image. The image width will be automatically updated to match its aspect
44
+ * 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
66
- * the source image.
65
+ * Width of the image. The original image is scaled to this width. Specify 0 to set width of the source
66
+ * 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
73
- * of the source image.
72
+ * Height of the image. The original image is scaled to this height. Specify 0 to set height of the
73
+ * 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
80
- * original image 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 original image
80
+ * 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
85
- * original 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 original
85
+ * 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
68
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
74
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
64
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
19
- * components (red, green, blue) written as hexadecimal numbers.
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.
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.0",
3
+ "version": "26.1.2",
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.0",
30
- "@inweb/viewer-core": "~26.1.0"
29
+ "@inweb/eventemitter2": "~26.1.2",
30
+ "@inweb/viewer-core": "~26.1.2"
31
31
  },
32
32
  "devDependencies": {
33
- "konva": "^9.3.16"
33
+ "konva": "^9.3.18"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "konva": "^9.3.14"
@@ -59,18 +59,17 @@ 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
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.
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.
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
68
- * {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
67
+ * or {@link https://developer.mozilla.org/docs/Web/API/TouchEvent#touch_event_types | touch events}
69
68
  * that the markup should redirect to the `viewer`.
70
69
  * @param viewer - `Viewer` instance that receives pointing device events.
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.
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.
74
73
  */
75
74
  initialize(
76
75
  container: HTMLElement,
@@ -141,16 +140,16 @@ export interface IMarkup {
141
140
  /**
142
141
  * Enables mouse interactions to select or draw markups.
143
142
  *
144
- * @param mode - Edit mode. Matches the type of markup object being created. Specify `false`
145
- * to exit edit mode.
143
+ * @param mode - Edit mode. Matches the type of markup object being created. Specify `false` to exit
144
+ * edit mode.
146
145
  */
147
146
  enableEditMode(mode: MarkupMode | false): this;
148
147
 
149
148
  /**
150
149
  * Creates a markup object.
151
150
  *
152
- * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`,
153
- * `Image` or `Cloud`.
151
+ * @param type - Markup object type. Can be `Line`, `Text`, `Rectangle`, `Ellipse`, `Arrow`, `Image` or
152
+ * `Cloud`.
154
153
  * @param params - Parameters for creating a markup object. Must match the object type:
155
154
  *
156
155
  * - `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
80
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
104
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
30
- * syntax `#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 syntax
30
+ * `#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
97
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
61
- * aspect ratio.
60
+ * Sets the width of the image. The image height will be automatically updated to match its aspect
61
+ * 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
72
- * aspect ratio.
71
+ * Sets the height of the image. The image width will be automatically updated to match its aspect
72
+ * 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
94
- * the source image.
93
+ * Width of the image. The original image is scaled to this width. Specify 0 to set width of the source
94
+ * 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
102
- * of the source image.
101
+ * Height of the image. The original image is scaled to this height. Specify 0 to set height of the
102
+ * 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
110
- * original image 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 original image
110
+ * 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
116
- * original 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 original
116
+ * 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
96
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
104
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
92
- * components (red, green, blue) written as hexadecimal numbers.
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.
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
46
- * components (red, green, blue) written as hexadecimal numbers.
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.
47
47
  */
48
48
  public asHex(): string {
49
49
  return "#" + this.HEX;