react-spatial 2.0.2-beta.0 → 2.0.2
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/package.json +2 -2
- package/setupTests.js +9 -9
- package/setupTests.js.map +2 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "react-spatial",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Components to build React map apps.",
|
|
5
|
-
"version": "2.0.2
|
|
5
|
+
"version": "2.0.2",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/react": "^11.14.0",
|
|
8
8
|
"@emotion/styled": "^11.14.1",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"maplibre-gl": "^4",
|
|
19
|
-
"mobility-toolbox-js": "^3",
|
|
19
|
+
"mobility-toolbox-js": "^3.6",
|
|
20
20
|
"ol": "^10",
|
|
21
21
|
"react": "^18",
|
|
22
22
|
"react-dom": "^18"
|
package/setupTests.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import ResizeObserver from "resize-observer-polyfill";
|
|
2
|
+
import util from "util";
|
|
3
|
+
if (!global.TextDecoder) {
|
|
4
|
+
global.TextDecoder = util.TextDecoder;
|
|
5
|
+
}
|
|
6
|
+
if (!global.TextEncoder) {
|
|
7
|
+
global.TextEncoder = util.TextEncoder;
|
|
8
|
+
}
|
|
2
9
|
global.URL.createObjectURL = jest.fn(() => {
|
|
3
10
|
return "fooblob";
|
|
4
11
|
});
|
|
@@ -16,20 +23,13 @@ class Worker {
|
|
|
16
23
|
this.onmessage(msg);
|
|
17
24
|
}
|
|
18
25
|
}
|
|
19
|
-
Object.defineProperty(window, "Worker", {
|
|
20
|
-
value: Worker,
|
|
21
|
-
writable: true
|
|
22
|
-
});
|
|
26
|
+
Object.defineProperty(window, "Worker", { value: Worker, writable: true });
|
|
23
27
|
const mock = {
|
|
24
28
|
clearWatch: jest.fn(),
|
|
25
29
|
getCurrentPosition: jest.fn(),
|
|
26
30
|
watchPosition: (onSuccess) => {
|
|
27
31
|
onSuccess({
|
|
28
|
-
coords: {
|
|
29
|
-
accuracy: 55,
|
|
30
|
-
latitude: 47.9913611,
|
|
31
|
-
longitude: 7.84868
|
|
32
|
-
},
|
|
32
|
+
coords: { accuracy: 55, latitude: 47.9913611, longitude: 7.84868 },
|
|
33
33
|
timestamp: 1552660077044
|
|
34
34
|
});
|
|
35
35
|
}
|
package/setupTests.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/setupTests.js"],
|
|
4
|
-
"sourcesContent": ["import ResizeObserver from \"resize-observer-polyfill\";\n\nglobal.URL.createObjectURL = jest.fn(() => {\n return \"fooblob\";\n});\n\nglobal.ResizeObserver = ResizeObserver;\n\nconst noop = () => {};\n\nclass Worker {\n onmessage;\n\n url;\n\n constructor(stringUrl) {\n this.url = stringUrl;\n this.onmessage = noop;\n }\n\n postMessage(msg) {\n this.onmessage(msg);\n }\n}\n\nObject.defineProperty(window, \"Worker\", {
|
|
5
|
-
"mappings": "AAAA,OAAO,oBAAoB;
|
|
4
|
+
"sourcesContent": ["import ResizeObserver from \"resize-observer-polyfill\";\nimport util from \"util\";\n\nif (!global.TextDecoder) {\n global.TextDecoder = util.TextDecoder;\n}\n\nif (!global.TextEncoder) {\n global.TextEncoder = util.TextEncoder;\n}\n\nglobal.URL.createObjectURL = jest.fn(() => {\n return \"fooblob\";\n});\n\nglobal.ResizeObserver = ResizeObserver;\n\nconst noop = () => {};\n\nclass Worker {\n onmessage;\n\n url;\n\n constructor(stringUrl) {\n this.url = stringUrl;\n this.onmessage = noop;\n }\n\n postMessage(msg) {\n this.onmessage(msg);\n }\n}\n\nObject.defineProperty(window, \"Worker\", { value: Worker, writable: true });\n\nconst mock = {\n clearWatch: jest.fn(),\n getCurrentPosition: jest.fn(),\n watchPosition: (onSuccess) => {\n onSuccess({\n coords: { accuracy: 55, latitude: 47.9913611, longitude: 7.84868 },\n timestamp: 1552660077044,\n });\n },\n};\n\nglobal.navigator.geolocation = mock;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,oBAAoB;AAC3B,OAAO,UAAU;AAEjB,IAAI,CAAC,OAAO,aAAa;AACvB,SAAO,cAAc,KAAK;AAC5B;AAEA,IAAI,CAAC,OAAO,aAAa;AACvB,SAAO,cAAc,KAAK;AAC5B;AAEA,OAAO,IAAI,kBAAkB,KAAK,GAAG,MAAM;AACzC,SAAO;AACT,CAAC;AAED,OAAO,iBAAiB;AAExB,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,OAAO;AAAA,EACX;AAAA,EAEA;AAAA,EAEA,YAAY,WAAW;AACrB,SAAK,MAAM;AACX,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,YAAY,KAAK;AACf,SAAK,UAAU,GAAG;AAAA,EACpB;AACF;AAEA,OAAO,eAAe,QAAQ,UAAU,EAAE,OAAO,QAAQ,UAAU,KAAK,CAAC;AAEzE,MAAM,OAAO;AAAA,EACX,YAAY,KAAK,GAAG;AAAA,EACpB,oBAAoB,KAAK,GAAG;AAAA,EAC5B,eAAe,CAAC,cAAc;AAC5B,cAAU;AAAA,MACR,QAAQ,EAAE,UAAU,IAAI,UAAU,YAAY,WAAW,QAAQ;AAAA,MACjE,WAAW;AAAA,IACb,CAAC;AAAA,EACH;AACF;AAEA,OAAO,UAAU,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|