@panoramax/web-viewer 3.2.3-develop-06e3ec22 → 3.2.3-develop-367cb599
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/CHANGELOG.md +3 -1
- package/build/index.css +2 -2
- package/build/index.css.map +1 -1
- package/build/index.js +85 -52
- package/build/index.js.map +1 -1
- package/build/widgets.html +1 -1
- package/docs/reference/components/ui/Loader.md +2 -0
- package/docs/reference/components/ui/ProgressBar.md +32 -0
- package/docs/reference/utils/URLHandler.md +7 -2
- package/docs/reference.md +1 -0
- package/docs/tutorials/migrate_v4.md +8 -0
- package/mkdocs.yml +1 -0
- package/package.json +1 -1
- package/public/widgets.html +5 -0
- package/src/components/core/Basic.css +2 -0
- package/src/components/core/Basic.js +2 -2
- package/src/components/core/CoverageMap.js +5 -1
- package/src/components/core/Editor.js +6 -0
- package/src/components/core/Viewer.css +8 -0
- package/src/components/core/Viewer.js +26 -6
- package/src/components/layout/CorneredGrid.js +1 -1
- package/src/components/ui/Loader.js +22 -22
- package/src/components/ui/ProgressBar.js +73 -0
- package/src/components/ui/index.js +1 -0
- package/src/img/loader_base.jpg +0 -0
- package/src/utils/URLHandler.js +8 -4
- package/src/utils/utils.js +9 -0
- package/tests/utils/URLHandler.test.js +51 -10
- package/src/img/loader_hd.jpg +0 -0
|
@@ -171,7 +171,7 @@ describe("nextURLString", () => {
|
|
|
171
171
|
});
|
|
172
172
|
|
|
173
173
|
describe("currentURLParams", () => {
|
|
174
|
-
it("works if empty", () => {
|
|
174
|
+
it("works if empty + search", () => {
|
|
175
175
|
delete window.location;
|
|
176
176
|
window.location = { search: "" };
|
|
177
177
|
const v = { addEventListener: jest.fn() };
|
|
@@ -179,20 +179,61 @@ describe("currentURLParams", () => {
|
|
|
179
179
|
expect(uh.currentURLParams()).toStrictEqual({});
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
it("works with single param", () => {
|
|
182
|
+
it("works with single param + search", () => {
|
|
183
183
|
delete window.location;
|
|
184
|
-
window.location = { search: "?
|
|
184
|
+
window.location = { search: "?nav=pic" };
|
|
185
|
+
const v = { addEventListener: jest.fn() };
|
|
186
|
+
const uh = new URLHandler(v);
|
|
187
|
+
expect(uh.currentURLParams()).toStrictEqual({"nav": "pic"});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it("works with multiple params + search", () => {
|
|
191
|
+
delete window.location;
|
|
192
|
+
window.location = { search: "?nav=pic&speed=42" };
|
|
193
|
+
const v = { addEventListener: jest.fn() };
|
|
194
|
+
const uh = new URLHandler(v);
|
|
195
|
+
expect(uh.currentURLParams()).toStrictEqual({"nav": "pic", "speed": "42"});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it("works if empty + hash", () => {
|
|
199
|
+
delete window.location;
|
|
200
|
+
window.location = { hash: "" };
|
|
201
|
+
const v = { addEventListener: jest.fn() };
|
|
202
|
+
const uh = new URLHandler(v);
|
|
203
|
+
expect(uh.currentURLParams(true)).toStrictEqual({});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it("works with single param + hash", () => {
|
|
207
|
+
delete window.location;
|
|
208
|
+
window.location = { hash: "#nav=pic" };
|
|
209
|
+
const v = { addEventListener: jest.fn() };
|
|
210
|
+
const uh = new URLHandler(v);
|
|
211
|
+
expect(uh.currentURLParams(true)).toStrictEqual({"nav": "pic"});
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it("works with multiple params + hash", () => {
|
|
215
|
+
delete window.location;
|
|
216
|
+
window.location = { hash: "#nav=pic&speed=42" };
|
|
185
217
|
const v = { addEventListener: jest.fn() };
|
|
186
218
|
const uh = new URLHandler(v);
|
|
187
|
-
expect(uh.currentURLParams()).toStrictEqual({"
|
|
219
|
+
expect(uh.currentURLParams(true)).toStrictEqual({"nav": "pic", "speed": "42"});
|
|
188
220
|
});
|
|
189
221
|
|
|
190
|
-
it("works with
|
|
222
|
+
it("works with search + hash", () => {
|
|
191
223
|
delete window.location;
|
|
192
|
-
window.location = {
|
|
224
|
+
window.location = { hash: "#nav=pic&speed=42", search: "?pic=bla" };
|
|
193
225
|
const v = { addEventListener: jest.fn() };
|
|
194
226
|
const uh = new URLHandler(v);
|
|
195
|
-
expect(uh.currentURLParams()).toStrictEqual({"
|
|
227
|
+
expect(uh.currentURLParams()).toStrictEqual({"pic": "bla"});
|
|
228
|
+
expect(uh.currentURLParams(true)).toStrictEqual({"nav": "pic", "speed": "42"});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it("skips unmanaged parameters", () => {
|
|
232
|
+
delete window.location;
|
|
233
|
+
window.location = { search: "?a=b" };
|
|
234
|
+
const v = { addEventListener: jest.fn() };
|
|
235
|
+
const uh = new URLHandler(v);
|
|
236
|
+
expect(uh.currentURLParams()).toStrictEqual({});
|
|
196
237
|
});
|
|
197
238
|
});
|
|
198
239
|
|
|
@@ -295,7 +336,7 @@ describe("_onParentChange", () => {
|
|
|
295
336
|
delete window.location;
|
|
296
337
|
|
|
297
338
|
window.history = { replaceState: jest.fn(), state: {} };
|
|
298
|
-
window.location = { href: "http://localhost:5000/?nav=pic&speed=2", search: "?nav=pic&speed=2" };
|
|
339
|
+
window.location = { href: "http://localhost:5000/?nav=pic&speed=2", search: "?nav=pic&speed=2", hash: "" };
|
|
299
340
|
|
|
300
341
|
const v = { addEventListener: jest.fn() };
|
|
301
342
|
const uh = new URLHandler(v);
|
|
@@ -314,7 +355,7 @@ describe("_onParentChange", () => {
|
|
|
314
355
|
delete window.location;
|
|
315
356
|
|
|
316
357
|
window.history = { pushState: jest.fn(), state: {} };
|
|
317
|
-
window.location = { href: "http://localhost:5000/?pic=bla", search: "?pic=bla" };
|
|
358
|
+
window.location = { href: "http://localhost:5000/?pic=bla", search: "?pic=bla", hash: "" };
|
|
318
359
|
|
|
319
360
|
const v = { addEventListener: jest.fn() };
|
|
320
361
|
const uh = new URLHandler(v);
|
|
@@ -333,7 +374,7 @@ describe("_onParentChange", () => {
|
|
|
333
374
|
delete window.location;
|
|
334
375
|
|
|
335
376
|
window.history = { replaceState: jest.fn(), state: {} };
|
|
336
|
-
window.location = { href: "http://localhost:5000/?speed=1&nav=seq", search: "?speed=1&nav=seq" };
|
|
377
|
+
window.location = { href: "http://localhost:5000/?speed=1&nav=seq", search: "?speed=1&nav=seq", hash: "" };
|
|
337
378
|
|
|
338
379
|
const v = { addEventListener: jest.fn() };
|
|
339
380
|
const uh = new URLHandler(v);
|
package/src/img/loader_hd.jpg
DELETED
|
Binary file
|