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

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 (152) hide show
  1. package/build/bundle.cjs +3399 -0
  2. package/build/bundle.cjs.map +1 -0
  3. package/build/bundle_photoviewer.cjs +2510 -0
  4. package/build/bundle_photoviewer.cjs.map +1 -0
  5. package/build/cjs/index.js +1 -1
  6. package/build/cjs/index_photoviewer.js +1 -1
  7. package/build/components/core/Basic.css +56 -0
  8. package/build/components/core/Basic.js +378 -0
  9. package/build/components/core/CoverageMap.css +10 -0
  10. package/build/components/core/CoverageMap.js +169 -0
  11. package/build/components/core/Editor.css +33 -0
  12. package/build/components/core/Editor.js +398 -0
  13. package/build/components/core/PhotoViewer.css +70 -0
  14. package/build/components/core/PhotoViewer.js +650 -0
  15. package/build/components/core/Viewer.css +130 -0
  16. package/build/components/core/Viewer.js +711 -0
  17. package/build/components/core/index.js +10 -0
  18. package/build/components/index.js +11 -0
  19. package/build/components/index_photoviewer.js +6 -0
  20. package/build/components/layout/BottomDrawer.js +258 -0
  21. package/build/components/layout/CorneredGrid.js +143 -0
  22. package/build/components/layout/Mini.js +121 -0
  23. package/build/components/layout/Tabs.js +140 -0
  24. package/build/components/layout/index.js +9 -0
  25. package/build/components/menus/LocationPrecisionDoc.js +42 -0
  26. package/build/components/menus/MapBackground.js +110 -0
  27. package/build/components/menus/MapFilters.js +567 -0
  28. package/build/components/menus/MapLayers.js +238 -0
  29. package/build/components/menus/MapLegend.js +68 -0
  30. package/build/components/menus/MiniPictureLegend.js +73 -0
  31. package/build/components/menus/PictureLegend.js +379 -0
  32. package/build/components/menus/PictureMetadata.js +380 -0
  33. package/build/components/menus/PlayerOptions.js +93 -0
  34. package/build/components/menus/QualityScoreDoc.js +42 -0
  35. package/build/components/menus/ReportForm.js +132 -0
  36. package/build/components/menus/SemanticsDoc.js +38 -0
  37. package/build/components/menus/SemanticsDownload.js +33 -0
  38. package/build/components/menus/SemanticsFilters.js +153 -0
  39. package/build/components/menus/SemanticsList.js +413 -0
  40. package/build/components/menus/SemanticsMetadata.js +368 -0
  41. package/build/components/menus/Share.js +105 -0
  42. package/build/components/menus/index.js +22 -0
  43. package/build/components/menus/index_photoviewer.js +11 -0
  44. package/build/components/styles.js +557 -0
  45. package/build/components/ui/AnnotationsSwitch.js +159 -0
  46. package/build/components/ui/Button.js +77 -0
  47. package/build/components/ui/ButtonGroup.css +59 -0
  48. package/build/components/ui/ButtonGroup.js +69 -0
  49. package/build/components/ui/CopyButton.js +110 -0
  50. package/build/components/ui/Grade.js +54 -0
  51. package/build/components/ui/GradeFilter.js +122 -0
  52. package/build/components/ui/IconSwitch.js +193 -0
  53. package/build/components/ui/LinkButton.js +67 -0
  54. package/build/components/ui/ListGroup.js +66 -0
  55. package/build/components/ui/ListItem.js +90 -0
  56. package/build/components/ui/Loader.js +203 -0
  57. package/build/components/ui/Map.css +63 -0
  58. package/build/components/ui/Map.js +853 -0
  59. package/build/components/ui/MapMore.js +175 -0
  60. package/build/components/ui/Photo.css +50 -0
  61. package/build/components/ui/Photo.js +1502 -0
  62. package/build/components/ui/Popup.js +145 -0
  63. package/build/components/ui/ProgressBar.js +104 -0
  64. package/build/components/ui/QualityScore.js +147 -0
  65. package/build/components/ui/SearchBar.js +374 -0
  66. package/build/components/ui/SemanticsEditor.js +191 -0
  67. package/build/components/ui/SemanticsTable.js +88 -0
  68. package/build/components/ui/Switch.js +139 -0
  69. package/build/components/ui/TogglableGroup.js +157 -0
  70. package/build/components/ui/index.js +29 -0
  71. package/build/components/ui/index_photoviewer.js +21 -0
  72. package/build/components/ui/widgets/CopyCoordinates.js +75 -0
  73. package/build/components/ui/widgets/GeoSearch.css +21 -0
  74. package/build/components/ui/widgets/GeoSearch.js +150 -0
  75. package/build/components/ui/widgets/Legend.js +190 -0
  76. package/build/components/ui/widgets/LevelSelect.css +51 -0
  77. package/build/components/ui/widgets/LevelSelect.js +143 -0
  78. package/build/components/ui/widgets/MapFiltersButton.js +114 -0
  79. package/build/components/ui/widgets/MapLayersButton.js +79 -0
  80. package/build/components/ui/widgets/OSMEditors.js +155 -0
  81. package/build/components/ui/widgets/PictureLegendActions.js +99 -0
  82. package/build/components/ui/widgets/Player.css +7 -0
  83. package/build/components/ui/widgets/Player.js +154 -0
  84. package/build/components/ui/widgets/SemanticsFiltersButton.js +65 -0
  85. package/build/components/ui/widgets/Zoom.js +84 -0
  86. package/build/components/ui/widgets/index.js +16 -0
  87. package/build/components/ui/widgets/index_photoviewer.js +7 -0
  88. package/build/esm/components/core/Basic.js +1 -1
  89. package/build/img/arrow_360.svg +14 -0
  90. package/build/img/arrow_flat.svg +11 -0
  91. package/build/img/arrow_triangle.svg +9 -0
  92. package/build/img/arrow_turn.svg +8 -0
  93. package/build/img/bg_aerial.jpg +0 -0
  94. package/build/img/bg_streets.jpg +0 -0
  95. package/build/img/loader_base.jpg +0 -0
  96. package/build/img/logo_dead.svg +91 -0
  97. package/build/img/marker.svg +17 -0
  98. package/build/img/marker_blue.svg +20 -0
  99. package/build/img/osm.svg +49 -0
  100. package/build/img/panoramax.svg +13 -0
  101. package/build/img/switch_big.svg +54 -0
  102. package/build/img/switch_mini.svg +48 -0
  103. package/build/img/wd.svg +1 -0
  104. package/build/index_photoviewer.js +4 -0
  105. package/build/package.json +148 -0
  106. package/build/servers.js +14 -0
  107. package/build/translations/ar.json +1 -0
  108. package/build/translations/be.json +257 -0
  109. package/build/translations/br.json +81 -0
  110. package/build/translations/cy.json +117 -0
  111. package/build/translations/da.json +300 -0
  112. package/build/translations/de.json +309 -0
  113. package/build/translations/en.json +294 -0
  114. package/build/translations/eo.json +235 -0
  115. package/build/translations/es.json +292 -0
  116. package/build/translations/fi.json +1 -0
  117. package/build/translations/fr.json +294 -0
  118. package/build/translations/hr.json +294 -0
  119. package/build/translations/hu.json +294 -0
  120. package/build/translations/it.json +306 -0
  121. package/build/translations/ja.json +182 -0
  122. package/build/translations/ko.json +1 -0
  123. package/build/translations/nl.json +305 -0
  124. package/build/translations/nn.json +1 -0
  125. package/build/translations/pl.json +169 -0
  126. package/build/translations/pt.json +296 -0
  127. package/build/translations/pt_BR.json +304 -0
  128. package/build/translations/sv.json +182 -0
  129. package/build/translations/ti.json +9 -0
  130. package/build/translations/tr.json +297 -0
  131. package/build/translations/uk.json +268 -0
  132. package/build/translations/zh_Hant.json +309 -0
  133. package/build/utils/API.js +928 -0
  134. package/build/utils/InitParameters.js +521 -0
  135. package/build/utils/MapStyleComposer.js +889 -0
  136. package/build/utils/PanoraMapProtocol.js +49 -0
  137. package/build/utils/PhotoAdapter.js +49 -0
  138. package/build/utils/PresetsManager.js +148 -0
  139. package/build/utils/SemanticsMapProtocol.js +144 -0
  140. package/build/utils/URLHandler.js +426 -0
  141. package/build/utils/geocoder.js +203 -0
  142. package/build/utils/i18n.js +128 -0
  143. package/build/utils/index.js +17 -0
  144. package/build/utils/index_photoviewer.js +14 -0
  145. package/build/utils/indoor.js +200 -0
  146. package/build/utils/map.js +788 -0
  147. package/build/utils/picture.js +507 -0
  148. package/build/utils/semantics.js +321 -0
  149. package/build/utils/services.js +148 -0
  150. package/build/utils/utils.js +433 -0
  151. package/build/utils/widgets.js +110 -0
  152. package/package.json +1 -1
@@ -0,0 +1,557 @@
1
+ import { css } from "lit";
2
+
3
+ // Classic panel
4
+ export const panel = css`
5
+ .pnx-panel {
6
+ position: absolute;
7
+ transition: opacity 0.2s 0.1s;
8
+ border-radius: 25px;
9
+ border: 1px solid var(--widget-border-div);
10
+ background-color: var(--widget-bg);
11
+ color: var(--widget-font);
12
+ min-width: 250px;
13
+ box-sizing: border-box;
14
+ font-family: var(--font-family);
15
+ }
16
+
17
+ .pnx-panel.pnx-hidden {
18
+ opacity: 0;
19
+ display: block !important;
20
+ pointer-events: none;
21
+ }
22
+
23
+ .pnx-panel.pnx-padded {
24
+ padding: 15px;
25
+ }
26
+ `;
27
+
28
+ // Hidden
29
+ export const hidden = css`
30
+ .pnx-hidden { display: none !important; }
31
+ `;
32
+
33
+ // Font Awesome SVG
34
+ export const faSvg = css`
35
+ .svg-inline--fa {
36
+ display: var(--fa-display, inline-block);
37
+ height: 1em;
38
+ overflow: visible;
39
+ vertical-align: -0.125em;
40
+ }
41
+ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
42
+ overflow: visible;
43
+ box-sizing: content-box;
44
+ }
45
+ @keyframes fa-spin {
46
+ from {transform:rotate(0deg);}
47
+ to {transform:rotate(360deg);}
48
+ }
49
+ .fa-spin {
50
+ animation: fa-spin 2s infinite linear;
51
+ }
52
+ `;
53
+
54
+ // Textarea
55
+ export const textarea = css`
56
+ textarea {
57
+ background-color: var(--widget-bg);
58
+ color: var(--widget-font);
59
+ border: 1px solid var(--widget-border-div);
60
+ border-radius: 10px;
61
+ padding: 5px;
62
+ width: 100%;
63
+ box-sizing: border-box;
64
+ font-family: var(--font-family);
65
+ resize: vertical;
66
+ }
67
+ `;
68
+
69
+ // Select
70
+ export const select = css`
71
+ select {
72
+ background-color: var(--widget-bg);
73
+ color: var(--widget-font);
74
+ border: 1px solid var(--widget-border-div);
75
+ border-radius: 20px;
76
+ font-size: 16px;
77
+ padding: 2px 10px;
78
+ font-family: var(--font-family);
79
+ }
80
+
81
+ select[disabled] {
82
+ background-color: var(--widget-bg-inactive);
83
+ }
84
+
85
+ select.pnx-100w {
86
+ width: 100%;
87
+ box-sizing: border-box;
88
+ }
89
+ `;
90
+
91
+ // Input
92
+ export const input = css`
93
+ input {
94
+ background-color: var(--widget-bg);
95
+ color: var(--widget-font);
96
+ border: 1px solid var(--widget-border-div);
97
+ border-radius: 20px;
98
+ font-size: 16px;
99
+ padding: 2px 10px;
100
+ font-family: var(--font-family);
101
+ }
102
+
103
+ input.pnx-100w {
104
+ width: 100%;
105
+ box-sizing: border-box;
106
+ }
107
+ `;
108
+
109
+ // Buttons
110
+ export const btn = css`
111
+ :host {
112
+ display: inline-flex;
113
+ }
114
+
115
+ /* Common properties */
116
+ .pnx-btn {
117
+ white-space: nowrap;
118
+ font-size: 1em;
119
+ font-family: var(--font-family);
120
+ flex-grow: 1;
121
+ flex-shrink: 1;
122
+ text-align: center;
123
+ padding: 5px;
124
+ font-weight: 600;
125
+ flex-basis: 30%;
126
+ line-height: 18px;
127
+ justify-content: center;
128
+ border-radius: 8px;
129
+ cursor: pointer;
130
+ text-decoration: none;
131
+ display: inline-flex;
132
+ align-items: center;
133
+ gap: 5px;
134
+ position: relative;
135
+ width: 100%;
136
+ height: 100%;
137
+ min-width: 26px;
138
+ }
139
+
140
+ .pnx-btn:disabled { color: var(--widget-bg-inactive); }
141
+
142
+ .pnx-btn.pnx-btn-active,
143
+ .pnx-btn.pnx-btn-active:hover,
144
+ .pnx-btn.pnx-btn-full.pnx-btn-active:hover,
145
+ .pnx-btn.pnx-btn-outline.pnx-btn-active:hover {
146
+ background-color: var(--widget-bg-active);
147
+ border-color: var(--widget-bg-active);
148
+ color: var(--widget-font-active);
149
+ }
150
+
151
+ .pnx-btn .svg-inline--fa,
152
+ .pnx-btn ::slotted(.svg-inline--fa),
153
+ .pnx-btn slot .svg-inline--fa {
154
+ height: 16px;
155
+ pointer-events: none;
156
+ }
157
+
158
+ /* Sizing */
159
+ .pnx-btn-sm {
160
+ border-radius: 6px;
161
+ line-height: 12px;
162
+ font-size: 12px;
163
+ min-width: unset;
164
+ }
165
+
166
+ .pnx-btn.pnx-btn-sm .svg-inline--fa,
167
+ .pnx-btn.pnx-btn-sm ::slotted(.svg-inline--fa) {
168
+ height: 12px;
169
+ }
170
+
171
+ .pnx-btn-l {
172
+ border-radius: 12px;
173
+ height: 24px;
174
+ line-height: 24px;
175
+ font-size: 20px;
176
+ min-width: 24px;
177
+ }
178
+
179
+ .pnx-btn-xl {
180
+ border-radius: 20px;
181
+ height: 40px;
182
+ line-height: 40px;
183
+ font-size: 16px;
184
+ font-weight: 500;
185
+ min-width: 40px;
186
+ padding: 0 10px;
187
+ gap: 8px;
188
+ }
189
+
190
+ .pnx-btn.pnx-btn-xl .svg-inline--fa,
191
+ .pnx-btn.pnx-btn-xl ::slotted(.svg-inline--fa) {
192
+ height: 16px;
193
+ }
194
+
195
+ .pnx-btn-xxl {
196
+ border-radius: 28px;
197
+ height: 56px;
198
+ line-height: 56px;
199
+ font-size: 24px;
200
+ min-width: 56px;
201
+ }
202
+
203
+ .pnx-btn.pnx-btn-xxl .svg-inline--fa,
204
+ .pnx-btn.pnx-btn-xxl ::slotted(.svg-inline--fa) {
205
+ height: 24px;
206
+ }
207
+
208
+ /* Fully-filled style */
209
+ .pnx-btn-full {
210
+ background-color: var(--widget-bg-primary);
211
+ color: var(--widget-font-direct);
212
+ border: none;
213
+ }
214
+
215
+ .pnx-btn-full:not(:disabled):hover {
216
+ background-color: var(--widget-bg-primary-hover);
217
+ }
218
+
219
+ /* Fully-filled warning style */
220
+ .pnx-btn-fullwarn {
221
+ background-color: var(--widget-bg-warn);
222
+ color: var(--widget-font-warn);
223
+ border: none;
224
+ }
225
+
226
+ .pnx-btn-fullwarn:not(:disabled):hover {
227
+ background-color: var(--widget-bg-warn);
228
+ }
229
+
230
+ /* Fully-filled success style */
231
+ .pnx-btn-fullsuccess {
232
+ background-color: var(--widget-bg-success);
233
+ color: var(--widget-font-success);
234
+ border: none;
235
+ }
236
+
237
+ .pnx-btn-fullsuccess:not(:disabled):hover {
238
+ background-color: var(--widget-bg-success);
239
+ }
240
+
241
+ /* Outline style */
242
+ .pnx-btn-outline {
243
+ border: 1px solid var(--widget-border-btn);
244
+ color: var(--widget-font-direct);
245
+ background-color: var(--widget-bg);
246
+ }
247
+
248
+ .pnx-btn-outline:not(:disabled):hover {
249
+ background-color: var(--widget-bg-hover);
250
+ }
251
+
252
+ /* Flat style */
253
+ .pnx-btn-flat,
254
+ .pnx-btn-flat.pnx-btn-active,
255
+ .pnx-btn-flat.pnx-btn-active:hover,
256
+ .pnx-btn-flat:not(:disabled):hover {
257
+ border: 1px solid var(--widget-border-div);
258
+ color: var(--widget-font);
259
+ background-color: var(--widget-bg);
260
+ }
261
+
262
+ .pnx-btn-flat:not(:disabled):hover {
263
+ background-color: var(--widget-bg-hover);
264
+ }
265
+
266
+ /* Superflat style */
267
+ .pnx-btn-superflat,
268
+ .pnx-btn-superflat.pnx-btn-active,
269
+ .pnx-btn-superflat.pnx-btn-active:hover,
270
+ .pnx-btn-superflat:not(:disabled):hover {
271
+ border: 1px solid var(--widget-border-div);
272
+ color: var(--widget-font-direct);
273
+ background-color: var(--widget-bg);
274
+ }
275
+
276
+ .pnx-btn-superflat:not(:disabled):hover {
277
+ background-color: var(--widget-bg-hover);
278
+ }
279
+
280
+ /* Inline style */
281
+ .pnx-btn-inline,
282
+ .pnx-btn-inline.pnx-btn-active,
283
+ .pnx-btn-inline.pnx-btn-active:hover,
284
+ .pnx-btn-inline:not(:disabled):hover,
285
+ .pnx-btn-superinline,
286
+ .pnx-btn-superinline.pnx-btn-active,
287
+ .pnx-btn-superinline.pnx-btn-active:hover,
288
+ .pnx-btn-superinline:not(:disabled):hover {
289
+ border: none;
290
+ color: var(--widget-font);
291
+ background: none;
292
+ }
293
+
294
+ .pnx-btn-inline:not(:disabled):hover,
295
+ .pnx-btn-superinline:not(:disabled):hover {
296
+ background-color: var(--widget-bg-hover);
297
+ }
298
+
299
+ /* Superinline style */
300
+ .pnx-btn-superinline,
301
+ .pnx-btn-superinline.pnx-btn-active,
302
+ .pnx-btn-superinline.pnx-btn-active:hover,
303
+ .pnx-btn-superinline:not(:disabled):hover {
304
+ color: var(--widget-font-direct);
305
+ }
306
+ `;
307
+
308
+ // Button group
309
+ export const btngroup = css`
310
+ pnx-button-group > pnx-button {
311
+ display: inline-flex;
312
+ }
313
+
314
+ pnx-button-group > pnx-button::part(btn) {
315
+ height: unset;
316
+ }
317
+
318
+ /* Togglable in group */
319
+ pnx-button-group > pnx-togglable-group > pnx-button {
320
+ width: 100%;
321
+ height: 100%;
322
+ }
323
+
324
+ /* Row */
325
+ pnx-button-group[dir="row"] > :not(:first-child):not(:last-child)::part(btn),
326
+ pnx-button-group[dir="row"] > :not(:first-child):not(:last-child) > ::part(btn) {
327
+ border-radius: 0;
328
+ border-left: none;
329
+ border-right: none;
330
+ }
331
+
332
+ pnx-button-group[dir="row"] > :first-child::part(btn),
333
+ pnx-button-group[dir="row"] > :first-child > ::part(btn) {
334
+ border-top-right-radius: 0;
335
+ border-bottom-right-radius: 0;
336
+ border-right: none;
337
+ }
338
+
339
+ pnx-button-group[dir="row"] > :last-child::part(btn),
340
+ pnx-button-group[dir="row"] > :last-child > ::part(btn) {
341
+ border-top-left-radius: 0;
342
+ border-bottom-left-radius: 0;
343
+ border-left: none;
344
+ }
345
+
346
+ /* Column */
347
+ pnx-button-group[dir="column"] > :not(:first-child):not(:last-child)::part(btn),
348
+ pnx-button-group[dir="column"] > :not(:first-child):not(:last-child) > ::part(btn) {
349
+ border-radius: 0;
350
+ border-top: none;
351
+ border-bottom: none;
352
+ }
353
+
354
+ pnx-button-group[dir="column"] > :first-child::part(btn),
355
+ pnx-button-group[dir="column"] > :first-child > ::part(btn) {
356
+ border-bottom-right-radius: 0;
357
+ border-bottom-left-radius: 0;
358
+ border-bottom: none;
359
+ }
360
+
361
+ pnx-button-group[dir="column"] > :last-child::part(btn),
362
+ pnx-button-group[dir="column"] > :last-child > ::part(btn) {
363
+ border-top-left-radius: 0;
364
+ border-top-right-radius: 0;
365
+ border-top: none;
366
+ }
367
+ `;
368
+
369
+ // Titles
370
+ export const titles = css`
371
+ h1, h2, h3, h4, h5, h6 {
372
+ font-family: var(--font-family);
373
+ }
374
+
375
+ h3 {
376
+ font-size: 1.1em;
377
+ line-height: 1.1em;
378
+ font-weight: 500;
379
+ margin: 10px 0 10px 0;
380
+ }
381
+
382
+ h4 {
383
+ font-size: 1.0em;
384
+ line-height: 1.0em;
385
+ font-weight: 500;
386
+ margin: 15px 0;
387
+ display: flex;
388
+ align-items: center;
389
+ justify-content: flex-start;
390
+ gap: 5px;
391
+ }
392
+
393
+ h4:first-of-type { margin-top: 0; }
394
+
395
+ h4 > svg.svg-inline--fa {
396
+ height: 18px;
397
+ }
398
+
399
+ h4[slot="title"] {
400
+ margin: 0;
401
+ justify-content: center;
402
+ font-size: 0.8em;
403
+ line-height: 2em;
404
+ padding: 0.5em 0;
405
+ }
406
+ h4[slot="title"] svg.svg-inline--fa {
407
+ height: 14px;
408
+ }
409
+ `;
410
+
411
+ // Active icon badge
412
+ export const activeIcon = css`
413
+ .pnx-active-icon {
414
+ box-sizing: border-box;
415
+ background-color: var(--orange);
416
+ border: 3px solid #fff;
417
+ border-radius: 8px;
418
+ height: 15px;
419
+ left: 20px;
420
+ position: absolute;
421
+ top: 5px;
422
+ width: 15px;
423
+ }
424
+ `;
425
+
426
+ // Counting badge
427
+ export const badgeCount = css`
428
+ .pnx-badge-count {
429
+ box-sizing: border-box;
430
+ background-color: var(--grey-pale);
431
+ border-radius: 8px;
432
+ right: -6px;
433
+ position: absolute;
434
+ top: -6px;
435
+ width: 12px;
436
+ height: 12px;
437
+ font-size: 10px;
438
+ text-align: center;
439
+ line-height: 12px;
440
+ font-weight: 800;
441
+ }
442
+ `;
443
+
444
+ // Placeholder background
445
+ export const placeholder = css`
446
+ @keyframes animatedBackground {
447
+ from {
448
+ background-position: 0 0;
449
+ }
450
+ to {
451
+ background-position: 1000px 0;
452
+ }
453
+ }
454
+
455
+ .pnx-placeholder-loading {
456
+ width: 100px;
457
+ height: 100px;
458
+ background-image: linear-gradient(
459
+ 90deg,
460
+ #e4e4e4 0%,
461
+ #f1f1f1 40%,
462
+ #ededed 60%,
463
+ #e4e4e4 100%
464
+ );
465
+ background-position: 0px 0px;
466
+ background-repeat: repeat;
467
+ animation: animatedBackground 5s linear infinite;
468
+ }
469
+ `;
470
+
471
+ // Expandable block
472
+ export const expandable = css`
473
+ details summary {
474
+ font-size: 1.0em;
475
+ line-height: 1.0em;
476
+ font-weight: 500;
477
+ margin: 15px 0;
478
+ cursor: pointer;
479
+ }
480
+
481
+ details summary svg {
482
+ height: 18px;
483
+ vertical-align: sub;
484
+ margin-right: 2px;
485
+ }
486
+ `;
487
+
488
+ // Print hidden
489
+ export const noprint = css`
490
+ @media print {
491
+ .pnx-print-hidden { display: none !important; }
492
+ }
493
+ `;
494
+
495
+ // Data table
496
+ export const table = css`
497
+ table {
498
+ border-collapse: collapse;
499
+ font-size: 0.9rem;
500
+ width: 100%;
501
+ max-width: 100%;
502
+ font-family: var(--font-family);
503
+ background: var(--white);
504
+ }
505
+
506
+ th, td {
507
+ padding: 10px;
508
+ text-align: left;
509
+ border-bottom: 1px solid #ddd;
510
+ }
511
+
512
+ th { font-weight: 600; }
513
+ `;
514
+
515
+ // Iconify icons
516
+ export const iconify = css`
517
+ iconify-icon {
518
+ display: inline-block;
519
+ width: 1em;
520
+ height: 1em;
521
+ }
522
+ `;
523
+
524
+ // Tabbed-legend data blocks
525
+ export const dataBlocks = css`
526
+ .data-block {
527
+ display: inline-block;
528
+ margin: 8px 0;
529
+ box-sizing: border-box;
530
+ vertical-align: top;
531
+ }
532
+ .data-block h5 {
533
+ font-size: 0.8em;
534
+ font-weight: 400;
535
+ color: var(--blue-dark);
536
+ margin: 0 0 5px 0;
537
+ display: flex;
538
+ align-items: center;
539
+ gap: 5px;
540
+ }
541
+ .data-block h5 pnx-button { vertical-align: middle; }
542
+ .data-block h5 svg.svg-inline--fa { height: 14px; }
543
+ .data-block div {
544
+ font-size: 0.8em;
545
+ }
546
+ `;
547
+
548
+ // Documentation popup
549
+ export const docPopup = css`
550
+ h4 {
551
+ font-size: 1.3em;
552
+ font-weight: 600;
553
+ border-bottom: 3px solid var(--grey-pale);
554
+ padding-bottom: 10px;
555
+ padding-top: 5px;
556
+ }
557
+ `;
@@ -0,0 +1,159 @@
1
+ import { LitElement, css, html, nothing } from "lit";
2
+ import { fa, onceParentAvailable } from "../../utils/widgets.js";
3
+ import { faTags, faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
4
+ import { hasAnnotations } from "../../utils/picture.js";
5
+ import { classMap } from "lit/directives/class-map.js";
6
+ import { panel } from "../styles.js";
7
+ import { DISABLE_ANNOTATIONS_PARAM } from "../../utils/utils.js";
8
+
9
+ /**
10
+ * AnnotationsSwitch component allows to switch on/off pictures annotations.
11
+ * @class Panoramax.components.ui.AnnotationsSwitch
12
+ * @element pnx-annotations-switch
13
+ * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
14
+ * @example
15
+ * ```html
16
+ * <pnx-annotations-switch ._parent=${viewer} />
17
+ * ```
18
+ */
19
+ export default class AnnotationsSwitch extends LitElement {
20
+ /** @private */
21
+ static styles = [ panel, css`
22
+ .pnx-panel {
23
+ padding: 5px;
24
+ margin-top: 5px;
25
+ width: max-content;
26
+ min-width: unset;
27
+ }
28
+
29
+ /* Custom button look */
30
+ pnx-button::part(btn) {
31
+ border-radius: 8px;
32
+ height: 26px;
33
+ width: 26px;
34
+ }
35
+
36
+ pnx-button[size="xl"]::part(btn) {
37
+ border-radius: 8px;
38
+ height: 38px;
39
+ width: 38px;
40
+ }
41
+
42
+ pnx-button[active]::part(btn),
43
+ pnx-button[active]:hover::part(btn) {
44
+ background-color: var(--widget-bg-active) !important;
45
+ border-color: var(--widget-bg-active) !important;
46
+ color: var(--widget-font-active) !important;
47
+ }
48
+
49
+ /* No-annotations badge */
50
+ .pnx-annotations-switch-empty {
51
+ position: absolute;
52
+ top: 1px;
53
+ right: 1px;
54
+ color: var(--orange);
55
+ height: 8px;
56
+ }
57
+
58
+ pnx-button[size="xl"] .pnx-annotations-switch-empty {
59
+ top: 2px;
60
+ right: 2px;
61
+ height: 12px;
62
+ }
63
+
64
+ pnx-button[active] .pnx-annotations-switch-empty {
65
+ color: var(--yellow);
66
+ }
67
+ `];
68
+
69
+ /**
70
+ * Component properties.
71
+ * @memberof Panoramax.components.ui.AnnotationsSwitch#
72
+ * @type {Object}
73
+ * @property {string} [size=xl] Button size (md, xl)
74
+ */
75
+ static properties = {
76
+ size: {type: String},
77
+ _annotationsToggled: {state: true},
78
+ _warnNoAnnot: {state: true},
79
+ _warnNoAnnotTooltip: {state: true},
80
+ };
81
+
82
+ constructor() {
83
+ super();
84
+ this._annotationsToggled = false;
85
+ this._warnNoAnnot = false;
86
+ this._warnNoAnnotTooltip = false;
87
+ this.size = "xl";
88
+ }
89
+
90
+ /** @private */
91
+ connectedCallback() {
92
+ super.connectedCallback();
93
+
94
+ onceParentAvailable(this).then(() => {
95
+ this._parent.onceReady().then(() => {
96
+ this._parent.psv.addEventListener("annotations-toggled", e => {
97
+ this._annotationsToggled = e.detail.visible;
98
+ this._persistAnnotationsLocalStorage(this._annotationsToggled);
99
+ });
100
+
101
+ this._warnNoAnnot = !hasAnnotations(this._parent.psv.getPictureMetadata());
102
+ this._parent.psv.addEventListener("picture-loaded", () => {
103
+ this._warnNoAnnot = !hasAnnotations(this._parent.psv.getPictureMetadata());
104
+ });
105
+ });
106
+
107
+ this._parent.onceFirstPicLoaded().then(() => {
108
+ this._annotationsToggled = this._parent.psv.areAnnotationsVisible() || false;
109
+ this._persistAnnotationsLocalStorage(this._annotationsToggled);
110
+ });
111
+ });
112
+ }
113
+
114
+ /** @private */
115
+ _persistAnnotationsLocalStorage(isAnnotToggled) {
116
+ localStorage.setItem(DISABLE_ANNOTATIONS_PARAM, isAnnotToggled ? "false": "true");
117
+ }
118
+
119
+ /** @private */
120
+ _onClick() {
121
+ if(!this._annotationsToggled && this._warnNoAnnot) {
122
+ this._warnNoAnnotTooltip = true;
123
+ setTimeout(() => this._warnNoAnnotTooltip = false, 2000);
124
+ }
125
+ this._persistAnnotationsLocalStorage(!this._annotationsToggled);
126
+ this._parent.psv.toggleAllAnnotations(!this._annotationsToggled);
127
+ }
128
+
129
+ /** @private */
130
+ render() {
131
+ const panelClasses = {
132
+ "pnx-panel": true,
133
+ "pnx-hidden": !this._warnNoAnnotTooltip,
134
+ };
135
+
136
+ return html`
137
+ <pnx-button
138
+ kind="superflat"
139
+ size=${this.size}
140
+ style="vertical-align: middle"
141
+ class="pnx-print-hidden"
142
+ title=${this._annotationsToggled ? this._parent._t?.pnx.semantics_hide_annotations : this._parent._t?.pnx.semantics_show_annotations}
143
+ active=${this._annotationsToggled ? "" : nothing}
144
+ @click=${this._onClick}
145
+ >
146
+ ${fa(faTags, { styles: { "height": "20px" }})}
147
+ ${this._warnNoAnnot ? fa(faTriangleExclamation, { classes: "pnx-annotations-switch-empty" }) : nothing}
148
+ </pnx-button>
149
+ <div
150
+ class=${classMap(panelClasses)}
151
+ @click=${() => this._warnNoAnnotTooltip = false}
152
+ >
153
+ ${this._parent._t?.pnx.semantics_zero_annotations}
154
+ </div>
155
+ `;
156
+ }
157
+ }
158
+
159
+ customElements.define("pnx-annotations-switch", AnnotationsSwitch);