@panoramax/web-viewer 3.0.2-develop-a8ea8e60

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 (125) hide show
  1. package/.dockerignore +6 -0
  2. package/.gitlab-ci.yml +71 -0
  3. package/CHANGELOG.md +428 -0
  4. package/CODE_OF_CONDUCT.md +134 -0
  5. package/Dockerfile +14 -0
  6. package/LICENSE +21 -0
  7. package/README.md +39 -0
  8. package/build/editor.html +1 -0
  9. package/build/index.css +36 -0
  10. package/build/index.css.map +1 -0
  11. package/build/index.html +1 -0
  12. package/build/index.js +25 -0
  13. package/build/index.js.map +1 -0
  14. package/build/map.html +1 -0
  15. package/build/viewer.html +1 -0
  16. package/config/env.js +104 -0
  17. package/config/getHttpsConfig.js +66 -0
  18. package/config/getPackageJson.js +25 -0
  19. package/config/jest/babelTransform.js +29 -0
  20. package/config/jest/cssTransform.js +14 -0
  21. package/config/jest/fileTransform.js +40 -0
  22. package/config/modules.js +134 -0
  23. package/config/paths.js +72 -0
  24. package/config/pnpTs.js +35 -0
  25. package/config/webpack/persistentCache/createEnvironmentHash.js +9 -0
  26. package/config/webpack.config.js +885 -0
  27. package/config/webpackDevServer.config.js +127 -0
  28. package/docs/01_Start.md +149 -0
  29. package/docs/02_Usage.md +828 -0
  30. package/docs/03_URL_settings.md +140 -0
  31. package/docs/04_Advanced_examples.md +214 -0
  32. package/docs/05_Compatibility.md +85 -0
  33. package/docs/09_Develop.md +62 -0
  34. package/docs/90_Releases.md +27 -0
  35. package/docs/images/class_diagram.drawio +129 -0
  36. package/docs/images/class_diagram.jpg +0 -0
  37. package/docs/images/screenshot.jpg +0 -0
  38. package/mkdocs.yml +45 -0
  39. package/package.json +254 -0
  40. package/public/editor.html +54 -0
  41. package/public/favicon.ico +0 -0
  42. package/public/index.html +59 -0
  43. package/public/map.html +53 -0
  44. package/public/viewer.html +67 -0
  45. package/scripts/build.js +217 -0
  46. package/scripts/start.js +176 -0
  47. package/scripts/test.js +52 -0
  48. package/src/Editor.css +37 -0
  49. package/src/Editor.js +359 -0
  50. package/src/StandaloneMap.js +114 -0
  51. package/src/Viewer.css +203 -0
  52. package/src/Viewer.js +1186 -0
  53. package/src/components/CoreView.css +64 -0
  54. package/src/components/CoreView.js +159 -0
  55. package/src/components/Loader.css +56 -0
  56. package/src/components/Loader.js +111 -0
  57. package/src/components/Map.css +65 -0
  58. package/src/components/Map.js +841 -0
  59. package/src/components/Photo.css +36 -0
  60. package/src/components/Photo.js +687 -0
  61. package/src/img/arrow_360.svg +14 -0
  62. package/src/img/arrow_flat.svg +11 -0
  63. package/src/img/arrow_triangle.svg +10 -0
  64. package/src/img/arrow_turn.svg +9 -0
  65. package/src/img/bg_aerial.jpg +0 -0
  66. package/src/img/bg_streets.jpg +0 -0
  67. package/src/img/loader_base.jpg +0 -0
  68. package/src/img/loader_hd.jpg +0 -0
  69. package/src/img/logo_dead.svg +91 -0
  70. package/src/img/marker.svg +17 -0
  71. package/src/img/marker_blue.svg +20 -0
  72. package/src/img/switch_big.svg +44 -0
  73. package/src/img/switch_mini.svg +48 -0
  74. package/src/index.js +10 -0
  75. package/src/translations/de.json +163 -0
  76. package/src/translations/en.json +164 -0
  77. package/src/translations/eo.json +6 -0
  78. package/src/translations/es.json +164 -0
  79. package/src/translations/fi.json +1 -0
  80. package/src/translations/fr.json +164 -0
  81. package/src/translations/hu.json +133 -0
  82. package/src/translations/nl.json +1 -0
  83. package/src/translations/zh_Hant.json +136 -0
  84. package/src/utils/API.js +709 -0
  85. package/src/utils/Exif.js +198 -0
  86. package/src/utils/I18n.js +75 -0
  87. package/src/utils/Map.js +382 -0
  88. package/src/utils/PhotoAdapter.js +45 -0
  89. package/src/utils/Utils.js +568 -0
  90. package/src/utils/Widgets.js +477 -0
  91. package/src/viewer/URLHash.js +334 -0
  92. package/src/viewer/Widgets.css +711 -0
  93. package/src/viewer/Widgets.js +1196 -0
  94. package/tests/Editor.test.js +125 -0
  95. package/tests/StandaloneMap.test.js +44 -0
  96. package/tests/Viewer.test.js +363 -0
  97. package/tests/__snapshots__/Editor.test.js.snap +300 -0
  98. package/tests/__snapshots__/StandaloneMap.test.js.snap +30 -0
  99. package/tests/__snapshots__/Viewer.test.js.snap +195 -0
  100. package/tests/components/CoreView.test.js +91 -0
  101. package/tests/components/Loader.test.js +38 -0
  102. package/tests/components/Map.test.js +230 -0
  103. package/tests/components/Photo.test.js +335 -0
  104. package/tests/components/__snapshots__/Loader.test.js.snap +15 -0
  105. package/tests/components/__snapshots__/Map.test.js.snap +767 -0
  106. package/tests/components/__snapshots__/Photo.test.js.snap +205 -0
  107. package/tests/data/Map_geocoder_ban.json +36 -0
  108. package/tests/data/Map_geocoder_nominatim.json +56 -0
  109. package/tests/data/Viewer_pictures_1.json +148 -0
  110. package/tests/setupTests.js +5 -0
  111. package/tests/utils/API.test.js +906 -0
  112. package/tests/utils/Exif.test.js +124 -0
  113. package/tests/utils/I18n.test.js +28 -0
  114. package/tests/utils/Map.test.js +105 -0
  115. package/tests/utils/Utils.test.js +300 -0
  116. package/tests/utils/Widgets.test.js +107 -0
  117. package/tests/utils/__snapshots__/API.test.js.snap +132 -0
  118. package/tests/utils/__snapshots__/Exif.test.js.snap +43 -0
  119. package/tests/utils/__snapshots__/Map.test.js.snap +48 -0
  120. package/tests/utils/__snapshots__/Utils.test.js.snap +41 -0
  121. package/tests/utils/__snapshots__/Widgets.test.js.snap +44 -0
  122. package/tests/viewer/URLHash.test.js +537 -0
  123. package/tests/viewer/Widgets.test.js +127 -0
  124. package/tests/viewer/__snapshots__/URLHash.test.js.snap +98 -0
  125. package/tests/viewer/__snapshots__/Widgets.test.js.snap +393 -0
@@ -0,0 +1,132 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`_loadMapStyles handles default user 1`] = `
4
+ Object {
5
+ "layers": Array [],
6
+ "sources": Object {
7
+ "geovisio": Object {
8
+ "maxzoom": 15,
9
+ "minzoom": 0,
10
+ "tiles": Array [
11
+ "https://panoramax.ign.fr/api/map/{z}/{x}/{y}.mvt",
12
+ ],
13
+ "type": "vector",
14
+ },
15
+ },
16
+ "version": 8,
17
+ }
18
+ `;
19
+
20
+ exports[`_loadMapStyles handles various users 1`] = `
21
+ Object {
22
+ "layers": Array [
23
+ Object {
24
+ "id": "provider",
25
+ },
26
+ Object {
27
+ "id": "provider_bla",
28
+ },
29
+ Object {
30
+ "id": "provider_blo",
31
+ },
32
+ ],
33
+ "sources": Object {
34
+ "provider": Object {},
35
+ "provider_bla": Object {},
36
+ "provider_blo": Object {},
37
+ },
38
+ "version": 8,
39
+ }
40
+ `;
41
+
42
+ exports[`_loadMapStyles loads background style from json 1`] = `
43
+ Object {
44
+ "layers": Array [
45
+ Object {
46
+ "id": "provlayer",
47
+ },
48
+ ],
49
+ "name": "Provider",
50
+ "sources": Object {
51
+ "geovisio": Object {
52
+ "maxzoom": 15,
53
+ "minzoom": 0,
54
+ "tiles": Array [
55
+ "https://panoramax.ign.fr/api/map/{z}/{x}/{y}.mvt",
56
+ ],
57
+ "type": "vector",
58
+ },
59
+ "provider": Object {},
60
+ },
61
+ "version": 8,
62
+ }
63
+ `;
64
+
65
+ exports[`_loadMapStyles loads background style from string 1`] = `
66
+ Object {
67
+ "layers": Array [
68
+ Object {
69
+ "id": "provlayer",
70
+ },
71
+ ],
72
+ "name": "Provider",
73
+ "sources": Object {
74
+ "geovisio": Object {
75
+ "maxzoom": 15,
76
+ "minzoom": 0,
77
+ "tiles": Array [
78
+ "https://panoramax.ign.fr/api/map/{z}/{x}/{y}.mvt",
79
+ ],
80
+ "type": "vector",
81
+ },
82
+ "provider": Object {},
83
+ },
84
+ "version": 8,
85
+ }
86
+ `;
87
+
88
+ exports[`_loadMapStyles works if no background style set 1`] = `
89
+ Object {
90
+ "layers": Array [],
91
+ "sources": Object {
92
+ "geovisio": Object {
93
+ "maxzoom": 15,
94
+ "minzoom": 0,
95
+ "tiles": Array [
96
+ "https://panoramax.ign.fr/api/map/{z}/{x}/{y}.mvt",
97
+ ],
98
+ "type": "vector",
99
+ },
100
+ },
101
+ "version": 8,
102
+ }
103
+ `;
104
+
105
+ exports[`_parseLanding fails if link rel=collection-preview type=image/jpeg is invalid 1`] = `"API endpoint 'collection-preview' (image/jpeg) is not a valid URL: bla"`;
106
+
107
+ exports[`_parseLanding fails if link rel=data type=application/json is invalid 1`] = `"API endpoint 'data' (application/json) is not a valid URL: bla"`;
108
+
109
+ exports[`_parseLanding fails if link rel=data type=application/rss+xml is invalid 1`] = `"API endpoint 'data' (application/rss+xml) is not a valid URL: bla"`;
110
+
111
+ exports[`_parseLanding fails if link rel=item-preview type=image/jpeg is invalid 1`] = `"API endpoint 'item-preview' (image/jpeg) is not a valid URL: bla"`;
112
+
113
+ exports[`_parseLanding fails if link rel=report type=application/json is invalid 1`] = `"API endpoint 'report' (application/json) is not a valid URL: bla"`;
114
+
115
+ exports[`_parseLanding fails if link rel=search type=application/geo+json is invalid 1`] = `"API endpoint 'search' (application/geo+json) is not a valid URL: bla"`;
116
+
117
+ exports[`_parseLanding fails if link rel=user-search type=application/json is invalid 1`] = `"API endpoint 'user-search' (application/json) is not a valid URL: bla"`;
118
+
119
+ exports[`_parseLanding fails if link rel=user-xyz type=application/vnd.mapbox-vector-tile is invalid 1`] = `"API endpoint 'user-xyz' (application/vnd.mapbox-vector-tile) is not a valid URL: bla"`;
120
+
121
+ exports[`_parseLanding fails if link rel=user-xyz-style type=application/json is invalid 1`] = `"API endpoint 'user-xyz-style' (application/json) is not a valid URL: bla"`;
122
+
123
+ exports[`_parseLanding fails if link rel=xyz type=application/vnd.mapbox-vector-tile is invalid 1`] = `"API endpoint 'xyz' (application/vnd.mapbox-vector-tile) is not a valid URL: bla"`;
124
+
125
+ exports[`_parseLanding fails if link rel=xyz-style type=application/json is invalid 1`] = `"API endpoint 'xyz-style' (application/json) is not a valid URL: bla"`;
126
+
127
+ exports[`_parseLanding fails if mandatory links are not set 1`] = `
128
+ "API doesn't offer a 'search' (application/geo+json) endpoint in its links
129
+ No direct access to pictures metadata.
130
+ API doesn't offer a 'data' (application/json) endpoint in its links
131
+ No way for viewer to access sequences."
132
+ `;
@@ -0,0 +1,43 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`getCroppedPanoData works with API props 1`] = `
4
+ Object {
5
+ "croppedHeight": 2606,
6
+ "croppedWidth": 15872,
7
+ "croppedX": 0,
8
+ "croppedY": 2538,
9
+ "fullHeight": 7936,
10
+ "fullWidth": 15872,
11
+ }
12
+ `;
13
+
14
+ exports[`getCroppedPanoData works with API props and unneeded 1`] = `Object {}`;
15
+
16
+ exports[`getCroppedPanoData works with exif tags 1`] = `
17
+ Object {
18
+ "croppedHeight": 2606,
19
+ "croppedWidth": 15872,
20
+ "croppedX": 0,
21
+ "croppedY": 2538,
22
+ "fullHeight": 7936,
23
+ "fullWidth": 15872,
24
+ }
25
+ `;
26
+
27
+ exports[`getCroppedPanoData works with exif tags and unneeded 1`] = `Object {}`;
28
+
29
+ exports[`getSphereCorrection works with API props 1`] = `
30
+ Object {
31
+ "pan": 0.7330382858376184,
32
+ "roll": 1.260127719939906,
33
+ "tilt": -0.5235987755982988,
34
+ }
35
+ `;
36
+
37
+ exports[`getSphereCorrection works with exif tags 1`] = `
38
+ Object {
39
+ "pan": 0.7330382858376184,
40
+ "roll": 1.260127719939906,
41
+ "tilt": -0.5235987755982988,
42
+ }
43
+ `;
@@ -0,0 +1,48 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`forwardGeocodingBAN works 1`] = `
4
+ Object {
5
+ "attribution": "BAN",
6
+ "features": Array [
7
+ Object {
8
+ "center": Object {
9
+ "lat": 47.8,
10
+ "lng": -1.7,
11
+ },
12
+ "place_name": "8 Boulevard du Port, Amiens",
13
+ "place_type": Array [
14
+ "place",
15
+ ],
16
+ "zoom": 20,
17
+ },
18
+ ],
19
+ "licence": "ODbL 1.0",
20
+ "limit": 1,
21
+ "query": "8 bd du port",
22
+ "type": "FeatureCollection",
23
+ "version": "draft",
24
+ }
25
+ `;
26
+
27
+ exports[`forwardGeocodingNominatim works 1`] = `
28
+ Object {
29
+ "features": Array [
30
+ Object {
31
+ "bounds": Object {
32
+ "ne": Object {
33
+ "lat": 47.8,
34
+ "lng": -1.7,
35
+ },
36
+ "sw": Object {
37
+ "lat": 47.8,
38
+ "lng": -1.7,
39
+ },
40
+ },
41
+ "place_name": "Paris, Île-de-France, France métropolitaine, France",
42
+ "place_type": Array [
43
+ "place",
44
+ ],
45
+ },
46
+ ],
47
+ }
48
+ `;
@@ -0,0 +1,41 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`getNodeCaption works with date + 2 producers 1`] = `
4
+ Object {
5
+ "date": Object {
6
+ "toLocaleDateString": [Function],
7
+ },
8
+ "producer": "GeoVisio Corp., PanierAvide",
9
+ }
10
+ `;
11
+
12
+ exports[`getNodeCaption works with date + producer 1`] = `
13
+ Object {
14
+ "date": Object {
15
+ "toLocaleDateString": [Function],
16
+ },
17
+ "producer": "PanierAvide",
18
+ }
19
+ `;
20
+
21
+ exports[`getNodeCaption works with date 1`] = `
22
+ Object {
23
+ "date": Object {
24
+ "toLocaleDateString": [Function],
25
+ },
26
+ }
27
+ `;
28
+
29
+ exports[`getNodeCaption works with date+tz 1`] = `
30
+ Object {
31
+ "date": Object {
32
+ "toLocaleDateString": [Function],
33
+ },
34
+ }
35
+ `;
36
+
37
+ exports[`getNodeCaption works with producer 1`] = `
38
+ Object {
39
+ "producer": "PanierAvide",
40
+ }
41
+ `;
@@ -0,0 +1,44 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`createExpandableButton works with large container 1`] = `"<svg aria-hidden=\\"true\\" focusable=\\"false\\" data-prefix=\\"fas\\" data-icon=\\"chevron-down\\" class=\\"svg-inline--fa fa-chevron-down\\" role=\\"img\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 512 512\\"><path fill=\\"currentColor\\" d=\\"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\\"></path></svg>blabla<svg aria-hidden=\\"true\\" focusable=\\"false\\" data-prefix=\\"fas\\" data-icon=\\"chevron-down\\" class=\\"svg-inline--fa fa-chevron-down\\" role=\\"img\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 512 512\\"><path fill=\\"currentColor\\" d=\\"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\\"></path></svg>"`;
4
+
5
+ exports[`createExpandableButton works with small container 1`] = `"<svg aria-hidden=\\"true\\" focusable=\\"false\\" data-prefix=\\"fas\\" data-icon=\\"chevron-down\\" class=\\"svg-inline--fa fa-chevron-down\\" role=\\"img\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 512 512\\"><path fill=\\"currentColor\\" d=\\"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\\"></path></svg>"`;
6
+
7
+ exports[`createGroup works 1`] = `"<span></span>"`;
8
+
9
+ exports[`createPanel works 1`] = `"<span></span>"`;
10
+
11
+ exports[`createPanel works 2`] = `
12
+ Array [
13
+ Array [
14
+ "click",
15
+ [Function],
16
+ ],
17
+ Array [
18
+ "hover",
19
+ [Function],
20
+ ],
21
+ ]
22
+ `;
23
+
24
+ exports[`createSearchBar works 1`] = `"<input type=\\"text\\" placeholder=\\"no res\\"><span class=\\"gvs-search-bar-icon\\"><svg aria-hidden=\\"true\\" focusable=\\"false\\" data-prefix=\\"fas\\" data-icon=\\"magnifying-glass\\" class=\\"svg-inline--fa fa-magnifying-glass\\" role=\\"img\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 512 512\\"><path fill=\\"currentColor\\" d=\\"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z\\"></path></svg></span><div id=\\"mysrch-panel\\" class=\\"gvs-panel gvs-widget-bg gvs-hidden gvs-search-bar-results\\"></div>"`;
25
+
26
+ exports[`fa works 1`] = `
27
+ <svg
28
+ aria-hidden="true"
29
+ class="svg-inline--fa fa-chevron-down"
30
+ data-icon="chevron-down"
31
+ data-prefix="fas"
32
+ focusable="false"
33
+ role="img"
34
+ viewBox="0 0 512 512"
35
+ xmlns="http://www.w3.org/2000/svg"
36
+ >
37
+ <path
38
+ d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"
39
+ fill="currentColor"
40
+ />
41
+ </svg>
42
+ `;
43
+
44
+ exports[`fat works 1`] = `"<svg aria-hidden=\\"true\\" focusable=\\"false\\" data-prefix=\\"fas\\" data-icon=\\"chevron-down\\" class=\\"svg-inline--fa fa-chevron-down\\" role=\\"img\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 512 512\\"><path fill=\\"currentColor\\" d=\\"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\\"></path></svg>"`;