qwc2 2026.7.7 → 2026.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/actions/theme.js CHANGED
@@ -63,6 +63,16 @@ export function finishThemeSetup(dispatch, theme, themes, layerConfigs, preserve
63
63
  return layer.role === LayerRole.BACKGROUND && layer.visibility === true;
64
64
  })) === null || _prevLayers$find === void 0 ? void 0 : _prevLayers$find.name) !== null && _prevLayers$find$name !== void 0 ? _prevLayers$find$name : null;
65
65
  }
66
+ // Create theme background layers
67
+ var bgLayers = ThemeUtils.createThemeBackgroundLayers(theme.backgroundLayers || [], themes, visibleBgLayer, externalLayers);
68
+ var actuallyVisibleBgLayer = (_bgLayers$find = bgLayers.find(function (entry) {
69
+ return entry.visibility;
70
+ })) === null || _bgLayers$find === void 0 ? void 0 : _bgLayers$find.name;
71
+ if (!prevTheme && visibleBgLayer && actuallyVisibleBgLayer !== visibleBgLayer) {
72
+ dispatch(showNotification("missingbglayer", LocaleUtils.tr("app.missingbg", visibleBgLayer), NotificationType.WARN, true));
73
+ } else if (actuallyVisibleBgLayer !== visibleBgLayer) {
74
+ visibleBgLayer = null;
75
+ }
66
76
 
67
77
  // Remove old layers
68
78
  var preserveUserLayers = preserve && ConfigUtils.getConfigProp("preserveNonThemeLayersOnThemeSwitch", theme) === true;
@@ -101,24 +111,16 @@ export function finishThemeSetup(dispatch, theme, themes, layerConfigs, preserve
101
111
  }
102
112
 
103
113
  // Add background layers for theme
104
- var bgLayers = ThemeUtils.createThemeBackgroundLayers(theme.backgroundLayers || [], themes, visibleBgLayer, externalLayers);
105
- var actuallyVisibleBgLayer = (_bgLayers$find = bgLayers.find(function (entry) {
106
- return entry.visibility;
107
- })) === null || _bgLayers$find === void 0 ? void 0 : _bgLayers$find.name;
108
- if (!prevTheme && visibleBgLayer && actuallyVisibleBgLayer !== visibleBgLayer) {
109
- dispatch(showNotification("missingbglayer", LocaleUtils.tr("app.missingbg", visibleBgLayer), NotificationType.WARN, true));
110
- }
111
114
  var _iterator = _createForOfIteratorHelper(bgLayers.reverse()),
112
115
  _step;
113
116
  try {
114
117
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
115
118
  var bgLayer = _step.value;
116
119
  // If previous visible BG layer kept, insert other BG layers around that layer
117
- if (bgLayer.name === visibleBgLayer && bgLayerKept) {
118
- bgLayerKept = false;
119
- } else {
120
- dispatch(addLayer(bgLayer, bgLayerKept ? 1 : 0));
120
+ if (!(bgLayer.name === visibleBgLayer && bgLayerKept)) {
121
+ dispatch(addLayer(bgLayer, insPos));
121
122
  }
123
+ ++insPos;
122
124
  }
123
125
  } catch (err) {
124
126
  _iterator.e(err);
@@ -133,7 +135,7 @@ export function finishThemeSetup(dispatch, theme, themes, layerConfigs, preserve
133
135
  try {
134
136
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
135
137
  var layer = _step2.value;
136
- dispatch(addLayer(layer, insPos));
138
+ dispatch(addLayer(layer));
137
139
  }
138
140
 
139
141
  // Restore external layers
@@ -138,6 +138,7 @@ var AttributeForm = /*#__PURE__*/function (_React$Component) {
138
138
  finished: _this.state.childEdit.finishCallback,
139
139
  iface: _this.props.iface,
140
140
  mapPrefix: _this.props.editContext.mapPrefix,
141
+ parentContextId: _this.props.editContext.id,
141
142
  pickFilter: _this.props.childPickFilter,
142
143
  readOnly: _this.props.readOnly,
143
144
  translations: _this.props.translations
@@ -40,7 +40,8 @@ var EditUploadField = /*#__PURE__*/function (_React$Component) {
40
40
  _defineProperty(_this, "state", {
41
41
  camera: false,
42
42
  imageData: null,
43
- imageFilename: null
43
+ imageFilename: null,
44
+ fileSelected: false
44
45
  });
45
46
  _defineProperty(_this, "fileSelected", function (ev) {
46
47
  if (ev.target.files[0].type.startsWith("image/")) {
@@ -57,6 +58,9 @@ var EditUploadField = /*#__PURE__*/function (_React$Component) {
57
58
  _this.props.updateField(_this.props.fieldId, ev.target.files[0].name);
58
59
  };
59
60
  } else {
61
+ _this.setState({
62
+ fileSelected: true
63
+ });
60
64
  _this.props.updateFile(_this.props.fieldId, ev.target.files[0]);
61
65
  _this.props.updateField(_this.props.fieldId, ev.target.files[0].name);
62
66
  }
@@ -277,7 +281,7 @@ var EditUploadField = /*#__PURE__*/function (_React$Component) {
277
281
  onClick: this.props.disabled ? null : this.clearImage
278
282
  }));
279
283
  }
280
- } else if (fileValue) {
284
+ } else if (fileValue && !this.state.fileSelected) {
281
285
  return /*#__PURE__*/React.createElement("span", {
282
286
  className: "edit-upload-field edit-upload-field-imagelink" + (this.props.disabled ? " edit-upload-field-disabled" : "")
283
287
  }, /*#__PURE__*/React.createElement("a", {
@@ -128,10 +128,25 @@ var ExportSelection = /*#__PURE__*/function (_React$Component) {
128
128
  }
129
129
  if (this.props.frameRatio !== prevProps.frameRatio) {
130
130
  this.setState(function (state) {
131
+ var maxWidth = _this2.exportContainer.offsetWidth;
132
+ var maxHeight = _this2.exportContainer.offsetHeight;
131
133
  var newheight = _this2.props.frameRatio ? Math.round(state.width * _this2.props.frameRatio) : state.height;
134
+ var newwidth = state.width;
135
+ if (_this2.props.frameRatio) {
136
+ if (newwidth > maxWidth) {
137
+ newwidth = maxWidth;
138
+ newheight = Math.round(newwidth * _this2.props.frameRatio);
139
+ }
140
+ if (newheight > maxHeight) {
141
+ newheight = maxHeight;
142
+ newwidth = Math.round(newheight / _this2.props.frameRatio);
143
+ }
144
+ }
132
145
  return {
133
146
  frameRatio: _this2.props.frameRatio,
134
- y: state.y + 0.5 * (state.height - newheight),
147
+ x: 0.5 * (maxWidth - newwidth),
148
+ y: 0.5 * (maxHeight - newheight),
149
+ width: newwidth,
135
150
  height: newheight
136
151
  };
137
152
  }, function () {
@@ -150,7 +165,10 @@ var ExportSelection = /*#__PURE__*/function (_React$Component) {
150
165
  height: this.state.height + 'px'
151
166
  };
152
167
  return /*#__PURE__*/React.createElement("div", {
153
- className: "export-selection-container"
168
+ className: "export-selection-container",
169
+ ref: function ref(el) {
170
+ _this3.exportContainer = el;
171
+ }
154
172
  }, /*#__PURE__*/React.createElement("div", {
155
173
  className: "export-selection",
156
174
  onContextMenu: MiscUtils.killEvent,
@@ -119,7 +119,8 @@ var LinkFeatureForm = /*#__PURE__*/function (_React$Component) {
119
119
  feature: this.props.feature,
120
120
  geomType: this.props.editConfig.geomType,
121
121
  editConfig: this.props.editConfig,
122
- mapPrefix: this.props.mapPrefix
122
+ mapPrefix: this.props.mapPrefix,
123
+ parentContextId: this.props.parentContextId
123
124
  });
124
125
  } else {
125
126
  this.props.iface.getFeatureById(this.props.editConfig, this.props.featureId, this.props.map.projection, function (result) {
@@ -129,7 +130,8 @@ var LinkFeatureForm = /*#__PURE__*/function (_React$Component) {
129
130
  feature: result,
130
131
  geomType: _this2.props.editConfig.geomType,
131
132
  editConfig: _this2.props.editConfig,
132
- mapPrefix: _this2.props.mapPrefix
133
+ mapPrefix: _this2.props.mapPrefix,
134
+ parentContextId: _this2.props.parentContextId
133
135
  });
134
136
  }
135
137
  });
@@ -145,13 +147,15 @@ var LinkFeatureForm = /*#__PURE__*/function (_React$Component) {
145
147
  geomType: _this2.props.editConfig.geomType,
146
148
  feature: feature,
147
149
  editConfig: _this2.props.editConfig,
148
- mapPrefix: _this2.props.mapPrefix
150
+ mapPrefix: _this2.props.mapPrefix,
151
+ parentContextId: _this2.props.parentContextId
149
152
  });
150
153
  });
151
154
  } else if (this.props.action === 'Pick') {
152
155
  this.props.setEditContext(this.props.editContextId, {
153
156
  editConfig: this.props.editConfig,
154
- mapPrefix: this.props.mapPrefix
157
+ mapPrefix: this.props.mapPrefix,
158
+ parentContextId: this.props.parentContextId
155
159
  });
156
160
  }
157
161
  }
@@ -240,6 +244,7 @@ _defineProperty(LinkFeatureForm, "propTypes", {
240
244
  iface: PropTypes.object,
241
245
  map: PropTypes.object,
242
246
  mapPrefix: PropTypes.string,
247
+ parentContextId: PropTypes.string,
243
248
  pickFilter: PropTypes.func,
244
249
  readOnly: PropTypes.bool,
245
250
  removeLayer: PropTypes.func,
@@ -56,7 +56,7 @@ var OrbitControls3D = /*#__PURE__*/function (_MapControls) {
56
56
  _this.enableDamping = true;
57
57
  _this.dampingFactor = 0.2;
58
58
  _this.keyPanSpeed = 10.0;
59
- _this.maxPolarAngle = Math.PI * 0.5;
59
+ _this.maxPolarAngle = 89 / 180 * Math.PI;
60
60
  _this.mouseButtons = mouseButtons;
61
61
  _this.zoomSpeed = 5;
62
62
  return _this;
@@ -65,10 +65,9 @@ var OrbitControls3D = /*#__PURE__*/function (_MapControls) {
65
65
  return _createClass(OrbitControls3D, [{
66
66
  key: "connect",
67
67
  value: function connect(sceneContext) {
68
- this.domElement = sceneContext.scene.domElement;
69
68
  this.sceneContext = sceneContext;
70
69
  this.enabled = true;
71
- _superPropGet(OrbitControls3D, "connect", this, 3)([]);
70
+ _superPropGet(OrbitControls3D, "connect", this, 3)([sceneContext.scene.domElement]);
72
71
  this.listenToKeyEvents(this.domElement);
73
72
  this.domElement.addEventListener('pointerdown', this.stopAnimations);
74
73
  this.domElement.addEventListener('wheel', this.stopAnimations);
@@ -162,7 +162,7 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
162
162
  var _collectSublayers = function collectSublayers(entry) {
163
163
  var _entry$resource2;
164
164
  var entryParams = LayerUtils.splitLayerUrlParam((_entry$resource2 = entry.resource) !== null && _entry$resource2 !== void 0 ? _entry$resource2 : "");
165
- if (stripQuery(entryParams.url) === groupUrl) {
165
+ if (isEmpty(entry.sublayers) && stripQuery(entryParams.url) === groupUrl) {
166
166
  sublayers[entryParams.name] = entryParams;
167
167
  }
168
168
  (entry.sublayers || []).forEach(_collectSublayers);
@@ -214,10 +214,12 @@ var LayerCatalogWidget = /*#__PURE__*/function (_React$PureComponent) {
214
214
  } else if (sublayerSubset) {
215
215
  var _filterSublayers = function filterSublayers(sublayers) {
216
216
  return sublayers.map(function (sublayer) {
217
- if (sublayer.sublayers) {
218
- return _filterSublayers(sublayer.sublayers);
219
- } else if (sublayer.name in sublayerSubset) {
220
- return _objectSpread(_objectSpread({}, sublayer), sublayerSubset);
217
+ if (sublayer.name in sublayerSubset) {
218
+ return _objectSpread(_objectSpread({}, sublayer), sublayerSubset[sublayer.name]);
219
+ } else if (sublayer.sublayers) {
220
+ return _objectSpread(_objectSpread({}, sublayer), {}, {
221
+ sublayers: _filterSublayers(sublayer.sublayers)
222
+ });
221
223
  } else {
222
224
  return null;
223
225
  }
@@ -248,11 +248,11 @@ var TextInput = /*#__PURE__*/function (_React$Component) {
248
248
  var wrapperClassName = classNames({
249
249
  "TextInput": true,
250
250
  "text-input-wrapper": true,
251
- "text-input-wrapper-multiline": this.props.multiline,
252
251
  "text-input-wrapper-focused": this.state.focus
253
252
  });
254
253
  var preClassName = classNames({
255
254
  "text-input": true,
255
+ "text-input-multiline": this.props.multiline,
256
256
  "text-input-disabled": this.props.disabled,
257
257
  "text-input-readonly": this.props.readOnly || !this.state.curValue,
258
258
  "text-input-invalid": this.props.required && !this.state.curValue
@@ -38,9 +38,11 @@ pre.text-input {
38
38
  flex: 1 1 auto;
39
39
  }
40
40
 
41
-
42
- text-input-wrapper-multiline > pre.text-input {
41
+ pre.text-input.text-input-multiline {
42
+ overflow-x: hidden;
43
43
  white-space: pre-wrap;
44
+ overflow-wrap: break-word;
45
+ word-break: break-word;
44
46
  }
45
47
 
46
48
  pre.text-input[contenteditable="true"] a {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2026.07.07",
3
+ "version": "2026.07.09",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",
@@ -227,7 +227,7 @@ var TimeManager = /*#__PURE__*/function (_React$Component) {
227
227
  }, LocaleUtils.tr("timemanager.displayfeatures")), /*#__PURE__*/React.createElement("option", {
228
228
  value: "layers"
229
229
  }, LocaleUtils.tr("timemanager.displaylayers"))))) : null)));
230
- var timeSpan = _this.state.endTime !== null ? _this.state.endTime.diff(_this.state.startTime) : dayjs().diff(_this.state.startTime);
230
+ var timeSpan = _this.state.endTime.diff(_this.state.startTime);
231
231
  var Timeline = _this.state.timelineMode === 'infinite' ? InfiniteTimeline : FixedTimeline;
232
232
  var filterActive = !isEmpty(_this.props.filter.filterParams) || !!_this.props.filter.filterGeom;
233
233
  var startdate = _this.state.timeData.values.length > 0 ? _this.state.timeData.values[0].hour(0).minute(0).second(0) : null;
@@ -760,7 +760,7 @@ var TimeManager = /*#__PURE__*/function (_React$Component) {
760
760
  timeData: timeData,
761
761
  currentTimestamp: (_state$currentTimesta = state.currentTimestamp) !== null && _state$currentTimesta !== void 0 ? _state$currentTimesta : timeData.values.length > 0 ? +timeData.values[0] : null,
762
762
  startTime: startdate,
763
- endTime: enddate && enddate.year() !== DUMMY_END_DATE.getFullYear() ? enddate : null
763
+ endTime: enddate && enddate.year() !== DUMMY_END_DATE.getFullYear() ? enddate : dayjs()
764
764
  };
765
765
  });
766
766
  this.updateTimeFeatures(timeData);
@@ -784,7 +784,7 @@ var TimeManager = /*#__PURE__*/function (_React$Component) {
784
784
  }
785
785
  return {
786
786
  startTime: startdate,
787
- endTime: enddate && enddate.year() !== DUMMY_END_DATE.getFullYear() ? enddate : null
787
+ endTime: enddate && enddate.year() !== DUMMY_END_DATE.getFullYear() ? enddate : dayjs()
788
788
  };
789
789
  });
790
790
  }
@@ -69,6 +69,18 @@ export default function editing() {
69
69
  contexts: _objectSpread({}, state.contexts),
70
70
  currentContext: state.currentContext === action.contextId ? action.newActiveContextId : state.currentContext
71
71
  };
72
+ var _clearChildContexts = function clearChildContexts(parentId) {
73
+ Object.values(newState.contexts).forEach(function (context) {
74
+ if (context.parentContextId === parentId) {
75
+ _clearChildContexts(context.id);
76
+ delete newState.contexts[context.id];
77
+ if (newState.currentContext === context.id) {
78
+ newState.currentContext = action.newActiveContextId;
79
+ }
80
+ }
81
+ });
82
+ };
83
+ _clearChildContexts(action.contextId);
72
84
  delete newState.contexts[action.contextId];
73
85
  return newState;
74
86
  }