@panoramax/web-viewer 3.2.3 → 4.0.0-develop-39167b4d
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.
- package/.gitlab-ci.yml +13 -6
- package/CHANGELOG.md +53 -1
- package/CODE_OF_CONDUCT.md +1 -1
- package/README.md +1 -1
- package/build/editor.html +10 -1
- package/build/index.css +12 -12
- package/build/index.css.map +1 -1
- package/build/index.html +1 -1
- package/build/index.js +2126 -14
- package/build/index.js.map +1 -1
- package/build/map.html +1 -1
- package/build/photo.html +1 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff2 +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff2 +0 -0
- package/build/viewer.html +12 -1
- package/build/widgets.html +1 -0
- package/config/jest/mocks.js +201 -0
- package/config/paths.js +2 -0
- package/config/webpack.config.js +52 -0
- package/docs/03_URL_settings.md +14 -16
- package/docs/05_Compatibility.md +59 -76
- package/docs/09_Develop.md +46 -11
- package/docs/90_Releases.md +2 -2
- package/docs/images/class_diagram.drawio +60 -45
- package/docs/images/class_diagram.jpg +0 -0
- package/docs/images/screenshot.jpg +0 -0
- package/docs/index.md +135 -0
- package/docs/reference/components/core/Basic.md +196 -0
- package/docs/reference/components/core/CoverageMap.md +210 -0
- package/docs/reference/components/core/Editor.md +224 -0
- package/docs/reference/components/core/PhotoViewer.md +307 -0
- package/docs/reference/components/core/Viewer.md +350 -0
- package/docs/reference/components/layout/BottomDrawer.md +35 -0
- package/docs/reference/components/layout/CorneredGrid.md +29 -0
- package/docs/reference/components/layout/Mini.md +45 -0
- package/docs/reference/components/layout/Tabs.md +45 -0
- package/docs/reference/components/menus/MapBackground.md +32 -0
- package/docs/reference/components/menus/MapFilters.md +15 -0
- package/docs/reference/components/menus/MapLayers.md +15 -0
- package/docs/reference/components/menus/MapLegend.md +15 -0
- package/docs/reference/components/menus/PictureLegend.md +16 -0
- package/docs/reference/components/menus/PictureMetadata.md +15 -0
- package/docs/reference/components/menus/PlayerOptions.md +15 -0
- package/docs/reference/components/menus/QualityScoreDoc.md +15 -0
- package/docs/reference/components/menus/ReportForm.md +15 -0
- package/docs/reference/components/menus/ShareMenu.md +15 -0
- package/docs/reference/components/ui/Button.md +40 -0
- package/docs/reference/components/ui/ButtonGroup.md +36 -0
- package/docs/reference/components/ui/CopyButton.md +38 -0
- package/docs/reference/components/ui/Grade.md +32 -0
- package/docs/reference/components/ui/LinkButton.md +45 -0
- package/docs/reference/components/ui/ListGroup.md +22 -0
- package/docs/reference/components/ui/Loader.md +56 -0
- package/docs/reference/components/ui/Map.md +239 -0
- package/docs/reference/components/ui/MapMore.md +256 -0
- package/docs/reference/components/ui/Photo.md +385 -0
- package/docs/reference/components/ui/Popup.md +56 -0
- package/docs/reference/components/ui/ProgressBar.md +32 -0
- package/docs/reference/components/ui/QualityScore.md +45 -0
- package/docs/reference/components/ui/SearchBar.md +63 -0
- package/docs/reference/components/ui/TogglableGroup.md +39 -0
- package/docs/reference/components/ui/widgets/GeoSearch.md +32 -0
- package/docs/reference/components/ui/widgets/Legend.md +49 -0
- package/docs/reference/components/ui/widgets/MapFiltersButton.md +33 -0
- package/docs/reference/components/ui/widgets/MapLayersButton.md +15 -0
- package/docs/reference/components/ui/widgets/OSMEditors.md +15 -0
- package/docs/reference/components/ui/widgets/PictureLegendActions.md +32 -0
- package/docs/reference/components/ui/widgets/Player.md +33 -0
- package/docs/reference/components/ui/widgets/Zoom.md +15 -0
- package/docs/reference/utils/API.md +334 -0
- package/docs/reference/utils/InitParameters.md +68 -0
- package/docs/reference/utils/URLHandler.md +107 -0
- package/docs/reference.md +79 -0
- package/docs/shortcuts.md +11 -0
- package/docs/tutorials/aerial_imagery.md +19 -0
- package/docs/tutorials/authentication.md +10 -0
- package/docs/tutorials/custom_widgets.md +59 -0
- package/docs/tutorials/map_style.md +39 -0
- package/docs/tutorials/migrate_v4.md +153 -0
- package/docs/tutorials/synced_coverage.md +43 -0
- package/mkdocs.yml +66 -5
- package/package.json +22 -17
- package/public/editor.html +21 -29
- package/public/index.html +17 -12
- package/public/map.html +19 -18
- package/public/photo.html +55 -0
- package/public/viewer.html +22 -26
- package/public/widgets.html +306 -0
- package/scripts/doc.js +79 -0
- package/src/components/core/Basic.css +48 -0
- package/src/components/core/Basic.js +349 -0
- package/src/components/core/CoverageMap.css +9 -0
- package/src/components/core/CoverageMap.js +139 -0
- package/src/components/core/Editor.css +23 -0
- package/src/components/core/Editor.js +390 -0
- package/src/components/core/PhotoViewer.css +48 -0
- package/src/components/core/PhotoViewer.js +499 -0
- package/src/components/core/Viewer.css +98 -0
- package/src/components/core/Viewer.js +564 -0
- package/src/components/core/index.js +12 -0
- package/src/components/index.js +13 -0
- package/src/components/layout/BottomDrawer.js +257 -0
- package/src/components/layout/CorneredGrid.js +112 -0
- package/src/components/layout/Mini.js +117 -0
- package/src/components/layout/Tabs.js +133 -0
- package/src/components/layout/index.js +9 -0
- package/src/components/menus/MapBackground.js +106 -0
- package/src/components/menus/MapFilters.js +400 -0
- package/src/components/menus/MapLayers.js +143 -0
- package/src/components/menus/MapLegend.js +34 -0
- package/src/components/menus/PictureLegend.js +257 -0
- package/src/components/menus/PictureMetadata.js +317 -0
- package/src/components/menus/PlayerOptions.js +95 -0
- package/src/components/menus/QualityScoreDoc.js +36 -0
- package/src/components/menus/ReportForm.js +133 -0
- package/src/components/menus/Share.js +100 -0
- package/src/components/menus/index.js +15 -0
- package/src/components/styles.js +383 -0
- package/src/components/ui/Button.js +77 -0
- package/src/components/ui/ButtonGroup.css +57 -0
- package/src/components/ui/ButtonGroup.js +68 -0
- package/src/components/ui/CopyButton.js +106 -0
- package/src/components/ui/Grade.js +54 -0
- package/src/components/ui/LinkButton.js +67 -0
- package/src/components/ui/ListGroup.js +66 -0
- package/src/components/ui/Loader.js +203 -0
- package/src/components/{Map.css → ui/Map.css} +5 -17
- package/src/components/{Map.js → ui/Map.js} +148 -156
- package/src/components/ui/MapMore.js +324 -0
- package/src/components/{Photo.css → ui/Photo.css} +6 -6
- package/src/components/{Photo.js → ui/Photo.js} +313 -101
- package/src/components/ui/Popup.js +145 -0
- package/src/components/ui/ProgressBar.js +104 -0
- package/src/components/ui/QualityScore.js +147 -0
- package/src/components/ui/SearchBar.js +367 -0
- package/src/components/ui/TogglableGroup.js +157 -0
- package/src/components/ui/index.js +22 -0
- package/src/components/ui/widgets/GeoSearch.css +21 -0
- package/src/components/ui/widgets/GeoSearch.js +139 -0
- package/src/components/ui/widgets/Legend.js +113 -0
- package/src/components/ui/widgets/MapFiltersButton.js +104 -0
- package/src/components/ui/widgets/MapLayersButton.js +79 -0
- package/src/components/ui/widgets/OSMEditors.js +155 -0
- package/src/components/ui/widgets/PictureLegendActions.js +117 -0
- package/src/components/ui/widgets/Player.css +7 -0
- package/src/components/ui/widgets/Player.js +151 -0
- package/src/components/ui/widgets/Zoom.js +82 -0
- package/src/components/ui/widgets/index.js +13 -0
- package/src/img/loader_base.jpg +0 -0
- package/src/img/panoramax.svg +13 -0
- package/src/img/switch_big.svg +20 -10
- package/src/index.js +7 -9
- package/src/translations/br.json +1 -0
- package/src/translations/da.json +38 -15
- package/src/translations/de.json +5 -3
- package/src/translations/en.json +35 -15
- package/src/translations/eo.json +38 -15
- package/src/translations/es.json +1 -1
- package/src/translations/fr.json +36 -16
- package/src/translations/hu.json +1 -1
- package/src/translations/it.json +39 -16
- package/src/translations/ja.json +182 -1
- package/src/translations/nl.json +106 -6
- package/src/translations/pl.json +1 -1
- package/src/translations/sv.json +182 -0
- package/src/translations/zh_Hant.json +35 -14
- package/src/utils/API.js +109 -49
- package/src/utils/InitParameters.js +388 -0
- package/src/utils/PhotoAdapter.js +1 -0
- package/src/utils/URLHandler.js +362 -0
- package/src/utils/geocoder.js +152 -0
- package/src/utils/{I18n.js → i18n.js} +7 -3
- package/src/utils/index.js +11 -0
- package/src/utils/{Map.js → map.js} +256 -77
- package/src/utils/picture.js +442 -0
- package/src/utils/utils.js +324 -0
- package/src/utils/widgets.js +55 -0
- package/tests/components/core/Basic.test.js +121 -0
- package/tests/components/core/BasicMock.js +25 -0
- package/tests/components/core/CoverageMap.test.js +20 -0
- package/tests/components/core/Editor.test.js +20 -0
- package/tests/components/core/PhotoViewer.test.js +57 -0
- package/tests/components/core/Viewer.test.js +84 -0
- package/tests/components/core/__snapshots__/PhotoViewer.test.js.snap +73 -0
- package/tests/components/core/__snapshots__/Viewer.test.js.snap +145 -0
- package/tests/components/ui/CopyButton.test.js +52 -0
- package/tests/components/ui/Loader.test.js +55 -0
- package/tests/components/{Map.test.js → ui/Map.test.js} +73 -61
- package/tests/components/{Photo.test.js → ui/Photo.test.js} +97 -63
- package/tests/components/ui/Popup.test.js +26 -0
- package/tests/components/ui/QualityScore.test.js +18 -0
- package/tests/components/ui/SearchBar.test.js +110 -0
- package/tests/components/ui/__snapshots__/CopyButton.test.js.snap +33 -0
- package/tests/components/ui/__snapshots__/Loader.test.js.snap +56 -0
- package/tests/components/{__snapshots__ → ui/__snapshots__}/Map.test.js.snap +11 -38
- package/tests/components/{__snapshots__ → ui/__snapshots__}/Photo.test.js.snap +70 -6
- package/tests/components/ui/__snapshots__/Popup.test.js.snap +29 -0
- package/tests/components/ui/__snapshots__/QualityScore.test.js.snap +11 -0
- package/tests/components/ui/__snapshots__/SearchBar.test.js.snap +65 -0
- package/tests/utils/API.test.js +83 -83
- package/tests/utils/InitParameters.test.js +499 -0
- package/tests/utils/URLHandler.test.js +401 -0
- package/tests/utils/__snapshots__/API.test.js.snap +10 -0
- package/tests/utils/__snapshots__/URLHandler.test.js.snap +21 -0
- package/tests/utils/__snapshots__/{Map.test.js.snap → geocoder.test.js.snap} +1 -1
- package/tests/utils/__snapshots__/map.test.js.snap +11 -0
- package/tests/utils/__snapshots__/picture.test.js.snap +327 -0
- package/tests/utils/__snapshots__/widgets.test.js.snap +19 -0
- package/tests/utils/geocoder.test.js +37 -0
- package/tests/utils/{I18n.test.js → i18n.test.js} +8 -8
- package/tests/utils/map.test.js +126 -0
- package/tests/utils/picture.test.js +745 -0
- package/tests/utils/utils.test.js +288 -0
- package/tests/utils/widgets.test.js +31 -0
- package/docs/01_Start.md +0 -149
- package/docs/02_Usage.md +0 -831
- package/docs/04_Advanced_examples.md +0 -216
- package/src/Editor.css +0 -37
- package/src/Editor.js +0 -361
- package/src/StandaloneMap.js +0 -114
- package/src/Viewer.css +0 -203
- package/src/Viewer.js +0 -1246
- package/src/components/CoreView.css +0 -70
- package/src/components/CoreView.js +0 -175
- package/src/components/Loader.css +0 -74
- package/src/components/Loader.js +0 -120
- package/src/img/loader_hd.jpg +0 -0
- package/src/utils/Exif.js +0 -193
- package/src/utils/Utils.js +0 -631
- package/src/utils/Widgets.js +0 -562
- package/src/viewer/URLHash.js +0 -469
- package/src/viewer/Widgets.css +0 -880
- package/src/viewer/Widgets.js +0 -1470
- package/tests/Editor.test.js +0 -126
- package/tests/StandaloneMap.test.js +0 -45
- package/tests/Viewer.test.js +0 -366
- package/tests/__snapshots__/Editor.test.js.snap +0 -298
- package/tests/__snapshots__/StandaloneMap.test.js.snap +0 -30
- package/tests/__snapshots__/Viewer.test.js.snap +0 -195
- package/tests/components/CoreView.test.js +0 -92
- package/tests/components/Loader.test.js +0 -38
- package/tests/components/__snapshots__/Loader.test.js.snap +0 -15
- package/tests/utils/Exif.test.js +0 -124
- package/tests/utils/Map.test.js +0 -113
- package/tests/utils/Utils.test.js +0 -300
- package/tests/utils/Widgets.test.js +0 -107
- package/tests/utils/__snapshots__/Exif.test.js.snap +0 -43
- package/tests/utils/__snapshots__/Utils.test.js.snap +0 -41
- package/tests/utils/__snapshots__/Widgets.test.js.snap +0 -44
- package/tests/viewer/URLHash.test.js +0 -559
- package/tests/viewer/Widgets.test.js +0 -127
- package/tests/viewer/__snapshots__/URLHash.test.js.snap +0 -108
- package/tests/viewer/__snapshots__/Widgets.test.js.snap +0 -403
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`_addMapBackgroundWidget works 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
class="gvs-panel gvs-widget-bg gvs-input-group"
|
|
7
|
-
id="gvs-map-bg"
|
|
8
|
-
>
|
|
9
|
-
<input
|
|
10
|
-
id="gvs-map-bg-streets"
|
|
11
|
-
name="gvs-map-bg"
|
|
12
|
-
type="radio"
|
|
13
|
-
value="streets"
|
|
14
|
-
/>
|
|
15
|
-
<label
|
|
16
|
-
for="gvs-map-bg-streets"
|
|
17
|
-
>
|
|
18
|
-
<img
|
|
19
|
-
alt=""
|
|
20
|
-
src="bg_streets.jpg"
|
|
21
|
-
/>
|
|
22
|
-
Streets
|
|
23
|
-
</label>
|
|
24
|
-
<input
|
|
25
|
-
id="gvs-map-bg-aerial"
|
|
26
|
-
name="gvs-map-bg"
|
|
27
|
-
type="radio"
|
|
28
|
-
value="aerial"
|
|
29
|
-
/>
|
|
30
|
-
<label
|
|
31
|
-
for="gvs-map-bg-aerial"
|
|
32
|
-
>
|
|
33
|
-
<img
|
|
34
|
-
alt=""
|
|
35
|
-
src="bg_aerial.jpg"
|
|
36
|
-
/>
|
|
37
|
-
Aerial
|
|
38
|
-
</label>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
exports[`_bindPicturesEvents works 1`] = `
|
|
44
|
-
Array [
|
|
45
|
-
Array [
|
|
46
|
-
"mousemove",
|
|
47
|
-
"geovisio_editor_pictures",
|
|
48
|
-
[Function],
|
|
49
|
-
],
|
|
50
|
-
Array [
|
|
51
|
-
"mouseleave",
|
|
52
|
-
"geovisio_editor_pictures",
|
|
53
|
-
[Function],
|
|
54
|
-
],
|
|
55
|
-
Array [
|
|
56
|
-
"click",
|
|
57
|
-
"geovisio_editor_pictures",
|
|
58
|
-
[Function],
|
|
59
|
-
],
|
|
60
|
-
]
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
exports[`_createMapStyle works 1`] = `
|
|
64
|
-
Object {
|
|
65
|
-
"layers": Array [
|
|
66
|
-
Object {
|
|
67
|
-
"id": "geovisio_editor_sequences",
|
|
68
|
-
"layout": Object {
|
|
69
|
-
"line-cap": "square",
|
|
70
|
-
},
|
|
71
|
-
"paint": Object {
|
|
72
|
-
"line-width": Array [
|
|
73
|
-
"interpolate",
|
|
74
|
-
Array [
|
|
75
|
-
"linear",
|
|
76
|
-
],
|
|
77
|
-
Array [
|
|
78
|
-
"zoom",
|
|
79
|
-
],
|
|
80
|
-
0,
|
|
81
|
-
0.5,
|
|
82
|
-
10,
|
|
83
|
-
2,
|
|
84
|
-
14,
|
|
85
|
-
4,
|
|
86
|
-
16,
|
|
87
|
-
5,
|
|
88
|
-
22,
|
|
89
|
-
3,
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
"source": "geovisio_editor_sequences",
|
|
93
|
-
"type": "line",
|
|
94
|
-
},
|
|
95
|
-
Object {
|
|
96
|
-
"id": "geovisio_editor_pictures",
|
|
97
|
-
"layout": Object {},
|
|
98
|
-
"paint": Object {
|
|
99
|
-
"circle-opacity": Array [
|
|
100
|
-
"interpolate",
|
|
101
|
-
Array [
|
|
102
|
-
"linear",
|
|
103
|
-
],
|
|
104
|
-
Array [
|
|
105
|
-
"zoom",
|
|
106
|
-
],
|
|
107
|
-
15,
|
|
108
|
-
0,
|
|
109
|
-
16,
|
|
110
|
-
1,
|
|
111
|
-
],
|
|
112
|
-
"circle-radius": Array [
|
|
113
|
-
"interpolate",
|
|
114
|
-
Array [
|
|
115
|
-
"linear",
|
|
116
|
-
],
|
|
117
|
-
Array [
|
|
118
|
-
"zoom",
|
|
119
|
-
],
|
|
120
|
-
15,
|
|
121
|
-
4.5,
|
|
122
|
-
18,
|
|
123
|
-
6,
|
|
124
|
-
24,
|
|
125
|
-
12,
|
|
126
|
-
],
|
|
127
|
-
"circle-stroke-color": "#ffffff",
|
|
128
|
-
"circle-stroke-width": Array [
|
|
129
|
-
"interpolate",
|
|
130
|
-
Array [
|
|
131
|
-
"linear",
|
|
132
|
-
],
|
|
133
|
-
Array [
|
|
134
|
-
"zoom",
|
|
135
|
-
],
|
|
136
|
-
16,
|
|
137
|
-
0,
|
|
138
|
-
17,
|
|
139
|
-
1,
|
|
140
|
-
18,
|
|
141
|
-
1.5,
|
|
142
|
-
24,
|
|
143
|
-
3,
|
|
144
|
-
],
|
|
145
|
-
},
|
|
146
|
-
"source": "geovisio_editor_sequences",
|
|
147
|
-
"type": "circle",
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
"sources": Object {
|
|
151
|
-
"geovisio_editor_sequences": Object {
|
|
152
|
-
"data": Object {
|
|
153
|
-
"features": Array [],
|
|
154
|
-
"type": "FeatureCollection",
|
|
155
|
-
},
|
|
156
|
-
"type": "geojson",
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
}
|
|
160
|
-
`;
|
|
161
|
-
|
|
162
|
-
exports[`_getNode works 1`] = `
|
|
163
|
-
Object {
|
|
164
|
-
"caption": Object {},
|
|
165
|
-
"gps": Array [
|
|
166
|
-
0.1,
|
|
167
|
-
0.1,
|
|
168
|
-
],
|
|
169
|
-
"horizontalFov": 70,
|
|
170
|
-
"id": undefined,
|
|
171
|
-
"panorama": Object {
|
|
172
|
-
"basePanoData": [Function],
|
|
173
|
-
"baseUrl": "2.jpg",
|
|
174
|
-
"cols": 2,
|
|
175
|
-
"hdUrl": undefined,
|
|
176
|
-
"origBaseUrl": "2.jpg",
|
|
177
|
-
"rows": 1,
|
|
178
|
-
"thumbUrl": undefined,
|
|
179
|
-
"tileUrl": [Function],
|
|
180
|
-
"width": 2,
|
|
181
|
-
},
|
|
182
|
-
"properties": Object {
|
|
183
|
-
"id": "2",
|
|
184
|
-
},
|
|
185
|
-
"sequence": Object {
|
|
186
|
-
"id": undefined,
|
|
187
|
-
"nextPic": undefined,
|
|
188
|
-
"prevPic": undefined,
|
|
189
|
-
},
|
|
190
|
-
"sphereCorrection": Object {},
|
|
191
|
-
}
|
|
192
|
-
`;
|
|
193
|
-
|
|
194
|
-
exports[`previewSequenceHeadingChange works when setting preview 1`] = `
|
|
195
|
-
Array [
|
|
196
|
-
Array [
|
|
197
|
-
Object {
|
|
198
|
-
"id": "sequence-headings",
|
|
199
|
-
"layout": Object {
|
|
200
|
-
"icon-image": "gvs-marker",
|
|
201
|
-
"icon-overlap": "always",
|
|
202
|
-
"icon-size": 0.8,
|
|
203
|
-
},
|
|
204
|
-
"source": "geovisio_editor_sequences",
|
|
205
|
-
"type": "symbol",
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
]
|
|
209
|
-
`;
|
|
210
|
-
|
|
211
|
-
exports[`previewSequenceHeadingChange works when setting preview 2`] = `
|
|
212
|
-
Array [
|
|
213
|
-
Array [
|
|
214
|
-
"sequence-headings",
|
|
215
|
-
"visibility",
|
|
216
|
-
"visible",
|
|
217
|
-
],
|
|
218
|
-
Array [
|
|
219
|
-
"sequence-headings",
|
|
220
|
-
"icon-rotate",
|
|
221
|
-
Array [
|
|
222
|
-
"+",
|
|
223
|
-
Array [
|
|
224
|
-
"get",
|
|
225
|
-
"view:azimuth",
|
|
226
|
-
],
|
|
227
|
-
-12,
|
|
228
|
-
10,
|
|
229
|
-
],
|
|
230
|
-
],
|
|
231
|
-
]
|
|
232
|
-
`;
|
|
233
|
-
|
|
234
|
-
exports[`previewSequenceHeadingChange works when setting preview 3`] = `
|
|
235
|
-
Array [
|
|
236
|
-
Array [
|
|
237
|
-
"sequence-headings",
|
|
238
|
-
Array [
|
|
239
|
-
"all",
|
|
240
|
-
Array [
|
|
241
|
-
"==",
|
|
242
|
-
Array [
|
|
243
|
-
"geometry-type",
|
|
244
|
-
],
|
|
245
|
-
"Point",
|
|
246
|
-
],
|
|
247
|
-
],
|
|
248
|
-
],
|
|
249
|
-
]
|
|
250
|
-
`;
|
|
251
|
-
|
|
252
|
-
exports[`previewSequenceHeadingChange works when unsetting 1`] = `Array []`;
|
|
253
|
-
|
|
254
|
-
exports[`previewSequenceHeadingChange works when unsetting 2`] = `
|
|
255
|
-
Array [
|
|
256
|
-
Array [
|
|
257
|
-
"sequence-headings",
|
|
258
|
-
"visibility",
|
|
259
|
-
"visible",
|
|
260
|
-
],
|
|
261
|
-
Array [
|
|
262
|
-
"sequence-headings",
|
|
263
|
-
"icon-rotate",
|
|
264
|
-
Array [
|
|
265
|
-
"+",
|
|
266
|
-
Array [
|
|
267
|
-
"get",
|
|
268
|
-
"view:azimuth",
|
|
269
|
-
],
|
|
270
|
-
-12,
|
|
271
|
-
10,
|
|
272
|
-
],
|
|
273
|
-
],
|
|
274
|
-
Array [
|
|
275
|
-
"sequence-headings",
|
|
276
|
-
"visibility",
|
|
277
|
-
"none",
|
|
278
|
-
],
|
|
279
|
-
]
|
|
280
|
-
`;
|
|
281
|
-
|
|
282
|
-
exports[`previewSequenceHeadingChange works when unsetting 3`] = `
|
|
283
|
-
Array [
|
|
284
|
-
Array [
|
|
285
|
-
"sequence-headings",
|
|
286
|
-
Array [
|
|
287
|
-
"all",
|
|
288
|
-
Array [
|
|
289
|
-
"==",
|
|
290
|
-
Array [
|
|
291
|
-
"geometry-type",
|
|
292
|
-
],
|
|
293
|
-
"Point",
|
|
294
|
-
],
|
|
295
|
-
],
|
|
296
|
-
],
|
|
297
|
-
]
|
|
298
|
-
`;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`_onSelect works 1`] = `
|
|
4
|
-
Array [
|
|
5
|
-
Array [
|
|
6
|
-
Object {
|
|
7
|
-
"filter": Array [
|
|
8
|
-
"==",
|
|
9
|
-
Array [
|
|
10
|
-
"get",
|
|
11
|
-
"id",
|
|
12
|
-
],
|
|
13
|
-
"bla",
|
|
14
|
-
],
|
|
15
|
-
"layers": Array [
|
|
16
|
-
"geovisio_pictures",
|
|
17
|
-
"geovisio_toto_pictures",
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
]
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
exports[`_onSelect works 2`] = `Array []`;
|
|
25
|
-
|
|
26
|
-
exports[`destroy works 1`] = `
|
|
27
|
-
Array [
|
|
28
|
-
Array [],
|
|
29
|
-
]
|
|
30
|
-
`;
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`setFilters works 1`] = `
|
|
4
|
-
Array [
|
|
5
|
-
Array [
|
|
6
|
-
CustomEvent {
|
|
7
|
-
"isTrusted": false,
|
|
8
|
-
},
|
|
9
|
-
],
|
|
10
|
-
Array [
|
|
11
|
-
CustomEvent {
|
|
12
|
-
"isTrusted": false,
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
]
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
exports[`setFilters works 2`] = `
|
|
19
|
-
Array [
|
|
20
|
-
Array [],
|
|
21
|
-
]
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
exports[`setFilters works 3`] = `
|
|
25
|
-
Array [
|
|
26
|
-
Array [
|
|
27
|
-
"sequences",
|
|
28
|
-
Array [
|
|
29
|
-
"step",
|
|
30
|
-
Array [
|
|
31
|
-
"zoom",
|
|
32
|
-
],
|
|
33
|
-
true,
|
|
34
|
-
7,
|
|
35
|
-
Array [
|
|
36
|
-
"all",
|
|
37
|
-
Array [
|
|
38
|
-
">=",
|
|
39
|
-
Array [
|
|
40
|
-
"get",
|
|
41
|
-
"date",
|
|
42
|
-
],
|
|
43
|
-
"2023-01-01",
|
|
44
|
-
],
|
|
45
|
-
Array [
|
|
46
|
-
"<=",
|
|
47
|
-
Array [
|
|
48
|
-
"get",
|
|
49
|
-
"date",
|
|
50
|
-
],
|
|
51
|
-
"2023-08-08",
|
|
52
|
-
],
|
|
53
|
-
Array [
|
|
54
|
-
"==",
|
|
55
|
-
Array [
|
|
56
|
-
"get",
|
|
57
|
-
"type",
|
|
58
|
-
],
|
|
59
|
-
"equirectangular",
|
|
60
|
-
],
|
|
61
|
-
Array [
|
|
62
|
-
">=",
|
|
63
|
-
Array [
|
|
64
|
-
"get",
|
|
65
|
-
"model",
|
|
66
|
-
],
|
|
67
|
-
"sony ",
|
|
68
|
-
Array [
|
|
69
|
-
"collator",
|
|
70
|
-
Object {
|
|
71
|
-
"case-sensitive": false,
|
|
72
|
-
"diacritic-sensitive": false,
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
],
|
|
76
|
-
Array [
|
|
77
|
-
"<=",
|
|
78
|
-
Array [
|
|
79
|
-
"get",
|
|
80
|
-
"model",
|
|
81
|
-
],
|
|
82
|
-
"sonyzzzzzzzzzzzzzzzzzzzz",
|
|
83
|
-
Array [
|
|
84
|
-
"collator",
|
|
85
|
-
Object {
|
|
86
|
-
"case-sensitive": false,
|
|
87
|
-
"diacritic-sensitive": false,
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
],
|
|
91
|
-
],
|
|
92
|
-
],
|
|
93
|
-
],
|
|
94
|
-
Array [
|
|
95
|
-
"pictures",
|
|
96
|
-
Array [
|
|
97
|
-
"step",
|
|
98
|
-
Array [
|
|
99
|
-
"zoom",
|
|
100
|
-
],
|
|
101
|
-
true,
|
|
102
|
-
15,
|
|
103
|
-
Array [
|
|
104
|
-
"all",
|
|
105
|
-
Array [
|
|
106
|
-
">=",
|
|
107
|
-
Array [
|
|
108
|
-
"get",
|
|
109
|
-
"ts",
|
|
110
|
-
],
|
|
111
|
-
"2023-01-01",
|
|
112
|
-
],
|
|
113
|
-
Array [
|
|
114
|
-
"<=",
|
|
115
|
-
Array [
|
|
116
|
-
"get",
|
|
117
|
-
"ts",
|
|
118
|
-
],
|
|
119
|
-
"2023-08-09",
|
|
120
|
-
],
|
|
121
|
-
Array [
|
|
122
|
-
"==",
|
|
123
|
-
Array [
|
|
124
|
-
"get",
|
|
125
|
-
"type",
|
|
126
|
-
],
|
|
127
|
-
"equirectangular",
|
|
128
|
-
],
|
|
129
|
-
Array [
|
|
130
|
-
">=",
|
|
131
|
-
Array [
|
|
132
|
-
"get",
|
|
133
|
-
"model",
|
|
134
|
-
],
|
|
135
|
-
"sony ",
|
|
136
|
-
Array [
|
|
137
|
-
"collator",
|
|
138
|
-
Object {
|
|
139
|
-
"case-sensitive": false,
|
|
140
|
-
"diacritic-sensitive": false,
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
],
|
|
144
|
-
Array [
|
|
145
|
-
"<=",
|
|
146
|
-
Array [
|
|
147
|
-
"get",
|
|
148
|
-
"model",
|
|
149
|
-
],
|
|
150
|
-
"sonyzzzzzzzzzzzzzzzzzzzz",
|
|
151
|
-
Array [
|
|
152
|
-
"collator",
|
|
153
|
-
Object {
|
|
154
|
-
"case-sensitive": false,
|
|
155
|
-
"diacritic-sensitive": false,
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
],
|
|
159
|
-
],
|
|
160
|
-
],
|
|
161
|
-
],
|
|
162
|
-
Array [
|
|
163
|
-
"sequences",
|
|
164
|
-
null,
|
|
165
|
-
],
|
|
166
|
-
Array [
|
|
167
|
-
"pictures",
|
|
168
|
-
null,
|
|
169
|
-
],
|
|
170
|
-
]
|
|
171
|
-
`;
|
|
172
|
-
|
|
173
|
-
exports[`setPicturesNavigation works 1`] = `
|
|
174
|
-
Array [
|
|
175
|
-
Array [
|
|
176
|
-
CustomEvent {
|
|
177
|
-
"isTrusted": false,
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
Array [
|
|
181
|
-
CustomEvent {
|
|
182
|
-
"isTrusted": false,
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
Array [
|
|
186
|
-
CustomEvent {
|
|
187
|
-
"isTrusted": false,
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
]
|
|
191
|
-
`;
|
|
192
|
-
|
|
193
|
-
exports[`setPopup opens 1`] = `"<div class=\\"gvs-popup-backdrop\\"></div><div class=\\"gvs-widget-bg\\"><button id=\\"gvs-popup-btn-close\\" class=\\"gvs-btn gvs-widget-bg\\"><svg aria-hidden=\\"true\\" focusable=\\"false\\" data-prefix=\\"fas\\" data-icon=\\"xmark\\" class=\\"svg-inline--fa fa-xmark\\" role=\\"img\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 384 512\\"><path fill=\\"currentColor\\" d=\\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\\"></path></svg></button>BLABLABLA</div>"`;
|
|
194
|
-
|
|
195
|
-
exports[`setPopup reopens 1`] = `"<div class=\\"gvs-popup-backdrop\\"></div><div class=\\"gvs-widget-bg\\"><button id=\\"gvs-popup-btn-close\\" class=\\"gvs-btn gvs-widget-bg\\"><svg aria-hidden=\\"true\\" focusable=\\"false\\" data-prefix=\\"fas\\" data-icon=\\"xmark\\" class=\\"svg-inline--fa fa-xmark\\" role=\\"img\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 384 512\\"><path fill=\\"currentColor\\" d=\\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\\"></path></svg></button>BLABLABLA</div>"`;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import Loader from "../../src/components/Loader";
|
|
2
|
-
import CoreView from "../../src/components/CoreView";
|
|
3
|
-
import API from "../../src/utils/API";
|
|
4
|
-
|
|
5
|
-
jest.mock("maplibre-gl", () => ({
|
|
6
|
-
addProtocol: jest.fn(),
|
|
7
|
-
}));
|
|
8
|
-
|
|
9
|
-
global.console = { info: jest.fn() };
|
|
10
|
-
global.AbortSignal = { timeout: jest.fn() };
|
|
11
|
-
|
|
12
|
-
describe("constructor", () => {
|
|
13
|
-
it("works with JS element", () => {
|
|
14
|
-
const container = document.createElement("div");
|
|
15
|
-
const v = new CoreView(container, "https://geovisio.fr/api");
|
|
16
|
-
expect(v._t).toBeDefined();
|
|
17
|
-
expect(v._selectedPicId).toBeNull();
|
|
18
|
-
expect(v._selectedSeqId).toBeNull();
|
|
19
|
-
expect(v._api).toBeInstanceOf(API);
|
|
20
|
-
expect(v.container).toBe(container);
|
|
21
|
-
expect(v._loader).toBeInstanceOf(Loader);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("works with string ID", () => {
|
|
25
|
-
const container = document.createElement("div");
|
|
26
|
-
container.id = "coreview";
|
|
27
|
-
document.body.appendChild(container);
|
|
28
|
-
|
|
29
|
-
const v = new CoreView("coreview", "https://geovisio.fr/api");
|
|
30
|
-
expect(v._t).toBeDefined();
|
|
31
|
-
expect(v._selectedPicId).toBeNull();
|
|
32
|
-
expect(v._selectedSeqId).toBeNull();
|
|
33
|
-
expect(v._api).toBeInstanceOf(API);
|
|
34
|
-
expect(v.container).toBe(container);
|
|
35
|
-
expect(v._loader).toBeInstanceOf(Loader);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("fails on missing element", () => {
|
|
39
|
-
expect(() => new CoreView("geovisio", "https://geovisio.fr/api")).toThrow(new Error("Container is not a valid HTML element, does it exist in your page ?"));
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("handle options", () => {
|
|
43
|
-
const opts = {
|
|
44
|
-
selectedSequence: "seq",
|
|
45
|
-
selectedPicture: "pic",
|
|
46
|
-
fetchOptions: { "bla": "bla" }
|
|
47
|
-
};
|
|
48
|
-
const container = document.createElement("div");
|
|
49
|
-
const v = new CoreView(container, "https://geovisio.fr/api", opts);
|
|
50
|
-
expect(v._selectedPicId).toBe("pic");
|
|
51
|
-
expect(v._selectedSeqId).toBe("seq");
|
|
52
|
-
expect(v._api._fetchOpts).toEqual({ "bla": "bla" });
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
describe("select", () => {
|
|
57
|
-
it("works", () => {
|
|
58
|
-
const container = document.createElement("div");
|
|
59
|
-
const v = new CoreView(container, "https://geovisio.fr/api");
|
|
60
|
-
const p = new Promise(resolve => {
|
|
61
|
-
v.addEventListener("select", e => {
|
|
62
|
-
expect(v._selectedPicId).toBe("pic");
|
|
63
|
-
expect(v._selectedSeqId).toBe("seq");
|
|
64
|
-
expect(e.detail.picId).toBe("pic");
|
|
65
|
-
expect(e.detail.seqId).toBe("seq");
|
|
66
|
-
resolve();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
v.select("seq", "pic");
|
|
70
|
-
return p;
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("unselects", () => {
|
|
74
|
-
const container = document.createElement("div");
|
|
75
|
-
const v = new CoreView(
|
|
76
|
-
container,
|
|
77
|
-
"https://geovisio.fr/api",
|
|
78
|
-
{ selectedSequence: "seq", selectedPicture: "pic" }
|
|
79
|
-
);
|
|
80
|
-
const p = new Promise(resolve => {
|
|
81
|
-
v.addEventListener("select", e => {
|
|
82
|
-
expect(v._selectedPicId).toBeNull();
|
|
83
|
-
expect(v._selectedSeqId).toBeNull();
|
|
84
|
-
expect(e.detail.picId).toBeNull();
|
|
85
|
-
expect(e.detail.seqId).toBeNull();
|
|
86
|
-
resolve();
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
v.select();
|
|
90
|
-
return p;
|
|
91
|
-
});
|
|
92
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import Loader from "../../src/components/Loader";
|
|
2
|
-
|
|
3
|
-
describe("constructor", () => {
|
|
4
|
-
it("works", () => {
|
|
5
|
-
const p = { _t: { gvs: { loading_labels_serious: ["Loading..."], loading_labels_fun: ["FUN..."] }, map: {} } };
|
|
6
|
-
const c = document.createElement("div");
|
|
7
|
-
const l = new Loader(p, c);
|
|
8
|
-
expect(l.container.className).toBe("gvs-loader gvs-loader-visible");
|
|
9
|
-
expect(l.container.innerHTML).toMatchSnapshot();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
describe("dismiss", () => {
|
|
14
|
-
it("works when no error set", () => {
|
|
15
|
-
const p = {
|
|
16
|
-
_t: { gvs: { loading_labels_serious: ["Loading..."], loading_labels_fun: ["FUN..."] }, map: {} },
|
|
17
|
-
dispatchEvent: jest.fn()
|
|
18
|
-
};
|
|
19
|
-
const c = document.createElement("div");
|
|
20
|
-
const l = new Loader(p, c);
|
|
21
|
-
l.dismiss();
|
|
22
|
-
expect(c.className).toBe("gvs-loader");
|
|
23
|
-
expect(p.dispatchEvent.mock.calls).toMatchSnapshot();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("works with error set", () => {
|
|
27
|
-
global.console = { error: jest.fn() };
|
|
28
|
-
const p = {
|
|
29
|
-
_t: { gvs: { loading_labels_serious: ["Loading..."], loading_labels_fun: ["FUN..."] }, map: {} },
|
|
30
|
-
dispatchEvent: jest.fn()
|
|
31
|
-
};
|
|
32
|
-
const c = document.createElement("div");
|
|
33
|
-
const l = new Loader(p, c);
|
|
34
|
-
expect(() => l.dismiss("Technical issue", "Oops it's broken")).toThrowError("Oops it's broken");
|
|
35
|
-
expect(c.className).toBe("gvs-loader gvs-loader-visible");
|
|
36
|
-
expect(c.innerHTML).toMatchSnapshot();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`constructor works 1`] = `"<img src=\\"marker.svg\\" alt=\\"\\" title=\\"undefined\\" class=\\"gvs-loader-img\\"><div><span>Loading...</span></div>"`;
|
|
4
|
-
|
|
5
|
-
exports[`dismiss works when no error set 1`] = `
|
|
6
|
-
Array [
|
|
7
|
-
Array [
|
|
8
|
-
CustomEvent {
|
|
9
|
-
"isTrusted": false,
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
]
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`dismiss works with error set 1`] = `"<img src=\\"logo_dead.svg\\" alt=\\"\\" title=\\"undefined\\" class=\\"gvs-loader-img\\" style=\\"width: 200px; animation: unset;\\"><div>undefined<br>Oops it's broken<br><small>undefined</small></div>"`;
|