qwc2 2026.7.8 → 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.
@@ -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,
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwc2",
3
- "version": "2026.07.08",
3
+ "version": "2026.07.09",
4
4
  "description": "QGIS Web Client",
5
5
  "author": "Sourcepole AG",
6
6
  "license": "BSD-2-Clause",