kitchen-simulator 1.1.1-test.17 → 1.1.1-test.20
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/es/catalog/utils/mtl-loader.js +2 -1
- package/es/catalog/utils/obj-loader.js +2 -1
- package/es/components/viewer3d/libs/mtl-loader.js +1 -1
- package/es/components/viewer3d/libs/obj-loader.js +1 -1
- package/es/components/viewer3d/libs/orbit-controls.js +5 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +4 -3
- package/es/utils/get-edges-of-subgraphs.js +2 -1
- package/es/utils/graph-cycles.js +2 -3
- package/es/utils/graph.js +2 -1
- package/es/utils/helper.js +0 -68
- package/lib/catalog/utils/mtl-loader.js +6 -2
- package/lib/catalog/utils/obj-loader.js +6 -2
- package/lib/components/viewer3d/libs/mtl-loader.js +5 -1
- package/lib/components/viewer3d/libs/obj-loader.js +5 -1
- package/lib/components/viewer3d/libs/orbit-controls.js +9 -4
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +8 -3
- package/lib/utils/get-edges-of-subgraphs.js +7 -1
- package/lib/utils/graph-cycles.js +9 -9
- package/lib/utils/graph.js +9 -3
- package/lib/utils/helper.js +1 -69
- package/package.json +1 -2
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
// Pan - right mouse, or arrow keys / touch: three finter swipe
|
|
15
15
|
|
|
16
16
|
var THREE = window.THREE || require('three');
|
|
17
|
-
|
|
18
|
-
module.exports = OrbitControls = function OrbitControls(object, domElement) {
|
|
17
|
+
function OrbitControls(object, domElement) {
|
|
19
18
|
this.object = object;
|
|
20
19
|
this.domElement = domElement !== undefined ? domElement : document;
|
|
21
20
|
|
|
@@ -623,7 +622,7 @@ module.exports = OrbitControls = function OrbitControls(object, domElement) {
|
|
|
623
622
|
// force an update at start
|
|
624
623
|
|
|
625
624
|
this.update();
|
|
626
|
-
}
|
|
625
|
+
}
|
|
627
626
|
OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype);
|
|
628
627
|
OrbitControls.prototype.constructor = OrbitControls;
|
|
629
628
|
Object.defineProperties(OrbitControls.prototype, {
|
|
@@ -695,4 +694,6 @@ Object.defineProperties(OrbitControls.prototype, {
|
|
|
695
694
|
this.dampingFactor = value;
|
|
696
695
|
}
|
|
697
696
|
}
|
|
698
|
-
});
|
|
697
|
+
});
|
|
698
|
+
export default OrbitControls;
|
|
699
|
+
export { OrbitControls };
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
var THREE = window.THREE || require('three');
|
|
6
|
-
|
|
7
|
-
module.exports = PointerLockControls = function PointerLockControls(camera) {
|
|
6
|
+
function PointerLockControls(camera) {
|
|
8
7
|
var scope = this;
|
|
9
8
|
camera.rotation.set(0, 0, 0);
|
|
10
9
|
var pitchObject = new THREE.Object3D();
|
|
@@ -42,4 +41,6 @@ module.exports = PointerLockControls = function PointerLockControls(camera) {
|
|
|
42
41
|
return v;
|
|
43
42
|
};
|
|
44
43
|
}();
|
|
45
|
-
}
|
|
44
|
+
}
|
|
45
|
+
export default PointerLockControls;
|
|
46
|
+
export { PointerLockControls };
|
package/es/utils/graph-cycles.js
CHANGED
|
@@ -200,9 +200,8 @@ function find_inner_cycles(V, EV) {
|
|
|
200
200
|
ev_mapping: cycles.ev_mapping
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
module.exports = find_inner_cycles;
|
|
203
|
+
export default find_inner_cycles;
|
|
204
|
+
export { find_inner_cycles, find_cycles, compute_ev_mapping, compute_incidences };
|
|
206
205
|
|
|
207
206
|
/**
|
|
208
207
|
* DATA
|
package/es/utils/graph.js
CHANGED
package/es/utils/helper.js
CHANGED
|
@@ -10,78 +10,10 @@ import * as Three from 'three';
|
|
|
10
10
|
import { returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
|
|
11
11
|
import convert from 'convert-units';
|
|
12
12
|
import { formatNumber } from "./math";
|
|
13
|
-
var AWS = require('aws-sdk');
|
|
14
|
-
var s3 = new AWS.S3({
|
|
15
|
-
accessKeyId: process.env.REACT_APP_AWS_ID,
|
|
16
|
-
secretAccessKey: process.env.REACT_APP_AWS_SECRET
|
|
17
|
-
});
|
|
18
|
-
var s3ParseUrl = function s3ParseUrl(url) {
|
|
19
|
-
var _decodedUrl = decodeURIComponent(url);
|
|
20
|
-
var _result = null;
|
|
21
|
-
|
|
22
|
-
// http://s3.amazonaws.com/bucket/key1/key2
|
|
23
|
-
var match = decodedUrl.match(/^https?:\/\/s3.amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
24
|
-
if (_match) {
|
|
25
|
-
_result = {
|
|
26
|
-
bucket: _match[1],
|
|
27
|
-
key: _match[2],
|
|
28
|
-
region: ''
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// http://s3-aws-region.amazonaws.com/bucket/key1/key2
|
|
33
|
-
match = decodedUrl.match(/^https?:\/\/s3-([^.]+).amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
34
|
-
if (_match) {
|
|
35
|
-
_result = {
|
|
36
|
-
bucket: _match[2],
|
|
37
|
-
key: _match[3],
|
|
38
|
-
region: _match[1]
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// http://bucket.s3.amazonaws.com/key1/key2
|
|
43
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).s3.amazonaws.com\/?(.*?)$/);
|
|
44
|
-
if (_match) {
|
|
45
|
-
_result = {
|
|
46
|
-
bucket: _match[1],
|
|
47
|
-
key: _match[2],
|
|
48
|
-
region: ''
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// http://bucket.s3-aws-region.amazonaws.com/key1/key2 or,
|
|
53
|
-
// http://bucket.s3.aws-region.amazonaws.com/key1/key2
|
|
54
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).(?:s3-|s3\.)([^.]+).amazonaws.com\/?(.*?)$/);
|
|
55
|
-
if (_match) {
|
|
56
|
-
_result = {
|
|
57
|
-
bucket: _match[1],
|
|
58
|
-
key: _match[3],
|
|
59
|
-
region: _match[2]
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
return _result;
|
|
63
|
-
};
|
|
64
13
|
export var textureCube = new HDRCubeTextureLoader().setPath('/catalog/envMap/').load(HDR_URLS, function () {
|
|
65
14
|
textureCube.magFilter = Three.LinearFilter;
|
|
66
15
|
textureCube.needsUpdate = true;
|
|
67
16
|
});
|
|
68
|
-
export var getSignedUrl = function getSignedUrl(url) {
|
|
69
|
-
if (!url) return url;
|
|
70
|
-
var signedUrl = url;
|
|
71
|
-
try {
|
|
72
|
-
var _s3ParseUrl = s3ParseUrl(url),
|
|
73
|
-
bucket = _s3ParseUrl.bucket,
|
|
74
|
-
key = _s3ParseUrl.key;
|
|
75
|
-
signedUrl = s3.getSignedUrl('getObject', {
|
|
76
|
-
Bucket: bucket,
|
|
77
|
-
Key: key,
|
|
78
|
-
ResponseCacheControl: 'no-cache'
|
|
79
|
-
});
|
|
80
|
-
} catch (e) {
|
|
81
|
-
signedUrl = url;
|
|
82
|
-
}
|
|
83
|
-
return signedUrl;
|
|
84
|
-
};
|
|
85
17
|
export var base64Decode = function base64Decode(targetStr) {
|
|
86
18
|
if (!targetStr) return null;
|
|
87
19
|
try {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.MTLLoader = void 0;
|
|
3
7
|
/**
|
|
4
8
|
* Loads a Wavefront .mtl file specifying materials
|
|
5
9
|
*
|
|
@@ -8,7 +12,7 @@
|
|
|
8
12
|
|
|
9
13
|
var THREE = window.THREE || require('three');
|
|
10
14
|
var MTLLoader;
|
|
11
|
-
MTLLoader = function MTLLoader(manager) {
|
|
15
|
+
exports.MTLLoader = MTLLoader = function MTLLoader(manager) {
|
|
12
16
|
this.manager = manager !== undefined ? manager : THREE.DefaultLoadingManager;
|
|
13
17
|
};
|
|
14
18
|
Object.assign(MTLLoader.prototype, THREE.EventDispatcher.prototype, {
|
|
@@ -356,4 +360,4 @@ MTLLoader.MaterialCreator.prototype = {
|
|
|
356
360
|
return texture;
|
|
357
361
|
}
|
|
358
362
|
};
|
|
359
|
-
|
|
363
|
+
var _default = exports["default"] = MTLLoader;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.OBJLoader = void 0;
|
|
3
7
|
/**
|
|
4
8
|
* @author mrdoob / http://mrdoob.com/
|
|
5
9
|
*/
|
|
6
10
|
var THREE = window.THREE || require('three');
|
|
7
11
|
var OBJLoader;
|
|
8
|
-
OBJLoader = function () {
|
|
12
|
+
exports.OBJLoader = OBJLoader = function () {
|
|
9
13
|
// o object_name | g group_name
|
|
10
14
|
var object_pattern = /^[og]\s*(.+)?/;
|
|
11
15
|
// mtllib file_reference
|
|
@@ -475,4 +479,4 @@ OBJLoader = function () {
|
|
|
475
479
|
};
|
|
476
480
|
return OBJLoader;
|
|
477
481
|
}();
|
|
478
|
-
|
|
482
|
+
var _default = exports["default"] = OBJLoader;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
3
7
|
/**
|
|
4
8
|
* Loads a Wavefront .mtl file specifying materials
|
|
5
9
|
*
|
|
@@ -356,4 +360,4 @@ MTLLoader.MaterialCreator.prototype = {
|
|
|
356
360
|
return texture;
|
|
357
361
|
}
|
|
358
362
|
};
|
|
359
|
-
|
|
363
|
+
var _default = exports["default"] = MTLLoader;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
3
7
|
/**
|
|
4
8
|
* @author mrdoob / http://mrdoob.com/
|
|
5
9
|
*/
|
|
@@ -461,4 +465,4 @@ OBJLoader.prototype = {
|
|
|
461
465
|
return container;
|
|
462
466
|
}
|
|
463
467
|
};
|
|
464
|
-
|
|
468
|
+
var _default = exports["default"] = OBJLoader;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OrbitControls = OrbitControls;
|
|
7
|
+
exports["default"] = void 0;
|
|
3
8
|
/**
|
|
4
9
|
* @author qiao / https://github.com/qiao
|
|
5
10
|
* @author mrdoob / http://mrdoob.com
|
|
@@ -16,8 +21,7 @@
|
|
|
16
21
|
// Pan - right mouse, or arrow keys / touch: three finter swipe
|
|
17
22
|
|
|
18
23
|
var THREE = window.THREE || require('three');
|
|
19
|
-
|
|
20
|
-
module.exports = OrbitControls = function OrbitControls(object, domElement) {
|
|
24
|
+
function OrbitControls(object, domElement) {
|
|
21
25
|
this.object = object;
|
|
22
26
|
this.domElement = domElement !== undefined ? domElement : document;
|
|
23
27
|
|
|
@@ -625,7 +629,7 @@ module.exports = OrbitControls = function OrbitControls(object, domElement) {
|
|
|
625
629
|
// force an update at start
|
|
626
630
|
|
|
627
631
|
this.update();
|
|
628
|
-
}
|
|
632
|
+
}
|
|
629
633
|
OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype);
|
|
630
634
|
OrbitControls.prototype.constructor = OrbitControls;
|
|
631
635
|
Object.defineProperties(OrbitControls.prototype, {
|
|
@@ -697,4 +701,5 @@ Object.defineProperties(OrbitControls.prototype, {
|
|
|
697
701
|
this.dampingFactor = value;
|
|
698
702
|
}
|
|
699
703
|
}
|
|
700
|
-
});
|
|
704
|
+
});
|
|
705
|
+
var _default = exports["default"] = OrbitControls;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PointerLockControls = PointerLockControls;
|
|
7
|
+
exports["default"] = void 0;
|
|
3
8
|
/**
|
|
4
9
|
* @author mrdoob / http://mrdoob.com/
|
|
5
10
|
*/
|
|
6
11
|
|
|
7
12
|
var THREE = window.THREE || require('three');
|
|
8
|
-
|
|
9
|
-
module.exports = PointerLockControls = function PointerLockControls(camera) {
|
|
13
|
+
function PointerLockControls(camera) {
|
|
10
14
|
var scope = this;
|
|
11
15
|
camera.rotation.set(0, 0, 0);
|
|
12
16
|
var pitchObject = new THREE.Object3D();
|
|
@@ -44,4 +48,5 @@ module.exports = PointerLockControls = function PointerLockControls(camera) {
|
|
|
44
48
|
return v;
|
|
45
49
|
};
|
|
46
50
|
}();
|
|
47
|
-
}
|
|
51
|
+
}
|
|
52
|
+
var _default = exports["default"] = PointerLockControls;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
exports.getEdgesOfSubgraphs = getEdgesOfSubgraphs;
|
|
8
|
+
exports.getVerticesFromBiconnectedComponent = getVerticesFromBiconnectedComponent;
|
|
3
9
|
function getEdgesOfSubgraphs(subgraphs, graph) {
|
|
4
10
|
var edges = [];
|
|
5
11
|
subgraphs.forEach(function (component) {
|
|
@@ -25,4 +31,4 @@ function getVerticesFromBiconnectedComponent(component) {
|
|
|
25
31
|
});
|
|
26
32
|
return vertices;
|
|
27
33
|
}
|
|
28
|
-
|
|
34
|
+
var _default = exports["default"] = getEdgesOfSubgraphs;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.compute_ev_mapping = compute_ev_mapping;
|
|
7
|
+
exports.compute_incidences = compute_incidences;
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
exports.find_cycles = find_cycles;
|
|
10
|
+
exports.find_inner_cycles = find_inner_cycles;
|
|
3
11
|
/**
|
|
4
12
|
* UTILS
|
|
5
13
|
*/
|
|
@@ -202,17 +210,12 @@ function find_inner_cycles(V, EV) {
|
|
|
202
210
|
ev_mapping: cycles.ev_mapping
|
|
203
211
|
};
|
|
204
212
|
}
|
|
205
|
-
|
|
206
|
-
// export default find_inner_cycles;
|
|
207
|
-
module.exports = find_inner_cycles;
|
|
208
|
-
|
|
213
|
+
var _default = exports["default"] = find_inner_cycles;
|
|
209
214
|
/**
|
|
210
215
|
* DATA
|
|
211
216
|
*/
|
|
212
|
-
|
|
213
217
|
// let V = [[0.5774, 1.0], [1.0, 1.0], [1.1547, 0.0], [1.0, 0.0], [0.0, 0.0], [0.0, 0.732], [1.0, 0.1547], [0.732, 0.0], [1.0491, 0.183], [-0.317, 0.549], [1.0, 0.268], [0.183, -0.3169], [0.5491, 1.049], [0.4642, 1.0], [0.0, -0.4226], [0.0, 1.0]]
|
|
214
218
|
// let EV = [[0, 1], [2, 3], [5, 4], [7, 6], [2, 8], [3, 6], [4, 9], [0, 10], [9, 5], [8, 10], [7, 11], [12, 13], [6, 8], [6, 10], [4, 7], [4, 11], [4, 14], [5, 15], [11, 14], [0, 12], [13, 15], [0, 13], [1, 10], [3, 7], [5, 13]]
|
|
215
|
-
|
|
216
219
|
// let V = [[0,0],[10,0],[10,10],[0,10], [100,100],[110,100],[110,110],[100,110], [5,0], [5,10]]
|
|
217
220
|
// let V = [[0,0.5],[12,-0.7],[14,14],[-2,10], [103,106],[117,98],[96,112],[104,109], [5.5,0.8], [4.8,10.5]]
|
|
218
221
|
// let EV = [[3,9],[9,2],[2,1],[1,8],[8,0],[0,3],[8,9]] // IT WORKS
|
|
@@ -221,14 +224,11 @@ module.exports = find_inner_cycles;
|
|
|
221
224
|
// let EV = [[2,3],[1,2],[0,1],[3,0]] // IT WORKS
|
|
222
225
|
// let EV = [[2,3],[1,2],[0,1],[3,0],[6,7],[5,6],[4,5],[7,4]] // IT WORKS
|
|
223
226
|
// let EV = [[3,2],[2,1],[1,0],[0,3],[7,6],[6,5],[5,4],[4,7]] // IT WORKS
|
|
224
|
-
|
|
225
227
|
// let V = [[2,5],[5,6],[10,6.8],[23,8],[9.6,11.3],[20,15],[25,16],[29,18],[30,22],[4,11],[6,10],[24,25],[18,20],[27,7]]
|
|
226
228
|
// let EV = [[0,1],[10,0],[9,10],[9,1],[1,2],[4,2],[3,13],[2,3],[4,5],[5,6],[6,7],[12,5],[12,11],[11,6],[11,8],[7,8],[9,4]]
|
|
227
|
-
|
|
228
229
|
/**
|
|
229
230
|
* MAIN
|
|
230
231
|
*/
|
|
231
|
-
|
|
232
232
|
// let cycles_data = find_inner_cycles(V, EV)
|
|
233
233
|
// console.log('############## OUTPUT')
|
|
234
234
|
// console.log('EDGES:')
|
package/lib/utils/graph.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Graph = exports.Edge = void 0;
|
|
8
|
+
exports.create_array = create_array;
|
|
9
|
+
exports["default"] = void 0;
|
|
4
10
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
5
11
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
6
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
@@ -15,12 +21,12 @@ function create_array(length) {
|
|
|
15
21
|
}
|
|
16
22
|
return array;
|
|
17
23
|
}
|
|
18
|
-
var Edge = /*#__PURE__*/_createClass(function Edge(u, v) {
|
|
24
|
+
var Edge = exports.Edge = /*#__PURE__*/_createClass(function Edge(u, v) {
|
|
19
25
|
_classCallCheck(this, Edge);
|
|
20
26
|
this.u = u;
|
|
21
27
|
this.v = v;
|
|
22
28
|
});
|
|
23
|
-
var Graph = /*#__PURE__*/function () {
|
|
29
|
+
var Graph = exports.Graph = /*#__PURE__*/function () {
|
|
24
30
|
function Graph(v) {
|
|
25
31
|
_classCallCheck(this, Graph);
|
|
26
32
|
this.count = 0; // count is number of biconnected components
|
|
@@ -148,4 +154,4 @@ var Graph = /*#__PURE__*/function () {
|
|
|
148
154
|
}
|
|
149
155
|
}]);
|
|
150
156
|
}();
|
|
151
|
-
|
|
157
|
+
var _default = exports["default"] = Graph;
|
package/lib/utils/helper.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.animateDoor = void 0;
|
|
|
7
7
|
exports.applyEdges = applyEdges;
|
|
8
8
|
exports.base64Decode = void 0;
|
|
9
9
|
exports.debugUtil = debugUtil;
|
|
10
|
-
exports.
|
|
10
|
+
exports.getPathInfo = exports.getPath = void 0;
|
|
11
11
|
exports.handleCamRect = handleCamRect;
|
|
12
12
|
exports.isCeilLimitation = isCeilLimitation;
|
|
13
13
|
exports.isElevationView = isElevationView;
|
|
@@ -33,78 +33,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
33
33
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
34
34
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
35
35
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
36
|
-
var AWS = require('aws-sdk');
|
|
37
|
-
var s3 = new AWS.S3({
|
|
38
|
-
accessKeyId: process.env.REACT_APP_AWS_ID,
|
|
39
|
-
secretAccessKey: process.env.REACT_APP_AWS_SECRET
|
|
40
|
-
});
|
|
41
|
-
var s3ParseUrl = function s3ParseUrl(url) {
|
|
42
|
-
var _decodedUrl = decodeURIComponent(url);
|
|
43
|
-
var _result = null;
|
|
44
|
-
|
|
45
|
-
// http://s3.amazonaws.com/bucket/key1/key2
|
|
46
|
-
var match = decodedUrl.match(/^https?:\/\/s3.amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
47
|
-
if (_match) {
|
|
48
|
-
_result = {
|
|
49
|
-
bucket: _match[1],
|
|
50
|
-
key: _match[2],
|
|
51
|
-
region: ''
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// http://s3-aws-region.amazonaws.com/bucket/key1/key2
|
|
56
|
-
match = decodedUrl.match(/^https?:\/\/s3-([^.]+).amazonaws.com\/([^\/]+)\/?(.*?)$/);
|
|
57
|
-
if (_match) {
|
|
58
|
-
_result = {
|
|
59
|
-
bucket: _match[2],
|
|
60
|
-
key: _match[3],
|
|
61
|
-
region: _match[1]
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// http://bucket.s3.amazonaws.com/key1/key2
|
|
66
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).s3.amazonaws.com\/?(.*?)$/);
|
|
67
|
-
if (_match) {
|
|
68
|
-
_result = {
|
|
69
|
-
bucket: _match[1],
|
|
70
|
-
key: _match[2],
|
|
71
|
-
region: ''
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// http://bucket.s3-aws-region.amazonaws.com/key1/key2 or,
|
|
76
|
-
// http://bucket.s3.aws-region.amazonaws.com/key1/key2
|
|
77
|
-
match = decodedUrl.match(/^https?:\/\/([^.]+).(?:s3-|s3\.)([^.]+).amazonaws.com\/?(.*?)$/);
|
|
78
|
-
if (_match) {
|
|
79
|
-
_result = {
|
|
80
|
-
bucket: _match[1],
|
|
81
|
-
key: _match[3],
|
|
82
|
-
region: _match[2]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return _result;
|
|
86
|
-
};
|
|
87
36
|
var textureCube = exports.textureCube = new _HDRCubeTextureLoader.HDRCubeTextureLoader().setPath('/catalog/envMap/').load(_constants.HDR_URLS, function () {
|
|
88
37
|
textureCube.magFilter = Three.LinearFilter;
|
|
89
38
|
textureCube.needsUpdate = true;
|
|
90
39
|
});
|
|
91
|
-
var getSignedUrl = exports.getSignedUrl = function getSignedUrl(url) {
|
|
92
|
-
if (!url) return url;
|
|
93
|
-
var signedUrl = url;
|
|
94
|
-
try {
|
|
95
|
-
var _s3ParseUrl = s3ParseUrl(url),
|
|
96
|
-
bucket = _s3ParseUrl.bucket,
|
|
97
|
-
key = _s3ParseUrl.key;
|
|
98
|
-
signedUrl = s3.getSignedUrl('getObject', {
|
|
99
|
-
Bucket: bucket,
|
|
100
|
-
Key: key,
|
|
101
|
-
ResponseCacheControl: 'no-cache'
|
|
102
|
-
});
|
|
103
|
-
} catch (e) {
|
|
104
|
-
signedUrl = url;
|
|
105
|
-
}
|
|
106
|
-
return signedUrl;
|
|
107
|
-
};
|
|
108
40
|
var base64Decode = exports.base64Decode = function base64Decode(targetStr) {
|
|
109
41
|
if (!targetStr) return null;
|
|
110
42
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kitchen-simulator",
|
|
3
|
-
"version": "1.1.1-test.
|
|
3
|
+
"version": "1.1.1-test.20",
|
|
4
4
|
"description": "It is a kitchen simulator.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"@sentry/react": "^9.10.1",
|
|
70
70
|
"area-polygon": "1.0.1",
|
|
71
71
|
"assert": "^2.1.0",
|
|
72
|
-
"aws-sdk": "^2.984.0",
|
|
73
72
|
"axios": "^0.20.0",
|
|
74
73
|
"browserify-zlib": "^0.2.0",
|
|
75
74
|
"buffer": "^6.0.3",
|