@sapui5/sap.ui.vk 1.140.0 → 1.142.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 (222) 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 +1 -1
  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 +34 -34
  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 +1 -1
  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 +352 -141
  75. package/src/sap/ui/vk/ecad/LayersPanel.js +1 -1
  76. package/src/sap/ui/vk/i18n/messagebundle_ar.properties +0 -2
  77. package/src/sap/ui/vk/i18n/messagebundle_bg.properties +0 -2
  78. package/src/sap/ui/vk/i18n/messagebundle_ca.properties +0 -2
  79. package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +0 -2
  80. package/src/sap/ui/vk/i18n/messagebundle_cs.properties +0 -2
  81. package/src/sap/ui/vk/i18n/messagebundle_cy.properties +0 -2
  82. package/src/sap/ui/vk/i18n/messagebundle_da.properties +0 -2
  83. package/src/sap/ui/vk/i18n/messagebundle_de.properties +0 -2
  84. package/src/sap/ui/vk/i18n/messagebundle_el.properties +0 -2
  85. package/src/sap/ui/vk/i18n/messagebundle_en.properties +0 -2
  86. package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +0 -2
  87. package/src/sap/ui/vk/i18n/messagebundle_es.properties +0 -2
  88. package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +0 -2
  89. package/src/sap/ui/vk/i18n/messagebundle_et.properties +0 -2
  90. package/src/sap/ui/vk/i18n/messagebundle_fi.properties +0 -2
  91. package/src/sap/ui/vk/i18n/messagebundle_fr.properties +0 -2
  92. package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +0 -2
  93. package/src/sap/ui/vk/i18n/messagebundle_hi.properties +0 -2
  94. package/src/sap/ui/vk/i18n/messagebundle_hr.properties +0 -2
  95. package/src/sap/ui/vk/i18n/messagebundle_hu.properties +0 -2
  96. package/src/sap/ui/vk/i18n/messagebundle_id.properties +0 -2
  97. package/src/sap/ui/vk/i18n/messagebundle_it.properties +0 -2
  98. package/src/sap/ui/vk/i18n/messagebundle_iw.properties +1 -3
  99. package/src/sap/ui/vk/i18n/messagebundle_ja.properties +0 -2
  100. package/src/sap/ui/vk/i18n/messagebundle_kk.properties +0 -2
  101. package/src/sap/ui/vk/i18n/messagebundle_ko.properties +0 -2
  102. package/src/sap/ui/vk/i18n/messagebundle_lt.properties +0 -2
  103. package/src/sap/ui/vk/i18n/messagebundle_lv.properties +0 -2
  104. package/src/sap/ui/vk/i18n/messagebundle_mk.properties +0 -2
  105. package/src/sap/ui/vk/i18n/messagebundle_ms.properties +0 -2
  106. package/src/sap/ui/vk/i18n/messagebundle_nl.properties +0 -2
  107. package/src/sap/ui/vk/i18n/messagebundle_no.properties +0 -2
  108. package/src/sap/ui/vk/i18n/messagebundle_pl.properties +0 -2
  109. package/src/sap/ui/vk/i18n/messagebundle_pt.properties +0 -2
  110. package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +0 -2
  111. package/src/sap/ui/vk/i18n/messagebundle_ro.properties +0 -2
  112. package/src/sap/ui/vk/i18n/messagebundle_ru.properties +0 -2
  113. package/src/sap/ui/vk/i18n/messagebundle_sh.properties +0 -2
  114. package/src/sap/ui/vk/i18n/messagebundle_sk.properties +0 -2
  115. package/src/sap/ui/vk/i18n/messagebundle_sl.properties +0 -2
  116. package/src/sap/ui/vk/i18n/messagebundle_sr.properties +0 -2
  117. package/src/sap/ui/vk/i18n/messagebundle_sv.properties +0 -2
  118. package/src/sap/ui/vk/i18n/messagebundle_th.properties +0 -2
  119. package/src/sap/ui/vk/i18n/messagebundle_tr.properties +0 -2
  120. package/src/sap/ui/vk/i18n/messagebundle_uk.properties +0 -2
  121. package/src/sap/ui/vk/i18n/messagebundle_vi.properties +0 -2
  122. package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +0 -2
  123. package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +0 -2
  124. package/src/sap/ui/vk/library.js +2 -2
  125. package/src/sap/ui/vk/matai/MataiLoaderWorker.js +29 -7
  126. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  127. package/src/sap/ui/vk/measurements/Area.js +1 -1
  128. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  129. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  130. package/src/sap/ui/vk/measurements/Face.js +1 -1
  131. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  132. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  133. package/src/sap/ui/vk/pdf/ContentManager.js +85 -13
  134. package/src/sap/ui/vk/pdf/Viewport.js +1 -1
  135. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  136. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  137. package/src/sap/ui/vk/svg/ContentManager.js +2 -1
  138. package/src/sap/ui/vk/svg/Element.js +162 -23
  139. package/src/sap/ui/vk/svg/Ellipse.js +4 -0
  140. package/src/sap/ui/vk/svg/HotspotHelper.js +30 -17
  141. package/src/sap/ui/vk/svg/MiniMap.js +63 -1
  142. package/src/sap/ui/vk/svg/NodeHierarchy.js +17 -1
  143. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  144. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  145. package/src/sap/ui/vk/svg/Scene.js +1 -1
  146. package/src/sap/ui/vk/svg/SceneBuilder.js +62 -5
  147. package/src/sap/ui/vk/svg/Text.js +72 -30
  148. package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
  149. package/src/sap/ui/vk/svg/Viewport.js +178 -32
  150. package/src/sap/ui/vk/svg/ViewportRenderer.js +82 -0
  151. package/src/sap/ui/vk/thirdparty/pdf.js +18003 -13388
  152. package/src/sap/ui/vk/thirdparty/pdf.worker.js +38149 -36166
  153. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
  154. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  155. package/src/sap/ui/vk/threejs/Billboard.js +16 -15
  156. package/src/sap/ui/vk/threejs/Callout.js +1 -1
  157. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  158. package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
  159. package/src/sap/ui/vk/threejs/DetailView.js +1 -1
  160. package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
  161. package/src/sap/ui/vk/threejs/Material.js +1 -1
  162. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  163. package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
  164. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  165. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  166. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
  167. package/src/sap/ui/vk/threejs/Scene.js +1 -1
  168. package/src/sap/ui/vk/threejs/SceneBuilder.js +16 -5
  169. package/src/sap/ui/vk/threejs/Texture.js +1 -1
  170. package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
  171. package/src/sap/ui/vk/threejs/ViewStateManager.js +3 -3
  172. package/src/sap/ui/vk/threejs/Viewport.js +8 -9
  173. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  174. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
  175. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
  176. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  177. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  178. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
  179. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
  180. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  181. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
  182. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  183. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
  184. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  185. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
  186. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  187. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
  188. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  189. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
  190. package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
  191. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
  192. package/src/sap/ui/vk/tools/Gizmo.js +1 -1
  193. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  194. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  195. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  196. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  197. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  198. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  199. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  200. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  201. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  202. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  203. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  204. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  205. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  206. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  207. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  208. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
  209. package/src/sap/ui/vk/tools/Tool.js +1 -1
  210. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  211. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  212. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  213. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +3 -3
  214. package/src/sap/ui/vk/tools/TransformSvgElementToolHandler.js +1 -1
  215. package/src/sap/ui/vk/totara/Command.js +1 -0
  216. package/src/sap/ui/vk/totara/SceneContext.js +23 -1
  217. package/src/sap/ui/vk/totara/TotaraLoader.js +1 -0
  218. package/src/sap/ui/vk/totara/TotaraLoaderWorker.js +16 -0
  219. package/src/sap/ui/vk/totara/TotaraUtils.js +3 -1
  220. package/src/sap/ui/vk/ve/dvl.wasm +0 -0
  221. package/src/sap/ui/vk/ve/matai.js +2 -2
  222. package/src/sap/ui/vk/ve/matai.wasm +0 -0
@@ -11,12 +11,14 @@ sap.ui.define([
11
11
  "../cssColorToColor",
12
12
  "../NodeContentType",
13
13
  "sap/base/assert",
14
+ "sap/base/Log",
14
15
  "sap/base/util/uid"
15
16
  ], function(
16
17
  abgrToColor,
17
18
  cssColorToColor,
18
19
  NodeContentType,
19
20
  assert,
21
+ Log,
20
22
  uid
21
23
  ) {
22
24
  "use strict";
@@ -136,6 +138,7 @@ sap.ui.define([
136
138
  this.stroke = convertColor(material.lineColor, 1);
137
139
  this.strokeWidth = material.lineWidth !== undefined ? material.lineWidth : 1;
138
140
  this.strokeDashArray = (material.lineStyle && material.lineStyle.dashPattern) || [];
141
+ this.coordinateSpace = material.lineStyle?.widthCoordinateSpace ?? unknownCoordinateSpace;
139
142
  }
140
143
  }
141
144
 
@@ -208,6 +211,11 @@ sap.ui.define([
208
211
  this._updateHotspotDescendants(hasHostpotAncestor ? null : this);
209
212
  }
210
213
 
214
+ const hasDynamicContentAncestor = this._hasDynamicContentAncestor();
215
+ if (hasDynamicContentAncestor || this.nodeContentType === NodeContentType.DynamicContent) {
216
+ this._updateHotspotDescendants(hasDynamicContentAncestor ? null : this);
217
+ }
218
+
211
219
  if (this.domRef) {
212
220
  element.traverse(function(child) {
213
221
  if (!child.domRef) {
@@ -274,6 +282,19 @@ sap.ui.define([
274
282
 
275
283
  node.userData.skipIt = true;
276
284
 
285
+ if (hotspotNode && node._isGeometryNode()) {
286
+ Object.defineProperty(node, "filter", {
287
+ get: function() {
288
+ return hotspotNode.getHotspotEffectDef().name;
289
+ },
290
+ configurable: true
291
+ });
292
+ }
293
+
294
+ if (node.hasOwnProperty("opacity")) {
295
+ delete node.opacity;
296
+ }
297
+
277
298
  if (node._isGeometryNode()) {
278
299
  node.fill = node.stroke = new Float32Array([1, 1, 1, 1]);
279
300
  node._updateColor();
@@ -289,6 +310,29 @@ sap.ui.define([
289
310
  return; // ignore this hotspot node because it has a hotspot ancestor
290
311
  }
291
312
 
313
+ Object.defineProperty(this, "opacity", {
314
+ get: function() {
315
+ return this.highlightColor || this.customHotspotColor || this.hotspotColor ? 1 : 0;
316
+ },
317
+ configurable: true
318
+ });
319
+
320
+ this._updateHotspotDescendants(this);
321
+
322
+ if (this.domRef !== null) {
323
+ if (this.domRef === (this.parent && this.parent.domRef)) {
324
+ this.invalidate();
325
+ } else {
326
+ this._updateColor();
327
+ }
328
+ }
329
+ };
330
+
331
+ Element.prototype._initAsDynamicContent = function() {
332
+ if (this._hasDynamicContentAncestor()) {
333
+ return; // ignore this dynamic content node because it has a dynamic content ancestor
334
+ }
335
+
292
336
  this._updateHotspotDescendants(this);
293
337
 
294
338
  if (this.domRef !== null) {
@@ -305,6 +349,10 @@ sap.ui.define([
305
349
  if (nodeContentType === NodeContentType.Hotspot) {
306
350
  this._initAsHotspot();
307
351
  }
352
+
353
+ if (nodeContentType === NodeContentType.DynamicContent) {
354
+ this._initAsDynamicContent();
355
+ }
308
356
  };
309
357
 
310
358
  Element.prototype.traverse = function(callback) {
@@ -362,8 +410,28 @@ sap.ui.define([
362
410
  var domRef = this.domRef;
363
411
  if (domRef !== null) {
364
412
  if (this.nodeContentType === NodeContentType.Hotspot && !this._hasHostpotAncestor()) {
365
- domRef.setAttribute("filter", "url(#" + this.getHotspotEffectDef().name + ")");
366
- domRef.setAttribute("opacity", this._getHotspotOpacity());
413
+ if (this.customText) {
414
+ this.customText.filter = this.getHotspotEffectDef().name + "-custom-text";
415
+ this.customText.domRef?.setAttribute("filter", `url(#${this.customText.filter})`);
416
+ }
417
+ this.traverse((node) => {
418
+ const filter = node.filter;
419
+ if (filter) {
420
+ node.domRef?.setAttribute("filter", `url(#${filter})`);
421
+ }
422
+ });
423
+ domRef.setAttribute("opacity", this.opacity);
424
+ } else if (this.nodeContentType === NodeContentType.DynamicContent && !this._hasDynamicContentAncestor()) {
425
+ if (this.customText) {
426
+ this.customText.filter = this.getHotspotEffectDef().name + "-custom-text";
427
+ this.customText.domRef?.setAttribute("filter", `url(#${this.customText.filter})`);
428
+ }
429
+ this.traverse((node) => {
430
+ const filter = node.filter;
431
+ if (filter) {
432
+ node.domRef?.setAttribute("filter", `url(#${filter})`);
433
+ }
434
+ });
367
435
  } else {
368
436
  var setAttributeFunc = domRef.setAttribute.bind(domRef);
369
437
  if (this.highlightColor || this.tintColor) {
@@ -397,10 +465,6 @@ sap.ui.define([
397
465
  }
398
466
  };
399
467
 
400
- Element.prototype._getHotspotOpacity = function() {
401
- return this.highlightColor || this.customHotspotColor || this.hotspotColor ? 1 : 0;
402
- };
403
-
404
468
  Element._hotspotEffectName = function(color) {
405
469
  return "hotspot-effect-" + rgbaToCSS(color.red, color.green, color.blue, color.alpha);
406
470
  };
@@ -440,7 +504,7 @@ sap.ui.define([
440
504
  };
441
505
 
442
506
  Element.prototype.setTintColor = function(mask, tintColor) {
443
- assert(this.nodeContentType !== NodeContentType.Hotspot && "setTintColor() method is not for hotspots, use setHotspotColor() method");
507
+ assert(this.nodeContentType !== NodeContentType.Hotspot, "setTintColor() method is not for hotspots, use setHotspotColor() method");
444
508
  this.tintColor = tintColor;
445
509
  this._updateColor(mask);
446
510
  };
@@ -450,13 +514,13 @@ sap.ui.define([
450
514
  };
451
515
 
452
516
  Element.prototype.setHotspotColor = function(mask, color) {
453
- assert(this.nodeContentType === NodeContentType.Hotspot && "setHotspotColor() method is only for hotspots");
517
+ assert((this.nodeContentType === NodeContentType.Hotspot || this.nodeContentType === NodeContentType.DynamicContent), "setHotspotColor() method is only for hotspots or dynamic content");
454
518
  this.hotspotColor = color;
455
519
  this._updateColor(mask);
456
520
  };
457
521
 
458
522
  Element.prototype.setCustomHotspotColor = function(mask, color) {
459
- assert(this.nodeContentType === NodeContentType.Hotspot && "setCustomHotspotColor() method is only for hotspots");
523
+ assert(this.nodeContentType === NodeContentType.Hotspot, "setCustomHotspotColor() method is only for hotspots");
460
524
  this.customHotspotColor = color;
461
525
  this._updateColor(mask);
462
526
  };
@@ -466,7 +530,7 @@ sap.ui.define([
466
530
  };
467
531
 
468
532
  Element.prototype.setOpacity = function(opacity) {
469
- assert(this.nodeContentType !== NodeContentType.Hotspot && "setOpacity() method is not for hotspots");
533
+ assert(this.nodeContentType !== NodeContentType.Hotspot, "setOpacity() method is not for hotspots");
470
534
 
471
535
  if (this._isGeometryNode()) {
472
536
  return;
@@ -502,6 +566,57 @@ sap.ui.define([
502
566
  }
503
567
  }
504
568
  }
569
+ this._updateCustomText();
570
+ };
571
+
572
+ /**
573
+ * Attaches a custom text to this element.
574
+ * @param {object} [options] The custom text options. If not specified, the existing custom text will be removed.
575
+ * @param {string} [options.text] The text to display, it's mutually exclusive with htmlText option.
576
+ * @param {string} [options.htmlText] The HTML text to display, it's mutually exclusive with text option.
577
+ * @param {string} [options.fontFamily] The font family of the text. Default is "Arial".
578
+ * @param {string} [options.fontStyle] The font style of the text (normal | italic | oblique). Default is undefined ("normal").
579
+ * @param {string} [options.fontWeight] The font weight of the text (normal | bold | bolder | lighter | <number>). Default is undefined ("normal").
580
+ * @param {string} [options.textDecoration] The text decoration of the text (none | underline | line-through, etc). Default is undefined ("none").
581
+ * @param {number} [options.size] The font size of the text in pixels. If not specified then the size will be automatically
582
+ * determined based on the median text size in the scene or computed from the bounding box of the scene.
583
+ * @param {string} [options.fill] The fill color of the text in CSS format. Default is "black".
584
+ * @param {number[]} [options.pivot] The pivot point of the text relative to the bounding box of the element. Default is [0.5, 0.5] (center).
585
+ * @param {number[]} [options.anchor] The anchor point of the text. Default is [0.5, 0.5] (center).
586
+ * @returns {sap.ui.vk.svg.Element} Returns this element for method chaining.
587
+ * @public
588
+ * @experimental
589
+ * @since 1.141.0
590
+ */
591
+ Element.prototype.setCustomText = function(options) {
592
+ Log.warning("You need to import 'sap.ui.vk.svg.Text' module to call method setCustomText().");
593
+ return this;
594
+ };
595
+
596
+ Element.prototype._updateCustomText = function() {
597
+ if (this.customText) {
598
+ const bbox = this._getBBox(null, true);
599
+ const textBBox = this.customText.domRef?.getBBox();
600
+ if (bbox && textBBox) {
601
+ // calculate the matrix of the custom text element based on the bounding box of the element
602
+ const matrix = this._matrixWorld();
603
+ const pivot = this.customText.pivot ?? [0.5, 0.5]; // default pivot is center of the bonding box
604
+ const x = bbox.x + bbox.width * pivot[0];
605
+ const y = bbox.y + bbox.height * (matrix[3] < 0 ? 1 - pivot[1] : pivot[1]);
606
+ matrix[4] = matrix[5] = 0;
607
+ const p = Element._transformPoint(x, y, matrix);
608
+ const anchor = this.customText.anchor;
609
+ if (anchor) {
610
+ p.x -= textBBox.x + textBBox.width * anchor[0];
611
+ p.y -= textBBox.y + textBBox.height * anchor[1];
612
+ }
613
+ const invMatrix = Element._invertMatrix(matrix);
614
+ const p2 = Element._transformPoint(p.x, p.y, invMatrix);
615
+ invMatrix[4] = p2.x;
616
+ invMatrix[5] = p2.y;
617
+ this.customText.setMatrix(invMatrix);
618
+ }
619
+ }
505
620
  };
506
621
 
507
622
  Element._multiplyMatrices = function(a, b) {
@@ -650,10 +765,10 @@ sap.ui.define([
650
765
  }
651
766
 
652
767
  // This method returns aligned bounding box if the matrix is passed, or oriented bounding box if no matrix is passed
653
- Element.prototype._getBBox = function(matrix) {
768
+ Element.prototype._getBBox = function(matrix, childrenOnly) {
654
769
  if (this.domRef) {
655
770
  var bbox;
656
- if (!this.parent || this.domRef !== this.parent.domRef) {
771
+ if (!childrenOnly && this.domRef !== this.parent?.domRef) {
657
772
  bbox = this.domRef.getBBox();
658
773
  if (matrix && bbox) {// transform bounding box to parent coordinate system
659
774
  bbox = transformBBox(bbox, matrix);
@@ -687,6 +802,7 @@ sap.ui.define([
687
802
  isIdentityMatrix(element.matrix) &&
688
803
  element.opacity === undefined &&
689
804
  (element.nodeContentType !== NodeContentType.Hotspot || element._hasHostpotAncestor()) && // not a hotspot
805
+ (element.nodeContentType !== NodeContentType.DynamicContent || element._hasDynamicContentAncestor()) && // not a dynamic content
690
806
  element.vMask === 1;
691
807
  }
692
808
 
@@ -777,13 +893,14 @@ sap.ui.define([
777
893
  Element.prototype._setBaseAttributes = function(setAttributeFunc, mask) {
778
894
  setAttributeFunc("id", this.uid);
779
895
 
780
- if (this.nodeContentType === NodeContentType.Hotspot) {
781
- if (!this._hasHostpotAncestor()) {
782
- setAttributeFunc("filter", "url(#" + this.getHotspotEffectDef().name + ")");
783
- setAttributeFunc("opacity", this._getHotspotOpacity());
784
- }
785
- } else if (this.opacity !== undefined) {
786
- setAttributeFunc("opacity", this.opacity);
896
+ const filter = this.filter; // filter can be defined as a getter for hotspots
897
+ if (filter != null) {
898
+ setAttributeFunc("filter", `url(#${filter})`);
899
+ }
900
+
901
+ const opacity = this.opacity; // opacity can be defined as a getter for hotspots
902
+ if (opacity != null) {
903
+ setAttributeFunc("opacity", opacity);
787
904
  }
788
905
  if (!isIdentityMatrix(this.matrix)) {
789
906
  setAttributeFunc("transform", "matrix(" + this.matrix.join(",") + ")");
@@ -876,7 +993,7 @@ sap.ui.define([
876
993
 
877
994
  var hotspots = [];
878
995
  this.children.forEach(function(element) {
879
- if (element.nodeContentType === NodeContentType.Hotspot) {
996
+ if (element.nodeContentType === NodeContentType.Hotspot || element.nodeContentType === NodeContentType.DynamicContent) {
880
997
  hotspots.push(element);
881
998
  } else {
882
999
  element.render(rm, mask, viewport);
@@ -888,6 +1005,8 @@ sap.ui.define([
888
1005
  element.render(rm, mask);
889
1006
  });
890
1007
 
1008
+ this.customText?.render(rm, mask);
1009
+
891
1010
  if (!skipIt) {
892
1011
  rm.close(tagName);
893
1012
  }
@@ -979,6 +1098,11 @@ sap.ui.define([
979
1098
  }
980
1099
  child._setDomRef(childDomRef);
981
1100
  }
1101
+
1102
+ if (this.customText) {
1103
+ this.customText.domRef = document.getElementById(this.customText.uid);
1104
+ this._updateCustomText();
1105
+ }
982
1106
  };
983
1107
 
984
1108
  Element.prototype.getElementByProperty = function(name, value) {
@@ -986,14 +1110,17 @@ sap.ui.define([
986
1110
  return this;
987
1111
  }
988
1112
 
989
- var children = this.children;
990
- for (var i = 0, l = children.length; i < l; i++) {
991
- var element = children[i].getElementByProperty(name, value);
1113
+ for (const child of this.children) {
1114
+ const element = child.getElementByProperty(name, value);
992
1115
  if (element !== null) {
993
1116
  return element;
994
1117
  }
995
1118
  }
996
1119
 
1120
+ if (this.customText && this.customText[name] === value) {
1121
+ return this.customText;
1122
+ }
1123
+
997
1124
  return null;
998
1125
  };
999
1126
 
@@ -1193,6 +1320,18 @@ sap.ui.define([
1193
1320
  return false;
1194
1321
  };
1195
1322
 
1323
+ Element.prototype._hasDynamicContentAncestor = function() {
1324
+ var ancestor = this.parent;
1325
+ while (ancestor) {
1326
+ if (ancestor.nodeContentType === NodeContentType.DynamicContent) {
1327
+ return true;
1328
+ }
1329
+ ancestor = ancestor.parent;
1330
+ }
1331
+
1332
+ return false;
1333
+ };
1334
+
1196
1335
  /**
1197
1336
  * The string given as "className" will be added to the "class" attribute of this element's root HTML element.
1198
1337
  * @param {string} className the CSS class name to be added
@@ -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.140.0
58
+ * @version 1.142.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.140.0
39
+ * @version 1.142.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.140.0
25
+ * @version 1.142.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.140.0
29
+ * @version 1.142.0
30
30
  * @extends sap.ui.vk.Scene
31
31
  * @alias sap.ui.vk.svg.Scene
32
32
  */