@panoramax/web-viewer 5.0.0-develop-d26305dd → 5.0.0-develop-be5ba1a7

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.
Files changed (153) hide show
  1. package/build/cjs/index.js +1 -1
  2. package/build/cjs/index_photoviewer.js +1 -1
  3. package/build/esm/components/core/Basic.js +1 -1
  4. package/build/esm/translations/el.json +92 -1
  5. package/package.json +1 -1
  6. package/build/bundle.cjs +0 -3399
  7. package/build/bundle.cjs.map +0 -1
  8. package/build/bundle_photoviewer.cjs +0 -2510
  9. package/build/bundle_photoviewer.cjs.map +0 -1
  10. package/build/components/core/Basic.css +0 -56
  11. package/build/components/core/Basic.js +0 -378
  12. package/build/components/core/CoverageMap.css +0 -10
  13. package/build/components/core/CoverageMap.js +0 -169
  14. package/build/components/core/Editor.css +0 -33
  15. package/build/components/core/Editor.js +0 -398
  16. package/build/components/core/PhotoViewer.css +0 -70
  17. package/build/components/core/PhotoViewer.js +0 -650
  18. package/build/components/core/Viewer.css +0 -130
  19. package/build/components/core/Viewer.js +0 -711
  20. package/build/components/core/index.js +0 -10
  21. package/build/components/index.js +0 -11
  22. package/build/components/index_photoviewer.js +0 -6
  23. package/build/components/layout/BottomDrawer.js +0 -258
  24. package/build/components/layout/CorneredGrid.js +0 -143
  25. package/build/components/layout/Mini.js +0 -121
  26. package/build/components/layout/Tabs.js +0 -140
  27. package/build/components/layout/index.js +0 -9
  28. package/build/components/menus/LocationPrecisionDoc.js +0 -42
  29. package/build/components/menus/MapBackground.js +0 -110
  30. package/build/components/menus/MapFilters.js +0 -567
  31. package/build/components/menus/MapLayers.js +0 -238
  32. package/build/components/menus/MapLegend.js +0 -68
  33. package/build/components/menus/MiniPictureLegend.js +0 -73
  34. package/build/components/menus/PictureLegend.js +0 -379
  35. package/build/components/menus/PictureMetadata.js +0 -380
  36. package/build/components/menus/PlayerOptions.js +0 -93
  37. package/build/components/menus/QualityScoreDoc.js +0 -42
  38. package/build/components/menus/ReportForm.js +0 -132
  39. package/build/components/menus/SemanticsDoc.js +0 -38
  40. package/build/components/menus/SemanticsDownload.js +0 -33
  41. package/build/components/menus/SemanticsFilters.js +0 -153
  42. package/build/components/menus/SemanticsList.js +0 -413
  43. package/build/components/menus/SemanticsMetadata.js +0 -368
  44. package/build/components/menus/Share.js +0 -105
  45. package/build/components/menus/index.js +0 -22
  46. package/build/components/menus/index_photoviewer.js +0 -11
  47. package/build/components/styles.js +0 -557
  48. package/build/components/ui/AnnotationsSwitch.js +0 -159
  49. package/build/components/ui/Button.js +0 -77
  50. package/build/components/ui/ButtonGroup.css +0 -59
  51. package/build/components/ui/ButtonGroup.js +0 -69
  52. package/build/components/ui/CopyButton.js +0 -110
  53. package/build/components/ui/Grade.js +0 -54
  54. package/build/components/ui/GradeFilter.js +0 -122
  55. package/build/components/ui/IconSwitch.js +0 -193
  56. package/build/components/ui/LinkButton.js +0 -67
  57. package/build/components/ui/ListGroup.js +0 -66
  58. package/build/components/ui/ListItem.js +0 -90
  59. package/build/components/ui/Loader.js +0 -203
  60. package/build/components/ui/Map.css +0 -63
  61. package/build/components/ui/Map.js +0 -853
  62. package/build/components/ui/MapMore.js +0 -175
  63. package/build/components/ui/Photo.css +0 -50
  64. package/build/components/ui/Photo.js +0 -1502
  65. package/build/components/ui/Popup.js +0 -145
  66. package/build/components/ui/ProgressBar.js +0 -104
  67. package/build/components/ui/QualityScore.js +0 -147
  68. package/build/components/ui/SearchBar.js +0 -374
  69. package/build/components/ui/SemanticsEditor.js +0 -191
  70. package/build/components/ui/SemanticsTable.js +0 -88
  71. package/build/components/ui/Switch.js +0 -139
  72. package/build/components/ui/TogglableGroup.js +0 -157
  73. package/build/components/ui/index.js +0 -29
  74. package/build/components/ui/index_photoviewer.js +0 -21
  75. package/build/components/ui/widgets/CopyCoordinates.js +0 -75
  76. package/build/components/ui/widgets/GeoSearch.css +0 -21
  77. package/build/components/ui/widgets/GeoSearch.js +0 -150
  78. package/build/components/ui/widgets/Legend.js +0 -190
  79. package/build/components/ui/widgets/LevelSelect.css +0 -51
  80. package/build/components/ui/widgets/LevelSelect.js +0 -143
  81. package/build/components/ui/widgets/MapFiltersButton.js +0 -114
  82. package/build/components/ui/widgets/MapLayersButton.js +0 -79
  83. package/build/components/ui/widgets/OSMEditors.js +0 -155
  84. package/build/components/ui/widgets/PictureLegendActions.js +0 -99
  85. package/build/components/ui/widgets/Player.css +0 -7
  86. package/build/components/ui/widgets/Player.js +0 -154
  87. package/build/components/ui/widgets/SemanticsFiltersButton.js +0 -65
  88. package/build/components/ui/widgets/Zoom.js +0 -84
  89. package/build/components/ui/widgets/index.js +0 -16
  90. package/build/components/ui/widgets/index_photoviewer.js +0 -7
  91. package/build/img/arrow_360.svg +0 -14
  92. package/build/img/arrow_flat.svg +0 -11
  93. package/build/img/arrow_triangle.svg +0 -9
  94. package/build/img/arrow_turn.svg +0 -8
  95. package/build/img/bg_aerial.jpg +0 -0
  96. package/build/img/bg_streets.jpg +0 -0
  97. package/build/img/loader_base.jpg +0 -0
  98. package/build/img/logo_dead.svg +0 -91
  99. package/build/img/marker.svg +0 -17
  100. package/build/img/marker_blue.svg +0 -20
  101. package/build/img/osm.svg +0 -49
  102. package/build/img/panoramax.svg +0 -13
  103. package/build/img/switch_big.svg +0 -54
  104. package/build/img/switch_mini.svg +0 -48
  105. package/build/img/wd.svg +0 -1
  106. package/build/index_photoviewer.js +0 -4
  107. package/build/package.json +0 -148
  108. package/build/servers.js +0 -14
  109. package/build/translations/ar.json +0 -1
  110. package/build/translations/be.json +0 -257
  111. package/build/translations/br.json +0 -81
  112. package/build/translations/cy.json +0 -117
  113. package/build/translations/da.json +0 -300
  114. package/build/translations/de.json +0 -309
  115. package/build/translations/en.json +0 -294
  116. package/build/translations/eo.json +0 -235
  117. package/build/translations/es.json +0 -292
  118. package/build/translations/fi.json +0 -1
  119. package/build/translations/fr.json +0 -294
  120. package/build/translations/hr.json +0 -294
  121. package/build/translations/hu.json +0 -294
  122. package/build/translations/it.json +0 -306
  123. package/build/translations/ja.json +0 -182
  124. package/build/translations/ko.json +0 -1
  125. package/build/translations/nl.json +0 -305
  126. package/build/translations/nn.json +0 -1
  127. package/build/translations/pl.json +0 -169
  128. package/build/translations/pt.json +0 -296
  129. package/build/translations/pt_BR.json +0 -304
  130. package/build/translations/sv.json +0 -182
  131. package/build/translations/ti.json +0 -9
  132. package/build/translations/tr.json +0 -297
  133. package/build/translations/uk.json +0 -268
  134. package/build/translations/zh_Hant.json +0 -309
  135. package/build/utils/API.js +0 -928
  136. package/build/utils/InitParameters.js +0 -521
  137. package/build/utils/MapStyleComposer.js +0 -889
  138. package/build/utils/PanoraMapProtocol.js +0 -49
  139. package/build/utils/PhotoAdapter.js +0 -49
  140. package/build/utils/PresetsManager.js +0 -148
  141. package/build/utils/SemanticsMapProtocol.js +0 -144
  142. package/build/utils/URLHandler.js +0 -426
  143. package/build/utils/geocoder.js +0 -203
  144. package/build/utils/i18n.js +0 -128
  145. package/build/utils/index.js +0 -17
  146. package/build/utils/index_photoviewer.js +0 -14
  147. package/build/utils/indoor.js +0 -200
  148. package/build/utils/map.js +0 -788
  149. package/build/utils/picture.js +0 -507
  150. package/build/utils/semantics.js +0 -321
  151. package/build/utils/services.js +0 -148
  152. package/build/utils/utils.js +0 -433
  153. package/build/utils/widgets.js +0 -110
@@ -1,379 +0,0 @@
1
- import { LitElement, css, nothing } from "lit";
2
- import { html, unsafeStatic } from "lit/static-html.js";
3
- import { classMap } from "lit/directives/class-map.js";
4
- import { fa, onceParentAvailable } from "../../utils/widgets.js";
5
- import {
6
- faArrowLeft, faCalendarAlt, faChevronDown, faChevronUp, faShareNodes,
7
- faTriangleExclamation, faUser, faUserLock,
8
- } from "@fortawesome/free-solid-svg-icons";
9
- import { hidden, panel, placeholder } from "../styles.js";
10
- import { reverseGeocodingNominatim } from "../../utils/geocoder.js";
11
- import { PanoramaxMetaCatalogURL } from "../../utils/services.js";
12
-
13
- /**
14
- * Picture legend shows info about picture author, capture date, address, and access to metadata popup.
15
- * @class Panoramax.components.menus.PictureLegend
16
- * @element pnx-picture-legend
17
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
18
- * @slot `editors` External links to map editors, or any tool that may be helpful. Defaults to OSM tools (iD & JOSM).
19
- * @example
20
- * ```html
21
- * <pnx-picture-legend ._parent=${viewer} />
22
- * ```
23
- */
24
- export default class PictureLegend extends LitElement {
25
- /** @private */
26
- static styles = [placeholder, panel, hidden, css`
27
- :host {
28
- display: flex;
29
- flex-direction: column;
30
- margin: 0;
31
- font-family: var(--font-family);
32
- flex-wrap: nowrap;
33
- }
34
-
35
- @media screen and (min-width: 576px) {
36
- :host {
37
- max-height: 70vh;
38
- }
39
- }
40
-
41
- /* Top bar */
42
- .headline {
43
- display: flex;
44
- gap: 10px;
45
- align-items: center;
46
- margin: 10px 10px 5px 10px;
47
- justify-content: space-between;
48
- flex: 1;
49
- }
50
-
51
- .headline-buttons {
52
- display: flex;
53
- gap: 5px;
54
- align-items: center;
55
- }
56
-
57
- /* Address line */
58
- #pic-legend-addr {
59
- line-height: 1.2em;
60
- font-size: 1em;
61
- margin-bottom: 2px;
62
- flex-grow: 5;
63
- font-weight: 800;
64
- text-overflow: ellipsis;
65
- overflow: hidden;
66
- white-space: nowrap;
67
- }
68
-
69
- #pic-legend-addr span {
70
- display: inline-block;
71
- height: 100%;
72
- width: 100%;
73
- }
74
-
75
- /* Visibility badge */
76
- .visibility-badge {
77
- cursor: help;
78
- background: var(--blue);
79
- color: var(--white);
80
- border-radius: 10px;
81
- height: 20px;
82
- display: inline-flex;
83
- font-size: 0.8em;
84
- padding: 0 5px;
85
- gap: 3px;
86
- font-size: 0.7em;
87
- align-items: center;
88
- }
89
-
90
- .visibility-badge svg {
91
- height: 1em;
92
- }
93
-
94
- /* Minimal info block */
95
- #pic-legend-info {
96
- margin: 10px;
97
- display: flex;
98
- gap: 10px;
99
- justify-content: space-around;
100
- }
101
- .info-block {
102
- display: flex;
103
- flex-shrink: 1;
104
- gap: 5px;
105
- font-weight: 600;
106
- font-size: 0.85em;
107
- align-items: center;
108
- }
109
- .info-block svg { height: 18px; }
110
-
111
- /* Expand button */
112
- #pic-legend-expand {
113
- display: block;
114
- margin-top: 5px;
115
- max-width: 100%;
116
- flex: 1;
117
- }
118
- #pic-legend-expand::part(btn) {
119
- border-radius: 10px;
120
- border-top-right-radius: 0;
121
- border-top-left-radius: 0;
122
- }
123
-
124
- /* Details block */
125
- pnx-picture-metadata {
126
- margin: 5px 10px;
127
- display: block;
128
- box-sizing: border-box;
129
- flex: 1;
130
- overflow-y: auto;
131
- }
132
-
133
- /* Details actions */
134
- #pic-legend-cta {
135
- display: flex;
136
- margin: 5px 10px;
137
- border-bottom-left-radius: 10px;
138
- border-bottom-right-radius: 10px;
139
- gap: 5px;
140
- flex-wrap: wrap;
141
- flex: 1;
142
- }
143
-
144
- /* More options menu */
145
- #pnx-legend-opts { min-width: unset; }
146
-
147
- /* Editors */
148
- #pic-legend-editors { margin: 0 10px; }
149
-
150
- /* Light version */
151
- .pnx-picture-legend-light {
152
- width: max-content;
153
- font-size: 10px;
154
- }
155
- `];
156
-
157
- /**
158
- * Component properties.
159
- * @memberof Panoramax.components.menus.PictureLegend#
160
- * @type {Object}
161
- * @property {boolean} [light=false] Lighter version (for iframes)
162
- */
163
- static properties = {
164
- light: {type: Boolean},
165
- _caption: { state: true },
166
- _addr: { state: true },
167
- _expanded: { state: true },
168
- _blockOnEditor: { state: true },
169
- _visibility: { state: true },
170
- collapsable: { type: Boolean },
171
- };
172
-
173
- /** @private */
174
- constructor() {
175
- super();
176
- this._expanded = true;
177
- this.collapsable = false;
178
- this.light = false;
179
- }
180
-
181
- /** @private */
182
- connectedCallback() {
183
- super.connectedCallback();
184
-
185
- this._expanded = !this.collapsable;
186
- this._prevSearches = {};
187
-
188
- onceParentAvailable(this)
189
- .then(() => this._parent.onceReady())
190
- .then(() => {
191
- this._onPicChange(this._parent.psv.getPictureMetadata());
192
- this._parent.psv.addEventListener("picture-loaded", () => {
193
- this._onPicChange(this._parent.psv.getPictureMetadata());
194
- });
195
- this._parent.psv.addEventListener("sequence-stopped", () => {
196
- this._onPicChange(this._parent.psv.getPictureMetadata());
197
- });
198
- this._parent.psv.addEventListener("annotation-focused", () => {
199
- this._expanded = true;
200
- });
201
- if(!this._parent._initParams.getParentPostInit().skipTagsMenuOpening) {
202
- this._parent.psv.addEventListener("annotations-toggled", e => {
203
- if(e.detail.visible) { this._expanded = true; }
204
- });
205
- }
206
- if(this._parent.psv.getSelectedAnnotations().length > 0) {
207
- this._expanded = true;
208
- }
209
- });
210
- }
211
-
212
- /** @private */
213
- _onPicChange(picMeta) {
214
- clearTimeout(this._addrTimer1);
215
- this._caption = picMeta?.caption;
216
-
217
- if(picMeta) {
218
- this._visibility = picMeta.properties?.["geovisio:visibility"] || null;
219
- if(this._visibility === "anyone") { this._visibility = null; }
220
-
221
- const coordsHash = `${picMeta.gps[0].toFixed(4)}/${picMeta.gps[1].toFixed(4)}`;
222
- if(this._prevSearches[coordsHash]) {
223
- this._addr = this._prevSearches[coordsHash];
224
- }
225
- else if(!this._parent.psv._sequencePlaying) {
226
- this._addr = "";
227
- this._addrTimer1 = setTimeout(() => {
228
- reverseGeocodingNominatim(picMeta.gps[1], picMeta.gps[0])
229
- .then(addr => {
230
- clearTimeout(this._addrTimer2);
231
- this._addr = addr;
232
- this._prevSearches[coordsHash] = addr;
233
- });
234
- }, 500);
235
- }
236
- }
237
- else {
238
- this._visibility = null;
239
- this._addr = "";
240
- }
241
- }
242
-
243
- /** @private */
244
- _onBackClick() {
245
- if(this._parent.isWidthSmall() && this._parent.focus === "map") {
246
- this._parent.select();
247
- }
248
- else {
249
- this._parent._setFocus?.("map");
250
- }
251
- }
252
-
253
- /**
254
- * Force legend to not go anywhere beyond tags editor.
255
- * @memberof Panoramax.components.menus.PictureLegend#
256
- * @param {boolean} enabled Set to true to block legend, false to unblock
257
- */
258
- blockOnEditing(enabled) {
259
- this._blockOnEditor = enabled;
260
- }
261
-
262
- /** @private */
263
- render() {
264
- if(!this._caption) { return nothing; }
265
-
266
- const lang = this._parent?.lang || window.navigator.language;
267
- const hiddenExpanded = classMap({"pnx-hidden": this._expanded});
268
- const shownExpanded = classMap({"pnx-hidden": !this._expanded});
269
-
270
- if(this.light) {
271
- return html`<div class="pnx-picture-legend-light">
272
- ${this._caption.producer?.length > 0 ? html`
273
- <a
274
- href=${PanoramaxMetaCatalogURL()+"/?pic="+this._parent.psv.getPictureMetadata().id}
275
- target="_blank"
276
- title=${this._parent?._t.pnx.share_page}
277
- >${this._caption.producer[this._caption.producer.length-1]}</a>
278
- </div>` : nothing}
279
-
280
- ${this._caption.producer?.length > 0 && this._caption.date ? "-" : ""}
281
-
282
- ${this._caption.date ? new Intl.DateTimeFormat(lang, {
283
- timeZone: this._caption.tz,
284
- dateStyle: "short"
285
- }).format(this._caption.date) : nothing}
286
-
287
- ${(this._caption.producer?.length > 0 || this._caption.date) && this._caption?.license ? "|" : ""}
288
-
289
- ${this._caption?.license ? html`${unsafeStatic(this._caption.license)}` : nothing}
290
- `;
291
- }
292
-
293
- return html`
294
- <div class=${classMap({ "headline": true, "pnx-hidden": this._blockOnEditor })}>
295
- ${this._parent._setFocus ? html`
296
- <pnx-button
297
- kind="superinline"
298
- @click=${this._onBackClick}
299
- >
300
- ${fa(faArrowLeft)}
301
- </pnx-button>
302
- ` : nothing}
303
-
304
- <div id="pic-legend-addr" title=${this._addr || ""}>
305
- ${this._addr?.length > 0 ? this._addr : html`<span class="pnx-placeholder-loading">&nbsp;</span>`}
306
- </div>
307
-
308
- <div class="headline-buttons">
309
- ${this._visibility ? html`
310
- <div
311
- class="visibility-badge"
312
- title=${this._parent?._t.pnx["visibility_title_"+this._visibility]}
313
- >
314
- ${fa(faUserLock, {transform: {size: 16}})}
315
- ${this._parent?._t.pnx["visibility_"+this._visibility]}
316
- </div>
317
- ` : nothing}
318
-
319
- <pnx-button
320
- size="sm"
321
- class=${hiddenExpanded}
322
- title=${this._parent?._t.pnx.share}
323
- @click=${() => this._parent._showShareOptions()}
324
- >
325
- ${fa(faShareNodes)}
326
- </pnx-button>
327
-
328
- <pnx-picture-legend-actions
329
- @click=${e => e.stopPropagation()}
330
- ._parent=${this._parent}
331
- ?full=${this._expanded}
332
- ></pnx-picture-legend-actions>
333
- </div>
334
- </div>
335
-
336
- <div id="pic-legend-info" class=${hiddenExpanded}>
337
- ${this._caption.producer?.length > 0 ? html`<div class="info-block">
338
- ${fa(faUser)}
339
- ${this._caption.producer[this._caption.producer.length-1]}
340
- </div>` : nothing}
341
-
342
- ${this._caption.date ? html`<div class="info-block">
343
- ${fa(faCalendarAlt)}
344
- ${this._caption.date.toLocaleDateString(this._parent?.lang || window.navigator.language, { year: "numeric", month: "long", day: "numeric" })} </div>` : nothing}
345
- </div>
346
-
347
- <div id="pic-legend-cta" class=${classMap({ "pnx-hidden": !this._expanded || this._blockOnEditor })}>
348
- <pnx-button size="sm" @click=${() => this._parent._showShareOptions()}>
349
- ${fa(faShareNodes)} ${this._parent?._t.pnx.share}
350
- </pnx-button>
351
-
352
- ${this._parent.getAPI()._endpoints.report ? html`
353
- <pnx-button kind="fullwarn" size="sm" @click=${() => this._parent._showReportForm()}>
354
- ${fa(faTriangleExclamation)} ${this._parent?._t.pnx.report}
355
- </pnx-button>
356
- ` : nothing}
357
-
358
- <slot name="editors">
359
- <pnx-widget-osmeditors ._parent=${this._parent} />
360
- </slot>
361
- </div>
362
-
363
- <pnx-picture-metadata
364
- class=${shownExpanded}
365
- .block-editor=${this._blockOnEditor}
366
- ._parent=${this._parent}
367
- ></pnx-picture-metadata>
368
-
369
- ${this.collapsable && !this._blockOnEditor ? html`<pnx-button
370
- kind="inline"
371
- size="sm"
372
- id="pic-legend-expand"
373
- @click=${() => this._expanded = !this._expanded}
374
- >${this._expanded ? fa(faChevronUp) : fa(faChevronDown)}</pnx-button>` : nothing}
375
- `;
376
- }
377
- }
378
-
379
- customElements.define("pnx-picture-legend", PictureLegend);