@panoramax/web-viewer 4.0.3-develop-a19dd3c4 → 4.0.3-develop-05bbd331

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.
@@ -0,0 +1,32 @@
1
+ <a name="Panoramax.components.ui.widgets.PictureLegendActions"></a>
2
+
3
+ ## Panoramax.components.ui.widgets.PictureLegendActions ⇐ <code>[lit.LitElement](https://lit.dev/docs/api/LitElement/)</code>
4
+ **Kind**: static class of <code>Panoramax.components.ui.widgets</code>
5
+ **Extends**: <code>[lit.LitElement](https://lit.dev/docs/api/LitElement/)</code>
6
+ **Element**: pnx-picture-legend-actions
7
+
8
+ * [.PictureLegendActions](#Panoramax.components.ui.widgets.PictureLegendActions) ⇐ <code>[lit.LitElement](https://lit.dev/docs/api/LitElement/)</code>
9
+ * [new PictureLegendActions()](#new_Panoramax.components.ui.widgets.PictureLegendActions_new)
10
+ * [.properties](#Panoramax.components.ui.widgets.PictureLegendActions+properties) : <code>Object</code>
11
+
12
+ <a name="new_Panoramax.components.ui.widgets.PictureLegendActions_new"></a>
13
+
14
+ ### new PictureLegendActions()
15
+ Picture Legend Actions is a menu showing up complementary actions for picture legend.
16
+
17
+ **Example**
18
+ ```html
19
+ <pnx-picture-legend-actions _parent=${viewer} />
20
+ ```
21
+ <a name="Panoramax.components.ui.widgets.PictureLegendActions+properties"></a>
22
+
23
+ ### pictureLegendActions.properties : <code>Object</code>
24
+ Component properties.
25
+
26
+ **Kind**: instance property of [<code>PictureLegendActions</code>](#Panoramax.components.ui.widgets.PictureLegendActions)
27
+ **Properties**
28
+
29
+ | Name | Type | Default | Description |
30
+ | --- | --- | --- | --- |
31
+ | [full] | <code>boolean</code> | <code>false</code> | Show advanced actions |
32
+
package/docs/reference.md CHANGED
@@ -71,6 +71,7 @@ More complex UI components (but not menus):
71
71
  - [MapFiltersButton](./reference/components/ui/widgets/MapFiltersButton.md) : a togglable map filters button & menu.
72
72
  - [MapLayersButton](./reference/components/ui/widgets/MapLayersButton.md) : a togglable map layers button & menu.
73
73
  - [OSMEditors](./reference/components/ui/widgets/OSMEditors.md) : shortcuts for OpenStreetMap editing tools.
74
+ - [PictureLegendActions](./reference/components/ui/widgets/PictureLegendActions.md) : various actions from picture legend.
74
75
  - [Player](./reference/components/ui/widgets/Player.md) : the previous/next/play/pause toolbar.
75
76
  - [Zoom](./reference/components/ui/widgets/Zoom.md) : the +/- zoom toolbar.
76
77
 
package/mkdocs.yml CHANGED
@@ -84,6 +84,7 @@ nav:
84
84
  - MapFiltersButton: 'reference/components/ui/widgets/MapFiltersButton.md'
85
85
  - MapLayersButton: 'reference/components/ui/widgets/MapLayersButton.md'
86
86
  - OSMEditors: 'reference/components/ui/widgets/OSMEditors.md'
87
+ - PictureLegendActions: 'reference/components/ui/widgets/PictureLegendActions.md'
87
88
  - Player: 'reference/components/ui/widgets/Player.md'
88
89
  - Zoom: 'reference/components/ui/widgets/Zoom.md'
89
90
  - Button: 'reference/components/ui/Button.md'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "4.0.3-develop-a19dd3c4",
3
+ "version": "4.0.3-develop-05bbd331",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -34,7 +34,7 @@
34
34
  --widget-font: var(--grey-dark);
35
35
  --widget-font-active: var(--white);
36
36
  --widget-font-direct: var(--blue);
37
- --widget-font-warn: #FF8F00;
37
+ --widget-font-warn: #BF360C;
38
38
  --font-family: "Atkinson Hyperlegible Next", sans-serif;
39
39
  overscroll-behavior-y: contain;
40
40
  }
@@ -47,6 +47,11 @@ export default class PictureLegend extends LitElement {
47
47
  justify-content: space-between;
48
48
  }
49
49
 
50
+ .headline-buttons {
51
+ display: flex;
52
+ gap: 5px;
53
+ }
54
+
50
55
  /* Address line */
51
56
  #pic-legend-addr {
52
57
  line-height: 1.2em;
@@ -211,14 +216,22 @@ export default class PictureLegend extends LitElement {
211
216
  ${this._addr?.length > 0 ? this._addr : html`<span class="pnx-placeholder-loading">&nbsp;</span>`}
212
217
  </div>
213
218
 
214
- <pnx-button
215
- title=${this._parent?._t.pnx.share}
216
- size="sm"
217
- @click=${() => this._parent._showShareOptions()}
218
- class=${hiddenExpanded}
219
- >
220
- ${fa(faShareNodes)}
221
- </pnx-button>
219
+ <div class="headline-buttons">
220
+ <pnx-button
221
+ size="sm"
222
+ class=${hiddenExpanded}
223
+ title=${this._parent?._t.pnx.share}
224
+ @click=${() => this._parent._showShareOptions()}
225
+ >
226
+ ${fa(faShareNodes)}
227
+ </pnx-button>
228
+
229
+ <pnx-picture-legend-actions
230
+ @click=${e => e.stopPropagation()}
231
+ ._parent=${this._parent}
232
+ ?full=${this._expanded}
233
+ ></pnx-picture-legend-actions>
234
+ </div>
222
235
  </div>
223
236
 
224
237
  <div id="pic-legend-info" class=${hiddenExpanded}>
@@ -1,13 +1,10 @@
1
- import { LitElement, css, html, nothing } from "lit";
1
+ import { LitElement, css, html } from "lit";
2
2
  import { fa } from "../../utils/widgets";
3
3
  import { faSvg, textarea, titles, input } from "../styles";
4
4
  import { faMap } from "@fortawesome/free-solid-svg-icons/faMap";
5
5
  import { faCircleInfo } from "@fortawesome/free-solid-svg-icons/faCircleInfo";
6
6
  import { faShareAlt } from "@fortawesome/free-solid-svg-icons/faShareAlt";
7
7
  import { faLink } from "@fortawesome/free-solid-svg-icons/faLink";
8
- import { faFileDownload } from "@fortawesome/free-solid-svg-icons/faFileDownload";
9
- import { faPrint } from "@fortawesome/free-solid-svg-icons/faPrint";
10
- import { faRssSquare } from "@fortawesome/free-solid-svg-icons/faRssSquare";
11
8
 
12
9
  /**
13
10
  * Share Menu displays links for quick picture sharing.
@@ -28,16 +25,6 @@ export default class ShareMenu extends LitElement {
28
25
  .links {
29
26
  display: flex;
30
27
  gap: 5px;
31
- align-items: center;
32
- margin-bottom: 10px;
33
- }
34
- .cta-links {
35
- display: flex;
36
- flex-wrap: nowrap;
37
- gap: 5px;
38
- }
39
- .cta-links pnx-link-button {
40
- flex: 1;
41
28
  }
42
29
  .embed {
43
30
  display: flex;
@@ -50,7 +37,6 @@ export default class ShareMenu extends LitElement {
50
37
  /** @private */
51
38
  static properties = {
52
39
  _url: {state: true},
53
- _meta: { state: true },
54
40
  };
55
41
 
56
42
  constructor() {
@@ -64,11 +50,6 @@ export default class ShareMenu extends LitElement {
64
50
  this._parent?.onceReady().then(() => {
65
51
  this._onUrlChange();
66
52
  this._parent.urlHandler.addEventListener("url-changed", this._onUrlChange.bind(this));
67
-
68
- this._meta = this._parent.psv.getPictureMetadata();
69
- this._parent.psv.addEventListener("picture-loaded", () => {
70
- this._meta = this._parent.psv.getPictureMetadata();
71
- });
72
53
  });
73
54
  }
74
55
 
@@ -78,12 +59,6 @@ export default class ShareMenu extends LitElement {
78
59
  this._url = this._parent?.urlHandler?.nextShortLink(baseUrl) || baseUrl;
79
60
  }
80
61
 
81
- /** @private */
82
- _onPrint() {
83
- this._parent?.setPopup(false);
84
- window.print();
85
- }
86
-
87
62
  /** @private */
88
63
  render() {
89
64
  const iframe = `<iframe src="${this._url}" style="border: none; width: 500px; height: 300px"></iframe>`;
@@ -91,36 +66,12 @@ export default class ShareMenu extends LitElement {
91
66
  return html`
92
67
  <h4>${fa(faShareAlt)} ${this._parent?._t.pnx.share}</h4>
93
68
  <pnx-tabs>
94
- <h4 slot="title">${fa(faLink)} ${this._parent?._t.pnx.share_picture}</h4>
69
+ <h4 slot="title">${fa(faLink)} ${this._parent?._t.pnx.share_page}</h4>
95
70
  <div slot="content">
96
71
  <div class="links">
97
- <div>${this._parent?._t.pnx.share_page}</div>
98
72
  <input type="text" readonly value=${this._url} style="flex: 2" />
99
73
  <pnx-copy-button ._t=${this._parent?._t} text=${this._url}></pnx-copy-button>
100
74
  </div>
101
- <div class="cta-links">
102
- <pnx-link-button
103
- download
104
- target="_blank"
105
- href=${this._meta?.panorama?.hdUrl}
106
- @click=${this._closeGroup}
107
- >${fa(faFileDownload)} ${this._parent?._t.pnx.share_image}</pnx-link-button>
108
-
109
- ${this._parent.isWidthSmall() ? nothing : html`<pnx-link-button @click=${this._onPrint}>
110
- ${fa(faPrint)} ${this._parent?._t.pnx.share_print}
111
- </pnx-link-button>`}
112
-
113
- ${this._parent?.api?.getRSSURL() && html`
114
- <pnx-link-button
115
- target="_blank"
116
- href=${this._parent?.api.getRSSURL(this._parent?.map?.getBounds?.())}
117
- title=${this._parent?._t.pnx.share_rss_title}
118
- @click=${this._closeGroup}
119
- >
120
- ${fa(faRssSquare)} ${this._parent?._t.pnx.share_rss}
121
- </pnx-link-button>
122
- `}
123
- </div>
124
75
  </div>
125
76
 
126
77
  <h4 slot="title">${fa(faMap)} ${this._parent?._t.pnx.share_embed}</h4>
@@ -130,7 +130,7 @@ export const btn = css`
130
130
  gap: 5px;
131
131
  position: relative;
132
132
  width: 100%;
133
- max-height: 100%;
133
+ height: 100%;
134
134
  min-width: 26px;
135
135
  }
136
136
 
@@ -0,0 +1,99 @@
1
+ import { LitElement, html, nothing, css } from "lit";
2
+ import { fa } from "../../../utils/widgets";
3
+ import { faEllipsisV } from "@fortawesome/free-solid-svg-icons/faEllipsisV";
4
+ import { noprint } from "../../styles";
5
+
6
+ /**
7
+ * Picture Legend Actions is a menu showing up complementary actions for picture legend.
8
+ * @class Panoramax.components.ui.widgets.PictureLegendActions
9
+ * @element pnx-picture-legend-actions
10
+ * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
11
+ * @example
12
+ * ```html
13
+ * <pnx-picture-legend-actions _parent=${viewer} />
14
+ * ```
15
+ */
16
+ export default class PictureLegendActions extends LitElement {
17
+ /** @private */
18
+ static styles = [ noprint, css`
19
+ pnx-togglable-group::part(menu) {
20
+ border-radius: 5px;
21
+ min-width: unset;
22
+ }
23
+ `];
24
+
25
+ /**
26
+ * Component properties.
27
+ * @memberof Panoramax.components.ui.widgets.PictureLegendActions#
28
+ * @type {Object}
29
+ * @property {boolean} [full=false] Show advanced actions
30
+ */
31
+ static properties = {
32
+ full: { type: Boolean },
33
+ _meta: { state: true },
34
+ };
35
+
36
+ constructor() {
37
+ super();
38
+ this.full = false;
39
+ }
40
+
41
+ /** @private */
42
+ connectedCallback() {
43
+ super.connectedCallback();
44
+
45
+ this._parent?.onceReady().then(() => {
46
+ this._meta = this._parent.psv.getPictureMetadata();
47
+ this._parent.psv.addEventListener("picture-loaded", () => {
48
+ this._meta = this._parent.psv.getPictureMetadata();
49
+ });
50
+ });
51
+ }
52
+
53
+ /** @private */
54
+ _onPrint() {
55
+ this._closeGroup();
56
+ window.print();
57
+ }
58
+
59
+ /** @private */
60
+ _closeGroup() {
61
+ this.renderRoot.querySelector("#pic-legend-headline-menu").close();
62
+ }
63
+
64
+ /** @private */
65
+ render() {
66
+ return html`<pnx-togglable-group padded="false" id="pic-legend-headline-menu" ._parent=${this._parent}>
67
+ <pnx-button slot="button" kind="inline">${fa(faEllipsisV)}</pnx-button>
68
+ <pnx-list-group class="pnx-print-hidden" @click=${this._closeMenu}>
69
+ ${this._meta ? html`<pnx-copy-button ._t=${this._parent?._t} text=${this._meta.id} unstyled>
70
+ ${this._parent?._t.pnx.metadata_general_copy_picid}
71
+ </pnx-copy-button>` : nothing}
72
+
73
+ <a
74
+ download
75
+ target="_blank"
76
+ href=${this._meta?.panorama?.hdUrl}
77
+ @click=${this._closeGroup}
78
+ >${this._parent?._t.pnx.share_image}</a>
79
+
80
+ ${this._parent.isWidthSmall() ? nothing : html`<button @click=${this._onPrint}>
81
+ ${this._parent?._t.pnx.share_print}
82
+ </button>`}
83
+
84
+ ${this._parent?.api?.getRSSURL() && html`
85
+ <a
86
+ target="_blank"
87
+ href=${this._parent?.api.getRSSURL(this._parent?.map?.getBounds?.())}
88
+ title=${this._parent?._t.pnx.share_rss_title}
89
+ @click=${this._closeGroup}
90
+ >
91
+ ${this._parent?._t.pnx.share_rss}
92
+ </a>
93
+ `}
94
+ </pnx-list-group>
95
+ </pnx-togglable-group>`;
96
+ }
97
+ }
98
+
99
+ customElements.define("pnx-picture-legend-actions", PictureLegendActions);
@@ -9,5 +9,6 @@ export {default as Legend} from "./Legend";
9
9
  export {default as MapFiltersButton} from "./MapFiltersButton";
10
10
  export {default as MapLayersButton} from "./MapLayersButton";
11
11
  export {default as OSMEditors} from "./OSMEditors";
12
+ export {default as PictureLegendActions} from "./PictureLegendActions";
12
13
  export {default as Player} from "./Player";
13
14
  export {default as Zoom} from "./Zoom";
@@ -33,7 +33,6 @@
33
33
  "share": "Share",
34
34
  "share_links": "Links",
35
35
  "share_page": "Link to this picture",
36
- "share_picture": "Picture",
37
36
  "share_image": "HD Image",
38
37
  "share_rss": "RSS feed",
39
38
  "share_rss_title": "RSS feed of new sequences in the currently visible map area",
@@ -31,7 +31,6 @@
31
31
  "search_address": "Rechercher une adresse, ville…",
32
32
  "search_user": "Rechercher un nom d'utilisateur…",
33
33
  "share": "Partager",
34
- "share_picture": "Photo",
35
34
  "share_links": "Liens utiles",
36
35
  "share_page": "Lien de la photo",
37
36
  "share_image": "Image HD",