qwc2 2025.8.14 → 2025.8.20

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 (77) hide show
  1. package/actions/localConfig.js +1 -1
  2. package/components/MessageBar.js +7 -0
  3. package/components/PluginsContainer.js +3 -2
  4. package/components/StandardApp.js +2 -2
  5. package/components/TaskBar.js +2 -2
  6. package/components/map/OlMap.js +2 -2
  7. package/components/map3d/ImportObjects3D.js +1 -1
  8. package/components/map3d/Map3D.js +6 -6
  9. package/components/map3d/MapControls3D.js +2 -2
  10. package/components/map3d/SearchField3D.js +3 -3
  11. package/components/map3d/drawtool/NumericInput3D.js +3 -3
  12. package/components/map3d/style/MapControls3D.css +9 -16
  13. package/components/map3d/utils/MiscUtils3D.js +7 -2
  14. package/components/map3d/utils/OrbitControls3D.js +1 -4
  15. package/components/map3d/utils/Tiles3DStyle.js +4 -4
  16. package/components/style/{TaskBar.css → MessageBar.css} +4 -4
  17. package/components/style/PluginsContainer.css +1 -1
  18. package/icons/above_terr.svg +81 -0
  19. package/icons/above_zero.svg +80 -0
  20. package/package.json +1 -1
  21. package/plugins/API.js +1 -1
  22. package/plugins/AttributeTable.js +1 -1
  23. package/plugins/Map.js +4 -3
  24. package/plugins/MapCompare.js +1 -1
  25. package/plugins/MapCopyright.js +1 -1
  26. package/plugins/TourGuide.js +3 -1
  27. package/plugins/View3D.js +26 -20
  28. package/plugins/map/LocateSupport.js +3 -5
  29. package/plugins/map/style/LocateSupport.css +33 -0
  30. package/plugins/map3d/BackgroundSwitcher3D.js +1 -1
  31. package/plugins/map3d/BottomBar3D.js +3 -1
  32. package/plugins/map3d/Compare3D.js +4 -2
  33. package/plugins/map3d/Draw3D.js +4 -2
  34. package/plugins/map3d/ExportObjects3D.js +13 -12
  35. package/plugins/map3d/HideObjects3D.js +12 -8
  36. package/plugins/map3d/Identify3D.js +10 -6
  37. package/plugins/map3d/LayerTree3D.js +3 -1
  38. package/plugins/map3d/MapCopyright3D.js +11 -0
  39. package/plugins/map3d/MapExport3D.js +4 -2
  40. package/plugins/map3d/MapLight3D.js +11 -0
  41. package/plugins/map3d/Measure3D.js +4 -2
  42. package/plugins/map3d/OverviewMap3D.js +2 -2
  43. package/plugins/map3d/Settings3D.js +3 -1
  44. package/plugins/map3d/TopBar3D.js +9 -1
  45. package/plugins/style/MapCopyright.css +3 -3
  46. package/plugins/style/View3D.css +0 -4
  47. package/reducers/localConfig.js +1 -1
  48. package/scripts/gen-plugin-docs.js +2 -2
  49. package/selectors/searchproviders.js +3 -7
  50. package/static/translations/bg-BG.json +2 -0
  51. package/static/translations/ca-ES.json +2 -0
  52. package/static/translations/cs-CZ.json +2 -0
  53. package/static/translations/de-CH.json +3 -1
  54. package/static/translations/de-DE.json +3 -1
  55. package/static/translations/en-US.json +3 -1
  56. package/static/translations/es-ES.json +2 -0
  57. package/static/translations/fi-FI.json +2 -0
  58. package/static/translations/fr-FR.json +3 -1
  59. package/static/translations/hu-HU.json +2 -0
  60. package/static/translations/it-IT.json +3 -1
  61. package/static/translations/ja-JP.json +2 -0
  62. package/static/translations/nl-NL.json +2 -0
  63. package/static/translations/no-NO.json +2 -0
  64. package/static/translations/pl-PL.json +2 -0
  65. package/static/translations/pt-BR.json +2 -0
  66. package/static/translations/pt-PT.json +2 -0
  67. package/static/translations/ro-RO.json +2 -0
  68. package/static/translations/ru-RU.json +2 -0
  69. package/static/translations/sv-SE.json +2 -0
  70. package/static/translations/tr-TR.json +2 -0
  71. package/static/translations/tsconfig.json +2 -0
  72. package/static/translations/uk-UA.json +2 -0
  73. package/utils/SearchProviders.js +8 -3
  74. package/components/map/OlLocate.css +0 -56
  75. package/components/map/OlLocate.js +0 -17
  76. package/components/map3d/Map3DLight.js +0 -11
  77. /package/{components/map3d/style/Map3DLight.css → plugins/map3d/style/MapLight3D.css} +0 -0
@@ -1,18 +1,3 @@
1
- div.map3d-nav {
2
- position: absolute;
3
- right: 1em;
4
- top: 5.5em;
5
- z-index: 1;
6
- pointer-events: none;
7
- display: flex;
8
- flex-direction: column;
9
- align-items: center;
10
- }
11
-
12
- div.map3d-nav > div:not(:last-child) {
13
- margin-bottom: 0.5em;
14
- }
15
-
16
1
  div.map3d-nav-pan,
17
2
  div.map3d-nav-rotate {
18
3
  pointer-events: initial;
@@ -26,6 +11,7 @@ div.map3d-nav-rotate {
26
11
  color: var(--map-button-text-color);
27
12
  background-color: var(--map-button-bg-color);
28
13
  box-shadow: 0px 5px 10px rgba(136, 136, 136, 0.5);
14
+ margin-bottom: 0.5em;
29
15
  }
30
16
 
31
17
  div.map3d-nav-pan > span,
@@ -50,6 +36,7 @@ div.map3d-nav-zoom {
50
36
  cursor: pointer;
51
37
  transition: background-color 0.5s, color 0.5s;
52
38
  flex-direction: column;
39
+ margin: 0 1em 0.5em 1em;
53
40
  }
54
41
 
55
42
  div.map3d-nav-zoom > div {
@@ -65,7 +52,6 @@ div.map3d-nav-zoom > div:first-child {
65
52
  }
66
53
 
67
54
 
68
-
69
55
  div.map3d-firstperson-button {
70
56
  pointer-events: initial;
71
57
  width: 2em;
@@ -80,9 +66,16 @@ div.map3d-firstperson-button {
80
66
  border-radius: 4px;
81
67
  cursor: pointer;
82
68
  transition: background-color 0.5s, color 0.5s;
69
+ margin: 0 1em 0.5em 1em;
83
70
  }
84
71
 
85
72
  div.map3d-firstperson-button-active {
86
73
  background-color: var(--map-button-text-color);
87
74
  color: var(--map-button-bg-color);
75
+ }
76
+
77
+ div.map3d-nav-spacer {
78
+ display: inline-block;
79
+ width: 1em;
80
+ flex: 1 1 auto;
88
81
  }
@@ -1,4 +1,4 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
2
2
  * Copyright 2025 Sourcepole AG
3
3
  * All rights reserved.
4
4
  *
@@ -9,4 +9,9 @@ var linegeom=new MeshLine;linegeom.setGeometry(new BufferGeometry().setFromPoint
9
9
  (_labelObject$element$=labelObject.element.parentNode)===null||_labelObject$element$===void 0||(_labelObject$element$2=_labelObject$element$.removeChild)===null||_labelObject$element$2===void 0||_labelObject$element$2.call(_labelObject$element$,labelObject.element)};sceneObject.addEventListener("removed",labelObject.userData.removeCallback)}else{labelObject.element.textContent=sceneObject.userData.label}}else if(labelObject){sceneObject.removeEventListener("removed",labelObject.userData.removeCallback);sceneContext.scene.view.removeEventListener("view-resized",labelObject.userData.sceneResizeCallback);// Remove leaderline first, as the remove trigger of the CSS2DObject assumes children are CSS2DObjects as well
10
10
  labelObject.children[0].removeFromParent();labelObject.removeFromParent()}}export function importGltf(dataOrUrl,name,sceneContext){var options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var loader=new GLTFLoader;var processor=function processor(gltf){// GLTF is Y-UP, we need Z-UP
11
11
  gltf.scene.rotation.x=Math.PI/2;gltf.scene.updateMatrixWorld(true);var objectId=uuidv4();options=_objectSpread({layertree:true,title:name},options);gltf.scene.traverse(function(c){if(c.geometry){c.castShadow=true;c.receiveShadow=true}updateObjectLabel(c,sceneContext)});// Center group on object
12
- var bbox=new Box3().setFromObject(gltf.scene);var center=bbox.getCenter(new Vector3);var offset=new Vector3().subVectors(center,gltf.scene.position).applyQuaternion(gltf.scene.quaternion.clone().invert());gltf.scene.children.forEach(function(child){child.position.sub(offset)});gltf.scene.position.copy(center);gltf.scene.updateMatrixWorld(true);sceneContext.addSceneObject(objectId,gltf.scene,options)};if(typeof dataOrUrl==="string"){loader.load(dataOrUrl,processor,function(){},function(err){/* eslint-disable-next-line */console.warn(err)})}else{loader.parse(dataOrUrl,ConfigUtils.getAssetsPath(),processor,function(err){/* eslint-disable-next-line */console.warn(err)})}}
12
+ var bbox=new Box3().setFromObject(gltf.scene);var center=bbox.getCenter(new Vector3);var offset=new Vector3().subVectors(center,gltf.scene.position).applyQuaternion(gltf.scene.quaternion.clone().invert());gltf.scene.children.forEach(function(child){child.position.sub(offset)});gltf.scene.position.copy(center);gltf.scene.updateMatrixWorld(true);sceneContext.addSceneObject(objectId,gltf.scene,options)};if(typeof dataOrUrl==="string"){loader.load(dataOrUrl,processor,function(){},function(err){/* eslint-disable-next-line */console.warn(err)})}else{loader.parse(dataOrUrl,ConfigUtils.getAssetsPath(),processor,function(err){/* eslint-disable-next-line */console.warn(err)})}}export var TileMeshHelper=/*#__PURE__*/function(){function TileMeshHelper(object){_classCallCheck(this,TileMeshHelper);this.object=object;var _object$userData=object.userData,meshFeatures=_object$userData.meshFeatures,structuralMetadata=_object$userData.structuralMetadata;if(meshFeatures&&structuralMetadata){// Get featureId via featureId attribute
13
+ var featureSetIndex=0;// usually 0 unless multiple feature sets
14
+ this.featureSet=meshFeatures.featureIds[featureSetIndex];this.featureIdAttr=object.geometry.getAttribute("_feature_id_".concat(this.featureSet.attribute))}else if("_batchid"in object.geometry.attributes){// Get featureId via batchId attribute
15
+ this.featureSet=null;this.featureIdAttr=object.geometry.getAttribute("_batchid")}else{/* eslint-disable-next-line */console.warn("Cannot determine tile mesh feature index attribute");this.featureIdAttr=null}this.tileObject=object;while(this.tileObject.parent&&!this.tileObject.parent.isTilesGroup){this.tileObject=this.tileObject.parent}}return _createClass(TileMeshHelper,[{key:"isValid",value:function isValid(){return this.featureIdAttr!==null}},{key:"getFeatureId",value:function getFeatureId(face){return this.featureIdAttr?this.featureIdAttr.getX(face.a):null}},{key:"getFeatureIdAttr",value:function getFeatureIdAttr(){return this.featureIdAttr}},{key:"getFeatureIds",value:function getFeatureIds(){var featureIds=new Set;for(var i=0;i<this.featureIdAttr.count;i++){featureIds.add(this.featureIdAttr.getX(i))}return featureIds}},{key:"getFeatureProperties",value:function getFeatureProperties(featureId){if(this.object.userData.structuralMetadata){return this.object.userData.structuralMetadata.getPropertyTableData([this.featureSet.propertyTable],[featureId])[0]}else if(this.tileObject.batchTable){return this.tileObject.batchTable.getDataFromId(featureId)}else{return{}}}},{key:"getTileUserData",value:function getTileUserData(){return this.tileObject.userData}},{key:"forEachFeatureTriangle",value:function forEachFeatureTriangle(featureId,callback){if(!this.featureIdAttr){return}else if(this.object.geometry.index){// For indexed geometries, index attribute contains a sequence of triangle index triplets
16
+ var indices=this.object.geometry.index.array;for(var tri=0;tri<indices.length;tri+=3){var i0=indices[tri];if(this.featureIdAttr.getX(i0)===featureId){var i1=indices[tri+1];var i2=indices[tri+2];callback(i0,i1,i2)}}}else{// For non-index geometries, the id attribute contains a sequence of triangle vertex indices
17
+ for(var _tri=0;_tri<this.featureIdAttr.count;_tri+=3){if(this.featureIdAttr.getX(_tri)===featureId){callback(_tri,_tri+1,_tri+2)}}}}}])}();
@@ -7,7 +7,4 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
7
7
  */import{Vector3}from"three";import{MapControls}from"three/addons/controls/MapControls";import{v4 as uuidv4}from"uuid";var OrbitControls3D=/*#__PURE__*/function(_MapControls){function OrbitControls3D(object){var _this;_classCallCheck(this,OrbitControls3D);_this=_callSuper(this,OrbitControls3D,[object]);_defineProperty(_this,"updateControlsTarget",function(){var _this$sceneContext$ge;if(_this.animationId){// Do nothing if animating
8
8
  return}var camerapos=_this.object.position;var x=_this.target.x;var y=_this.target.y;var height=(_this$sceneContext$ge=_this.sceneContext.getTerrainHeightFromMap([x,y]))!==null&&_this$sceneContext$ge!==void 0?_this$sceneContext$ge:0;// If camera height is at terrain height, target height should be at terrain height
9
9
  // If camera height is at twice the terrain height or further, target height should be zero
10
- _this._targetTerrainHeight=Math.max(0,1-(camerapos.z-height)/height)*height;_this.target.z=_this._targetTerrainHeight+_this._heightOffset});_defineProperty(_this,"updateTargetTerrainAndOffsetHeight",function(camerapos,target){var _this$sceneContext$ge2;// Compute targetHeight and heightOffset offset
11
- var height=(_this$sceneContext$ge2=_this.sceneContext.getTerrainHeightFromMap([target.x,target.y]))!==null&&_this$sceneContext$ge2!==void 0?_this$sceneContext$ge2:0;// If camera height is at terrain height, target height should be at terrain height
12
- // If camera height is at twice the terrain height or further, target height should be zero
13
- _this._targetTerrainHeight=Math.max(0,1-(camerapos.z-height)/height)*height;_this._heightOffset=target.z-_this._targetTerrainHeight});_defineProperty(_this,"stopAnimations",function(){_this.animationId=null});_defineProperty(_this,"_handleKeyboardNav",function(){var pg=-_this._keyState.PageDown+_this._keyState.PageUp;if(pg){var newHeightOffset=Math.max(0,_this._heightOffset+_this._heightOffset*pg*0.05);var deltaHeight=newHeightOffset-_this._heightOffset;_this._heightOffset=newHeightOffset;_this.target.z=_this._targetTerrainHeight+_this._heightOffset;_this.object.position.z+=deltaHeight;_this.update()}});_defineProperty(_this,"_onKeyDown",function(event){if(event.key in _this._keyState){_this._keyState[event.key]=true;if(!_this._keyboardNavInterval){_this._keyboardNavInterval=setInterval(_this._handleKeyboardNav,50)}}});_defineProperty(_this,"_onKeyUp",function(event){if(event.key in _this._keyState){_this._keyState[event.key]=false;if(Object.values(_this._keyState).every(function(x){return!x})){clearInterval(_this._keyboardNavInterval);_this._keyboardNavInterval=null}}});_defineProperty(_this,"_onBlur",function(){_this._keyState={PageUp:false,PageDown:false};clearInterval(_this._keyboardNavInterval);_this._keyboardNavInterval=null});_this.animationId=null;_this.sceneContext=null;_this.enabled=false;_this.zoomToCursor=true;_this.enableDamping=true;_this.dampingFactor=0.2;_this.keyPanSpeed=10;_this.maxPolarAngle=Math.PI*0.5;_this._targetHeight=0;_this._heightOffset=0;_this._keyState={PageUp:false,PageDown:false};_this._keyboardNavInterval=null;return _this}_inherits(OrbitControls3D,_MapControls);return _createClass(OrbitControls3D,[{key:"connect",value:function connect(sceneContext){this.domElement=sceneContext.scene.domElement;this.sceneContext=sceneContext;this.enabled=true;_superPropGet(OrbitControls3D,"connect",this,3)([]);this.listenToKeyEvents(this.domElement);this.domElement.addEventListener("pointerdown",this.stopAnimations);this.domElement.addEventListener("wheel",this.stopAnimations);this.domElement.addEventListener("keydown",this._onKeyDown);this.domElement.addEventListener("keyup",this._onKeyUp);this.domElement.addEventListener("blur",this._onBlur);this.addEventListener("change",this.updateControlsTarget);this.object.near=2;this.sceneContext.scene.view.setControls(this)}},{key:"disconnect",value:function disconnect(){this.animationId=null;_superPropGet(OrbitControls3D,"disconnect",this,3)([]);this.enabled=false;this.sceneContext.scene.view.setControls(null);this.domElement.removeEventListener("pointerdown",this.stopAnimations);this.domElement.removeEventListener("wheel",this.stopAnimations);this.domElement.removeEventListener("keydown",this._onKeyDown);this.domElement.removeEventListener("keyup",this._onKeyUp);this.domElement.removeEventListener("blur",this._onBlur);this.removeEventListener("change",this.updateControlsTarget);this._keyState={PageUp:false,PageDown:false}}},{key:"setView",value:function setView(camerapos,target){this.object.position.copy(camerapos);this.target.copy(target);this.updateTargetTerrainAndOffsetHeight(camerapos,target);this.update()}},{key:"panView",value:function panView(dx,dy){if(dx||dy){this._pan(-dx*10,dy*10);this.update()}}},{key:"tiltView",value:function tiltView(azimuth,polar){if(azimuth){this._rotateLeft(azimuth)}if(polar){this._rotateUp(polar)}if(azimuth||polar){this.update()}}},{key:"zoomView",value:function zoomView(delta){if(delta>0){this._dollyIn(this._getZoomScale(-delta));this.update()}else if(delta<0){this._dollyOut(this._getZoomScale(-delta));this.update()}}},{key:"animateTo",value:function animateTo(camerapos,target,azimuth){var _this2=this;var callback=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var oldPosition=this.object.position.clone();var oldTarget=this.target.clone();var oldYaw=this.getAzimuthalAngle();var newPosition=camerapos;var newTarget=target;var rotateAngle=-oldYaw+azimuth;while(rotateAngle>Math.PI)rotateAngle-=2*Math.PI;while(rotateAngle<-Math.PI)rotateAngle+=2*Math.PI;var startTime=new Date/1000;var animationId=uuidv4();this.animationId=animationId;this.enableDamping=false;var _animate=function animate(){if(_this2.animationId!==animationId){_this2.updateTargetTerrainAndOffsetHeight(_this2.object.position,_this2.target);return}var duration=2;var elapsed=new Date/1000-startTime;var x=elapsed/duration;var k=0.5*(1-Math.cos(x*Math.PI));var currentPosition=new Vector3().lerpVectors(oldPosition,newPosition,k);var currentTarget=new Vector3().lerpVectors(oldTarget,newTarget,k);currentPosition.x-=currentTarget.x;currentPosition.y-=currentTarget.y;currentPosition.applyAxisAngle(new Vector3(0,0,1),rotateAngle*k);currentPosition.x+=currentTarget.x;currentPosition.y+=currentTarget.y;_this2.object.position.copy(currentPosition);_this2.target.copy(currentTarget);_this2.update();if(elapsed<duration){requestAnimationFrame(_animate)}else{_this2.object.position.copy(newPosition);_this2.target.copy(newTarget);_this2.update();_this2._rotateLeft(_this2.getAzimuthalAngle()-azimuth);_this2.update();_this2.enableDamping=true;_this2.animationId=null;_this2.updateTargetTerrainAndOffsetHeight(_this2.object.position,_this2.target);callback===null||callback===void 0||callback()}};requestAnimationFrame(_animate)}}])}(MapControls);export{OrbitControls3D as default};
10
+ var newHeight=Math.max(0,1-(camerapos.z-height)/height)*height;_this.target.z=newHeight});_defineProperty(_this,"stopAnimations",function(){_this.animationId=null});_this.animationId=null;_this.sceneContext=null;_this.enabled=false;_this.zoomToCursor=true;_this.enableDamping=true;_this.dampingFactor=0.2;_this.keyPanSpeed=10;_this.maxPolarAngle=Math.PI*0.5;return _this}_inherits(OrbitControls3D,_MapControls);return _createClass(OrbitControls3D,[{key:"connect",value:function connect(sceneContext){this.domElement=sceneContext.scene.domElement;this.sceneContext=sceneContext;this.enabled=true;_superPropGet(OrbitControls3D,"connect",this,3)([]);this.listenToKeyEvents(this.domElement);this.domElement.addEventListener("pointerdown",this.stopAnimations);this.domElement.addEventListener("wheel",this.stopAnimations);this.addEventListener("change",this.updateControlsTarget);this.object.near=2;this.sceneContext.scene.view.setControls(this)}},{key:"disconnect",value:function disconnect(){this.animationId=null;_superPropGet(OrbitControls3D,"disconnect",this,3)([]);this.enabled=false;this.sceneContext.scene.view.setControls(null);this.domElement.removeEventListener("pointerdown",this.stopAnimations);this.domElement.removeEventListener("wheel",this.stopAnimations);this.removeEventListener("change",this.updateControlsTarget)}},{key:"setView",value:function setView(camerapos,target){this.object.position.copy(camerapos);this.target.copy(target);this.update()}},{key:"panView",value:function panView(dx,dy){if(dx||dy){this._pan(-dx*10,dy*10);this.update()}}},{key:"tiltView",value:function tiltView(azimuth,polar){if(azimuth){this._rotateLeft(azimuth)}if(polar){this._rotateUp(polar)}if(azimuth||polar){this.update()}}},{key:"zoomView",value:function zoomView(delta){if(delta>0){this._dollyIn(this._getZoomScale(-delta));this.update()}else if(delta<0){this._dollyOut(this._getZoomScale(-delta));this.update()}}},{key:"animateTo",value:function animateTo(camerapos,target,azimuth){var _this2=this;var callback=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var oldPosition=this.object.position.clone();var oldTarget=this.target.clone();var oldYaw=this.getAzimuthalAngle();var newPosition=camerapos;var newTarget=target;var rotateAngle=-oldYaw+azimuth;while(rotateAngle>Math.PI)rotateAngle-=2*Math.PI;while(rotateAngle<-Math.PI)rotateAngle+=2*Math.PI;var startTime=new Date/1000;var animationId=uuidv4();this.animationId=animationId;this.enableDamping=false;var _animate=function animate(){if(_this2.animationId!==animationId){return}var duration=2;var elapsed=new Date/1000-startTime;var x=elapsed/duration;var k=0.5*(1-Math.cos(x*Math.PI));var currentPosition=new Vector3().lerpVectors(oldPosition,newPosition,k);var currentTarget=new Vector3().lerpVectors(oldTarget,newTarget,k);currentPosition.x-=currentTarget.x;currentPosition.y-=currentTarget.y;currentPosition.applyAxisAngle(new Vector3(0,0,1),rotateAngle*k);currentPosition.x+=currentTarget.x;currentPosition.y+=currentTarget.y;_this2.object.position.copy(currentPosition);_this2.target.copy(currentTarget);_this2.update();if(elapsed<duration){requestAnimationFrame(_animate)}else{_this2.object.position.copy(newPosition);_this2.target.copy(newTarget);_this2.update();_this2._rotateLeft(_this2.getAzimuthalAngle()-azimuth);_this2.update();_this2.enableDamping=true;_this2.animationId=null;callback===null||callback===void 0||callback()}};requestAnimationFrame(_animate)}}])}(MapControls);export{OrbitControls3D as default};
@@ -4,11 +4,11 @@ function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
- */import{Parser as ExprParser}from"expr-eval";import isEmpty from"lodash.isempty";import parseCssColor from"parse-css-color";import{Float32BufferAttribute,Group,Vector3}from"three";import MiscUtils from"../../../utils/MiscUtils";import{createLabelObject}from"./MiscUtils3D";var styleExpressionParser=new ExprParser;styleExpressionParser.functions.color=function(name){var alpha=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var color=parseCssColor(name);return[].concat(_toConsumableArray(color.values.map(function(c){return c/255})),[alpha])};styleExpressionParser.functions.rgb=function(r,g,b){return[r/255,g/255,g/255,1]};styleExpressionParser.functions.rgba=function(r,g,b,a){return[r/255,g/255,g/255,a]};styleExpressionParser.functions.hsl=function(h,s,l){return[].concat(_toConsumableArray(MiscUtils.hslToRgb(h,s,l)),[1])};styleExpressionParser.functions.hsla=function(h,s,l,a){return[].concat(_toConsumableArray(MiscUtils.hslToRgb(h,s,l)),[a])};function batchColor(batchId,batchAttr,context){var _context$batchStyles$,_context$batchStyles;if(((_context$batchStyles$=(_context$batchStyles=context.batchStyles)===null||_context$batchStyles===void 0||(_context$batchStyles=_context$batchStyles[batchId])===null||_context$batchStyles===void 0?void 0:_context$batchStyles.color)!==null&&_context$batchStyles$!==void 0?_context$batchStyles$:null)!==null){var color=parseCssColor(context.batchStyles[batchId].color);return[].concat(_toConsumableArray(color.values.map(function(c){return c/255})),[color.alpha])}else if(context.colorExpressions.length){try{for(var i=0;i<context.colorExpressions.length;++i){var condition=context.colorExpressions[i][0].evaluate(batchAttr);if(condition){return context.colorExpressions[i][1].evaluate(batchAttr)}}}catch(e){/* eslint-disable-next-line */console.warn("Failed to parse color expression: "+String(e))}return null}else if(batchAttr[context.colorAttr]){var _batchAttr$context$al;var _color=batchAttr[context.colorAttr];var alpha=context.alphaAttr?(_batchAttr$context$al=batchAttr[context.alphaAttr])!==null&&_batchAttr$context$al!==void 0?_batchAttr$context$al:255:255;var r=(_color>>16&255)/255;var g=(_color>>8&255)/255;var b=(_color&255)/255;return[r,g,b,alpha/255]}else{return null}}function batchLabel(batchId,batchAttr,context){var _context$batchStyles$2,_context$batchStyles2;if(((_context$batchStyles$2=(_context$batchStyles2=context.batchStyles)===null||_context$batchStyles2===void 0||(_context$batchStyles2=_context$batchStyles2[batchId])===null||_context$batchStyles2===void 0?void 0:_context$batchStyles2.label)!==null&&_context$batchStyles$2!==void 0?_context$batchStyles$2:null)!==null){var _context$batchStyles$3;return{text:context.batchStyles[batchId].label,offset:(_context$batchStyles$3=context.batchStyles[batchId].labelOffset)!==null&&_context$batchStyles$3!==void 0?_context$batchStyles$3:80}}else if(context.labelAttr){return batchAttr[context.labelAttr]}else{return null}}var Tiles3DStyle={applyTileStyle:function applyTileStyle(group,config,sceneContext){var _config$idAttr,_config$tilesetStyle,_config$tilesetStyle2;var batchColorCache={};var batchLabelCache={};var labels={};var idAttr=(_config$idAttr=config.idAttr)!==null&&_config$idAttr!==void 0?_config$idAttr:"id";var context={colorExpressions:[],batchStyles:(_config$tilesetStyle=config.tilesetStyle)===null||_config$tilesetStyle===void 0?void 0:_config$tilesetStyle.batchstyles,colorAttr:config.colorAttr,alphaAttr:config.alphaAttr,labelAttr:config.labelAttr};var baseColor=[1,1,1,1];var customBaseColor=false;if(config.baseColor){var color=parseCssColor(config.baseColor);baseColor=[].concat(_toConsumableArray(color.values.map(function(x){return x/255})),[color.alpha]);customBaseColor=true}var colorRules=(_config$tilesetStyle2=config.tilesetStyle)===null||_config$tilesetStyle2===void 0?void 0:_config$tilesetStyle2.color;var parseExpr=function parseExpr(expr){var cleanExpr=expr.replace(/\$\{(\w+)\}/g,"$1").replaceAll("===","==").replaceAll("!==","==");return styleExpressionParser.parse(cleanExpr)};if(colorRules!==null&&colorRules!==void 0&&colorRules.conditions){colorRules===null||colorRules===void 0||colorRules.conditions.map(function(cond){context.colorExpressions.push([parseExpr(cond[0]),parseExpr(cond[1])])})}else if(typeof colorRules==="string"){context.colorExpressions.push([parseExpr("true"),parseExpr(colorRules)])}group.traverse(function(c){if(c.geometry){var batchidxAttr=c.geometry.getAttribute("_batchid");if(!batchidxAttr){return}var batchPosAttr=c.geometry.getAttribute("position");var rgbaColors=[];var rgbColors=[];var haveColor=customBaseColor;var haveAlpha=baseColor[3]<1;batchidxAttr.array.forEach(function(batchIdx,idx){var batchAttr=group.batchTable.getDataFromId(batchIdx);var batchId=String(batchAttr[idAttr]);// Handle color
8
- var color=batchColorCache[batchIdx];if(color===undefined){color=batchColorCache[batchIdx]=batchColor(batchId,batchAttr,context)}if(color){haveColor=true;haveAlpha|=color[3]<1;rgbaColors.push.apply(rgbaColors,_toConsumableArray(color));rgbColors.push.apply(rgbColors,_toConsumableArray(color.slice(0,3)))}else{rgbaColors.push.apply(rgbaColors,_toConsumableArray(baseColor));rgbColors.push.apply(rgbColors,_toConsumableArray(baseColor.slice(0,3)))}// Handle label
9
- var label=batchLabelCache[batchIdx];if(label===undefined){label=batchLabelCache[batchIdx]=batchLabel(batchId,batchAttr,context)}if(label){var pos=batchPosAttr.array.slice(3*idx,3*idx+3);var entry=labels[batchIdx];if(!entry){entry=labels[batchIdx]={label:label.text,labelOffset:label.offset,pos:pos,ymax:pos[1],count:1,matrix:c.matrixWorld}}else{entry.pos[0]+=pos[0];entry.pos[1]+=pos[1];entry.pos[2]+=pos[2];entry.ymax=Math.max(entry.ymax,pos[1]);++entry.count}}});// NOTE: Also update color buffers if they were previously colored
7
+ */import{Parser as ExprParser}from"expr-eval";import isEmpty from"lodash.isempty";import parseCssColor from"parse-css-color";import{Float32BufferAttribute,Group,Vector3}from"three";import MiscUtils from"../../../utils/MiscUtils";import{createLabelObject,TileMeshHelper}from"./MiscUtils3D";var styleExpressionParser=new ExprParser;styleExpressionParser.functions.color=function(name){var alpha=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var color=parseCssColor(name);return[].concat(_toConsumableArray(color.values.map(function(c){return c/255})),[alpha])};styleExpressionParser.functions.rgb=function(r,g,b){return[r/255,g/255,g/255,1]};styleExpressionParser.functions.rgba=function(r,g,b,a){return[r/255,g/255,g/255,a]};styleExpressionParser.functions.hsl=function(h,s,l){return[].concat(_toConsumableArray(MiscUtils.hslToRgb(h,s,l)),[1])};styleExpressionParser.functions.hsla=function(h,s,l,a){return[].concat(_toConsumableArray(MiscUtils.hslToRgb(h,s,l)),[a])};function featureColor(objectId,featureProperties,context){var _context$featureStyle,_context$featureStyle2;if(((_context$featureStyle=(_context$featureStyle2=context.featureStyles)===null||_context$featureStyle2===void 0||(_context$featureStyle2=_context$featureStyle2[objectId])===null||_context$featureStyle2===void 0?void 0:_context$featureStyle2.color)!==null&&_context$featureStyle!==void 0?_context$featureStyle:null)!==null){var color=parseCssColor(context.featureStyles[objectId].color);return[].concat(_toConsumableArray(color.values.map(function(c){return c/255})),[color.alpha])}else if(context.colorExpressions.length){try{for(var i=0;i<context.colorExpressions.length;++i){var condition=context.colorExpressions[i][0].evaluate(featureProperties);if(condition){return context.colorExpressions[i][1].evaluate(featureProperties)}}}catch(e){/* eslint-disable-next-line */console.warn("Failed to parse color expression: "+String(e))}return null}else if(featureProperties[context.colorAttr]){var _featureProperties$co;var _color=featureProperties[context.colorAttr];var alpha=context.alphaAttr?(_featureProperties$co=featureProperties[context.alphaAttr])!==null&&_featureProperties$co!==void 0?_featureProperties$co:255:255;var r=(_color>>16&255)/255;var g=(_color>>8&255)/255;var b=(_color&255)/255;return[r,g,b,alpha/255]}else{return null}}function featureLabel(objectId,featureProperties,context){var _context$featureStyle3,_context$featureStyle4;if(((_context$featureStyle3=(_context$featureStyle4=context.featureStyles)===null||_context$featureStyle4===void 0||(_context$featureStyle4=_context$featureStyle4[objectId])===null||_context$featureStyle4===void 0?void 0:_context$featureStyle4.label)!==null&&_context$featureStyle3!==void 0?_context$featureStyle3:null)!==null){var _context$featureStyle5;return{text:context.featureStyles[objectId].label,offset:(_context$featureStyle5=context.featureStyles[objectId].labelOffset)!==null&&_context$featureStyle5!==void 0?_context$featureStyle5:80}}else if(context.labelAttr){return featureProperties[context.labelAttr]}else{return null}}var Tiles3DStyle={applyTileStyle:function applyTileStyle(group,config,sceneContext){var _config$idAttr,_config$tilesetStyle,_config$tilesetStyle2;var featureColorCache={};var featureLabelCache={};var labels={};var idAttr=(_config$idAttr=config.idAttr)!==null&&_config$idAttr!==void 0?_config$idAttr:"id";var context={colorExpressions:[],featureStyles:(_config$tilesetStyle=config.tilesetStyle)===null||_config$tilesetStyle===void 0?void 0:_config$tilesetStyle.featureStyles,colorAttr:config.colorAttr,alphaAttr:config.alphaAttr,labelAttr:config.labelAttr};var baseColor=[1,1,1,1];var customBaseColor=false;if(config.baseColor){var color=parseCssColor(config.baseColor);baseColor=[].concat(_toConsumableArray(color.values.map(function(x){return x/255})),[color.alpha]);customBaseColor=true}var colorRules=(_config$tilesetStyle2=config.tilesetStyle)===null||_config$tilesetStyle2===void 0?void 0:_config$tilesetStyle2.color;var parseExpr=function parseExpr(expr){var cleanExpr=expr.replace(/\$\{(\w+)\}/g,"$1").replaceAll("===","==").replaceAll("!==","==");return styleExpressionParser.parse(cleanExpr)};if(colorRules!==null&&colorRules!==void 0&&colorRules.conditions){colorRules===null||colorRules===void 0||colorRules.conditions.map(function(cond){context.colorExpressions.push([parseExpr(cond[0]),parseExpr(cond[1])])})}else if(typeof colorRules==="string"){context.colorExpressions.push([parseExpr("true"),parseExpr(colorRules)])}group.traverse(function(c){if(c.geometry){var helper=new TileMeshHelper(c);var featureIdAttr=helper.getFeatureIdAttr();if(!featureIdAttr){return}var posAttr=c.geometry.getAttribute("position");var rgbaColors=[];var rgbColors=[];var haveColor=customBaseColor;var haveAlpha=baseColor[3]<1;for(var idx=0;idx<featureIdAttr.count;++idx){var featureId=featureIdAttr.getX(idx);var featureProperties=helper.getFeatureProperties(featureId);var objectId=String(featureProperties[idAttr]);// Handle color
8
+ var _color2=featureColorCache[featureId];if(_color2===undefined){_color2=featureColorCache[featureId]=featureColor(objectId,featureProperties,context)}if(_color2){haveColor=true;haveAlpha|=_color2[3]<1;rgbaColors.push.apply(rgbaColors,_toConsumableArray(_color2));rgbColors.push.apply(rgbColors,_toConsumableArray(_color2.slice(0,3)))}else{rgbaColors.push.apply(rgbaColors,_toConsumableArray(baseColor));rgbColors.push.apply(rgbColors,_toConsumableArray(baseColor.slice(0,3)))}// Handle label
9
+ var label=featureLabelCache[featureId];if(label===undefined){label=featureLabelCache[featureId]=featureLabel(objectId,featureProperties,context)}if(label){var pos=posAttr.array.slice(3*idx,3*idx+3);var entry=labels[featureId];if(!entry){entry=labels[featureId]={label:label.text,labelOffset:label.offset,pos:pos,ymax:pos[1],count:1,matrix:c.matrixWorld}}else{entry.pos[0]+=pos[0];entry.pos[1]+=pos[1];entry.pos[2]+=pos[2];entry.ymax=Math.max(entry.ymax,pos[1]);++entry.count}}}// NOTE: Also update color buffers if they were previously colored
10
10
  if(haveColor||group.userData.haveColor){if(haveAlpha){c.geometry.setAttribute("color",new Float32BufferAttribute(rgbaColors,4))}else{// Discard alpha
11
11
  var count=rgbaColors.length/4;var bufAttr=new Float32BufferAttribute(count*3,3);for(var i=0,j=0;i<count;++i){bufAttr.array[j++]=rgbaColors[4*i];bufAttr.array[j++]=rgbaColors[4*i+1];bufAttr.array[j++]=rgbaColors[4*i+2]}c.geometry.setAttribute("color",bufAttr)}c.material.vertexColors=true;c.material.transparent=haveAlpha;group.userData.haveColor=haveColor}}});// Clear previous labels
12
12
  if(group.userData.labelGroup){group.remove(group.children.find(function(child){return child.uuid===group.userData.labelGroup}));// Explicitly remove label DOM elements
13
13
  Object.values(group.userData.tileLabels).forEach(function(entry){entry.labelObject.element.parentNode.removeChild(entry.labelObject.element)});delete group.userData.tileLabels;delete group.userData.labelGroup}// Add new labels
14
- if(!isEmpty(labels)){var tileLabels={};var labelObjects=new Group;Object.entries(labels).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),batchId=_ref2[0],entry=_ref2[1];var pos=new Vector3(entry.pos[0]/entry.count,entry.pos[1]/entry.count,entry.pos[2]/entry.count).applyMatrix4(entry.matrix);var maxpos=new Vector3(entry.pos[0]/entry.count,entry.ymax,entry.pos[2]/entry.count).applyMatrix4(entry.matrix);tileLabels[batchId]={pos:pos,label:entry.label,labelOffset:entry.labelOffset};tileLabels[batchId].labelObject=createLabelObject(entry.label,pos,sceneContext,0,entry.labelOffset+(maxpos.y-pos.y));labelObjects.add(tileLabels[batchId].labelObject)});group.userData.tileLabels=tileLabels;group.userData.labelGroup=labelObjects.uuid;group.add(labelObjects)}}};export default Tiles3DStyle;
14
+ if(!isEmpty(labels)){var tileLabels={};var labelObjects=new Group;Object.entries(labels).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),featureId=_ref2[0],entry=_ref2[1];var pos=new Vector3(entry.pos[0]/entry.count,entry.pos[1]/entry.count,entry.pos[2]/entry.count).applyMatrix4(entry.matrix);var maxpos=new Vector3(entry.pos[0]/entry.count,entry.ymax,entry.pos[2]/entry.count).applyMatrix4(entry.matrix);tileLabels[featureId]={pos:pos,label:entry.label,labelOffset:entry.labelOffset};tileLabels[featureId].labelObject=createLabelObject(entry.label,pos,sceneContext,0,entry.labelOffset+(maxpos.y-pos.y));labelObjects.add(tileLabels[featureId].labelObject)});group.userData.tileLabels=tileLabels;group.userData.labelGroup=labelObjects.uuid;group.add(labelObjects)}}};export default Tiles3DStyle;
@@ -1,4 +1,4 @@
1
- div.taskbar-container {
1
+ div.messagebar-container {
2
2
  position: absolute;
3
3
  left: 0;
4
4
  right: 0;
@@ -8,7 +8,7 @@ div.taskbar-container {
8
8
  z-index: 3;
9
9
  }
10
10
 
11
- div.taskbar {
11
+ div.messagebar {
12
12
  position: relative;
13
13
  flex: 0 0 auto;
14
14
  pointer-events: initial;
@@ -20,12 +20,12 @@ div.taskbar {
20
20
  border-top: 1px solid rgba(136, 136, 136, 0.5);
21
21
  }
22
22
 
23
- div.taskbar > div.body {
23
+ div.messagebar > div.body {
24
24
  padding: 0.25em 0.5em 0.25em 0.25em;
25
25
  display: inline-block;
26
26
  }
27
27
 
28
- div.taskbar > span.closewrapper {
28
+ div.messagebar > span.closewrapper {
29
29
  position: absolute;
30
30
  right: 0;
31
31
  top: 0;
@@ -21,7 +21,7 @@ div.map-buttons-container {
21
21
  flex-wrap: wrap-reverse;
22
22
  z-index: 2;
23
23
  overflow: hidden;
24
- padding: 1.5em 1em 2.5em 1em;
24
+ padding: 2em 1em 2.5em 1em;
25
25
  }
26
26
 
27
27
  div.map-buttons-spacer {
@@ -0,0 +1,81 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ version="1.1"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ id="svg6"
8
+ sodipodi:docname="above_terr.svg"
9
+ inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
10
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
11
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12
+ xmlns="http://www.w3.org/2000/svg"
13
+ xmlns:svg="http://www.w3.org/2000/svg"
14
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
15
+ xmlns:cc="http://creativecommons.org/ns#"
16
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
17
+ <metadata
18
+ id="metadata12">
19
+ <rdf:RDF>
20
+ <cc:Work
21
+ rdf:about="">
22
+ <dc:format>image/svg+xml</dc:format>
23
+ <dc:type
24
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
25
+ <dc:title>uniE080</dc:title>
26
+ </cc:Work>
27
+ </rdf:RDF>
28
+ </metadata>
29
+ <defs
30
+ id="defs10" />
31
+ <sodipodi:namedview
32
+ pagecolor="#ffffff"
33
+ bordercolor="#666666"
34
+ borderopacity="1"
35
+ objecttolerance="10"
36
+ gridtolerance="10"
37
+ guidetolerance="10"
38
+ inkscape:pageopacity="0"
39
+ inkscape:pageshadow="2"
40
+ inkscape:window-width="1920"
41
+ inkscape:window-height="1172"
42
+ id="namedview8"
43
+ showgrid="true"
44
+ inkscape:zoom="20.85965"
45
+ inkscape:cx="5.0815809"
46
+ inkscape:cy="9.0845244"
47
+ inkscape:window-x="0"
48
+ inkscape:window-y="0"
49
+ inkscape:window-maximized="1"
50
+ inkscape:current-layer="g1132"
51
+ inkscape:document-rotation="0"
52
+ inkscape:pagecheckerboard="0"
53
+ inkscape:showpageshadow="2"
54
+ inkscape:deskcolor="#d1d1d1">
55
+ <inkscape:grid
56
+ type="xygrid"
57
+ id="grid908"
58
+ originx="0"
59
+ originy="0"
60
+ spacingy="1"
61
+ spacingx="1"
62
+ units="px" />
63
+ </sodipodi:namedview>
64
+ <title
65
+ id="title2">uniE080</title>
66
+ <g
67
+ id="g3356"
68
+ transform="translate(4.2175145,-1.0000001)">
69
+ <g
70
+ id="g1132">
71
+ <path
72
+ id="rect847"
73
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stop-color:#000000"
74
+ d="m 11.782485,2.0000002 -5.9999995,6 H 9.782485 V 19 C 7.9468654,17.587985 4.7824855,16 2.7824855,16 c -2,0 -3.50228637,1.078682 -6,3 v 4 c 1.9467076,-1.753851 3.73681103,-3 6,-3 2.263189,0 5,3 7,3 2.0000005,0 2.0000005,0 4.0000005,0 2,0 2.997711,-0.498856 3.999999,-1 v -4 c -1.999999,1 -2.999999,1 -4,1 V 8.0000002 h 4 z"
75
+ sodipodi:nodetypes="cccczcczzscccccc" />
76
+ <g
77
+ id="g1126"
78
+ transform="rotate(45,7.2573571,13.510407)" />
79
+ </g>
80
+ </g>
81
+ </svg>
@@ -0,0 +1,80 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ version="1.1"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ id="svg6"
8
+ sodipodi:docname="above_zero.svg"
9
+ inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
10
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
11
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12
+ xmlns="http://www.w3.org/2000/svg"
13
+ xmlns:svg="http://www.w3.org/2000/svg"
14
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
15
+ xmlns:cc="http://creativecommons.org/ns#"
16
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
17
+ <metadata
18
+ id="metadata12">
19
+ <rdf:RDF>
20
+ <cc:Work
21
+ rdf:about="">
22
+ <dc:format>image/svg+xml</dc:format>
23
+ <dc:type
24
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
25
+ <dc:title>uniE080</dc:title>
26
+ </cc:Work>
27
+ </rdf:RDF>
28
+ </metadata>
29
+ <defs
30
+ id="defs10" />
31
+ <sodipodi:namedview
32
+ pagecolor="#ffffff"
33
+ bordercolor="#666666"
34
+ borderopacity="1"
35
+ objecttolerance="10"
36
+ gridtolerance="10"
37
+ guidetolerance="10"
38
+ inkscape:pageopacity="0"
39
+ inkscape:pageshadow="2"
40
+ inkscape:window-width="1920"
41
+ inkscape:window-height="1172"
42
+ id="namedview8"
43
+ showgrid="true"
44
+ inkscape:zoom="20.85965"
45
+ inkscape:cx="5.0815809"
46
+ inkscape:cy="9.0845244"
47
+ inkscape:window-x="0"
48
+ inkscape:window-y="0"
49
+ inkscape:window-maximized="1"
50
+ inkscape:current-layer="g1132"
51
+ inkscape:document-rotation="0"
52
+ inkscape:pagecheckerboard="0"
53
+ inkscape:showpageshadow="2"
54
+ inkscape:deskcolor="#d1d1d1">
55
+ <inkscape:grid
56
+ type="xygrid"
57
+ id="grid908"
58
+ originx="0"
59
+ originy="0"
60
+ spacingy="1"
61
+ spacingx="1"
62
+ units="px" />
63
+ </sodipodi:namedview>
64
+ <title
65
+ id="title2">uniE080</title>
66
+ <g
67
+ id="g3356"
68
+ transform="translate(4.2175145,-1.0000001)">
69
+ <g
70
+ id="g1132">
71
+ <path
72
+ id="rect847"
73
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stop-color:#000000"
74
+ d="M 12.282485 2.5000001 L 6.2824855 8.5000001 L 10.282485 8.5000001 L 10.282485 19.5 L -2.7175145 19.5 L -2.7175145 23.5 L 18.282485 23.5 L 18.282485 19.5 L 14.282485 19.5 L 14.282485 8.5000001 L 18.282485 8.5000001 L 12.282485 2.5000001 z M 1.7824855 7.5468751 C -1.2041736 7.5468751 -2.4850926 10.359329 -2.4850926 12.972656 C -2.4850926 15.585983 -1.2175069 18.400391 1.7824855 18.400391 C 4.7824779 18.400391 6.0500636 15.585983 6.0500636 12.972656 C 6.0500636 10.359329 4.7691446 7.5468751 1.7824855 7.5468751 z M 1.7824855 9.8535157 C 3.1291488 9.8535157 3.4485011 11.987607 3.4485011 12.960938 C 3.4485011 13.934269 3.1291488 16.09375 1.7824855 16.09375 C 0.43582227 16.09375 0.11646987 13.934269 0.11646987 12.960938 C 0.11646987 11.987607 0.43582227 9.8535157 1.7824855 9.8535157 z " />
75
+ <g
76
+ id="g1126"
77
+ transform="rotate(45,7.2573571,13.510407)" />
78
+ </g>
79
+ </g>
80
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2025.08.14",
3
+ "version": "2025.08.20",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",
package/plugins/API.js CHANGED
@@ -85,7 +85,7 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
85
85
  * * `name`: An identifier
86
86
  * * `plugin`: The plugin component class
87
87
  * * `translations`: The plugin translation messages: `{"<lang>": {<messages>}, ...}`
88
- */_defineProperty(_this,"addPlugin",function(name,plugin){var _plugin$WrappedCompon,_component$availableI,_component$availableI2;var translations=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var component=(_plugin$WrappedCompon=plugin.WrappedComponent)!==null&&_plugin$WrappedCompon!==void 0?_plugin$WrappedCompon:plugin;var availableIn2D=(_component$availableI=component.availableIn2D)!==null&&_component$availableI!==void 0?_component$availableI:true;var availableIn3D=(_component$availableI2=component.availableIn3D)!==null&&_component$availableI2!==void 0?_component$availableI2:false;PluginStore.addCustomPlugin(name,plugin);window.qwc2.addTranslations(translations);_this.props.registerCustomPlugin(name,availableIn2D,availableIn3D)});/**
88
+ */_defineProperty(_this,"addPlugin",function(name,plugin){var _plugin$WrappedCompon,_component$availableI;var translations=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var component=(_plugin$WrappedCompon=plugin.WrappedComponent)!==null&&_plugin$WrappedCompon!==void 0?_plugin$WrappedCompon:plugin;var availableIn3D=(_component$availableI=component.availableIn3D)!==null&&_component$availableI!==void 0?_component$availableI:false;PluginStore.addCustomPlugin(name,plugin);window.qwc2.addTranslations(translations);_this.props.registerCustomPlugin(name,availableIn3D)});/**
89
89
  * Remove custom plugin
90
90
  *
91
91
  * * `name`: The identifier
@@ -13,4 +13,4 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
13
13
  *
14
14
  * This plugin queries the dataset via the editing service specified by
15
15
  * `editServiceUrl` in `config.json` (by default the `qwc-data-service`).
16
- */var AttributeTable=/*#__PURE__*/function(_React$Component){function AttributeTable(){var _this;_classCallCheck(this,AttributeTable);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,AttributeTable,[].concat(args));_defineProperty(_this,"onClose",function(){if(!_this.props.blocked){_this.props.setCurrentTask(null)}});return _this}_inherits(AttributeTable,_React$Component);return _createClass(AttributeTable,[{key:"render",value:function render(){var _this$props$taskData;if(!this.props.active){return null}return/*#__PURE__*/React.createElement(ResizeableWindow,{dockable:"bottom",icon:"editing",initialHeight:480,initialWidth:800,initiallyDocked:true,onClose:this.onClose,splitScreenWhenDocked:true,title:LocaleUtils.tr("attribtable.title")},/*#__PURE__*/React.createElement(AttributeTableWidget,{allowAddForGeometryLayers:this.props.allowAddForGeometryLayers,iface:this.props.iface,initialLayer:(_this$props$taskData=this.props.taskData)===null||_this$props$taskData===void 0?void 0:_this$props$taskData.layer,role:"body",showEditFormButton:this.props.showEditFormButton,showLimitToExtent:this.props.showLimitToExtent,zoomLevel:this.props.zoomLevel}))}}])}(React.Component);_defineProperty(AttributeTable,"propTypes",{active:PropTypes.bool,/** Whether to allow adding records for datasets which have a geometry column. */allowAddForGeometryLayers:PropTypes.bool,blocked:PropTypes.bool,iface:PropTypes.object,setCurrentTask:PropTypes.func,/** Whether to show a button to open the edit form for selected layer. Requires the Editing plugin to be enabled. */showEditFormButton:PropTypes.bool,/** Whether to show the "Limit to extent" checkbox */showLimitToExtent:PropTypes.bool,taskData:PropTypes.object,/** The zoom level for zooming to point features. */zoomLevel:PropTypes.number});_defineProperty(AttributeTable,"defaultProps",{zoomLevel:1000,showEditFormButton:true});export default(function(){var iface=arguments.length>0&&arguments[0]!==undefined?arguments[0]:EditingInterface;return connect(function(state){return{active:state.task.id==="AttributeTable",blocked:state.task.id==="AttributeTable"&&state.task.blocked,iface:iface,taskData:state.task.id==="AttributeTable"?state.task.data:null}},{setCurrentTask:setCurrentTask})(AttributeTable)});
16
+ */var AttributeTable=/*#__PURE__*/function(_React$Component){function AttributeTable(){var _this;_classCallCheck(this,AttributeTable);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,AttributeTable,[].concat(args));_defineProperty(_this,"onClose",function(){if(!_this.props.blocked){_this.props.setCurrentTask(null)}});return _this}_inherits(AttributeTable,_React$Component);return _createClass(AttributeTable,[{key:"render",value:function render(){var _this$props$taskData;if(!this.props.active){return null}return/*#__PURE__*/React.createElement(ResizeableWindow,{dockable:"bottom",icon:"editing",initialHeight:480,initialWidth:800,initiallyDocked:true,onClose:this.onClose,splitScreenWhenDocked:true,title:LocaleUtils.tr("attribtable.title")},/*#__PURE__*/React.createElement(AttributeTableWidget,{allowAddForGeometryLayers:this.props.allowAddForGeometryLayers,iface:this.props.iface,initialLayer:(_this$props$taskData=this.props.taskData)===null||_this$props$taskData===void 0?void 0:_this$props$taskData.layer,role:"body",showEditFormButton:this.props.showEditFormButton,showLimitToExtent:this.props.showLimitToExtent,zoomLevel:this.props.zoomLevel}))}}])}(React.Component);_defineProperty(AttributeTable,"propTypes",{active:PropTypes.bool,/** Whether to allow adding records for datasets which have a geometry column. */allowAddForGeometryLayers:PropTypes.bool,blocked:PropTypes.bool,iface:PropTypes.object,setCurrentTask:PropTypes.func,/** Whether to show a button to open the edit form for selected layer. Requires the Editing plugin to be enabled. */showEditFormButton:PropTypes.bool,/** Whether to show the "Limit to extent" checkbox */showLimitToExtent:PropTypes.bool,taskData:PropTypes.object,/** The zoom level for zooming to point features. */zoomLevel:PropTypes.number});_defineProperty(AttributeTable,"defaultProps",{zoomLevel:1000,showEditFormButton:true,showLimitToExtent:true});export default(function(){var iface=arguments.length>0&&arguments[0]!==undefined?arguments[0]:EditingInterface;return connect(function(state){return{active:state.task.id==="AttributeTable",blocked:state.task.id==="AttributeTable"&&state.task.blocked,iface:iface,taskData:state.task.id==="AttributeTable"?state.task.data:null}},{setCurrentTask:setCurrentTask})(AttributeTable)});
package/plugins/Map.js CHANGED
@@ -1,4 +1,4 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}/**
2
2
  * Copyright 2016 GeoSolutions Sas
3
3
  * Copyright 2016-2024 Sourcepole AG
4
4
  * All rights reserved.
@@ -7,7 +7,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */import React from"react";import ReactDOM from"react-dom";import{connect}from"react-redux";import isEmpty from"lodash.isempty";import PropTypes from"prop-types";import{LayerRole}from"../actions/layers";import{MapContainerPortalContext}from"../components/PluginsContainer";import OlLayer from"../components/map/OlLayer";import OlMap from"../components/map/OlMap";import Spinner from"../components/widgets/Spinner";import LayerUtils from"../utils/LayerUtils";import LocaleUtils from"../utils/LocaleUtils";import"./style/Map.css";/**
9
9
  * The main map component.
10
- */var MapPlugin=/*#__PURE__*/function(_React$Component){function MapPlugin(props){var _this;_classCallCheck(this,MapPlugin);_this=_callSuper(this,MapPlugin,[props]);_defineProperty(_this,"state",{renderLayers:[],swipeLayer:null});_defineProperty(_this,"renderLayers",function(){var zIndex=0;return _this.state.renderLayers.map(function(layer){var _layer$zIndex;if(layer.type==="placeholder"){return null}++zIndex;var swipe=_this.props.swipe!==null&&layer===_this.state.swipeLayer;return/*#__PURE__*/React.createElement(OlLayer,{key:layer.id,options:layer,swipe:swipe?_this.props.swipe:null,zIndex:(_layer$zIndex=layer.zIndex)!==null&&_layer$zIndex!==void 0?_layer$zIndex:zIndex})})});_defineProperty(_this,"renderSupportTools",function(){return Object.entries(_this.props.tools).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],Tool=_ref2[1];var options=_this.props.toolsOptions[key]||{};return/*#__PURE__*/React.createElement(Tool,{key:key,options:options})})});_this.loadingEl=null;return _this}_inherits(MapPlugin,_React$Component);return _createClass(MapPlugin,[{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this2=this;if(this.props.layers!==prevProps.layers||this.props.swipe!==null!==(prevProps.swipe!==null)){var renderLayers=[];// Inject external layers
10
+ */var Map=/*#__PURE__*/function(_React$Component){function Map(props){var _this;_classCallCheck(this,Map);_this=_callSuper(this,Map,[props]);_defineProperty(_this,"state",{renderLayers:[],swipeLayer:null});_defineProperty(_this,"renderLayers",function(){var zIndex=0;return _this.state.renderLayers.map(function(layer){var _layer$zIndex;if(layer.type==="placeholder"){return null}++zIndex;var swipe=_this.props.swipe!==null&&layer===_this.state.swipeLayer;return/*#__PURE__*/React.createElement(OlLayer,{key:layer.id,options:layer,swipe:swipe?_this.props.swipe:null,zIndex:(_layer$zIndex=layer.zIndex)!==null&&_layer$zIndex!==void 0?_layer$zIndex:zIndex})})});_defineProperty(_this,"renderSupportTools",function(){return Object.entries(_this.props.tools).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],Tool=_ref2[1];var options=_this.props.toolsOptions[key]||{};return/*#__PURE__*/React.createElement(Tool,_extends({key:key},options))})});_this.loadingEl=null;return _this}_inherits(Map,_React$Component);return _createClass(Map,[{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this2=this;if(this.props.layers!==prevProps.layers||this.props.swipe!==null!==(prevProps.swipe!==null)){var renderLayers=[];// Inject external layers
11
11
  this.props.layers.slice(0).reverse().forEach(function(layer){if(layer.type==="wms"&&layer.role===LayerRole.THEME){var sublayers=layer.params.LAYERS.split(",");var opacities=layer.params.OPACITIES.split(",");var styles=(layer.params.STYLES||"").split(",");for(var i=0;i<sublayers.length;++i){if(layer.externalLayerMap&&layer.externalLayerMap[sublayers[i]]){// Sublayer is mapped to an external layer
12
12
  var sublayer=LayerUtils.searchSubLayer(layer,"name",sublayers[i]);if(sublayer.visibility){var extlayer=_objectSpread(_objectSpread({},layer.externalLayerMap[sublayers[i]]),{},{rev:layer.rev,opacity:parseInt(opacities[i],10),visibility:true,role:LayerRole.THEME,minScale:sublayer.minScale,maxScale:sublayer.maxScale});if(extlayer.type==="wms"){extlayer.params=_objectSpread(_objectSpread(_objectSpread({},layer.params),layer.externalLayerMap[sublayers[i]].params),{},{OPACITIES:opacities[i],STYLES:""})}renderLayers.push(extlayer)}}else if(renderLayers.length>0&&renderLayers[renderLayers.length-1].id===layer.id){// Compress with previous renderlayer
13
13
  renderLayers[renderLayers.length-1].params.LAYERS+=","+sublayers[i];renderLayers[renderLayers.length-1].params.OPACITIES+=","+opacities[i];renderLayers[renderLayers.length-1].params.STYLES+=","+(styles[i]||"")}else{// Add new renderlayer
@@ -19,4 +19,5 @@ var swipeLayer=null;var swipeLayerNameBlacklist=this.props.swipeLayerNameBlackli
19
19
  },_ret2;for(var j=paramLayers.length-1;j>=0;--j){_ret2=_loop2();if(_ret2===0)continue;if(_ret2===1)break}}else{if(swipeLayerNameBlacklist.find(function(entry){return layer.name.match(entry)})){return 0;// continue
20
20
  }if(_this2.props.swipeGeometryTypeBlacklist.includes((layer.geometryType||"").replace(/[ZM]+$/,""))){return 0;// continue
21
21
  }swipeLayer=layer}},_ret;// Pick candidate swipe layer according to rules
22
- for(var i=renderLayers.length-1;swipeLayer===null&&i>=0;--i){_ret=_loop();if(_ret===0)continue}}this.setState({renderLayers:renderLayers,swipeLayer:swipeLayer})}}},{key:"render",value:function render(){var _this3=this,_this$props$theme;var loadingIndicator=null;if(this.props.showLoading&&!isEmpty(this.props.loadingLayers)){loadingIndicator=/*#__PURE__*/React.createElement("span",{className:"map-loading-indicator",key:"map-loading",ref:function ref(el){_this3.loadingEl=el}},/*#__PURE__*/React.createElement(Spinner,{className:"spinner"}),LocaleUtils.tr("map.loading"));setTimeout(function(){if(_this3.loadingEl){_this3.loadingEl.style.opacity=1}},1000)}return/*#__PURE__*/ReactDOM.createPortal([/*#__PURE__*/React.createElement("div",{className:"map-contents",id:"map",key:"map",tabIndex:"0"},/*#__PURE__*/React.createElement(OlMap,_extends({id:"map",key:"map",mapOptions:this.props.mapOptions},this.props.map,{fullExtent:(_this$props$theme=this.props.theme)===null||_this$props$theme===void 0?void 0:_this$props$theme.bbox}),this.renderLayers(),this.renderSupportTools())),loadingIndicator],this.context)}}])}(React.Component);_defineProperty(MapPlugin,"contextType",MapContainerPortalContext);_defineProperty(MapPlugin,"propTypes",{layers:PropTypes.array,loadingLayers:PropTypes.array,map:PropTypes.object,/** Zoom duration in ms, rotation in degrees, panStepSize and panPageSize as fraction of map width/height. */mapOptions:PropTypes.shape({zoomDuration:PropTypes.number,enableRotation:PropTypes.bool,rotation:PropTypes.number,panStepSize:PropTypes.number,panPageSize:PropTypes.number,constrainExtent:PropTypes.bool,kineticPanParams:PropTypes.object}),/** Whether to display the loading spinner when layers are loading. */showLoading:PropTypes.bool,swipe:PropTypes.number,/** A list of layer geometry types to ignore when determining the top-most layer to compare. */swipeGeometryTypeBlacklist:PropTypes.arrayOf(PropTypes.string),/** A list of layer names to ignore when determining the top-most layer to compare. You can use `*` as a wildcard character. */swipeLayerNameBlacklist:PropTypes.arrayOf(PropTypes.string),theme:PropTypes.object,tools:PropTypes.object,/** Map tool configuraiton options. Refer to the sample config.json. */toolsOptions:PropTypes.object});_defineProperty(MapPlugin,"defaultProps",{mapOptions:{},showLoading:true,swipeGeometryTypeBlacklist:[],swipeLayerNameBlacklist:[],tools:{},toolsOptions:{}});export default(function(tools){return connect(function(state){return{map:state.map,layers:state.layers.flat,loadingLayers:state.layers.loading,swipe:state.layers.swipe,theme:state.theme.current,tools:tools}})(MapPlugin)});
22
+ for(var i=renderLayers.length-1;swipeLayer===null&&i>=0;--i){_ret=_loop();if(_ret===0)continue}}this.setState({renderLayers:renderLayers,swipeLayer:swipeLayer})}}},{key:"render",value:function render(){var _this3=this,_this$props$theme;var loadingIndicator=null;if(this.props.showLoading&&!isEmpty(this.props.loadingLayers)){loadingIndicator=/*#__PURE__*/React.createElement("span",{className:"map-loading-indicator",key:"map-loading",ref:function ref(el){_this3.loadingEl=el}},/*#__PURE__*/React.createElement(Spinner,{className:"spinner"}),LocaleUtils.tr("map.loading"));setTimeout(function(){if(_this3.loadingEl){_this3.loadingEl.style.opacity=1}},1000)}return/*#__PURE__*/ReactDOM.createPortal([/*#__PURE__*/React.createElement("div",{className:"map-contents",id:"map",key:"map",tabIndex:"0"},/*#__PURE__*/React.createElement(OlMap,_extends({id:"map",key:"map",mapOptions:this.props.mapOptions},this.props.map,{fullExtent:(_this$props$theme=this.props.theme)===null||_this$props$theme===void 0?void 0:_this$props$theme.bbox}),this.renderLayers(),this.renderSupportTools())),loadingIndicator],this.context)}}])}(React.Component);_defineProperty(Map,"contextType",MapContainerPortalContext);_defineProperty(Map,"propTypes",{layers:PropTypes.array,loadingLayers:PropTypes.array,map:PropTypes.object,/** Zoom duration in ms, rotation in degrees, panStepSize and panPageSize as fraction of map width/height. */mapOptions:PropTypes.shape({zoomDuration:PropTypes.number,enableRotation:PropTypes.bool,rotation:PropTypes.number,panStepSize:PropTypes.number,panPageSize:PropTypes.number,constrainExtent:PropTypes.bool,kineticPanParams:PropTypes.object}),/** Whether to display the loading spinner when layers are loading. */showLoading:PropTypes.bool,swipe:PropTypes.number,/** A list of layer geometry types to ignore when determining the top-most layer to compare. */swipeGeometryTypeBlacklist:PropTypes.arrayOf(PropTypes.string),/** A list of layer names to ignore when determining the top-most layer to compare. You can use `*` as a wildcard character. */swipeLayerNameBlacklist:PropTypes.arrayOf(PropTypes.string),theme:PropTypes.object,tools:PropTypes.object,/** Options to pass to the map support plugins, in the form `{"<Name>": {<options>}}.
23
+ * Refer to the documentation of the <a href="#mapSupportPlugins">Map support plugins</a> for settable options. */toolsOptions:PropTypes.object});_defineProperty(Map,"defaultProps",{mapOptions:{},showLoading:true,swipeGeometryTypeBlacklist:[],swipeLayerNameBlacklist:[],tools:{},toolsOptions:{}});export default(function(tools){return connect(function(state){return{map:state.map,layers:state.layers.flat,loadingLayers:state.layers.loading,swipe:state.layers.swipe,theme:state.theme.current,tools:tools}})(Map)});
@@ -8,4 +8,4 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
8
8
  * Allows comparing the top layer with the rest of the map.
9
9
  *
10
10
  * Activated through a checkbox in the LayerTree.
11
- */var MapComparePlugin=/*#__PURE__*/function(_React$Component){function MapComparePlugin(){var _this;_classCallCheck(this,MapComparePlugin);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,MapComparePlugin,[].concat(args));_defineProperty(_this,"startDragHandle",function(ev){var rect=ev.currentTarget.getBoundingClientRect();var parentRect=ev.currentTarget.parentElement.getBoundingClientRect();var clickOffset=ev.clientX-rect.left;var moveHandle=function moveHandle(ev2){var perc=(ev2.clientX-clickOffset-parentRect.left)/parentRect.width*100;perc=Math.min(100,Math.max(0,perc));_this.props.setSwipe(perc)};ev.view.document.body.style.userSelect="none";ev.view.addEventListener("pointermove",moveHandle);ev.view.addEventListener("pointerup",function(){ev.view.document.body.style.userSelect="";ev.view.removeEventListener("pointermove",moveHandle)},{once:true})});return _this}_inherits(MapComparePlugin,_React$Component);return _createClass(MapComparePlugin,[{key:"render",value:function render(){if(this.props.swipe===null){return null}var style={left:this.props.swipe+"%"};return/*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div",{id:"MapCompare",onPointerDown:this.startDragHandle,style:style},/*#__PURE__*/React.createElement("div",{className:"map-compare-handle"},/*#__PURE__*/React.createElement(Icon,{className:"map-compare-handle-icon",icon:"triangle-left"}),/*#__PURE__*/React.createElement(Icon,{className:"map-compare-handle-icon",icon:"triangle-right"}))),this.context)}}])}(React.Component);_defineProperty(MapComparePlugin,"contextType",MapContainerPortalContext);_defineProperty(MapComparePlugin,"propTypes",{setSwipe:PropTypes.func,swipe:PropTypes.number});export default connect(function(state){return{swipe:state.layers.swipe}},{setSwipe:setSwipe})(MapComparePlugin);
11
+ */var MapCompare=/*#__PURE__*/function(_React$Component){function MapCompare(){var _this;_classCallCheck(this,MapCompare);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,MapCompare,[].concat(args));_defineProperty(_this,"startDragHandle",function(ev){var rect=ev.currentTarget.getBoundingClientRect();var parentRect=ev.currentTarget.parentElement.getBoundingClientRect();var clickOffset=ev.clientX-rect.left;var moveHandle=function moveHandle(ev2){var perc=(ev2.clientX-clickOffset-parentRect.left)/parentRect.width*100;perc=Math.min(100,Math.max(0,perc));_this.props.setSwipe(perc)};ev.view.document.body.style.userSelect="none";ev.view.addEventListener("pointermove",moveHandle);ev.view.addEventListener("pointerup",function(){ev.view.document.body.style.userSelect="";ev.view.removeEventListener("pointermove",moveHandle)},{once:true})});return _this}_inherits(MapCompare,_React$Component);return _createClass(MapCompare,[{key:"render",value:function render(){if(this.props.swipe===null){return null}var style={left:this.props.swipe+"%"};return/*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div",{id:"MapCompare",onPointerDown:this.startDragHandle,style:style},/*#__PURE__*/React.createElement("div",{className:"map-compare-handle"},/*#__PURE__*/React.createElement(Icon,{className:"map-compare-handle-icon",icon:"triangle-left"}),/*#__PURE__*/React.createElement(Icon,{className:"map-compare-handle-icon",icon:"triangle-right"}))),this.context)}}])}(React.Component);_defineProperty(MapCompare,"contextType",MapContainerPortalContext);_defineProperty(MapCompare,"propTypes",{setSwipe:PropTypes.func,swipe:PropTypes.number});export default connect(function(state){return{swipe:state.layers.swipe}},{setSwipe:setSwipe})(MapCompare);
@@ -8,4 +8,4 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
8
8
  * Displays layer attributions in the bottom right corner of the map.
9
9
  */var MapCopyright=/*#__PURE__*/function(_React$Component){function MapCopyright(){var _this;_classCallCheck(this,MapCopyright);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,MapCopyright,[].concat(args));_defineProperty(_this,"state",{currentCopyrights:{}});_defineProperty(_this,"layerNames",function(layers){if(!_this.props.prefixCopyrightsWithLayerNames){return""}else{return layers.map(function(layer){return layer.titleMsgId?LocaleUtils.tr(layer.titleMsgId):layer.title}).join(", ")+": "}});return _this}_inherits(MapCopyright,_React$Component);return _createClass(MapCopyright,[{key:"render",value:function render(){var _this2=this;// If attribution has both url and label, "key" is the url and "value.title" the label.
10
10
  // If it only has a label, "key" is the label and "value" is null.
11
- var copyrights=Object.entries(this.state.currentCopyrights).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if(value.title){return/*#__PURE__*/React.createElement("span",{key:key},/*#__PURE__*/React.createElement("a",{href:key,rel:"noreferrer",target:"_blank"},_this2.layerNames(value.layers)+value.title))}else{return/*#__PURE__*/React.createElement("span",{key:key},_this2.layerNames(value.layers),/*#__PURE__*/React.createElement("span",{dangerouslySetInnerHTML:{__html:DOMPurify.sanitize(key)}}))}});if(isEmpty(copyrights)){return null}return/*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div",{id:"MapCopyright"},copyrights),this.context)}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps){if(nextProps.map&&nextProps.map.bbox&&nextProps.layers){var copyrights=nextProps.layers.reduce(function(res,layer){return _objectSpread(_objectSpread({},res),LayerUtils.getAttribution(layer,nextProps.map,nextProps.showThemeCopyrightOnly))},{});return{currentCopyrights:copyrights}}return null}}])}(React.Component);_defineProperty(MapCopyright,"contextType",MapContainerPortalContext);_defineProperty(MapCopyright,"propTypes",{layers:PropTypes.array,map:PropTypes.object,/** Whether to prepend the layer name to the attribution string. */prefixCopyrightsWithLayerNames:PropTypes.bool,/** Whether to only display the attribution of the theme, omitting external layers. */showThemeCopyrightOnly:PropTypes.bool});var selector=function selector(state){return{layers:state.layers.flat,map:state.map}};export default connect(selector,{})(MapCopyright);
11
+ var copyrights=Object.entries(this.state.currentCopyrights).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if(value.title){return/*#__PURE__*/React.createElement("span",{key:key},/*#__PURE__*/React.createElement("a",{href:key,rel:"noreferrer",target:"_blank"},_this2.layerNames(value.layers)+value.title))}else{return/*#__PURE__*/React.createElement("span",{key:key},_this2.layerNames(value.layers),/*#__PURE__*/React.createElement("span",{dangerouslySetInnerHTML:{__html:DOMPurify.sanitize(key)}}))}});if(isEmpty(copyrights)){return null}return/*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div",{className:"MapCopyright"},copyrights),this.context)}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps){if(nextProps.map&&nextProps.map.bbox&&nextProps.layers){var copyrights=nextProps.layers.reduce(function(res,layer){return _objectSpread(_objectSpread({},res),LayerUtils.getAttribution(layer,nextProps.map,nextProps.showThemeCopyrightOnly))},{});return{currentCopyrights:copyrights}}return null}}])}(React.Component);_defineProperty(MapCopyright,"contextType",MapContainerPortalContext);_defineProperty(MapCopyright,"propTypes",{layers:PropTypes.array,map:PropTypes.object,/** Whether to prepend the layer name to the attribution string. */prefixCopyrightsWithLayerNames:PropTypes.bool,/** Whether to only display the attribution of the theme, omitting external layers. */showThemeCopyrightOnly:PropTypes.bool});var selector=function selector(state){return{layers:state.layers.flat,map:state.map}};export default connect(selector,{})(MapCopyright);
@@ -1 +1,3 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}import React from"react";import{connect}from"react-redux";import PropTypes from"prop-types";import{setCurrentTask}from"../actions/task";import LocaleUtils from"../utils/LocaleUtils";import MiscUtils from"../utils/MiscUtils";var TourGuide=/*#__PURE__*/function(_React$Component){function TourGuide(){var _this;_classCallCheck(this,TourGuide);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,TourGuide,[].concat(args));_defineProperty(_this,"state",{tourSteps:[],driverObj:null,currentStepIndex:0,rawStepData:[]});_defineProperty(_this,"handleClick",function(driverObj,direction){var _this$state=_this.state,currentStepIndex=_this$state.currentStepIndex,rawStepData=_this$state.rawStepData;var currentRawStep=rawStepData[currentStepIndex];var actionNames=direction==="next"?currentRawStep===null||currentRawStep===void 0?void 0:currentRawStep.onNextClick:currentRawStep===null||currentRawStep===void 0?void 0:currentRawStep.onPrevClick;if(Array.isArray(actionNames)){actionNames.forEach(function(actionName){return _this.runCustomAction(actionName)})}else if(actionNames){_this.runCustomAction(actionNames)}_this.setState(function(prevState){return{currentStepIndex:direction==="next"?prevState.currentStepIndex+1:Math.max(prevState.currentStepIndex-1,0)}},function(){direction==="next"?driverObj.moveNext():driverObj.movePrevious()})});_defineProperty(_this,"runCustomAction",function(actionName){var _document$querySelect,_document$querySelect2;if(actionName.startsWith("setTask:")){_this.props.setCurrentTask(actionName.replace("setTask:","").trim());return}if(actionName.startsWith("openSubMenu:")){var submenuName=actionName.replace("openSubMenu:","").trim();var submenu=Array.from(document.querySelectorAll(".appmenu-submenu")).find(function(el){return el.querySelector("span.icon-".concat(submenuName))});if(submenu){submenu.classList.add("appmenu-submenu-expanded")}else{/* eslint-disable-next-line */console.warn("Submenu with icon-".concat(submenuName," not found."))}return}if(actionName.startsWith("closeSubMenu:")){var _submenuName=actionName.replace("closeSubMenu:","").trim();var _submenu=Array.from(document.querySelectorAll(".appmenu-submenu")).find(function(el){return el.querySelector("span.icon-".concat(_submenuName))});if(_submenu){_submenu.classList.remove("appmenu-submenu-expanded")}else{/* eslint-disable-next-line */console.warn("Submenu with icon-".concat(_submenuName," not found."))}return}switch(actionName){case"openMenu":(_document$querySelect=document.querySelector(".AppMenu"))===null||_document$querySelect===void 0||_document$querySelect.classList.add("appmenu-visible");break;case"closeMenu":(_document$querySelect2=document.querySelector(".AppMenu"))===null||_document$querySelect2===void 0||_document$querySelect2.classList.remove("appmenu-visible");break;default:/* eslint-disable-next-line */console.warn("Unknown action:",actionName)}});_defineProperty(_this,"startTour",function(){var _this$state$driverObj;(_this$state$driverObj=_this.state.driverObj)===null||_this$state$driverObj===void 0||_this$state$driverObj.drive()});return _this}_inherits(TourGuide,_React$Component);return _createClass(TourGuide,[{key:"componentDidMount",value:function componentDidMount(){var _this2=this;if(!this.props.tourGuideUrl){return}fetch(MiscUtils.resolveAssetsPath(this.props.tourGuideUrl)).then(function(response){return response.json()}).then(function(data){var steps=data.map(function(step){return{element:step.selector,popover:{title:step.title,description:step.content,side:step.side,align:step.align},disableActiveInteraction:step.disableActiveInteraction}});_this2.setState({tourSteps:steps,rawStepData:data})})["catch"](function(err){/* eslint-disable-next-line */console.error("Failed to fetch tour guide data:",err)})}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this3=this;if(this.props.active&&!prevProps.active&&this.state.tourSteps){var tourSteps=this.state.tourSteps;import("driver.js/dist/driver.css");import("./style/TourGuide.css");import("driver.js").then(function(module){var driver=module.driver;var driverObj=driver({popoverClass:"driverjs-theme",nextBtnText:LocaleUtils.tr("tourguide.next")+" \u2192",prevBtnText:"\u2190 "+LocaleUtils.tr("tourguide.previous"),doneBtnText:LocaleUtils.tr("tourguide.done"),progressText:"{{current}} / {{total}}",showProgress:true,steps:tourSteps,onNextClick:function onNextClick(){return _this3.handleClick(driverObj,"next")},onPrevClick:function onPrevClick(){return _this3.handleClick(driverObj,"prev")},onDestroyed:function onDestroyed(){var _document$querySelect3;document.querySelectorAll(".AppMenu .appmenu-submenu").forEach(function(submenu){return submenu.classList.remove("appmenu-submenu-expanded")});(_document$querySelect3=document.querySelector(".AppMenu"))===null||_document$querySelect3===void 0||_document$querySelect3.classList.remove("appmenu-visible");_this3.props.setCurrentTask(null)},onHighlightStarted:function onHighlightStarted(_,step){var index=tourSteps.findIndex(function(s){return s.element===step.element});_this3.setState({currentStepIndex:index})}});_this3.setState({driverObj:driverObj},function(){_this3.startTour();_this3.props.setCurrentTask(null)})})["catch"](function(err){/* eslint-disable-next-line */console.error("Failed to load Driver.js:",err)})}}},{key:"render",value:function render(){return null}}])}(React.Component);_defineProperty(TourGuide,"propTypes",{active:PropTypes.bool,setCurrentTask:PropTypes.func,/** Url of the Tourguide JSON configuration. */tourGuideUrl:PropTypes.string});_defineProperty(TourGuide,"defaultProps",{tourGuideUrl:":/tourguide.json"});export default connect(function(state){return{active:state.task.id==="TourGuide"}},{setCurrentTask:setCurrentTask})(TourGuide);
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}import React from"react";import{connect}from"react-redux";import PropTypes from"prop-types";import{setCurrentTask}from"../actions/task";import LocaleUtils from"../utils/LocaleUtils";import MiscUtils from"../utils/MiscUtils";/**
2
+ * Launches a tour guide of the application, as configured by a configuration file.
3
+ */var TourGuide=/*#__PURE__*/function(_React$Component){function TourGuide(){var _this;_classCallCheck(this,TourGuide);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,TourGuide,[].concat(args));_defineProperty(_this,"state",{tourSteps:[],driverObj:null,currentStepIndex:0,rawStepData:[]});_defineProperty(_this,"handleClick",function(driverObj,direction){var _this$state=_this.state,currentStepIndex=_this$state.currentStepIndex,rawStepData=_this$state.rawStepData;var currentRawStep=rawStepData[currentStepIndex];var actionNames=direction==="next"?currentRawStep===null||currentRawStep===void 0?void 0:currentRawStep.onNextClick:currentRawStep===null||currentRawStep===void 0?void 0:currentRawStep.onPrevClick;if(Array.isArray(actionNames)){actionNames.forEach(function(actionName){return _this.runCustomAction(actionName)})}else if(actionNames){_this.runCustomAction(actionNames)}_this.setState(function(prevState){return{currentStepIndex:direction==="next"?prevState.currentStepIndex+1:Math.max(prevState.currentStepIndex-1,0)}},function(){direction==="next"?driverObj.moveNext():driverObj.movePrevious()})});_defineProperty(_this,"runCustomAction",function(actionName){var _document$querySelect,_document$querySelect2;if(actionName.startsWith("setTask:")){_this.props.setCurrentTask(actionName.replace("setTask:","").trim());return}if(actionName.startsWith("openSubMenu:")){var submenuName=actionName.replace("openSubMenu:","").trim();var submenu=Array.from(document.querySelectorAll(".appmenu-submenu")).find(function(el){return el.querySelector("span.icon-".concat(submenuName))});if(submenu){submenu.classList.add("appmenu-submenu-expanded")}else{/* eslint-disable-next-line */console.warn("Submenu with icon-".concat(submenuName," not found."))}return}if(actionName.startsWith("closeSubMenu:")){var _submenuName=actionName.replace("closeSubMenu:","").trim();var _submenu=Array.from(document.querySelectorAll(".appmenu-submenu")).find(function(el){return el.querySelector("span.icon-".concat(_submenuName))});if(_submenu){_submenu.classList.remove("appmenu-submenu-expanded")}else{/* eslint-disable-next-line */console.warn("Submenu with icon-".concat(_submenuName," not found."))}return}switch(actionName){case"openMenu":(_document$querySelect=document.querySelector(".AppMenu"))===null||_document$querySelect===void 0||_document$querySelect.classList.add("appmenu-visible");break;case"closeMenu":(_document$querySelect2=document.querySelector(".AppMenu"))===null||_document$querySelect2===void 0||_document$querySelect2.classList.remove("appmenu-visible");break;default:/* eslint-disable-next-line */console.warn("Unknown action:",actionName)}});_defineProperty(_this,"startTour",function(){var _this$state$driverObj;(_this$state$driverObj=_this.state.driverObj)===null||_this$state$driverObj===void 0||_this$state$driverObj.drive()});return _this}_inherits(TourGuide,_React$Component);return _createClass(TourGuide,[{key:"componentDidMount",value:function componentDidMount(){var _this2=this;if(!this.props.tourGuideUrl){return}fetch(MiscUtils.resolveAssetsPath(this.props.tourGuideUrl)).then(function(response){return response.json()}).then(function(data){var steps=data.map(function(step){return{element:step.selector,popover:{title:step.title,description:step.content,side:step.side,align:step.align},disableActiveInteraction:step.disableActiveInteraction}});_this2.setState({tourSteps:steps,rawStepData:data})})["catch"](function(err){/* eslint-disable-next-line */console.error("Failed to fetch tour guide data:",err)})}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this3=this;if(this.props.active&&!prevProps.active&&this.state.tourSteps){var tourSteps=this.state.tourSteps;import("driver.js/dist/driver.css");import("./style/TourGuide.css");import("driver.js").then(function(module){var driver=module.driver;var driverObj=driver({popoverClass:"driverjs-theme",nextBtnText:LocaleUtils.tr("tourguide.next")+" \u2192",prevBtnText:"\u2190 "+LocaleUtils.tr("tourguide.previous"),doneBtnText:LocaleUtils.tr("tourguide.done"),progressText:"{{current}} / {{total}}",showProgress:true,steps:tourSteps,onNextClick:function onNextClick(){return _this3.handleClick(driverObj,"next")},onPrevClick:function onPrevClick(){return _this3.handleClick(driverObj,"prev")},onDestroyed:function onDestroyed(){var _document$querySelect3;document.querySelectorAll(".AppMenu .appmenu-submenu").forEach(function(submenu){return submenu.classList.remove("appmenu-submenu-expanded")});(_document$querySelect3=document.querySelector(".AppMenu"))===null||_document$querySelect3===void 0||_document$querySelect3.classList.remove("appmenu-visible");_this3.props.setCurrentTask(null)},onHighlightStarted:function onHighlightStarted(_,step){var index=tourSteps.findIndex(function(s){return s.element===step.element});_this3.setState({currentStepIndex:index})}});_this3.setState({driverObj:driverObj},function(){_this3.startTour();_this3.props.setCurrentTask(null)})})["catch"](function(err){/* eslint-disable-next-line */console.error("Failed to load Driver.js:",err)})}}},{key:"render",value:function render(){return null}}])}(React.Component);_defineProperty(TourGuide,"propTypes",{active:PropTypes.bool,setCurrentTask:PropTypes.func,/** Url of the Tourguide JSON configuration. */tourGuideUrl:PropTypes.string});export default connect(function(state){return{active:state.task.id==="TourGuide"}},{setCurrentTask:setCurrentTask})(TourGuide);