@panoramax/web-viewer 5.3.0-develop-4e1ca8c3 → 5.3.0-develop-a0d7774d

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.
@@ -9,7 +9,7 @@ import BasicStyles from "./Basic.css" with { type: "css" };
9
9
  document.adoptedStyleSheets.push(AtkinsonStyles);
10
10
  document.adoptedStyleSheets.push(BasicStyles);
11
11
 
12
- const __COMMIT_HASH__ = "4e1ca8c";
12
+ const __COMMIT_HASH__ = "a0d7774";
13
13
  const __PACKAGE_VERSION__ = "5.3.0";
14
14
  const __PACKAGE_ISSUES_URL__ = "https://gitlab.com/panoramax/clients/web-viewer/-/work_items";
15
15
 
@@ -73,8 +73,10 @@ export default class SemanticsList extends LitElement {
73
73
  onceParentAvailable(this).then(() => {
74
74
  this._parent.psv?.addEventListener("picture-loaded", this._onPicChange.bind(this));
75
75
  this._parent.psv?.addEventListener("annotation-focused", e => this.showAnnotation(e.detail.annotationId));
76
- this._parent.psv?.addEventListener("annotations-unfocused", () => this._onListItemClick(null));
77
- this._parent.psv?.addEventListener("semantics-unfocused", () => this._onListItemClick(null));
76
+ this._parent.psv?.addEventListener("annotations-unfocused", e => {
77
+ if(e.detail.source === "user-click") { delete this._prevPsvView; }
78
+ this._onListItemClick(null);
79
+ });
78
80
 
79
81
  const selectedAnnots = this._parent.psv.getSelectedAnnotations();
80
82
  if(selectedAnnots.length > 0) {
@@ -559,7 +559,14 @@ export default class Photo extends PSViewer {
559
559
  // Check if there is no blocked focus on
560
560
  const ba = this.getSelectedAnnotations().find(a => this._myMarkers.markers["annotation-"+a]?.config?.data?.blockFocus);
561
561
  if(ba) { return; }
562
- this.focusOnAnnotation(e.marker.data.id);
562
+
563
+ // Check if clicked annotation is not the selected one
564
+ if(this.getSelectedAnnotations().find(a => e.marker.id.endsWith(a))) {
565
+ // Skip PSV move due to semantics list
566
+ this.unfocusAnnotation(false, false, "user-click");
567
+ } else {
568
+ this.focusOnAnnotation(e.marker.data.id);
569
+ }
563
570
  }
564
571
  }
565
572
 
@@ -1206,10 +1213,11 @@ export default class Photo extends PSViewer {
1206
1213
  data: {
1207
1214
  selected: true,
1208
1215
  blockFocus
1209
- }
1216
+ },
1217
+ tooltip: this._parent._t.pnx.semantics_annotation_tooltip_close,
1210
1218
  });
1211
1219
  this._myMarkers.gotoMarker(annotationId, 0);
1212
- this.zoom(65);
1220
+ this.zoom(Math.max(65, this.getZoomLevel()));
1213
1221
 
1214
1222
  /**
1215
1223
  * Event launched on annotation focus
@@ -1228,8 +1236,9 @@ export default class Photo extends PSViewer {
1228
1236
  * @memberof Panoramax.components.ui.Photo#
1229
1237
  * @param {boolean} [skipEvent=false] Set to true to avoid launching annotations-unfocused event
1230
1238
  * @param {boolean} [skipBlocked=false] Set to true to not unfocus blocked annotations
1239
+ * @param {string} [source] Set which event initiated this call ("user-click" for example)
1231
1240
  */
1232
- unfocusAnnotation(skipEvent = false, skipBlocked = false) {
1241
+ unfocusAnnotation(skipEvent = false, skipBlocked = false, source = null) {
1233
1242
  const selectedAnnotations = this.getSelectedAnnotations();
1234
1243
 
1235
1244
  if(selectedAnnotations.length > 0) {
@@ -1250,7 +1259,8 @@ export default class Photo extends PSViewer {
1250
1259
  data: {
1251
1260
  selected: false,
1252
1261
  blockFocus: false,
1253
- }
1262
+ },
1263
+ tooltip: this._parent._t.pnx.semantics_annotation_tooltip,
1254
1264
  });
1255
1265
  });
1256
1266
 
@@ -1258,9 +1268,10 @@ export default class Photo extends PSViewer {
1258
1268
  /**
1259
1269
  * Event for pictures annotation unfocus
1260
1270
  * @event Panoramax.components.ui.Photo#annotations-unfocused
1261
- * @type {Event}
1271
+ * @type {CustomEvent}
1272
+ * @property {string} detail.source The original source event type (user-click, null)
1262
1273
  */
1263
- this.dispatchEvent(new Event("annotations-unfocused"));
1274
+ this.dispatchEvent(new CustomEvent("annotations-unfocused", { detail: { source }}));
1264
1275
  }
1265
1276
  }
1266
1277
  }
@@ -219,6 +219,7 @@
219
219
  "semantics_features_default_title": "Tag {nb}",
220
220
  "semantics_features_subtitle": "{nb} associated properties",
221
221
  "semantics_annotation_tooltip": "Click to see details",
222
+ "semantics_annotation_tooltip_close": "Click to unselect",
222
223
  "semantics_show_all_tags": "Show all tags",
223
224
  "semantics_hide_all_tags": "Hide all tags",
224
225
  "semantics_key": "Key",
@@ -219,6 +219,7 @@
219
219
  "semantics_features_default_title": "Tag {nb}",
220
220
  "semantics_features_subtitle": "{nb} attributs associés",
221
221
  "semantics_annotation_tooltip": "Cliquez pour voir les détails",
222
+ "semantics_annotation_tooltip_close": "Cliquez pour désélectionner",
222
223
  "semantics_show_all_tags": "Voir tous les attributs",
223
224
  "semantics_hide_all_tags": "Masquer les attributs",
224
225
  "semantics_key": "Clé",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "5.3.0-develop-4e1ca8c3",
3
+ "version": "5.3.0-develop-a0d7774d",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "./build/cjs/index.js",
6
6
  "module": "./build/esm/index.js",