@panoramax/web-viewer 3.2.3-develop-881b0162 → 3.2.3-develop-76d7de04

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.
@@ -63,7 +63,6 @@ Component properties. All of [Basic properties](Basic.md/#Panoramax.components.c
63
63
  | [picture] | <code>string</code> | | The picture ID to display |
64
64
  | [sequence] | <code>string</code> | | The sequence ID of the picture displayed |
65
65
  | [fetchOptions] | <code>object</code> | | Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters)) |
66
- | [users] | <code>Array.&lt;string&gt;</code> | <code>[geovisio]</code> | List of users IDs to use for map display (defaults to general map, identified as "geovisio") |
67
66
  | [mapstyle] | <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. |
68
67
  | [lang] | <code>string</code> | | To override language used for labels. Defaults to using user's preferred languages. |
69
68
  | [raster] | <code>object</code> | | The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster). |
@@ -29,4 +29,5 @@ Component properties.
29
29
  | Name | Type | Default | Description |
30
30
  | --- | --- | --- | --- |
31
31
  | [playing] | <code>boolean</code> | <code>false</code> | Is sequence currently playing ? |
32
+ | [size] | <code>string</code> | <code>&quot;xl&quot;</code> | Group size (md, xl) |
32
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.3-develop-881b0162",
3
+ "version": "3.2.3-develop-76d7de04",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -47,7 +47,6 @@ export default class Editor extends Basic {
47
47
  * @property {string} [picture] The picture ID to display
48
48
  * @property {string} [sequence] The sequence ID of the picture displayed
49
49
  * @property {object} [fetchOptions] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))
50
- * @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as "geovisio")
51
50
  * @property {string|object} [mapstyle] 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.
52
51
  * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.
53
52
  * @property {object} [raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).
@@ -97,6 +96,23 @@ export default class Editor extends Basic {
97
96
  }
98
97
  }
99
98
 
99
+ connectedCallback() {
100
+ if(Array.isArray(this.users) && this.users.length > 0) {
101
+ console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible");
102
+ this.users = [];
103
+ }
104
+ super.connectedCallback();
105
+ }
106
+
107
+ attributeChangedCallback(name, old, value) {
108
+ if(name === "users" && Array.isArray(value) && value.length > 0) {
109
+ console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible");
110
+ }
111
+ else {
112
+ super.attributeChangedCallback(name, old, value);
113
+ }
114
+ }
115
+
100
116
  /** @private */
101
117
  render() {
102
118
  return [this.loader, this._psvContainer, this._mapContainer];
@@ -141,7 +141,12 @@ export default class PhotoViewer extends Basic {
141
141
  picture: this._initParams.getParentPostInit().picture,
142
142
  });
143
143
  this.grid.appendChild(this.legend);
144
- this.grid.appendChild(createWebComp("pnx-widget-player", {slot: "top", _parent: this, class: "pnx-only-psv pnx-print-hidden"}));
144
+ this.grid.appendChild(createWebComp("pnx-widget-player", {
145
+ slot: "top",
146
+ _parent: this,
147
+ class: "pnx-only-psv pnx-print-hidden",
148
+ size: this.isHeightSmall() ? "md": "xl",
149
+ }));
145
150
  }
146
151
  }
147
152
 
@@ -154,7 +154,12 @@ export default class Viewer extends PhotoViewer {
154
154
  picture: this._initParams.getParentPostInit().picture,
155
155
  });
156
156
  this.grid.appendChild(this.legend);
157
- this.grid.appendChild(createWebComp("pnx-widget-player", {slot: "top", _parent: this, class: "pnx-only-psv pnx-print-hidden"}));
157
+ this.grid.appendChild(createWebComp("pnx-widget-player", {
158
+ slot: "top",
159
+ _parent: this,
160
+ class: "pnx-only-psv pnx-print-hidden",
161
+ size: this.isHeightSmall() ? "md": "xl",
162
+ }));
158
163
 
159
164
  this.grid.appendChild(createWebComp("pnx-widget-geosearch", {
160
165
  slot: this.isWidthSmall() ? "top-right" : "top-left",
@@ -30,10 +30,10 @@ export default class ButtonGroup extends LitElement {
30
30
 
31
31
  div.xl { line-height: 38px; font-size: 20px; }
32
32
  div.row.xl { height: 38px; }
33
- div.column.xl { width: 38px;}
33
+ div.column.xl { width: 38px; }
34
34
 
35
- div.row ::slotted(*) { height: 100%; }
36
- div.column ::slotted(*) { width: 100%; }
35
+ div.row ::slotted(*) { height: 100%; min-width: 24px; }
36
+ div.column ::slotted(*) { width: 100%; min-height: 24px; }
37
37
 
38
38
  div.row.xl ::slotted(*) { min-width: 38px; }
39
39
  div.column.xl ::slotted(*) { min-height: 38px; }
@@ -334,6 +334,7 @@ export default class Map extends maplibregl.Map {
334
334
  */
335
335
  async setVisibleUsers(visibleIds = []) {
336
336
  if(typeof visibleIds === "string") { visibleIds = [visibleIds]; }
337
+ else if(visibleIds === null) { visibleIds = []; }
337
338
 
338
339
  // Create any missing user layer
339
340
  await Promise.all(
@@ -45,7 +45,7 @@ PSViewer.useNewAnglesOrder = true;
45
45
 
46
46
  /**
47
47
  * Triggered once when the panorama image has been loaded and the viewer is ready to perform the first render.
48
- * @see [Photo Sphere Viewer documentation](https://photo-sphere-viewer.js.org/guide/events.html#ready)
48
+ * @see {@link https://photo-sphere-viewer.js.org/guide/events.html#ready|Photo Sphere Viewer documentation}
49
49
  * @event Panoramax.components.ui.Photo#ready
50
50
  * @memberof Panoramax.components.ui.Photo
51
51
  * @type {Event}
@@ -23,9 +23,11 @@ export default class Player extends LitElement {
23
23
  * @memberof Panoramax.components.ui.widgets.Player#
24
24
  * @type {Object}
25
25
  * @property {boolean} [playing=false] Is sequence currently playing ?
26
+ * @property {string} [size=xl] Group size (md, xl)
26
27
  */
27
28
  static properties = {
28
29
  playing: {type: Boolean, reflect: true},
30
+ size: {type: String},
29
31
  _activePrev: {state: true},
30
32
  _activePlay: {state: true},
31
33
  _activeNext: {state: true},
@@ -35,6 +37,7 @@ export default class Player extends LitElement {
35
37
  super();
36
38
 
37
39
  this.playing = false;
40
+ this.size = "xl";
38
41
  this._activePrev = true;
39
42
  this._activePlay = true;
40
43
  this._activeNext = true;
@@ -100,7 +103,7 @@ export default class Player extends LitElement {
100
103
  <pnx-button-group
101
104
  id="pnx-widget-player"
102
105
  dir="row"
103
- size="xl"
106
+ size=${this.size}
104
107
  class="pnx-print-hidden"
105
108
  >
106
109
  <pnx-button
@@ -11,6 +11,7 @@ jest.mock("../../../src/components/core/Basic", () => (
11
11
  this._t = { maplibre: {}, psv: {} };
12
12
  }
13
13
  isWidthSmall() { return false; }
14
+ isHeightSmall() { return false; }
14
15
  getSubComponentsNames() {
15
16
  return ["loader", "api"];
16
17
  }
@@ -16,6 +16,7 @@ jest.mock("../../../src/components/core/PhotoViewer", () => (
16
16
  }
17
17
  getAttribute() { return null; }
18
18
  isWidthSmall() { return false; }
19
+ isHeightSmall() { return false; }
19
20
  getSubComponentsNames() {
20
21
  return ["loader", "api", "psv", "grid", "popup", "urlHandler"];
21
22
  }
@@ -25,6 +25,7 @@ exports[`_initWidgets should handle widgets if width is not small 1`] = `
25
25
  Array [
26
26
  <pnx-widget-player
27
27
  class="pnx-only-psv pnx-print-hidden"
28
+ size="xl"
28
29
  slot="top"
29
30
  />,
30
31
  ],
@@ -69,6 +70,7 @@ exports[`_initWidgets should handle widgets if width is small 1`] = `
69
70
  Array [
70
71
  <pnx-widget-player
71
72
  class="pnx-only-psv pnx-print-hidden"
73
+ size="xl"
72
74
  slot="top"
73
75
  />,
74
76
  ],
@@ -25,6 +25,7 @@ exports[`_initWidgets should handle widgets if width is not small 1`] = `
25
25
  Array [
26
26
  <pnx-widget-player
27
27
  class="pnx-only-psv pnx-print-hidden"
28
+ size="xl"
28
29
  slot="top"
29
30
  />,
30
31
  ],
@@ -106,6 +107,7 @@ exports[`_initWidgets should handle widgets if width is small 1`] = `
106
107
  Array [
107
108
  <pnx-widget-player
108
109
  class="pnx-only-psv pnx-print-hidden"
110
+ size="xl"
109
111
  slot="top"
110
112
  />,
111
113
  ],