@panoramax/web-viewer 4.3.1-develop-39b43404 → 4.3.1-develop-768c86eb

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.
@@ -108,6 +108,7 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
108
108
  | [url-parameters] | <code>string</code> | <code>true</code> | Should the component add and update URL query parameters to save viewer state ? |
109
109
  | [keyboard-shortcuts] | <code>string</code> | <code>true</code> | Should keyboard shortcuts be enabled ? Set to "false" to fully disable any keyboard shortcuts. |
110
110
  | [skip-tags-menu-opening] | <code>string</code> | <code>false</code> | Should the "Tags" menu automatically open when you toggle Annotations switch ? Set true to avoid auto-opening. |
111
+ | [share-base-url] | <code>string</code> | | Override the default base URL (current page) for the Share widget. Useful to lead to a public page when viewer is used in a closed tool. |
111
112
 
112
113
  <a name="Panoramax.components.core.PhotoViewer+onceReady"></a>
113
114
 
@@ -125,6 +125,7 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
125
125
  | [map-style] | <code>string</code> \| <code>object</code> | | The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles. |
126
126
  | [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
127
127
  | [skip-tags-menu-opening] | <code>string</code> | <code>false</code> | Should the "Tags" menu automatically open when you toggle Annotations switch ? Set true to avoid auto-opening. |
128
+ | [share-base-url] | <code>string</code> | | Override the default base URL (current page) for the Share widget. Useful to lead to a public page when viewer is used in a closed tool. |
128
129
 
129
130
  <a name="Panoramax.components.core.Viewer+onceReady"></a>
130
131
 
@@ -4,6 +4,11 @@
4
4
  **Kind**: static class of <code>Panoramax.components.menus</code>
5
5
  **Extends**: <code>[lit.LitElement](https://lit.dev/docs/api/LitElement/)</code>
6
6
  **Element**: pnx-share-menu
7
+
8
+ * [.ShareMenu](#Panoramax.components.menus.ShareMenu) ⇐ <code>[lit.LitElement](https://lit.dev/docs/api/LitElement/)</code>
9
+ * [new ShareMenu()](#new_Panoramax.components.menus.ShareMenu_new)
10
+ * [.properties](#Panoramax.components.menus.ShareMenu+properties) : <code>Object</code>
11
+
7
12
  <a name="new_Panoramax.components.menus.ShareMenu_new"></a>
8
13
 
9
14
  ### new ShareMenu()
@@ -13,3 +18,15 @@ Share Menu displays links for quick picture sharing.
13
18
  ```html
14
19
  <pnx-share-menu ._parent=${viewer} />
15
20
  ```
21
+ <a name="Panoramax.components.menus.ShareMenu+properties"></a>
22
+
23
+ ### shareMenu.properties : <code>Object</code>
24
+ Component properties.
25
+
26
+ **Kind**: instance property of [<code>ShareMenu</code>](#Panoramax.components.menus.ShareMenu)
27
+ **Properties**
28
+
29
+ | Name | Type | Description |
30
+ | --- | --- | --- |
31
+ | [base-url] | <code>string</code> | Override the default base URL (current page) |
32
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "4.3.1-develop-39b43404",
3
+ "version": "4.3.1-develop-768c86eb",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -88,6 +88,7 @@ export default class PhotoViewer extends Basic {
88
88
  * @property {string} [url-parameters=true] Should the component add and update URL query parameters to save viewer state ?
89
89
  * @property {string} [keyboard-shortcuts=true] Should keyboard shortcuts be enabled ? Set to "false" to fully disable any keyboard shortcuts.
90
90
  * @property {string} [skip-tags-menu-opening=false] Should the "Tags" menu automatically open when you toggle Annotations switch ? Set true to avoid auto-opening.
91
+ * @property {string} [share-base-url] Override the default base URL (current page) for the Share widget. Useful to lead to a public page when viewer is used in a closed tool.
91
92
  */
92
93
  static properties = {
93
94
  "psv-options": {converter: Basic.GetJSONConverter()},
@@ -96,6 +97,7 @@ export default class PhotoViewer extends Basic {
96
97
  "keyboard-shortcuts": {type: String},
97
98
  tabindex: {type: Number},
98
99
  "skip-tags-menu-opening": {type: String},
100
+ "share-base-url": {type: String},
99
101
  ...Basic.properties
100
102
  };
101
103
 
@@ -107,6 +109,7 @@ export default class PhotoViewer extends Basic {
107
109
  this["url-parameters"] = this.getAttribute("url-parameters") || true;
108
110
  this["keyboard-shortcuts"] = this.getAttribute("keyboard-shortcuts") || true;
109
111
  this["skip-tags-menu-opening"] = (this.getAttribute("skip-tags-menu-opening") || "false") !== "true";
112
+ this["share-base-url"] = this.getAttribute("share-base-url") || null;
110
113
  this.widgets = this.getAttribute("widgets") || "true";
111
114
 
112
115
  // Init DOM containers
@@ -516,7 +519,7 @@ export default class PhotoViewer extends Basic {
516
519
 
517
520
  /** @private */
518
521
  _showShareOptions() {
519
- this.setPopup(true, [createWebComp("pnx-share-menu", {_parent: this})]);
522
+ this.setPopup(true, [createWebComp("pnx-share-menu", {_parent: this, "base-url": this["share-base-url"]})]);
520
523
  }
521
524
 
522
525
  /** @private */
@@ -103,6 +103,7 @@ export default class Viewer extends PhotoViewer {
103
103
  * @property {string|object} [map-style] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.
104
104
  * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
105
105
  * @property {string} [skip-tags-menu-opening=false] Should the "Tags" menu automatically open when you toggle Annotations switch ? Set true to avoid auto-opening.
106
+ * @property {string} [share-base-url] Override the default base URL (current page) for the Share widget. Useful to lead to a public page when viewer is used in a closed tool.
106
107
  */
107
108
  static properties = {
108
109
  "map-options": {converter: PhotoViewer.GetJSONConverter()},
@@ -34,9 +34,15 @@ export default class ShareMenu extends LitElement {
34
34
  }
35
35
  ` ];
36
36
 
37
- /** @private */
37
+ /**
38
+ * Component properties.
39
+ * @memberof Panoramax.components.menus.ShareMenu#
40
+ * @type {Object}
41
+ * @property {string} [base-url] Override the default base URL (current page)
42
+ */
38
43
  static properties = {
39
44
  _url: {state: true},
45
+ "base-url": {type: String},
40
46
  };
41
47
 
42
48
  constructor() {
@@ -55,7 +61,7 @@ export default class ShareMenu extends LitElement {
55
61
 
56
62
  /** @private */
57
63
  _onUrlChange() {
58
- const baseUrl = window.location.href.replace(/\/$/, "");
64
+ const baseUrl = (this["base-url"] || window.location.href).replace(/\/$/, "");
59
65
  this._url = this._parent?.urlHandler?.nextShortLink(baseUrl) || baseUrl;
60
66
  }
61
67