@sapui5/sap.ui.vk 1.139.0 → 1.141.0

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.
Files changed (223) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vk/.library +1 -1
  3. package/src/sap/ui/vk/AnimationPlayback.js +1 -1
  4. package/src/sap/ui/vk/AnimationPlayer.js +1 -1
  5. package/src/sap/ui/vk/AnimationSequence.js +1 -1
  6. package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
  7. package/src/sap/ui/vk/AnimationTrack.js +1 -1
  8. package/src/sap/ui/vk/Annotation.js +3 -3
  9. package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
  10. package/src/sap/ui/vk/Camera.js +1 -1
  11. package/src/sap/ui/vk/ContentConnector.js +1 -1
  12. package/src/sap/ui/vk/ContentManager.js +1 -1
  13. package/src/sap/ui/vk/ContentResource.js +1 -1
  14. package/src/sap/ui/vk/Core.js +1 -1
  15. package/src/sap/ui/vk/DownloadManager.js +1 -1
  16. package/src/sap/ui/vk/DrawerToolbar.js +1 -1
  17. package/src/sap/ui/vk/DvlException.js +1 -1
  18. package/src/sap/ui/vk/FlexibleControl.js +1 -1
  19. package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
  20. package/src/sap/ui/vk/Highlight.js +1 -1
  21. package/src/sap/ui/vk/ImageContentManager.js +1 -1
  22. package/src/sap/ui/vk/JointUtils.js +1 -1
  23. package/src/sap/ui/vk/LayerProxy.js +1 -1
  24. package/src/sap/ui/vk/Loco.js +1 -1
  25. package/src/sap/ui/vk/Material.js +1 -1
  26. package/src/sap/ui/vk/NativeViewport.js +1 -1
  27. package/src/sap/ui/vk/NodeContentType.js +6 -1
  28. package/src/sap/ui/vk/NodeHierarchy.js +1 -1
  29. package/src/sap/ui/vk/NodeProxy.js +1 -1
  30. package/src/sap/ui/vk/NodeUtils.js +1 -1
  31. package/src/sap/ui/vk/Notifications.js +1 -1
  32. package/src/sap/ui/vk/ObjectType.js +2 -1
  33. package/src/sap/ui/vk/OrthographicCamera.js +1 -1
  34. package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
  35. package/src/sap/ui/vk/ProgressIndicator.js +1 -1
  36. package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
  37. package/src/sap/ui/vk/RedlineConversation.js +1 -1
  38. package/src/sap/ui/vk/RedlineDesign.js +1 -1
  39. package/src/sap/ui/vk/RedlineElement.js +1 -1
  40. package/src/sap/ui/vk/RedlineElementComment.js +1 -1
  41. package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
  42. package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
  43. package/src/sap/ui/vk/RedlineElementLine.js +1 -1
  44. package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
  45. package/src/sap/ui/vk/RedlineElementText.js +1 -1
  46. package/src/sap/ui/vk/RedlineSurface.js +1 -1
  47. package/src/sap/ui/vk/SafeArea.js +1 -1
  48. package/src/sap/ui/vk/Scene.js +1 -1
  49. package/src/sap/ui/vk/SceneTree.js +1 -1
  50. package/src/sap/ui/vk/StepNavigation.js +1 -1
  51. package/src/sap/ui/vk/Texture.js +1 -1
  52. package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
  53. package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
  54. package/src/sap/ui/vk/Toolbar.js +1 -1
  55. package/src/sap/ui/vk/View.js +1 -1
  56. package/src/sap/ui/vk/ViewGallery.js +1 -1
  57. package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
  58. package/src/sap/ui/vk/ViewGroup.js +1 -1
  59. package/src/sap/ui/vk/ViewManager.js +1 -1
  60. package/src/sap/ui/vk/ViewStateManager.js +1 -1
  61. package/src/sap/ui/vk/ViewStateManagerBase.js +1 -1
  62. package/src/sap/ui/vk/Viewer.js +12 -2
  63. package/src/sap/ui/vk/Viewport.js +43 -1
  64. package/src/sap/ui/vk/ViewportBase.js +24 -1
  65. package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
  66. package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
  67. package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
  68. package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
  69. package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
  70. package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
  71. package/src/sap/ui/vk/dvl/Scene.js +1 -1
  72. package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
  73. package/src/sap/ui/vk/dvl/Viewport.js +2 -2
  74. package/src/sap/ui/vk/ecad/ElementsPanel.js +636 -375
  75. package/src/sap/ui/vk/ecad/LayersPanel.js +88 -75
  76. package/src/sap/ui/vk/i18n/messagebundle.properties +0 -4
  77. package/src/sap/ui/vk/i18n/messagebundle_ar.properties +2 -3
  78. package/src/sap/ui/vk/i18n/messagebundle_bg.properties +2 -3
  79. package/src/sap/ui/vk/i18n/messagebundle_ca.properties +2 -3
  80. package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +2 -3
  81. package/src/sap/ui/vk/i18n/messagebundle_cs.properties +2 -3
  82. package/src/sap/ui/vk/i18n/messagebundle_cy.properties +2 -3
  83. package/src/sap/ui/vk/i18n/messagebundle_da.properties +2 -3
  84. package/src/sap/ui/vk/i18n/messagebundle_de.properties +4 -5
  85. package/src/sap/ui/vk/i18n/messagebundle_el.properties +2 -3
  86. package/src/sap/ui/vk/i18n/messagebundle_en.properties +2 -3
  87. package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +2 -3
  88. package/src/sap/ui/vk/i18n/messagebundle_en_US_saprigi.properties +1 -3
  89. package/src/sap/ui/vk/i18n/messagebundle_es.properties +2 -3
  90. package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +2 -3
  91. package/src/sap/ui/vk/i18n/messagebundle_et.properties +2 -3
  92. package/src/sap/ui/vk/i18n/messagebundle_fi.properties +2 -3
  93. package/src/sap/ui/vk/i18n/messagebundle_fr.properties +2 -3
  94. package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +2 -3
  95. package/src/sap/ui/vk/i18n/messagebundle_hi.properties +2 -3
  96. package/src/sap/ui/vk/i18n/messagebundle_hr.properties +2 -3
  97. package/src/sap/ui/vk/i18n/messagebundle_hu.properties +2 -3
  98. package/src/sap/ui/vk/i18n/messagebundle_id.properties +3 -4
  99. package/src/sap/ui/vk/i18n/messagebundle_it.properties +2 -3
  100. package/src/sap/ui/vk/i18n/messagebundle_iw.properties +2 -3
  101. package/src/sap/ui/vk/i18n/messagebundle_ja.properties +4 -5
  102. package/src/sap/ui/vk/i18n/messagebundle_kk.properties +2 -3
  103. package/src/sap/ui/vk/i18n/messagebundle_ko.properties +2 -3
  104. package/src/sap/ui/vk/i18n/messagebundle_lt.properties +2 -3
  105. package/src/sap/ui/vk/i18n/messagebundle_lv.properties +2 -3
  106. package/src/sap/ui/vk/i18n/messagebundle_mk.properties +2 -3
  107. package/src/sap/ui/vk/i18n/messagebundle_ms.properties +2 -3
  108. package/src/sap/ui/vk/i18n/messagebundle_nl.properties +2 -3
  109. package/src/sap/ui/vk/i18n/messagebundle_no.properties +3 -4
  110. package/src/sap/ui/vk/i18n/messagebundle_pl.properties +2 -3
  111. package/src/sap/ui/vk/i18n/messagebundle_pt.properties +2 -3
  112. package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +2 -3
  113. package/src/sap/ui/vk/i18n/messagebundle_ro.properties +2 -3
  114. package/src/sap/ui/vk/i18n/messagebundle_ru.properties +2 -3
  115. package/src/sap/ui/vk/i18n/messagebundle_sh.properties +2 -3
  116. package/src/sap/ui/vk/i18n/messagebundle_sk.properties +2 -3
  117. package/src/sap/ui/vk/i18n/messagebundle_sl.properties +2 -3
  118. package/src/sap/ui/vk/i18n/messagebundle_sr.properties +2 -3
  119. package/src/sap/ui/vk/i18n/messagebundle_sv.properties +2 -3
  120. package/src/sap/ui/vk/i18n/messagebundle_th.properties +2 -3
  121. package/src/sap/ui/vk/i18n/messagebundle_tr.properties +2 -3
  122. package/src/sap/ui/vk/i18n/messagebundle_uk.properties +2 -3
  123. package/src/sap/ui/vk/i18n/messagebundle_vi.properties +3 -4
  124. package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +2 -3
  125. package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +2 -3
  126. package/src/sap/ui/vk/library.js +2 -2
  127. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  128. package/src/sap/ui/vk/measurements/Area.js +1 -1
  129. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  130. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  131. package/src/sap/ui/vk/measurements/Face.js +1 -1
  132. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  133. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  134. package/src/sap/ui/vk/pdf/ContentManager.js +85 -13
  135. package/src/sap/ui/vk/pdf/Viewport.js +1 -1
  136. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  137. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  138. package/src/sap/ui/vk/svg/ContentManager.js +2 -1
  139. package/src/sap/ui/vk/svg/Element.js +162 -23
  140. package/src/sap/ui/vk/svg/Ellipse.js +4 -0
  141. package/src/sap/ui/vk/svg/HotspotHelper.js +30 -17
  142. package/src/sap/ui/vk/svg/MiniMap.js +63 -1
  143. package/src/sap/ui/vk/svg/NodeHierarchy.js +17 -1
  144. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  145. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  146. package/src/sap/ui/vk/svg/Scene.js +1 -1
  147. package/src/sap/ui/vk/svg/SceneBuilder.js +57 -5
  148. package/src/sap/ui/vk/svg/Text.js +72 -30
  149. package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
  150. package/src/sap/ui/vk/svg/Viewport.js +178 -32
  151. package/src/sap/ui/vk/svg/ViewportRenderer.js +82 -0
  152. package/src/sap/ui/vk/thirdparty/BufferGeometryUtils.js +86 -27
  153. package/src/sap/ui/vk/thirdparty/pdf.js +18003 -13388
  154. package/src/sap/ui/vk/thirdparty/pdf.worker.js +38149 -36166
  155. package/src/sap/ui/vk/thirdparty/three.js +48127 -25854
  156. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
  157. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  158. package/src/sap/ui/vk/threejs/Billboard.js +1 -1
  159. package/src/sap/ui/vk/threejs/Callout.js +1 -1
  160. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  161. package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
  162. package/src/sap/ui/vk/threejs/DetailView.js +1 -1
  163. package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
  164. package/src/sap/ui/vk/threejs/Material.js +1 -1
  165. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  166. package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
  167. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  168. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  169. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
  170. package/src/sap/ui/vk/threejs/Scene.js +1 -1
  171. package/src/sap/ui/vk/threejs/SceneBuilder.js +12 -1
  172. package/src/sap/ui/vk/threejs/Texture.js +1 -1
  173. package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
  174. package/src/sap/ui/vk/threejs/ViewStateManager.js +7 -8
  175. package/src/sap/ui/vk/threejs/Viewport.js +7 -5
  176. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  177. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
  178. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
  179. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  180. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  181. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
  182. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
  183. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  184. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
  185. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  186. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
  187. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  188. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
  189. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  190. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
  191. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  192. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
  193. package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
  194. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
  195. package/src/sap/ui/vk/tools/Gizmo.js +4 -3
  196. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  197. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  198. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  199. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  200. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  201. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  202. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  203. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  204. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  205. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  206. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  207. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  208. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  209. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  210. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  211. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
  212. package/src/sap/ui/vk/tools/Tool.js +1 -1
  213. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  214. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  215. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  216. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +3 -3
  217. package/src/sap/ui/vk/tools/TransformSvgElementToolHandler.js +1 -1
  218. package/src/sap/ui/vk/totara/Command.js +1 -0
  219. package/src/sap/ui/vk/totara/SceneContext.js +26 -2
  220. package/src/sap/ui/vk/totara/TotaraLoader.js +1 -0
  221. package/src/sap/ui/vk/totara/TotaraLoaderWorker.js +16 -0
  222. package/src/sap/ui/vk/totara/TotaraUtils.js +3 -1
  223. package/src/sap/ui/vk/ve/dvl.wasm +0 -0
@@ -59,6 +59,10 @@ sap.ui.define([
59
59
  parametric.major = this.rx;
60
60
  parametric.minor = this.ry;
61
61
  }
62
+ if (this.cx || this.cy) {
63
+ parametric.cx = this.cx;
64
+ parametric.cy = this.cy;
65
+ }
62
66
  return parametric;
63
67
  };
64
68
 
@@ -13,6 +13,7 @@ sap.ui.define([
13
13
  "./Rectangle",
14
14
  "./Path",
15
15
  "sap/base/assert",
16
+ "sap/base/Log",
16
17
  "sap/base/util/uid",
17
18
  "../TransformationMatrix",
18
19
  "../thirdparty/imagetracer",
@@ -23,6 +24,7 @@ sap.ui.define([
23
24
  Rectangle,
24
25
  Path,
25
26
  assert,
27
+ Log,
26
28
  uid,
27
29
  TransformationMatrix,
28
30
  ImageTracer,
@@ -75,7 +77,7 @@ sap.ui.define([
75
77
  * They had references to other geometry nodes via joint nodes.
76
78
  *
77
79
  * This method creates copies of joint nodes with geometries and adds the copies as child nodes
78
- * of the hotspot.
80
+ * to the hotspot.
79
81
  *
80
82
  * A better solution would be updating the data in the backend service.
81
83
  *
@@ -83,24 +85,16 @@ sap.ui.define([
83
85
  * @private
84
86
  */
85
87
  HotspotHelper.prototype.updateHotspot = function(hotspotNode) {
86
- // TODO: The original comment for the following loop said "remove all previous joint nodes".
87
- // It's unclear what "previous" means in this context as the children of hotspotNode are
88
- // created by this method.
89
- var i = hotspotNode.children.length;
90
- while (i-- > 0) {
91
- var child = hotspotNode.children[i];
92
- if (child.userData.sourceJointNode !== undefined) {
93
- hotspotNode.remove(child);
94
- }
95
- }
88
+ const parentMatrixWorldInv = Element._invertMatrix(hotspotNode._matrixWorld());
96
89
 
97
- var parentMatrixWorldInv = Element._invertMatrix(hotspotNode._matrixWorld());
98
90
  function addNodeGeometry(jointNode) {
99
91
  jointNode.traverse(function(child) {
100
92
  if (child.nodeContentType === NodeContentType.Hotspot || child.parent === hotspotNode) {
101
93
  return; // ignore this joint node because it is already embedded in the hotspot
102
94
  }
103
- var clone;
95
+
96
+ let clone;
97
+
104
98
  if (child.type === "Image") {
105
99
  clone = new Rectangle({
106
100
  x: child.x,
@@ -110,8 +104,11 @@ sap.ui.define([
110
104
  });
111
105
  } else if (child.type !== "Group") {
112
106
  clone = new child.constructor().copy(child, false);
107
+ } else {
108
+ Log.warning(`Unsupported child node type "${child.type}" is tried to be embedded in hotspot node "${hotspotNode.name}"`);
113
109
  }
114
- if (clone) {
110
+
111
+ if (clone != null) {
115
112
  clone.matrix = Element._multiplyMatrices(parentMatrixWorldInv, child._matrixWorld());
116
113
  clone.userData.sourceJointNode = child;
117
114
  hotspotNode.add(clone);
@@ -119,14 +116,26 @@ sap.ui.define([
119
116
  });
120
117
  }
121
118
 
119
+ // First, remove all child nodes added from joint nodes in the previous call to this method.
120
+ for (let i = hotspotNode.children.length - 1; i >= 0; --i) {
121
+ const child = hotspotNode.children[i];
122
+
123
+ if (child.userData.sourceJointNode !== undefined) {
124
+ hotspotNode.remove(child);
125
+ }
126
+ }
127
+
128
+
129
+ // Then, add copies of joint nodes as child nodes to `hotspotNode`.
122
130
  const jointNodes = hotspotNode.userData.jointNodes;
123
- if (jointNodes) {
124
- jointNodes.forEach(function(jointNode) {
131
+
132
+ if (jointNodes != null) {
133
+ for (const jointNode of jointNodes) {
125
134
  // skip joint nodes already embedded in the hotspot
126
135
  if (jointNode.nodeContentType !== NodeContentType.Hotspot && jointNode.parent !== hotspotNode) {
127
136
  addNodeGeometry(jointNode);
128
137
  }
129
- });
138
+ }
130
139
  }
131
140
 
132
141
  hotspotNode._initAsHotspot();
@@ -583,6 +592,10 @@ sap.ui.define([
583
592
  nodeInfo.contentType = "HOTSPOT";
584
593
  }
585
594
 
595
+ if (element.nodeContentType === NodeContentType.DynamicContent) {
596
+ nodeInfo.contentType = "DYNAMICCONTENT";
597
+ }
598
+
586
599
  if (element.userData.duplicatedFrom) {
587
600
  nodeInfo.duplicatedFrom = element.userData.duplicatedFrom;
588
601
  delete element.userData.duplicatedFrom;
@@ -72,6 +72,7 @@ sap.ui.define([
72
72
 
73
73
  this._sceneBBox = null; // [x, y, width, height]
74
74
  this._width = this._height = 0;
75
+ this._lockPosition = { x: -16, y: 16 };
75
76
 
76
77
  this._canvas = document.createElement("canvas");
77
78
  this._canvas.classList.add("sapUiVkMiniMapViewCanvas");
@@ -150,7 +151,61 @@ sap.ui.define([
150
151
  MiniMap.prototype.ontouchstart = function(event) {
151
152
  const viewport = Element.getElementById(this.getViewport());
152
153
  const sceneBBox = this._sceneBBox;
153
- if (!viewport || !sceneBBox) {
154
+ const dialogDomRef = this.getParent()?.getDomRef();
155
+ if (!viewport || !sceneBBox || !dialogDomRef) {
156
+ return;
157
+ }
158
+
159
+ if (event.button === 2) { // dragging the minimap with right mouse button
160
+ const viewportRect = viewport.getDomRef()?.getBoundingClientRect();
161
+ const miniMapDialogRect = dialogDomRef.getBoundingClientRect();
162
+ if (!viewportRect || !miniMapDialogRect) {
163
+ return;
164
+ }
165
+ const dragStart = {
166
+ x: event.pageX,
167
+ y: event.pageY,
168
+ elementX: parseInt(dialogDomRef.style.left, 10) || 0,
169
+ elementY: parseInt(dialogDomRef.style.top, 10) || 0
170
+ };
171
+
172
+ let onMouseUp;
173
+ const onMouseMove = (event) => {
174
+ if (event.buttons !== 2) {
175
+ onMouseUp();
176
+ return;
177
+ }
178
+ let x = dragStart.elementX + event.pageX - dragStart.x;
179
+ let y = dragStart.elementY + event.pageY - dragStart.y;
180
+ // clip position to be inside the viewport
181
+ x = Math.min(Math.max(x, viewportRect.x), viewportRect.x + viewportRect.width - miniMapDialogRect.width - 1);
182
+ y = Math.min(Math.max(y, viewportRect.y), viewportRect.y + viewportRect.height - miniMapDialogRect.height - 1);
183
+
184
+ dialogDomRef.style.left = x + "px";
185
+ dialogDomRef.style.top = y + "px";
186
+
187
+ const left = x - viewportRect.x;
188
+ const top = y - viewportRect.y;
189
+ const right = viewportRect.x + viewportRect.width - (x + miniMapDialogRect.width);
190
+ const bottom = viewportRect.y + viewportRect.height - (y + miniMapDialogRect.height);
191
+
192
+ this._lockPosition.x = left < right ? left : -right;
193
+ this._lockPosition.y = top < bottom ? top : -bottom;
194
+
195
+ event.setMarked();
196
+ event.preventDefault();
197
+ };
198
+
199
+ // ontouchmove and ontouchend are not fired when the touch is outside the MiniMap, so we have to use document events for dragging
200
+ const $document = jQuery(document);
201
+ onMouseUp = (event) => {
202
+ $document.off("mousemove", onMouseMove);
203
+ $document.off("mouseup", onMouseUp);
204
+ dialogDomRef.style.cursor = null;
205
+ };
206
+ $document.on("mousemove", onMouseMove);
207
+ $document.on("mouseup", onMouseUp);
208
+ dialogDomRef.style.cursor = "grab";
154
209
  return;
155
210
  }
156
211
 
@@ -178,10 +233,17 @@ sap.ui.define([
178
233
  const onMouseUp = (event) => {
179
234
  $document.off("mousemove", onMouseMove);
180
235
  $document.off("mouseup", onMouseUp);
236
+ dialogDomRef.style.cursor = null;
181
237
  viewport.endGesture();
182
238
  };
183
239
  $document.on("mousemove", onMouseMove);
184
240
  $document.on("mouseup", onMouseUp);
241
+ dialogDomRef.style.cursor = "crosshair";
242
+ };
243
+
244
+ MiniMap.prototype.oncontextmenu = function(event) {
245
+ event.preventDefault();
246
+ event.stopPropagation();
185
247
  };
186
248
 
187
249
  MiniMap.prototype._onContentUpdate = function() {
@@ -55,7 +55,7 @@ sap.ui.define([
55
55
  *
56
56
  * @public
57
57
  * @author SAP SE
58
- * @version 1.139.0
58
+ * @version 1.141.0
59
59
  * @extends sap.ui.vk.NodeHierarchy
60
60
  * @alias sap.ui.vk.svg.NodeHierarchy
61
61
  */
@@ -397,6 +397,22 @@ sap.ui.define([
397
397
  return nodes;
398
398
  };
399
399
 
400
+ /**
401
+ * Returns a list of dynamic content node references.
402
+ *
403
+ * @returns {any[]} A list of dynamic content node references.
404
+ * @public
405
+ */
406
+ NodeHierarchy.prototype.getDynamicContentNodeRefs = function() {
407
+ var nodes = [];
408
+ this._scene.getRootElement().traverse(function(node) {
409
+ if (node._vkGetNodeContentType() === NodeContentType.DynamicContent) {
410
+ nodes.push(node);
411
+ }
412
+ });
413
+ return nodes;
414
+ };
415
+
400
416
  NodeHierarchy.prototype.attachChanged = function(data, func, listener) {
401
417
  return this.attachEvent("changed", data, func, listener);
402
418
  };
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  *
37
37
  * @public
38
38
  * @author SAP SE
39
- * @version 1.139.0
39
+ * @version 1.141.0
40
40
  * @extends sap.ui.vk.NodeProxy
41
41
  * @alias sap.ui.vk.svg.NodeProxy
42
42
  */
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @public
24
24
  * @author SAP SE
25
- * @version 1.139.0
25
+ * @version 1.141.0
26
26
  * @extends sap.ui.vk.OrthographicCamera
27
27
  * @alias sap.ui.vk.svg.OrthographicCamera
28
28
  * @since 1.80.0
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  *
27
27
  * @public
28
28
  * @author SAP SE
29
- * @version 1.139.0
29
+ * @version 1.141.0
30
30
  * @extends sap.ui.vk.Scene
31
31
  * @alias sap.ui.vk.svg.Scene
32
32
  */
@@ -66,7 +66,7 @@ sap.ui.define([
66
66
  *
67
67
  * @private
68
68
  * @author SAP SE
69
- * @version 1.139.0
69
+ * @version 1.141.0
70
70
  */
71
71
  var SceneBuilder = function(rootNode, contentResource, resolve, reject) {
72
72
  this._rootNode = rootNode;
@@ -122,14 +122,37 @@ sap.ui.define([
122
122
  */
123
123
  SceneBuilder.prototype.setScene = function(info) {
124
124
  this._yIndex = 1; // VDS4 file geometry data
125
- this._rootNode.matrix[3] = info.upAxis === 2 ? -1 : 1; // (0 = +X, 1 = -X, 2 = +Y, 3 = -Y, 4 = +Z, 5 = -Z)
126
- var camera = this._cameras.get(info.cameraId);
125
+ this._rootNode.matrix[3] = info.upAxis === 2 || info.upAxis === 4 ? -1 : 1; // (0 = +X, 1 = -X, 2 = +Y, 3 = -Y, 4 = +Z, 5 = -Z)
126
+ const camera = this._cameras.get(info.cameraId);
127
+ const outputSettings = info.outputSettings;
128
+ if (outputSettings && camera) {
129
+ // update line width in materials if coordinate space is in device/paper units
130
+ const outputDPI = 72; // ignore outputSettings.dpi as VEA ignores DPI setting and always uses 72 DPI
131
+ const mmToInch = 1 / 25.4; // 1 inch = 25.4 mm
132
+ const pointToPixel = 4 / 3; // 1 inch = 72 points(common for older screens) = 96 pixels(standard web displays), so 1 point = 96 / 72 pixels = 4 / 3 pixels
133
+ const mmToPixels = mmToInch * outputDPI * pointToPixel; // convert mm to pixels (mm -> inches -> points -> pixels)
134
+ const outputSize = Math.min(outputSettings.width, outputSettings.height) * mmToPixels;
135
+
136
+ this._materialMap.forEach(function(material) {
137
+ if (material.lineStyle.widthCoordinateSpace === 4) { // sap::ve::core::Material::CoordinateSpace::Device (device/paper units)
138
+ if (!info.showPaperSpace) {
139
+ // this mode has a weird behavior in VE Author, the line thickness is measured in weird units that are converted
140
+ // to pixels (doesn't depend on the zoom factor), but it depends on the viewport size
141
+ material.lineWidth = material.lineStyle.width * 1024 / outputSize; // 1024 is a medium viewport size in pixels
142
+ material.lineStyle.widthCoordinateSpace = 0; // convert to screen space
143
+ }
144
+ // material.lineWidth = material.lineStyle.width / (outputSize * camera._initialZoom);
145
+ }
146
+ });
147
+ }
148
+
127
149
  Log.info("setScene", JSON.stringify(info), camera);
128
150
  this._resolve?.({
129
151
  node: this._rootNode,
130
- camera: camera,
152
+ camera,
131
153
  backgroundTopColor: info.backgroundTopColor,
132
154
  backgroundBottomColor: info.backgroundBottomColor,
155
+ outputSettings,
133
156
  contentResource: this._contentResource,
134
157
  builder: this
135
158
  });
@@ -691,6 +714,7 @@ sap.ui.define([
691
714
  * @param {any} nodeInfo The node information object containing the following properties <br/>
692
715
  * <code>sid</code>: String. The id of node.
693
716
  * <code>parametricId</code>: String. The id of object's parametric representation.
717
+ * <code>dynamicContentId</code>: String. The id of object's dynamic content representation.
694
718
  * <code>name</code>: String. The name of the node. Optional.<br/>
695
719
  * <code>visible</code>: Boolean. True if the node is visible. Default true. Optional<br/>
696
720
  * <code>visualisable</code>: Boolean. False if the node is skipped. Default true. Optional<br/>
@@ -737,12 +761,14 @@ sap.ui.define([
737
761
 
738
762
  if (nodeInfo.parametricId) {
739
763
  userData.parametricId = nodeInfo.parametricId;
764
+ } else if (nodeInfo.dynamicContentId) {
765
+ userData.dynamicContentId = nodeInfo.dynamicContentId;
740
766
  } else if (nodeInfo.meshId) {
741
767
  this._setMeshNode(node, nodeInfo.meshId);
742
768
  }
743
769
 
744
770
  userData.treeNode = nodeInfo;
745
- node.setVisible(1, nodeInfo.visible ? nodeInfo.visible : true);
771
+ node.setVisible(1, nodeInfo.visible ?? true);
746
772
 
747
773
  if (nodeInfo.visualisable === false) {
748
774
  userData.skipIt = true; // Don't display this node in scene tree
@@ -778,6 +804,8 @@ sap.ui.define([
778
804
 
779
805
  if (nodeInfo.contentType === "HOTSPOT") {
780
806
  node._vkSetNodeContentType(NodeContentType.Hotspot);
807
+ } else if (nodeInfo.contentType === "DYNAMIC_CONTENT") {
808
+ node._vkSetNodeContentType(NodeContentType.DynamicContent);
781
809
  } else if (nodeInfo.contentType === "ANNOTATION") {
782
810
  node._vkSetNodeContentType(NodeContentType.Annotation);
783
811
  } else if (nodeInfo.contentType === "SVG") {
@@ -994,6 +1022,28 @@ sap.ui.define([
994
1022
  }
995
1023
  };
996
1024
 
1025
+ /**
1026
+ * Set dynamic content (represented as "parametric rectange") to scene node
1027
+ * @param {string} nodeId Identifier of the node which will have dynamic content assigned
1028
+ * @param {any} dynamicContent The dynamic content object
1029
+ * @param {any} sceneId The scene identifier
1030
+ * @public
1031
+ */
1032
+ SceneBuilder.prototype.setDynamicContent = function(nodeId, dynamicContent, sceneId) {
1033
+ this._resetCurrentScene(sceneId);
1034
+ const node = this._nodes.get(nodeId);
1035
+ if (node) {
1036
+ node.userData.templateId = dynamicContent.templateId;
1037
+ const parametricContent = {
1038
+ type: "rectangle",
1039
+ width: 1,
1040
+ height: 1
1041
+ };
1042
+ const rectangle = this._createObject(parametricContent, node);
1043
+ rectangle.fill = rectangle.stroke = [0, 0, 0, 0];
1044
+ }
1045
+ };
1046
+
997
1047
  function polarToCartesian(cx, cy, rx, ry, angle) {
998
1048
  return [cx + rx * Math.cos(angle), cy + ry * Math.sin(angle)];
999
1049
  }
@@ -1083,6 +1133,8 @@ sap.ui.define([
1083
1133
  }
1084
1134
  node.add(shape);
1085
1135
  }
1136
+
1137
+ return shape;
1086
1138
  };
1087
1139
 
1088
1140
  SceneBuilder.prototype.createImageNote = function(annotation, sceneId) {
@@ -17,6 +17,11 @@ sap.ui.define([
17
17
  ) {
18
18
  "use strict";
19
19
 
20
+ // Parametric text content types (sap::ve::core::ParametricType)
21
+ const ptParametricTextData = 10;
22
+ const ptParametricTextSpan = 11;
23
+ const ptParametricTextPath = 12;
24
+
20
25
  var Text = function(parameters) {
21
26
  parameters = parameters || {};
22
27
  Element.call(this, parameters);
@@ -28,12 +33,11 @@ sap.ui.define([
28
33
  this.style.size = this.style.size || "1em";
29
34
  this.x = parameters.x || 0;
30
35
  this.y = parameters.y || 0;
31
- if (parameters.dx) {
32
- this.dx = parameters.dx;
33
- }
34
- if (parameters.dy) {
35
- this.dy = parameters.dy;
36
- }
36
+ ["dx", "dy", "textAnchor", "alignmentBaseline", "pivot", "anchor"].forEach((prop) => {
37
+ if (parameters[prop] != null) {
38
+ this[prop] = parameters[prop];
39
+ }
40
+ });
37
41
 
38
42
  // If not specified then set default colours for text objects
39
43
  this.fillStyle = parameters.fillStyle || { colour: [0, 0, 0, 1] };
@@ -139,6 +143,12 @@ sap.ui.define([
139
143
  if (this.dy) {
140
144
  setAttributeFunc("dy", this.dy);
141
145
  }
146
+ if (this.textAnchor) {
147
+ setAttributeFunc("text-anchor", this.textAnchor);
148
+ }
149
+ if (this.alignmentBaseline) {
150
+ setAttributeFunc("alignment-baseline", this.alignmentBaseline);
151
+ }
142
152
  setStyle(this.style, setAttributeFunc, true);
143
153
  };
144
154
 
@@ -165,12 +175,12 @@ sap.ui.define([
165
175
  for (var i = 0, l = content.length; i < l; i++) {
166
176
  var c = content[i];
167
177
  switch (c.type) {
168
- case 10: // ptParametricTextData
178
+ case ptParametricTextData:
169
179
  case undefined:
170
180
  case "text":
171
181
  rm.text(c.text);
172
182
  break;
173
- case 11: // ptParametricTextSpan
183
+ case ptParametricTextSpan:
174
184
  case "span":
175
185
  rm.openStart("tspan");
176
186
  setContentAttributes(c, setAttributeFunc);
@@ -184,7 +194,7 @@ sap.ui.define([
184
194
  renderContent(c.content, rm);
185
195
  rm.close("tspan");
186
196
  break;
187
- case 12: // ptParametricTextPath
197
+ case ptParametricTextPath:
188
198
  case "path":
189
199
  rm.openStart("textPath");
190
200
  setContentAttributes(c, setAttributeFunc);
@@ -232,12 +242,12 @@ sap.ui.define([
232
242
  for (var i = 0, l = content.length; i < l; i++) {
233
243
  var c = content[i];
234
244
  switch (c.type) {
235
- case 10: // ptParametricTextData
245
+ case ptParametricTextData:
236
246
  case undefined:
237
247
  case "text":
238
248
  parentDomRef.append(c.text);
239
249
  break;
240
- case 11: // ptParametricTextSpan
250
+ case ptParametricTextSpan:
241
251
  case "span":
242
252
  domRef = document.createElementNS(Element._svgNamespace, "tspan");
243
253
  setAttributeFunc = domRef.setAttribute.bind(domRef);
@@ -251,7 +261,7 @@ sap.ui.define([
251
261
  createContent(c.content, domRef);
252
262
  parentDomRef.append(domRef);
253
263
  break;
254
- case 12: // ptParametricTextPath
264
+ case ptParametricTextPath:
255
265
  case "path":
256
266
  domRef = document.createElementNS(Element._svgNamespace, "textPath");
257
267
  setAttributeFunc = domRef.setAttribute.bind(domRef);
@@ -289,17 +299,21 @@ sap.ui.define([
289
299
  };
290
300
 
291
301
  function toPixels(size) {
302
+ let value;
292
303
  switch (typeof size) {
293
- case "number": return size;
304
+ case "number": value = size; break;
294
305
  case "string":
295
306
  if (size.endsWith("pt")) {
296
- return parseFloat(size) * 4 / 3;
307
+ value = parseFloat(size) * 4 / 3;
297
308
  } else if (size.endsWith("em")) {
298
- return parseFloat(size) * 16;
309
+ value = parseFloat(size) * 16;
310
+ } else {
311
+ value = parseFloat(size);
299
312
  }
300
- return parseFloat(size);
301
- default: return 0;
313
+ break;
314
+ default: value = 0; break;
302
315
  }
316
+ return typeof value === "number" && isFinite(value) ? value : 0;
303
317
  }
304
318
 
305
319
  function getContent(p) {
@@ -308,12 +322,12 @@ sap.ui.define([
308
322
  var node = p.childNodes[i];
309
323
  if (node.data !== undefined) {
310
324
  content.push({
311
- type: 10,
325
+ type: ptParametricTextData,
312
326
  text: node.data
313
327
  });
314
328
  } else if (node.childNodes.length > 0) {
315
329
  var tspan = {
316
- type: 11,
330
+ type: ptParametricTextSpan,
317
331
  content: getContent(node)
318
332
  };
319
333
  var nodeStyle = node.style;
@@ -363,6 +377,7 @@ sap.ui.define([
363
377
  }
364
378
 
365
379
  Text.prototype.setHtmlTextContent = function(htmlText) {
380
+ // console.log("setHtmlTextContent", htmlText);
366
381
  var htmlElem = document.createElement("html");
367
382
  htmlElem.innerHTML = htmlText;
368
383
  var content = [];
@@ -379,8 +394,8 @@ sap.ui.define([
379
394
  y += i > 0 ? maxFontSize : 0;
380
395
  }
381
396
  content.push({
382
- type: 11,
383
- x: (node.style.paddingLeft || 0) + this.x,
397
+ type: ptParametricTextSpan,
398
+ x: toPixels(node.style.paddingLeft) + this.x,
384
399
  y: y,
385
400
  content: getContent(node)
386
401
  });
@@ -389,7 +404,7 @@ sap.ui.define([
389
404
  }
390
405
  } else if (node.data) {// text node
391
406
  content.push({
392
- type: 10,
407
+ type: ptParametricTextData,
393
408
  text: node.data
394
409
  });
395
410
  }
@@ -406,14 +421,14 @@ sap.ui.define([
406
421
  for (var i = 0; i < content.length; i++) {
407
422
  var c = content[i];
408
423
  switch (c.type) {
409
- case 10:
424
+ case ptParametricTextData:
410
425
  case undefined:
411
426
  case "text":
412
427
  value += c.text;
413
428
  break;
414
- case 11:
429
+ case ptParametricTextSpan:
415
430
  case "span":
416
- case 12:
431
+ case ptParametricTextPath:
417
432
  case "path":
418
433
  var style = c.style;
419
434
  if (!inlineContent || c.y !== undefined || c.dy !== undefined) {
@@ -485,12 +500,12 @@ sap.ui.define([
485
500
  switch (c.type) {
486
501
  case undefined:
487
502
  case "text":
488
- content.push({ type: 10, text: c.text });
503
+ content.push({ type: ptParametricTextData, text: c.text });
489
504
  break;
490
505
  default:
491
506
  case "span":
492
507
  case "path":
493
- var tspan = { type: c.type === "path" ? 12 : 11 };
508
+ var tspan = { type: c.type === "path" ? ptParametricTextPath : ptParametricTextSpan };
494
509
  if (c.x !== undefined) {
495
510
  tspan.x = c.x;
496
511
  }
@@ -524,13 +539,13 @@ sap.ui.define([
524
539
  for (var i = 0; i < content.length; i++) {
525
540
  var c = content[i];
526
541
  switch (c.type) {
527
- case 10:
542
+ case ptParametricTextData:
528
543
  case undefined:
529
544
  children.push({ text: c.text });
530
545
  break;
531
- case 11:
546
+ case ptParametricTextSpan:
532
547
  case "span":
533
- case 12:
548
+ case ptParametricTextPath:
534
549
  case "path":
535
550
  var span = { type: "span" };
536
551
  if (c.x !== undefined) {
@@ -620,5 +635,32 @@ sap.ui.define([
620
635
  return this;
621
636
  };
622
637
 
638
+ Element.prototype.setCustomText = function(options) {
639
+ if (options == null || (options.text == null && options.htmlText == null)) {
640
+ this.customText = null;
641
+ return this;
642
+ }
643
+
644
+ const customText = this.customText = new Text({
645
+ text: options.text,
646
+ pivot: options.pivot ?? [0.5, 0.5],
647
+ anchor: options.anchor ?? [0.5, 0.5],
648
+ style: {
649
+ size: options.size ?? "0px",
650
+ fontFace: options.fontFamily ?? options.fontFace ?? "Arial",
651
+ fontStyle: options.fontStyle,
652
+ fontWeight: options.fontWeight,
653
+ textDecoration: options.textDecoration,
654
+ fill: options.fill ?? "black"
655
+ }
656
+ });
657
+ if (options.htmlText) {
658
+ customText.setHtmlTextContent(options.htmlText);
659
+ }
660
+ customText.userData.customText = true; // mark the custom text element for special hit test handling
661
+ return this;
662
+ };
663
+
664
+
623
665
  return Text;
624
666
  });
@@ -49,7 +49,7 @@ sap.ui.define([
49
49
  * @param {object} [mSettings] Initial settings for the new ViewStateManager object.
50
50
  * @public
51
51
  * @author SAP SE
52
- * @version 1.139.0
52
+ * @version 1.141.0
53
53
  * @extends sap.ui.vk.ViewStateManagerBase
54
54
  * @alias sap.ui.vk.svg.ViewStateManager
55
55
  * @since 1.80.0
@@ -442,7 +442,7 @@ sap.ui.define([
442
442
  var selected = parentSelected || this._selectedNodes.has(nodeRef);
443
443
 
444
444
  nodeRef.setSelected(this._mask, selected, this._highlightColorABGR);
445
- if (nodeRef.nodeContentType !== NodeContentType.Hotspot) {// recursively update highlight color for regular nodes
445
+ if (nodeRef.nodeContentType !== NodeContentType.Hotspot && nodeRef.nodeContentType !== NodeContentType.DynamicContent) {// recursively update highlight color for regular nodes
446
446
  var children = nodeRef.children;
447
447
  for (var i = 0, l = children.length; i < l; i++) {
448
448
  this._updateHighlightColor(children[i], selected);