@vitrosoftware/common-ui-ts 1.1.130 → 1.1.132

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.
@@ -9,5 +9,6 @@ export declare enum EVENT {
9
9
  HISTORY_UPDATE = "vitro.history.update",
10
10
  HISTORY_CHANGED = "vitro.history.changed",
11
11
  DROP = "drop",
12
- CONTEXTMENU = "contextmenu"
12
+ CONTEXTMENU = "contextmenu",
13
+ COMMANDMENU_TOGGLE = "vitro.commandmenu.toggle"
13
14
  }
@@ -13,6 +13,7 @@ interface CommandMenuDropdownButtonProps {
13
13
  imageUrl?: string;
14
14
  imageHoverUrl?: string;
15
15
  className?: string;
16
+ onClick?: (e: any) => any;
16
17
  }
17
18
  export declare const CommandMenuDropdownButton: (props: CommandMenuDropdownButtonProps) => JSX.Element;
18
19
  export {};
@@ -2,6 +2,7 @@
2
2
  export interface IssueTileProps {
3
3
  id: string;
4
4
  url?: string;
5
+ name: string;
5
6
  text: string;
6
7
  userName: string;
7
8
  userImage?: string;
@@ -1,3 +1,5 @@
1
1
  export declare enum LOCALE {
2
- TEXTAREA_LABEL = "app.common.issueTile.textareaLabel"
2
+ TEXTAREA_LABEL = "app.common.issueTile.textareaLabel",
3
+ INPUT_NAME_LABEL = "app.common.issueTile.inputNameLabel",
4
+ ERROR_EMPTY = "app.common.issueTile.error.empty"
3
5
  }
@@ -50,7 +50,9 @@ export declare enum EVENT {
50
50
  ON_GET_GANTT_MENU = "OnGetGanttMenu",
51
51
  ON_RENDER_CHILD_PART_FINISH = "OnRenderChildPartFinish",
52
52
  ON_RENDER_CHILD_PART_START = "OnRenderChildPartStart",
53
- ON_EXPAND_ALL_FINISH = "OnExpandAllFinish"
53
+ ON_EXPAND_ALL_FINISH = "OnExpandAllFinish",
54
+ ON_GET_FORMAT = "OnGetFormat",
55
+ ON_GET_GANTT_SIDE_HTML = "OnGetGanttSideHtml"
54
56
  }
55
57
  export declare enum URL {
56
58
  LAYOUT = "Layout",
@@ -110,7 +112,8 @@ export declare enum ATTRIBUTE {
110
112
  VISIBLE = "Visible",
111
113
  ID = "Id",
112
114
  ADDED = "Added",
113
- FORMULA = "Formula"
115
+ FORMULA = "Formula",
116
+ FORMAT = "Format"
114
117
  }
115
118
  export declare enum DRAG_ITEM_TYPE {
116
119
  CANNOT_DROP = 0,
@@ -211,3 +214,6 @@ export declare enum DEF_ROW {
211
214
  FOLDER = "Folder",
212
215
  R = "R"
213
216
  }
217
+ export declare enum DATE_FORMAT {
218
+ DEFAULT = "dd.MM.yyyy"
219
+ }
@@ -84,8 +84,8 @@ export interface TableViewContext {
84
84
  showPopupMenu(): any;
85
85
  closeDialog(): void;
86
86
  hideTip(): void;
87
- showMenu(row: TableViewRow, col: string, menu: any, position?: any, func?: Function): void;
88
- showPopup(menu: any, func?: Function): void;
87
+ showMenu(row: TableViewRow, col: string, menu: any, position?: any, func?: Function): any;
88
+ showPopup(menu: any, func?: Function): any;
89
89
  getShownRows(): TableViewRow[];
90
90
  getShownCols(section?: number): string[];
91
91
  refreshGantt(): void;
@@ -99,8 +99,8 @@ export declare class TreeGridTableViewContextImpl implements TableViewContext {
99
99
  showPopupMenu(): any;
100
100
  closeDialog(): void;
101
101
  hideTip(): void;
102
- showMenu(row: TableViewRow, col: string, menu: any, position?: any, func?: Function): void;
103
- showPopup(menu: any, func?: Function): void;
102
+ showMenu(row: TableViewRow, col: string, menu: any, position?: any, func?: Function): any;
103
+ showPopup(menu: any, func?: Function): any;
104
104
  getShownRows(): TableViewRow[];
105
105
  getShownCols(section?: number): string[];
106
106
  refreshGantt(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrosoftware/common-ui-ts",
3
- "version": "1.1.130",
3
+ "version": "1.1.132",
4
4
  "description": "vitro software common ui ts",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -1,11 +1,11 @@
1
- import { BIMModel, BIMCommon, BIMAnnotation } from '/resource/bimViewer/js/bim-viewer-models.js?version=1.1.130';
1
+ import { BIMModel, BIMCommon, BIMAnnotation } from '/resource/bimViewer/js/bim-viewer-models.js?version=1.1.132';
2
2
 
3
3
  import {
4
4
  Viewer, XKTLoaderPlugin, NavCubePlugin, SectionPlanesPlugin, math, BCFViewpointsPlugin, AnnotationsPlugin,
5
5
  ContextMenu, TreeViewPlugin, StoreyViewsPlugin, AngleMeasurementsPlugin, CameraMemento, DistanceMeasurementsPlugin,
6
6
  GLTFLoaderPlugin, utils, FastNavPlugin, MetaObject, parsers
7
7
  }
8
- from '/resource/bimViewer/js/xeokit/xeokit-sdk.es.js?version=1.1.130';
8
+ from '/resource/bimViewer/js/xeokit/xeokit-sdk.es.js?version=1.1.132';
9
9
 
10
10
 
11
11
  const processByChildIdList = (treeViewNode, event) => {
@@ -1,17 +1,17 @@
1
- import * as three from '/resource/dxfViewer/js/three/three.module.js?version=1.1.130';
2
- import { Matrix3, Vector2 } from '/resource/dxfViewer/js/three/three.module.js?version=1.1.130';
3
- import { Batch, DxfViewer, Layer } from '/resource/dxfViewer/js/viewer/DxfViewer.js?version=1.1.130';
4
- import { Block as SceneBlock } from '/resource/dxfViewer/js/viewer/DxfScene.js?version=1.1.130';
5
- import { Block } from '/resource/dxfViewer/js/viewer/DxfViewer.js?version=1.1.130';
6
- import { DxfScene, Entity, ColorCode } from '/resource/dxfViewer/js/viewer/DxfScene.js?version=1.1.130';
7
- import { TextRenderer, ParseSpecialChars, HAlign, VAlign } from '/resource/dxfViewer/js/viewer/TextRenderer.js?version=1.1.130';
8
- import { DxfWorker } from '/resource/dxfViewer/js/viewer/DxfWorker.js?version=1.1.130';
9
- import { DxfFetcher } from '/resource/dxfViewer/js/viewer/DxfFetcher.js?version=1.1.130';
10
- import DxfParser from '/resource/dxfViewer/js/viewer/parser/DxfParser.js?version=1.1.130';
11
- import { RenderBatch } from '/resource/dxfViewer/js/viewer/DxfScene.js?version=1.1.130';
12
- import { DynamicBuffer, NativeType } from '/resource/dxfViewer/js/viewer/DynamicBuffer.js?version=1.1.130';
13
- import { OrbitControls } from '/resource/dxfViewer/js/viewer/OrbitControls.js?version=1.1.130';
14
- import { CSS2DRenderer, CSS2DObject } from '/resource/dxfViewer/js/three/three.module.js?version=1.1.130';
1
+ import * as three from '/resource/dxfViewer/js/three/three.module.js?version=1.1.132';
2
+ import { Matrix3, Vector2 } from '/resource/dxfViewer/js/three/three.module.js?version=1.1.132';
3
+ import { Batch, DxfViewer, Layer } from '/resource/dxfViewer/js/viewer/DxfViewer.js?version=1.1.132';
4
+ import { Block as SceneBlock } from '/resource/dxfViewer/js/viewer/DxfScene.js?version=1.1.132';
5
+ import { Block } from '/resource/dxfViewer/js/viewer/DxfViewer.js?version=1.1.132';
6
+ import { DxfScene, Entity, ColorCode } from '/resource/dxfViewer/js/viewer/DxfScene.js?version=1.1.132';
7
+ import { TextRenderer, ParseSpecialChars, HAlign, VAlign } from '/resource/dxfViewer/js/viewer/TextRenderer.js?version=1.1.132';
8
+ import { DxfWorker } from '/resource/dxfViewer/js/viewer/DxfWorker.js?version=1.1.132';
9
+ import { DxfFetcher } from '/resource/dxfViewer/js/viewer/DxfFetcher.js?version=1.1.132';
10
+ import DxfParser from '/resource/dxfViewer/js/viewer/parser/DxfParser.js?version=1.1.132';
11
+ import { RenderBatch } from '/resource/dxfViewer/js/viewer/DxfScene.js?version=1.1.132';
12
+ import { DynamicBuffer, NativeType } from '/resource/dxfViewer/js/viewer/DynamicBuffer.js?version=1.1.132';
13
+ import { OrbitControls } from '/resource/dxfViewer/js/viewer/OrbitControls.js?version=1.1.132';
14
+ import { CSS2DRenderer, CSS2DObject } from '/resource/dxfViewer/js/three/three.module.js?version=1.1.132';
15
15
 
16
16
  let treeViewData = [];
17
17
  let notes = [];
@@ -21208,7 +21208,7 @@ const defaultOptions = {
21208
21208
  kind: OptionKind.WORKER
21209
21209
  },
21210
21210
  workerSrc: {
21211
- value: "resource/pdfViewer/js/pdf.worker.js?version=1.1.130",
21211
+ value: "resource/pdfViewer/js/pdf.worker.js?version=1.1.132",
21212
21212
  kind: OptionKind.WORKER
21213
21213
  }
21214
21214
  };
@@ -27043,6 +27043,7 @@ class PDFViewer {
27043
27043
  presetValue: newValue
27044
27044
  });
27045
27045
  }
27046
+ showNotesLayer();
27046
27047
  return;
27047
27048
  }
27048
27049
  this.viewer.style.setProperty("--scale-factor", newScale * _pdfjsLib.PixelsPerInch.PDF_TO_CSS_UNITS);
@@ -33216,17 +33217,27 @@ function dragging(event, pageNr) {
33216
33217
  if (!drawStart) {
33217
33218
  return;
33218
33219
  }
33220
+
33221
+ var shapeType = getShapeType();
33222
+ var outlineId = 'shapeOutline';
33223
+ var settings = getShapeSettings(outlineId);
33224
+ var shapeParams = getShapeParams(drawStart.X, drawStart.Y, (event.clientX - offset.left), (event.clientY - offset.top));
33225
+ var pagesRotation = getPdfPagesRotation();
33226
+ var shapeParamsByType = getShapeParamsObjByType(shapeParams, pagesRotation, shapeType);
33227
+
33219
33228
  if (!outline) {
33220
- outline = sketchpad[pageNr].rect(0, 0, 0, 0,
33221
- {fill: 'none', stroke: '#c0c0c0', strokeWidth: 1, strokeDashArray: '2,2'});
33229
+
33230
+ var initShapeParams = getShapeParams(0, 0, 20, 20);
33231
+ outline = getShapeNodeByType(pageNr, shapeType, initShapeParams, pagesRotation, settings);
33232
+
33222
33233
  $(outline).mouseup(function(e) {
33223
33234
  endDrag(e, pageNr);
33224
33235
  });
33225
33236
  }
33226
- sketchpad[pageNr].change(outline, {x: Math.min(event.clientX - offset.left, drawStart.X),
33227
- y: Math.min(event.clientY - offset.top, drawStart.Y),
33228
- width: Math.abs(event.clientX - offset.left - drawStart.X),
33229
- height: Math.abs(event.clientY - offset.top - drawStart.Y)});
33237
+
33238
+
33239
+ sketchpad[pageNr].change(outline, shapeParamsByType);
33240
+
33230
33241
  event.preventDefault();
33231
33242
  }
33232
33243
 
@@ -33580,53 +33591,14 @@ function setMeasure(pageNr, measureGrpId, measureGrp, posX, posY, width, height,
33580
33591
  }
33581
33592
 
33582
33593
  /* Draw the selected element on the canvas */
33583
- function drawShape(x1, y1, x2, y2, pageNr, shape) {
33584
-
33585
- var left = Math.min(x1, x2);
33586
- var top = Math.min(y1, y2);
33587
- var right = Math.max(x1, x2);
33588
- var bottom = Math.max(y1, y2);
33594
+ function drawShape(x1, y1, x2, y2, pageNr, shapeType) {
33589
33595
 
33590
33596
  var nodeId = Date.now();
33597
+ var shapeParams = getShapeParams(x1, y1, x2, y2);
33591
33598
  var settings = getShapeSettings(nodeId);
33592
33599
  var pagesRotation = getPdfPagesRotation();
33593
33600
 
33594
- var node = null;
33595
- if (shape == 'rect') {
33596
- node = sketchpad[pageNr].rect(left, top, right - left, bottom - top, settings);
33597
- }
33598
- else if (shape == 'circle') {
33599
- var r = Math.min(right - left, bottom - top) / 2;
33600
- node = sketchpad[pageNr].circle(left + r, top + r, r, settings);
33601
- }
33602
- else if (shape == 'ellipse') {
33603
- var rx = (right - left) / 2;
33604
- var ry = (bottom - top) / 2;
33605
- node = sketchpad[pageNr].ellipse(left + rx, top + ry, rx, ry, settings);
33606
- }
33607
- else if (shape == 'line') {
33608
- node = sketchpad[pageNr].line(x1, y1, x2, y2, settings);
33609
- }
33610
- else if (shape == 'arrow') {
33611
- var arrowPath = getArrowPath(x1, y1, x2, y2);
33612
- node = sketchpad[pageNr].path(arrowPath, settings);
33613
- }
33614
- else if (shape == 'polyline') {
33615
- node = sketchpad[pageNr].polyline([[(x1 + x2) / 2, y1], [x2, y2],
33616
- [x1, (y1 + y2) / 2], [x2, (y1 + y2) / 2], [x1, y2],
33617
- [(x1 + x2) / 2, y1]], $.extend(settings, {fill: 'none'}));
33618
- }
33619
- else if (shape == 'cloud') {
33620
- var cloudPath = getCloudPath(left, top, right, bottom);
33621
- node = sketchpad[pageNr].path(cloudPath, settings);
33622
- }
33623
- else if (shape == 'polygon') {
33624
- var polygonPos = getPolygonPosByPageRotation(x1, y1, x2, y2, pagesRotation);
33625
- node = sketchpad[pageNr].polygon(polygonPos, settings);
33626
- }
33627
-
33628
- var width = right - left;
33629
- var height = bottom - top;
33601
+ var node = getShapeNodeByType(pageNr, shapeType, shapeParams, pagesRotation, settings);
33630
33602
 
33631
33603
  var direction = getDrawDirectionByPagesRotation(x1, y1, x2, y2, pagesRotation);
33632
33604
 
@@ -33634,16 +33606,16 @@ function drawShape(x1, y1, x2, y2, pageNr, shape) {
33634
33606
  var svgData = {
33635
33607
  pageNr: pageNr,
33636
33608
  position: {
33637
- x: left,
33638
- y: top
33609
+ x: shapeParams.left,
33610
+ y: shapeParams.top
33639
33611
  },
33640
- width: width,
33641
- height: height
33612
+ width: shapeParams.width,
33613
+ height: shapeParams.height
33642
33614
  };
33643
33615
  var nodeSvgData = getNormalizedSvgData(svgData, pagesRotation);
33644
- setDrawNodes(pageNr, nodeId, node, nodeSvgData.position.x, nodeSvgData.position.y, nodeSvgData.width, nodeSvgData.height, shape, direction);
33616
+ setDrawNodes(pageNr, nodeId, node, nodeSvgData.position.x, nodeSvgData.position.y, nodeSvgData.width, nodeSvgData.height, shapeType, direction);
33645
33617
  } else {
33646
- setDrawNodes(pageNr, nodeId, node, left, top, width, height, shape, direction);
33618
+ setDrawNodes(pageNr, nodeId, node, shapeParams.left, shapeParams.top, shapeParams.width, shapeParams.height, shapeType, direction);
33647
33619
  }
33648
33620
 
33649
33621
  $(node).mousedown(function(e) {
@@ -33659,6 +33631,184 @@ function drawShape(x1, y1, x2, y2, pageNr, shape) {
33659
33631
  initDlgForSvg(drawNodes[nodeId], false, removeSvg, false, drawNodes[nodeId].data);
33660
33632
  }
33661
33633
 
33634
+ function getShapeNodeByType(pageNr, shapeType, shapeParams, pagesRotation, settings) {
33635
+ var node = null;
33636
+ if (shapeType == 'rect') {
33637
+ node = getShapeNodeRect(pageNr, shapeParams.left, shapeParams.top, shapeParams.width, shapeParams.height, settings );
33638
+ }
33639
+ else if (shapeType == 'circle') {
33640
+ node = getShapeNodeCircle(pageNr, shapeParams.left, shapeParams.top, shapeParams.right, shapeParams.bottom, settings);
33641
+ }
33642
+ else if (shapeType == 'ellipse') {
33643
+ node = getShapeNodeEllipse(pageNr, shapeParams.left, shapeParams.top, shapeParams.right, shapeParams.bottom, settings);
33644
+ }
33645
+ else if (shapeType == 'line') {
33646
+ node= getShapeNodeLine(pageNr, shapeParams.x1, shapeParams.y1, shapeParams.x2, shapeParams.y2, settings);
33647
+ }
33648
+ else if (shapeType == 'arrow') {
33649
+ node = getShapeNodeArrow(pageNr, shapeParams.x1, shapeParams.y1, shapeParams.x2, shapeParams.y2, settings);
33650
+ }
33651
+ else if (shapeType == 'polyline') {
33652
+ node = getShapeNodePolyline(pageNr, shapeParams.x1, shapeParams.y1, shapeParams.x2, shapeParams.y2, settings);
33653
+ }
33654
+ else if (shapeType == 'cloud') {
33655
+ node = getShapeNodeCloud(pageNr, shapeParams.left, shapeParams.top, shapeParams.right, shapeParams.bottom, settings);
33656
+ }
33657
+ else if (shapeType == 'polygon') {
33658
+ node = getShapeNodePolygone(pageNr, shapeParams.x1, shapeParams.y1, shapeParams.x2, shapeParams.y2, pagesRotation, settings);
33659
+ }
33660
+
33661
+ return node;
33662
+ }
33663
+
33664
+ function getShapeParams(x1, y1, x2, y2) {
33665
+ var left = Math.min(x1, x2);
33666
+ var top = Math.min(y1, y2);
33667
+ var right = Math.max(x1, x2);
33668
+ var bottom = Math.max(y1, y2);
33669
+ var width = right - left;
33670
+ var height = bottom - top;
33671
+
33672
+ var params = {
33673
+ x1: x1,
33674
+ y1: y1,
33675
+ x2: x2,
33676
+ y2: y2,
33677
+ left: left,
33678
+ top: top,
33679
+ right: right,
33680
+ bottom: bottom,
33681
+ width: width,
33682
+ height: height
33683
+ };
33684
+
33685
+ return params;
33686
+ }
33687
+
33688
+ function getShapeParamsObjByType(shapeParams, pagesRotation, shapeType) {
33689
+ var params;
33690
+ if (shapeType == 'rect') {
33691
+ params = {
33692
+ x: shapeParams.left,
33693
+ y: shapeParams.top,
33694
+ width: shapeParams.width,
33695
+ height: shapeParams.height
33696
+ };
33697
+ } else if (shapeType == 'circle') {
33698
+ var r = getShapeCircleRadius(shapeParams.left, shapeParams.top, shapeParams.right, shapeParams.bottom);
33699
+ params = {
33700
+ cx: (shapeParams.left + r),
33701
+ cy: (shapeParams.top + r),
33702
+ r: r
33703
+ };
33704
+ } else if (shapeType == 'ellipse') {
33705
+ var rx = getShapeEllipseRadiusX(shapeParams.left, shapeParams.right);
33706
+ var ry = getShapeEllipseRadiusY(shapeParams.top, shapeParams.bottom);
33707
+ params = {
33708
+ cx: (shapeParams.left + rx),
33709
+ cy: (shapeParams.top + ry),
33710
+ rx: rx,
33711
+ ry: ry
33712
+ };
33713
+ } else if (shapeType == 'line') {
33714
+ params = {
33715
+ x1: shapeParams.x1,
33716
+ y1: shapeParams.y1,
33717
+ x2: shapeParams.x2,
33718
+ y2: shapeParams.y2
33719
+ };
33720
+ } else if (shapeType == 'arrow') {
33721
+ params = {
33722
+ d: getArrowPath(shapeParams.x1, shapeParams.y1, shapeParams.x2, shapeParams.y2).join(',')
33723
+ };
33724
+ } else if (shapeType == 'polyline') {
33725
+ params = {
33726
+ points: [
33727
+ [(shapeParams.x1 + shapeParams.x2) / 2, shapeParams.y1],
33728
+ [shapeParams.x2, shapeParams.y2],
33729
+ [shapeParams.x1, (shapeParams.y1 + shapeParams.y2) / 2],
33730
+ [shapeParams.x2, (shapeParams.y1 + shapeParams.y2) / 2],
33731
+ [shapeParams.x1, shapeParams.y2],
33732
+ [(shapeParams.x1 + shapeParams.x2) / 2, shapeParams.y1]
33733
+ ]
33734
+ };
33735
+ } else if (shapeType == 'cloud') {
33736
+ params = {
33737
+ d: getCloudPath(shapeParams.left, shapeParams.top, shapeParams.right, shapeParams.bottom).join(',')
33738
+ };
33739
+ } else if (shapeType == 'polygon') {
33740
+ params = {
33741
+ points: getPolygonPosByPageRotation(shapeParams.x1, shapeParams.y1, shapeParams.x2, shapeParams.y2, pagesRotation)
33742
+ };
33743
+ }
33744
+
33745
+ return params;
33746
+ }
33747
+
33748
+
33749
+ function getShapeNodeRect(pageNr, left, top, width, height, settings ) {
33750
+ var node = sketchpad[pageNr].rect(left, top, width, height, settings);
33751
+ return node;
33752
+ }
33753
+
33754
+ function getShapeNodeCircle(pageNr, left, top, right, bottom, settings) {
33755
+ var r = getShapeCircleRadius(left, top, right, bottom);
33756
+ var node = sketchpad[pageNr].circle(left + r, top + r, r, settings);
33757
+ return node;
33758
+ }
33759
+
33760
+ function getShapeCircleRadius(left, top, right, bottom) {
33761
+ var radius = Math.min(right - left, bottom - top) / 2;
33762
+ return radius;
33763
+ }
33764
+
33765
+ function getShapeNodeEllipse(pageNr, left, top, right, bottom, settings) {
33766
+ var rx = getShapeEllipseRadiusX(left, right);
33767
+ var ry = getShapeEllipseRadiusY(top, bottom);
33768
+ var node = sketchpad[pageNr].ellipse(left + rx, top + ry, rx, ry, settings);
33769
+ return node;
33770
+ }
33771
+
33772
+ function getShapeEllipseRadiusX(left, right) {
33773
+ var radius= (right - left) / 2;
33774
+ return radius;
33775
+ }
33776
+
33777
+ function getShapeEllipseRadiusY(top, bottom) {
33778
+ var radius= (bottom - top) / 2;
33779
+ return radius;
33780
+ }
33781
+
33782
+ function getShapeNodeLine(pageNr, x1, y1, x2, y2, settings) {
33783
+ var node = sketchpad[pageNr].line(x1, y1, x2, y2, settings);
33784
+ return node;
33785
+ }
33786
+
33787
+ function getShapeNodePolyline(pageNr, x1, y1, x2, y2, settings) {
33788
+ var node = sketchpad[pageNr].polyline([[(x1 + x2) / 2, y1], [x2, y2],
33789
+ [x1, (y1 + y2) / 2], [x2, (y1 + y2) / 2], [x1, y2],
33790
+ [(x1 + x2) / 2, y1]], $.extend(settings, {fill: 'none'}));
33791
+ return node;
33792
+ }
33793
+
33794
+ function getShapeNodeCloud(pageNr, left, top, right, bottom, settings) {
33795
+ var cloudPath = getCloudPath(left, top, right, bottom);
33796
+ var node = sketchpad[pageNr].path(cloudPath, settings);
33797
+ return node;
33798
+ }
33799
+
33800
+ function getShapeNodePolygone(pageNr, x1, y1, x2, y2, pagesRotation, settings) {
33801
+ var polygonPos = getPolygonPosByPageRotation(x1, y1, x2, y2, pagesRotation);
33802
+ var node = sketchpad[pageNr].polygon(polygonPos, settings);
33803
+ return node;
33804
+ }
33805
+
33806
+ function getShapeNodeArrow(pageNr, x1, y1, x2, y2, settings) {
33807
+ var arrowPath = getArrowPath(x1, y1, x2, y2);
33808
+ var node = sketchpad[pageNr].path(arrowPath, settings);
33809
+ return node;
33810
+ }
33811
+
33662
33812
  function getArrowPath(x1, y1, x2, y2) {
33663
33813
  var arrowCoords = getArrowMarkerCoords(x1, y1, x2, y2);
33664
33814
  var mrx = Math.round(arrowCoords.markerR.x);
@@ -33745,20 +33895,31 @@ function getCloudPath(x1, y1, x2, y2) {
33745
33895
  var baseRx = Math.round(18*scale);
33746
33896
  var baseRy = Math.round(18*scale);
33747
33897
 
33748
- var width = x2-x1;
33749
- var height = y2-y1;
33898
+ var width = x2 - x1;
33899
+ var height = y2 - y1;
33900
+
33901
+ width = width ? width : 1;
33902
+ height = height ? height : 1;
33750
33903
 
33751
33904
  var countY = Math.round(height/(baseRy*2));
33752
- if(countY < 3) {
33753
- countY = 3
33905
+ if(countY < 2) {
33906
+ countY = 2
33754
33907
  }
33755
33908
  var rY = height/(countY*2);
33756
33909
 
33757
33910
  var countX = Math.round(width/(rY*2));
33758
- if(countX < 3) {
33759
- countX = 3;
33911
+ if(countX < 2) {
33912
+ countX = 2;
33760
33913
  }
33761
- var rX = width/(countX*2);
33914
+ var rX = width / (countX * 2);
33915
+
33916
+ if (Math.max(rX, rY) / Math.min(rX, rY) > 1.5) {
33917
+ var countY = Math.round(height / (rX * 2));
33918
+ if (countY < 2) {
33919
+ countY = 2;
33920
+ }
33921
+ var rY = height / (countY * 2);
33922
+ }
33762
33923
 
33763
33924
  var path = [
33764
33925
  'M ' + (x1 + rX*2) + ',' + (y1 + rY),
@@ -37231,7 +37392,7 @@ var label_createAnnotation = context.createLocale('app.viewer.pdf.contextMenu.ad
37231
37392
  var label_measures2PointHint = context.createLocale('app.viewer.pdf.measures.twoPointHint');
37232
37393
 
37233
37394
  function initContextMenuCanvas() {
37234
- var pages = '#viewer .page';
37395
+ var pages = '#viewer .page:not(.has-new-svg)';
37235
37396
  $.contextMenu({
37236
37397
  selector: pages,
37237
37398
  trigger: 'right',
@@ -37240,15 +37401,14 @@ function initContextMenuCanvas() {
37240
37401
  name: context.createLocale('app.viewer.pdf.contextMenu.addNote'),
37241
37402
  icon: "add"
37242
37403
  },
37243
- /*"showTxt": {
37244
- name: "Show / Hide Text",
37245
- icon: "page-facing-up",
37246
- },*/
37247
37404
  "sep1": "---------",
37248
37405
  "quit": {
37249
37406
  name: context.createLocale('app.viewer.pdf.contextMenu.cancel'),
37250
37407
  icon: function () {
37251
37408
  return 'context-menu-icon context-menu-icon-quit';
37409
+ },
37410
+ callback: function (key, opt) {
37411
+ context.toggleIssueDetail(false);
37252
37412
  }
37253
37413
  }
37254
37414
  },
@@ -37266,6 +37426,49 @@ function initContextMenuCanvas() {
37266
37426
  });
37267
37427
  }
37268
37428
 
37429
+ function initContextMenuNewSvg() {
37430
+ var pages = '#viewer .page.has-new-svg';
37431
+ $.contextMenu({
37432
+ selector: pages,
37433
+ trigger: 'right',
37434
+ items: {
37435
+ "removeNewSvg": {
37436
+ name: context.createLocale('app.viewer.pdf.contextMenu.cancel'),
37437
+ icon: function () {
37438
+ return 'context-menu-icon context-menu-icon-quit';
37439
+ }
37440
+ }
37441
+ },
37442
+ callback: function (key, options, e) {
37443
+ e.preventDefault();
37444
+ e.stopPropagation();
37445
+ $(document).trigger(key, [options.$trigger]);
37446
+ }
37447
+ });
37448
+ }
37449
+
37450
+ function activateNewSvgMode() {
37451
+ $('#viewer .page').addClass('has-new-svg');
37452
+ }
37453
+
37454
+ function deactivateNewSvgMode() {
37455
+ $('#viewer .page').removeClass('has-new-svg');
37456
+ }
37457
+
37458
+ function bindContextMenuRemoveNewSvgEventHandler() {
37459
+ $(document).on('removeNewSvg', function () {
37460
+ contextMenuRemoveNewSvgEventHandler();
37461
+ });
37462
+ }
37463
+
37464
+ function contextMenuRemoveNewSvgEventHandler() {
37465
+ removeNewSvg();
37466
+ context.toggleIssueDetail(false);
37467
+ if ($('#btnDrawAnnotation').hasClass('toggled')) {
37468
+ $('#btnDrawAnnotation').click();
37469
+ }
37470
+ }
37471
+
37269
37472
  function bindContextMenuNote() {
37270
37473
  }
37271
37474
 
@@ -37990,6 +38193,7 @@ function bindOnClickNote(note) {
37990
38193
 
37991
38194
  function removeNewSvg() {
37992
38195
  $('[id^="svg-new-"]').remove();
38196
+ deactivateNewSvgMode();
37993
38197
  }
37994
38198
 
37995
38199
  function removeNewSvgByPage(page) {
@@ -38079,6 +38283,7 @@ function drawShape(x1, y1, x2, y2, pageNr, shape) {
38079
38283
  initDlgForSvg(drawNodes[nodeId], false, removeSvg, false, drawNodes[nodeId].data);
38080
38284
 
38081
38285
  deactivateDrawAnnotation();
38286
+ activateNewSvgMode();
38082
38287
  }
38083
38288
 
38084
38289
  function saveMeasuresSettings() {
@@ -38209,6 +38414,8 @@ $(document).ready(function() {
38209
38414
  initContextMenu();
38210
38415
 
38211
38416
  initNotesCanvas();
38417
+ initContextMenuNewSvg();
38418
+ bindContextMenuRemoveNewSvgEventHandler();
38212
38419
  initSketchpadButtons();
38213
38420
 
38214
38421
  initNotes();