@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,368 +0,0 @@
1
- import { LitElement, css, html, nothing } from "lit";
2
- import { fa, onceParentAvailable } from "../../utils/widgets.js";
3
- import {
4
- faEraser, faFloppyDisk, faInfoCircle, faPlusSquare, faTimes
5
- } from "@fortawesome/free-solid-svg-icons";
6
- import { dataBlocks, hidden } from "../styles.js";
7
- import { getUserAccount } from "../../utils/utils.js";
8
-
9
- /**
10
- * Semantics metadata displays detailed info about semantic attributes of a single picture.
11
- * @class Panoramax.components.menus.SemanticsMetadata
12
- * @element pnx-semantics-metadata
13
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
14
- * @example
15
- * ```html
16
- * <pnx-semantics-metadata ._parent=${viewer}></pnx-semantics-metadata>
17
- * ```
18
- */
19
- export default class SemanticsMetadata extends LitElement {
20
- /** @private */
21
- static styles = [ hidden, dataBlocks, css`
22
- .top-btns, pnx-semantics-list {
23
- font-size: 0.8em;
24
- }
25
- .top-btns {
26
- display: flex;
27
- margin: 5px 0;
28
- gap: 5px;
29
- }
30
- .top-btns > * {
31
- overflow: hidden;
32
- }
33
- .top-btns > *::part(btn) {
34
- height: unset;
35
- }
36
- .data-block {
37
- width: 100%;
38
- }
39
- .data-block h5 {
40
- justify-content: space-between;
41
- }
42
- ` ];
43
-
44
- /** @private */
45
- static properties = {
46
- _meta: {state: true},
47
- _prevPSVPicNav: {state: true},
48
- _authUrl: {state: true},
49
- _showLinks: {state: true},
50
-
51
- _addTag: {state: true},
52
- _editTag: {state: true},
53
- _addTagGeom: {state: true},
54
- _editTagSem: {state: true},
55
- };
56
-
57
- constructor() {
58
- super();
59
- this._meta = {};
60
- this._prevPSVPicNav = null;
61
- this._authUrl = null;
62
- this._showLinks = true;
63
-
64
- this._addTag = false;
65
- this._editTag = null;
66
- this._addTagGeom = null;
67
- this._editTagSem = null;
68
- }
69
-
70
- /** @private */
71
- connectedCallback() {
72
- super.connectedCallback();
73
-
74
- onceParentAvailable(this).then(() => {
75
- this._meta = this._parent?.psv?.getPictureMetadata();
76
- this._parent?.oncePSVReady?.().then(() => {
77
- this._parent.psv.addEventListener("picture-loaded", () => {
78
- this._meta = this._parent.psv.getPictureMetadata();
79
- });
80
- this._parent.psv.addEventListener("annotation-focused", () => {
81
- const tabs = this.shadowRoot.querySelector("pnx-tabs");
82
- if(tabs) { tabs.setAttribute("activeTabIndex", 4); }
83
- });
84
- });
85
-
86
- this._parent.getAPI().getAuthURL().then(res => this._authUrl = res);
87
- });
88
- }
89
-
90
- /** @private */
91
- _blockPicChange(block) {
92
- this._parent?.legend?.renderRoot.querySelector("pnx-picture-legend")?.blockOnEditing(block);
93
- if(this._parent?.mini) { this._parent.mini.style.display = block ? "none" : null; }
94
- const answ = this._parent.renderRoot.querySelector("pnx-annotations-switch");
95
- if(answ) { answ.style.display = block ? "none": null; }
96
-
97
- if(block) {
98
- this._prevPSVPicNav = this._parent.psv.getPicturesNavigation();
99
- this._parent.psv.setPicturesNavigation("pic");
100
- this._parent._disableKeyboard();
101
- window.addEventListener("beforeunload", this._onBrowserQuit);
102
- }
103
- else {
104
- this._parent.psv.setPicturesNavigation(this._prevPSVPicNav);
105
- this._parent._enableKeyboard();
106
- window.removeEventListener("beforeunload", this._onBrowserQuit);
107
- }
108
- }
109
-
110
- /** @private */
111
- _onBrowserQuit(e) {
112
- e.preventDefault();
113
- e.returnValue = true;
114
- }
115
-
116
- /** @private */
117
- _checkCanEdit() {
118
- const isFromLocalInstance = !this._meta.origInstance || this._parent?.api?._endpoint.startsWith(this._meta.origInstance.href);
119
- if(isFromLocalInstance && getUserAccount() !== null) {
120
- return true;
121
- }
122
- else {
123
- if(!isFromLocalInstance && confirm((this._parent?._t.pnx.semantics_login_needed || "").replace("{n}", this._meta.origInstance.instance_name || this._meta.origInstance.href))) {
124
- window.location.href = this._meta.origInstance.href + window.location.search.replace(/&?nav=pic/, "");
125
- }
126
- else if(isFromLocalInstance && confirm((this._parent?._t.pnx.semantics_login_needed || "").replace("{n}", this._parent.getAPI()._metadata.name))) {
127
- window.location.href = this._authUrl.replace("<CBURL>", encodeURIComponent(window.location.href));
128
- }
129
- else {
130
- return false;
131
- }
132
- }
133
- }
134
-
135
- /** @private */
136
- _startAddTag() {
137
- if(!this._checkCanEdit()) { return; }
138
-
139
- this._blockPicChange(true);
140
- this._addTag = true;
141
- this._editTag = false;
142
- this._addTagGeom = null;
143
- this._editTagSem = null;
144
-
145
- this._addTagGeomListener = e => {
146
- this.renderRoot.querySelector("#pnx-sem-editor")?.forceInput();
147
- this._addTagGeom = e.detail.shape;
148
- };
149
- this._parent.psv.addEventListener("annotation-drawn", this._addTagGeomListener);
150
- this._parent.psv.startDrawAnnotation();
151
- }
152
-
153
- /** @private */
154
- _onTagSemChange(e) {
155
- this._editTagSem = e.detail;
156
- }
157
-
158
- /** @private */
159
- _onSaveTag() {
160
- const field = this.renderRoot.querySelector("#pnx-sem-editor");
161
-
162
- // Check field validity
163
- if(!field || !field.checkValidity() || !this._editTagSem || !this._editTagSem.delta || this._editTagSem.delta.length === 0) {
164
- field.reportValidity();
165
- return;
166
- }
167
-
168
- // Edit an annotation
169
- if(this._editTag?.type === "annotation") {
170
- this._parent?.api.editPictureAnnotation(this._editTag.annotation.id, this._editTagSem.delta).then(newAnnot => {
171
- const annotPos = this._meta.properties.annotations.findIndex(a => a.id === newAnnot.id);
172
- this._meta.properties.annotations[annotPos] = newAnnot;
173
- this._onCancelEditTag(newAnnot);
174
- }).catch(e => {
175
- console.error("Can't send annotation", e);
176
- this._onCancelEditTag(this._editTag.annotation);
177
- alert(this._parent?._t.pnx.semantics_send_fail);
178
- });
179
- }
180
- // Create annotation if a geom exists
181
- else if(this._addTag && this._addTagGeom) {
182
- this._parent.psv.fixDrawAnnotation();
183
- this._parent?.api.createPictureAnnotation(this._meta, this._addTagGeom, this._editTagSem.delta).then(newAnnot => {
184
- this._meta.properties.annotations.push(newAnnot);
185
- this._onCancelEditTag(newAnnot, true);
186
- }).catch(e => {
187
- console.error("Can't send annotation", e);
188
- alert(this._parent?._t.pnx.semantics_send_fail);
189
- this._onCancelEditTag();
190
- });
191
- }
192
- // Create picture tag or edit a tag group
193
- else if(this._addTag || (this._editTag && this._editTag.type !== "annotation")) {
194
- this._parent?.api.sendPictureSemantics(this._meta, this._editTagSem.delta).then(newPic => {
195
- this._meta.properties.semantics = newPic.properties.semantics;
196
- this._onCancelEditTag(this._editTagSem.delta);
197
- }).catch(e => {
198
- alert(this._parent?._t.pnx.semantics_send_fail);
199
- console.error("Can't send semantics", e);
200
- this._onCancelEditTag();
201
- });
202
- }
203
- }
204
-
205
- /** @private */
206
- _onEraseDrawnAnnotation() {
207
- this._parent.psv.stopDrawAnnotation();
208
- this._addTagGeom = null;
209
- this._parent.psv.startDrawAnnotation();
210
- }
211
-
212
- /** @private */
213
- _onEditTag(e) {
214
- if(!this._checkCanEdit()) { return; }
215
-
216
- this._blockPicChange(true);
217
- this._addTag = false;
218
- this._addTagGeom = null;
219
- this._editTagSem = e.detail.item?.type === "annotation" ? { semantics: e.detail.item.annotation.semantics } : e.detail.item.tagGroup;
220
- this._editTag = e.detail.item;
221
-
222
- if(e.detail.item?.type === "annotation") {
223
- this._parent.psv.focusOnAnnotation(e.detail.item.annotation.id, true);
224
- }
225
- }
226
-
227
- /** @private */
228
- _onCancelEditTag(item = null, skipStopDraw = false) {
229
- // Force hiding of report status on tag editor
230
- this.renderRoot.querySelector("#pnx-sem-editor").reset();
231
-
232
- this._addTag = false;
233
- this._addTagGeom = null;
234
- this._editTag = null;
235
- if(!skipStopDraw) { this._parent.psv.stopDrawAnnotation(); }
236
- this._blockPicChange(false);
237
-
238
- // Select back item in list
239
- this.getUpdateComplete().then(() => {
240
- const list = this.renderRoot.querySelector("#pnx-sem-list");
241
- if(item && list) {
242
- if(item.id) { list.showAnnotation(item.id); }
243
- else { list.showTagsGroup(item); }
244
- }
245
- });
246
- }
247
-
248
- /** @private */
249
- _onDeleteTag(e) {
250
- if(!this._checkCanEdit()) { return; }
251
-
252
- if(confirm(this._parent?._t.pnx.semantics_delete_annotation_confirm)) {
253
- const item = e.detail.item;
254
- // Annotation deleting
255
- if(item?.type === "annotation") {
256
- this._parent?.api.deletePictureAnnotation(item.annotation.id).then(() => {
257
- // Remove from current metadata
258
- const newMeta = Object.assign({}, this._meta);
259
- newMeta.properties.annotations = this._meta.properties.annotations.filter(a => a.id != item.annotation.id);
260
- this._meta = newMeta;
261
-
262
- // Remove from PSV
263
- this._parent.psv.toggleAllAnnotations(true);
264
-
265
- // Remove from annotations list
266
- this.renderRoot.querySelector("pnx-semantics-list")?._onPicChange();
267
- }).catch(e => {
268
- console.error("Can't send annotation", e);
269
- alert(this._parent?._t.pnx.semantics_send_fail);
270
- });
271
- }
272
- // Tag group deletion
273
- else {
274
- const semDiff = item.tagGroup.semantics.map(t => Object.assign({action: "delete"}, t));
275
- this._parent?.api.sendPictureSemantics(this._meta, semDiff).then(newPic => {
276
- this._meta.properties.semantics = newPic.properties.semantics;
277
- this.renderRoot.querySelector("pnx-semantics-list")?._onPicChange();
278
- }).catch(e => {
279
- alert(this._parent?._t.pnx.semantics_send_fail);
280
- console.error("Can't send semantics", e);
281
- });
282
- }
283
- }
284
- }
285
-
286
- /** @private */
287
- render() {
288
- if(!this._meta?.properties) { return; }
289
-
290
- const canEdit = !this._meta.origInstance && (this._authUrl || getUserAccount() !== null);
291
-
292
- return html`
293
- ${(this._addTag || this._editTag) ? html`
294
- <div class="data-block">
295
- <h5>
296
- ${this._addTag ? this._parent?._t.pnx.semantics_add_annotation : this._parent?._t.pnx.semantics_edit}
297
-
298
- <pnx-button-group>
299
- <pnx-button
300
- kind="fullsuccess"
301
- style="margin-right: 3px"
302
- title=${this._parent?._t.pnx.semantics_save}
303
- @click=${this._onSaveTag}
304
- >
305
- ${fa(faFloppyDisk)}
306
- </pnx-button>
307
- <pnx-button
308
- kind="fullwarn"
309
- title=${this._parent?._t.pnx.semantics_undo}
310
- @click=${() => this._onCancelEditTag(this._editTag?.annotation || this._editTag)}
311
- >
312
- ${fa(faTimes)}
313
- </pnx-button>
314
- </pnx-button-group>
315
- </h5>
316
- <div>
317
- ${this._addTag ? this._parent?._t.pnx.semantics_draw_annotation : nothing}
318
- ${this._addTag && this._addTagGeom ? html`<pnx-button
319
- kind="full"
320
- style="margin-top: 5px; width: 100%"
321
- @click=${this._onEraseDrawnAnnotation}
322
- >
323
- ${fa(faEraser)} ${this._parent?._t.pnx.semantics_erase_annotation}
324
- </pnx-button>` : nothing}
325
-
326
- <pnx-semantics-editor
327
- id="pnx-sem-editor"
328
- style="display: block; margin-top: 5px"
329
- .semantics=${this._editTagSem?.semantics || []}
330
- ._t=${this._parent._t}
331
- @change=${this._onTagSemChange}
332
- ></pnx-semantics-editor>
333
- </div>
334
- </div>
335
- ` : html`
336
- ${this._showLinks ? html `
337
- <div class="top-btns">
338
- <pnx-button
339
- kind="full"
340
- size="md"
341
- style="flex: 2 1"
342
- @click=${this._startAddTag}
343
- >
344
- ${fa(faPlusSquare)} ${this._parent?._t.pnx.semantics_add_annotation}
345
- </pnx-button>
346
- <pnx-button
347
- kind="full"
348
- size="md"
349
- style="flex: 1 1"
350
- @click=${() => this._parent?._showSemanticsDoc()}
351
- >${fa(faInfoCircle)} ${this._parent?._t.pnx.semantics_doc}</pnx-button>
352
- </div>
353
- ` : nothing}
354
-
355
- <pnx-semantics-list
356
- id="pnx-sem-list"
357
- .editable=${canEdit}
358
- @select=${e => this._showLinks = e.detail.item == null}
359
- @edit-click=${this._onEditTag}
360
- @delete-click=${this._onDeleteTag}
361
- ._parent=${this._parent}
362
- />
363
- `}
364
- `;
365
- }
366
- }
367
-
368
- customElements.define("pnx-semantics-metadata", SemanticsMetadata);
@@ -1,105 +0,0 @@
1
- import { LitElement, css, html } from "lit";
2
- import { fa, onceParentAvailable } from "../../utils/widgets.js";
3
- import { faSvg, input, textarea, titles } from "../styles.js";
4
- import {
5
- faCircleInfo, faLink, faMap, faShareAlt
6
- } from "@fortawesome/free-solid-svg-icons";
7
-
8
- /**
9
- * Share Menu displays links for quick picture sharing.
10
- * @class Panoramax.components.menus.ShareMenu
11
- * @element pnx-share-menu
12
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
13
- * @example
14
- * ```html
15
- * <pnx-share-menu ._parent=${viewer} />
16
- * ```
17
- */
18
- export default class ShareMenu extends LitElement {
19
- /** @private */
20
- static styles = [ faSvg, input, textarea, titles, css`
21
- div[slot="content"] {
22
- margin-top: 10px;
23
- }
24
- .links {
25
- display: flex;
26
- gap: 5px;
27
- }
28
- .embed {
29
- display: flex;
30
- gap: 5px;
31
- align-items: center;
32
- flex-direction: column;
33
- }
34
- ` ];
35
-
36
- /**
37
- * Component properties.
38
- * @memberof Panoramax.components.menus.ShareMenu#
39
- * @type {Object}
40
- * @property {string} [base-url] Override the default base URL (current page)
41
- */
42
- static properties = {
43
- _url: {state: true},
44
- "base-url": {type: String},
45
- };
46
-
47
- constructor() {
48
- super();
49
- this._onUrlChange();
50
- }
51
-
52
- /** @private */
53
- connectedCallback() {
54
- super.connectedCallback();
55
- onceParentAvailable(this).then(() => this._parent.onceReady()).then(() => {
56
- this._onUrlChange();
57
- this._parent.urlHandler.addEventListener("url-changed", this._onUrlChange.bind(this));
58
- });
59
- }
60
-
61
- /** @private */
62
- _onUrlChange() {
63
- const baseUrl = (this["base-url"] || window.location.href).replace(/\/$/, "");
64
- this._url = this._parent?.urlHandler?.nextShortLink(baseUrl) || baseUrl;
65
- }
66
-
67
- /** @private */
68
- render() {
69
- const iframe = `<iframe src="${this._url}" style="border: none; width: 500px; height: 300px"></iframe>`;
70
-
71
- return html`
72
- <h4>${fa(faShareAlt)} ${this._parent?._t.pnx.share}</h4>
73
- <pnx-tabs>
74
- <h4 slot="title">${fa(faLink)} ${this._parent?._t.pnx.share_page}</h4>
75
- <div slot="content">
76
- <div class="links">
77
- <input type="text" readonly value=${this._url} style="flex: 2" />
78
- <pnx-copy-button ._t=${this._parent?._t} text=${this._url}></pnx-copy-button>
79
- </div>
80
- </div>
81
-
82
- <h4 slot="title">${fa(faMap)} ${this._parent?._t.pnx.share_embed}</h4>
83
- <div slot="content">
84
- <div class="embed">
85
- <pnx-link-button
86
- href="https://docs.panoramax.fr/web-viewer/03_URL_settings/"
87
- target="_blank"
88
- kind="superinline"
89
- size="sm"
90
- >
91
- ${fa(faCircleInfo)} ${this._parent?._t.pnx.share_embed_docs}
92
- </pnx-link-button>
93
- <textarea readonly .value=${iframe}></textarea>
94
- <pnx-copy-button
95
- ._t=${this._parent?._t}
96
- text=${iframe}
97
- style="width: 100%"
98
- ></pnx-copy-button>
99
- </div>
100
- </div>
101
- </pnx-tabs>`;
102
- }
103
- }
104
-
105
- customElements.define("pnx-share-menu", ShareMenu);
@@ -1,22 +0,0 @@
1
- /**
2
- * Complex menus components
3
- * @module Panoramax:components:menus
4
- */
5
-
6
- export {default as LocationPrecisionDoc} from "./LocationPrecisionDoc.js";
7
- export {default as MapBackground} from "./MapBackground.js";
8
- export {default as MapFilters} from "./MapFilters.js";
9
- export {default as MapLayers} from "./MapLayers.js";
10
- export {default as MapLegend} from "./MapLegend.js";
11
- export {default as MiniPictureLegend} from "./MiniPictureLegend.js";
12
- export {default as PictureLegend} from "./PictureLegend.js";
13
- export {default as PictureMetadata} from "./PictureMetadata.js";
14
- export {default as PlayerOptions} from "./PlayerOptions.js";
15
- export {default as QualityScoreDoc} from "./QualityScoreDoc.js";
16
- export {default as ReportForm} from "./ReportForm.js";
17
- export {default as SemanticsDoc} from "./SemanticsDoc.js";
18
- export {default as SemanticsDownload} from "./SemanticsDownload.js";
19
- export {default as SemanticsFilters} from "./SemanticsFilters.js";
20
- export {default as SemanticsList} from "./SemanticsList.js";
21
- export {default as SemanticsMetadata} from "./SemanticsMetadata.js";
22
- export {default as Share} from "./Share.js";
@@ -1,11 +0,0 @@
1
- // Lightweight export for PhotoViewer
2
- export {default as PictureLegend} from "./PictureLegend.js";
3
- export {default as PictureMetadata} from "./PictureMetadata.js";
4
- export {default as PlayerOptions} from "./PlayerOptions.js";
5
- export {default as QualityScoreDoc} from "./QualityScoreDoc.js";
6
- export {default as ReportForm} from "./ReportForm.js";
7
- export {default as SemanticsDoc} from "./SemanticsDoc.js";
8
- export {default as SemanticsDownload} from "./SemanticsDownload.js";
9
- export {default as SemanticsList} from "./SemanticsList.js";
10
- export {default as SemanticsMetadata} from "./SemanticsMetadata.js";
11
- export {default as Share} from "./Share.js";