@inweb/viewer-visualize 25.4.3 → 25.4.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.
- package/dist/viewer-visualize.js +83 -6
- package/dist/viewer-visualize.js.map +1 -1
- package/dist/viewer-visualize.min.js +1 -1
- package/dist/viewer-visualize.module.js +4 -6
- package/dist/viewer-visualize.module.js.map +1 -1
- package/lib/Viewer/Markup/Api/IMarkupArrow.d.ts +31 -0
- package/lib/Viewer/Markup/Api/IMarkupCloud.d.ts +36 -0
- package/lib/Viewer/Markup/Api/IMarkupColorable.d.ts +11 -0
- package/lib/Viewer/Markup/Api/IMarkupEllipse.d.ts +36 -0
- package/lib/Viewer/Markup/Api/IMarkupImage.d.ts +36 -0
- package/lib/Viewer/Markup/Api/IMarkupLine.d.ts +27 -0
- package/lib/Viewer/Markup/Api/IMarkupObject.d.ts +37 -1
- package/lib/Viewer/Markup/Api/IMarkupRectangle.d.ts +36 -0
- package/lib/Viewer/Markup/Api/IMarkupText.d.ts +28 -0
- package/lib/Viewer/Markup/IMarkup.d.ts +85 -0
- package/lib/Viewer/Markup/Impl/Konva/MarkupColor.d.ts +17 -0
- package/lib/Viewer/Markup/Impl/Visualize/VisualizeMarkup.d.ts +0 -1
- package/lib/Viewer/Markup/MarkupFactory.d.ts +6 -0
- package/lib/Viewer/Viewer.d.ts +2 -0
- package/package.json +4 -4
- package/src/Viewer/Markup/Api/IMarkupArrow.ts +57 -0
- package/src/Viewer/Markup/Api/IMarkupCloud.ts +63 -0
- package/src/Viewer/Markup/Api/IMarkupColorable.ts +35 -0
- package/src/Viewer/Markup/Api/IMarkupEllipse.ts +63 -0
- package/src/Viewer/Markup/Api/IMarkupImage.ts +63 -0
- package/src/Viewer/Markup/Api/IMarkupLine.ts +52 -0
- package/src/Viewer/Markup/Api/IMarkupObject.ts +65 -2
- package/src/Viewer/Markup/Api/IMarkupRectangle.ts +63 -0
- package/src/Viewer/Markup/Api/IMarkupText.ts +54 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaArrow.ts +23 -0
- package/src/Viewer/Markup/IMarkup.ts +120 -0
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +29 -4
- package/src/Viewer/Markup/Impl/Konva/MarkupColor.ts +40 -0
- package/src/Viewer/Markup/Impl/Visualize/VisualizeMarkup.ts +0 -4
- package/src/Viewer/Markup/MarkupFactory.ts +29 -0
- package/src/Viewer/Viewer.ts +4 -2
package/dist/viewer-visualize.js
CHANGED
|
@@ -3023,12 +3023,41 @@
|
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
3025
|
|
|
3026
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
3027
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3028
|
+
// All rights reserved.
|
|
3029
|
+
//
|
|
3030
|
+
// This software and its documentation and related materials are owned by
|
|
3031
|
+
// the Alliance. The software may only be incorporated into application
|
|
3032
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
3033
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
3034
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
3035
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
3036
|
+
// protected by copyright law and international treaty provisions. Application
|
|
3037
|
+
// programs incorporating this software must include the following statement
|
|
3038
|
+
// with their copyright notices:
|
|
3039
|
+
//
|
|
3040
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
3041
|
+
// license agreement with Open Design Alliance.
|
|
3042
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
3043
|
+
// All rights reserved.
|
|
3044
|
+
//
|
|
3045
|
+
// By use of this software, its documentation or related materials, you
|
|
3046
|
+
// acknowledge and accept the above terms.
|
|
3047
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
3048
|
+
/**
|
|
3049
|
+
* Version of the markup support. Old = "Visualize", New = "Konva"
|
|
3050
|
+
*/
|
|
3026
3051
|
var MarkupType;
|
|
3027
3052
|
(function (MarkupType) {
|
|
3028
3053
|
MarkupType[MarkupType["Unknown"] = 0] = "Unknown";
|
|
3029
3054
|
MarkupType["Konva"] = "Konva";
|
|
3030
3055
|
MarkupType["Visualize"] = "Visualize";
|
|
3031
3056
|
})(MarkupType || (MarkupType = {}));
|
|
3057
|
+
/**
|
|
3058
|
+
* Defines type of markup object. For old Visualize markup ({@link MarkupType}) only "Line" and
|
|
3059
|
+
* "Text" markup objects are supported.
|
|
3060
|
+
*/
|
|
3032
3061
|
var MarkupMode;
|
|
3033
3062
|
(function (MarkupMode) {
|
|
3034
3063
|
MarkupMode["Line"] = "Line";
|
|
@@ -14465,6 +14494,28 @@
|
|
|
14465
14494
|
var libExports = lib$1.exports;
|
|
14466
14495
|
var Konva = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
14467
14496
|
|
|
14497
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
14498
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
14499
|
+
// All rights reserved.
|
|
14500
|
+
//
|
|
14501
|
+
// This software and its documentation and related materials are owned by
|
|
14502
|
+
// the Alliance. The software may only be incorporated into application
|
|
14503
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
14504
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
14505
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
14506
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
14507
|
+
// protected by copyright law and international treaty provisions. Application
|
|
14508
|
+
// programs incorporating this software must include the following statement
|
|
14509
|
+
// with their copyright notices:
|
|
14510
|
+
//
|
|
14511
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
14512
|
+
// license agreement with Open Design Alliance.
|
|
14513
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
14514
|
+
// All rights reserved.
|
|
14515
|
+
//
|
|
14516
|
+
// By use of this software, its documentation or related materials, you
|
|
14517
|
+
// acknowledge and accept the above terms.
|
|
14518
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
14468
14519
|
class MarkupColor {
|
|
14469
14520
|
/**
|
|
14470
14521
|
* Color in #000000 format
|
|
@@ -14472,12 +14523,29 @@
|
|
|
14472
14523
|
get HexColor() {
|
|
14473
14524
|
return "#" + this._hex;
|
|
14474
14525
|
}
|
|
14526
|
+
/**
|
|
14527
|
+
* Color as object with r,g,b properties
|
|
14528
|
+
*/
|
|
14475
14529
|
get RGB() {
|
|
14476
14530
|
return { r: this.R, g: this.G, b: this.B };
|
|
14477
14531
|
}
|
|
14532
|
+
/**
|
|
14533
|
+
* Create an instance of Color
|
|
14534
|
+
*
|
|
14535
|
+
* @param r - Red color in [0,255] range
|
|
14536
|
+
* @param g - Green color in [0,255] range
|
|
14537
|
+
* @param b - Blue color in [0,255] range
|
|
14538
|
+
*/
|
|
14478
14539
|
constructor(r, g, b) {
|
|
14479
14540
|
this.setColor(r, g, b);
|
|
14480
14541
|
}
|
|
14542
|
+
/**
|
|
14543
|
+
* Set Color for current instance
|
|
14544
|
+
*
|
|
14545
|
+
* @param r - Red color in [0,255] range
|
|
14546
|
+
* @param g - Green color in [0,255] range
|
|
14547
|
+
* @param b - Blue color in [0,255] range
|
|
14548
|
+
*/
|
|
14481
14549
|
setColor(r, g, b) {
|
|
14482
14550
|
this.R = r;
|
|
14483
14551
|
this.G = g;
|
|
@@ -14840,6 +14908,7 @@
|
|
|
14840
14908
|
}
|
|
14841
14909
|
}
|
|
14842
14910
|
|
|
14911
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
14843
14912
|
class KonvaArrow {
|
|
14844
14913
|
constructor(params, ref = null) {
|
|
14845
14914
|
var _a, _b;
|
|
@@ -15179,6 +15248,7 @@
|
|
|
15179
15248
|
}
|
|
15180
15249
|
}
|
|
15181
15250
|
|
|
15251
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
15182
15252
|
// move to separate class and create factory with enum?
|
|
15183
15253
|
const MarkupMode2Konva = new Map([
|
|
15184
15254
|
[
|
|
@@ -15391,7 +15461,7 @@
|
|
|
15391
15461
|
let object;
|
|
15392
15462
|
let zIndex = this._zIndex;
|
|
15393
15463
|
// TODO: factory?
|
|
15394
|
-
switch (type) {
|
|
15464
|
+
switch (type.toLocaleLowerCase()) {
|
|
15395
15465
|
case "line":
|
|
15396
15466
|
object = new KonvaLine(params);
|
|
15397
15467
|
zIndex = 1;
|
|
@@ -16160,8 +16230,9 @@
|
|
|
16160
16230
|
addImage(position, src, width, height, id) {
|
|
16161
16231
|
if (!position)
|
|
16162
16232
|
return;
|
|
16233
|
+
let konvaImage;
|
|
16163
16234
|
if (src) {
|
|
16164
|
-
|
|
16235
|
+
konvaImage = new KonvaImage({
|
|
16165
16236
|
position,
|
|
16166
16237
|
src,
|
|
16167
16238
|
width,
|
|
@@ -16178,7 +16249,7 @@
|
|
|
16178
16249
|
}
|
|
16179
16250
|
}
|
|
16180
16251
|
this.removeImageInput();
|
|
16181
|
-
return;
|
|
16252
|
+
return konvaImage;
|
|
16182
16253
|
}
|
|
16183
16254
|
}
|
|
16184
16255
|
|
|
@@ -16462,9 +16533,6 @@
|
|
|
16462
16533
|
viewpoint.description = new Date().toDateString();
|
|
16463
16534
|
return viewpoint;
|
|
16464
16535
|
}
|
|
16465
|
-
getLayer() {
|
|
16466
|
-
throw new Error("Not implemented yet");
|
|
16467
|
-
}
|
|
16468
16536
|
createObject(type, params) {
|
|
16469
16537
|
throw new Error("Not implemented yet");
|
|
16470
16538
|
}
|
|
@@ -16482,7 +16550,14 @@
|
|
|
16482
16550
|
}
|
|
16483
16551
|
}
|
|
16484
16552
|
|
|
16553
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
16485
16554
|
class MarkupFactory {
|
|
16555
|
+
/**
|
|
16556
|
+
* Initialize {@link IMarkup} instance
|
|
16557
|
+
*
|
|
16558
|
+
* @param markupType - Specifies version of the markup support. Two variants of markup
|
|
16559
|
+
* support are implemented: old "Visualize" and new "Konva". Default is "Konva". {@link MarkupType}
|
|
16560
|
+
*/
|
|
16486
16561
|
static createMarkup(markupType) {
|
|
16487
16562
|
let markup;
|
|
16488
16563
|
switch (markupType) {
|
|
@@ -16526,6 +16601,8 @@
|
|
|
16526
16601
|
* @param params.enableAutoUpdate - Enable auto-update of the viewer after any changes. If
|
|
16527
16602
|
* the auto-update is disabled, you need to update the `VisualizeJS` viewer and the active
|
|
16528
16603
|
* dragger manually using the `update` event. Default is `true`.
|
|
16604
|
+
* @param params.markupType - Specifies version of the markup support. Two variants of markup
|
|
16605
|
+
* support are implemented: old "Visualize" and new "Konva". Default is "Konva". {@link MarkupType}
|
|
16529
16606
|
*/
|
|
16530
16607
|
constructor(client, params = {}) {
|
|
16531
16608
|
var _a, _b;
|