kitchen-simulator 1.1.1-test.6 → 1.1.1-test.60
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/KitchenConfigurator.js +8 -15
- package/es/KitchenConfiguratorApp.js +11 -27
- package/es/actions/holes-actions.js +1 -1
- package/es/actions/items-actions.js +1 -1
- package/es/actions/lines-actions.js +1 -1
- package/es/actions/project-actions.js +1 -1
- package/es/actions/scene-actions.js +1 -1
- package/es/actions/vertices-actions.js +1 -1
- package/es/actions/viewer2d-actions.js +1 -1
- package/es/actions/viewer3d-actions.js +1 -1
- package/es/catalog/areas/area/planner-element.js +10 -7
- package/es/catalog/factories/wall-factory-3d.js +1 -1
- package/es/catalog/holes/export.js +13 -13
- package/es/catalog/lines/wall/planner-element.js +13 -10
- package/es/catalog/properties/property-checkbox.js +63 -18
- package/es/catalog/properties/property-enum.js +51 -9
- package/es/catalog/properties/property-lenght-measure.js +2 -2
- package/es/catalog/properties/property-length-measure.js +58 -9
- package/es/catalog/properties/property-length-measure_hole.js +2 -2
- package/es/catalog/utils/exporter.js +1 -1
- package/es/catalog/utils/item-loader.js +1 -1
- package/es/catalog/utils/mtl-loader.js +3 -2
- package/es/catalog/utils/obj-loader.js +3 -2
- package/es/class/area.js +1 -1
- package/es/class/group.js +3 -3
- package/es/class/hole.js +5 -6
- package/es/class/item.js +8 -10
- package/es/class/layer.js +2 -2
- package/es/class/project.js +4 -4
- package/es/components/content.js +1 -0
- package/es/components/disclaimer/disclaimer.js +66 -86
- package/es/components/style/form-number-input.js +31 -7
- package/es/components/style/form-select.js +56 -8
- package/es/components/style/form-slider.js +22 -6
- package/es/components/style/form-text-input.js +31 -12
- package/es/components/viewer2d/area.js +4 -4
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/es/components/viewer2d/item.js +3 -5
- package/es/components/viewer2d/line.js +2 -5
- package/es/components/viewer2d/ruler.js +2 -3
- package/es/components/viewer2d/rulerDist.js +1 -1
- package/es/components/viewer2d/scene.js +2 -2
- package/es/components/viewer2d/utils.js +37 -1
- package/es/components/viewer2d/viewer2d.js +10 -4
- package/es/components/viewer3d/libs/mtl-loader.js +2 -2
- package/es/components/viewer3d/libs/obj-loader.js +2 -2
- package/es/components/viewer3d/libs/orbit-controls.js +6 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +5 -4
- package/es/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
- package/es/components/viewer3d/ruler-utils/scene3D.js +2 -3
- package/es/components/viewer3d/scene-creator.js +1 -1
- package/es/components/viewer3d/viewer3d.js +12 -13
- package/es/index.js +20 -14
- package/es/models.js +4 -3
- package/es/plugins/keyboard.js +2 -2
- package/es/reducers/holes-reducer.js +1 -1
- package/es/reducers/items-reducer.js +2 -5
- package/es/reducers/lines-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -2
- package/es/reducers/scene-reducer.js +1 -1
- package/es/reducers/user-reducer.js +1 -2
- package/es/reducers/vertices-reducer.js +1 -1
- package/es/reducers/viewer2d-reducer.js +2 -2
- package/es/reducers/viewer3d-reducer.js +2 -2
- package/es/utils/convert-units-lite.js +29 -0
- package/es/utils/geometry.js +4 -4
- 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 +1 -69
- package/es/utils/id-broker.js +2 -2
- package/es/utils/molding.js +34 -34
- package/lib/KitchenConfigurator.js +33 -40
- package/lib/KitchenConfiguratorApp.js +34 -49
- package/lib/catalog/areas/area/planner-element.js +12 -8
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/holes/export.js +13 -13
- package/lib/catalog/lines/wall/planner-element.js +15 -11
- package/lib/catalog/properties/property-checkbox.js +64 -19
- package/lib/catalog/properties/property-enum.js +49 -7
- package/lib/catalog/properties/property-lenght-measure.js +3 -3
- package/lib/catalog/properties/property-length-measure.js +60 -11
- package/lib/catalog/properties/property-length-measure_hole.js +3 -3
- package/lib/catalog/utils/exporter.js +5 -6
- package/lib/catalog/utils/item-loader.js +20 -21
- package/lib/catalog/utils/mtl-loader.js +7 -3
- package/lib/catalog/utils/obj-loader.js +7 -3
- package/lib/class/item.js +13 -16
- package/lib/components/content.js +1 -0
- package/lib/components/disclaimer/disclaimer.js +66 -86
- package/lib/components/style/form-number-input.js +30 -6
- package/lib/components/style/form-select.js +54 -8
- package/lib/components/style/form-slider.js +22 -6
- package/lib/components/style/form-text-input.js +30 -12
- package/lib/components/viewer2d/area.js +5 -5
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/lib/components/viewer2d/item.js +7 -8
- package/lib/components/viewer2d/line.js +2 -5
- package/lib/components/viewer2d/ruler.js +6 -7
- package/lib/components/viewer2d/rulerDist.js +4 -4
- package/lib/components/viewer2d/scene.js +1 -1
- package/lib/components/viewer2d/utils.js +37 -0
- package/lib/components/viewer2d/viewer2d.js +25 -17
- package/lib/components/viewer3d/libs/mtl-loader.js +6 -2
- package/lib/components/viewer3d/libs/obj-loader.js +6 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- package/lib/components/viewer3d/ruler-utils/itemRect.js +7 -7
- package/lib/components/viewer3d/ruler-utils/layer3D.js +32 -32
- package/lib/components/viewer3d/ruler-utils/scene3D.js +3 -4
- package/lib/components/viewer3d/scene-creator.js +24 -24
- package/lib/components/viewer3d/viewer3d.js +17 -17
- package/lib/index.js +22 -88
- package/lib/models.js +7 -7
- package/lib/reducers/user-reducer.js +0 -1
- package/lib/reducers/viewer2d-reducer.js +3 -4
- package/lib/reducers/viewer3d-reducer.js +3 -4
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/geometry.js +9 -10
- 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 +7 -76
- package/lib/utils/id-broker.js +2 -2
- package/lib/utils/molding.js +52 -52
- package/package.json +34 -70
- package/es/analytics/ga4.js +0 -191
- package/es/analytics/posthog.js +0 -60
- package/lib/analytics/ga4.js +0 -197
- package/lib/analytics/posthog.js +0 -68
package/lib/index.js
CHANGED
|
@@ -1,94 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return _catalog["default"];
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "ElementsFactories", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _export6["default"];
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "KitchenConfiguratorActions", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _export3["default"];
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "KitchenConfiguratorApp", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _KitchenConfiguratorApp["default"];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "KitchenConfiguratorClasses", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function get() {
|
|
34
|
-
return _export5["default"];
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "KitchenConfiguratorComponents", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function get() {
|
|
40
|
-
return _export2["default"];
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
exports.KitchenConfiguratorConstants = void 0;
|
|
44
|
-
Object.defineProperty(exports, "KitchenConfiguratorReducers", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function get() {
|
|
47
|
-
return _export4["default"];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
exports.KitchenConfiguratorSharedStyle = void 0;
|
|
51
|
-
Object.defineProperty(exports, "KitchenConfiguratorUtils", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function get() {
|
|
54
|
-
return _export7["default"];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
exports.Models = void 0;
|
|
58
|
-
Object.defineProperty(exports, "Plugins", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
get: function get() {
|
|
61
|
-
return _export["default"];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(exports, "Translator", {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function get() {
|
|
67
|
-
return _translator["default"];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(exports, "reducer", {
|
|
71
|
-
enumerable: true,
|
|
72
|
-
get: function get() {
|
|
73
|
-
return _reducer["default"];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
var _catalog = _interopRequireDefault(require("./catalog/catalog"));
|
|
77
|
-
var _translator = _interopRequireDefault(require("./translator/translator"));
|
|
78
|
-
var Models = _interopRequireWildcard(require("./models"));
|
|
79
|
-
exports.Models = Models;
|
|
80
|
-
var _reducer = _interopRequireDefault(require("./reducers/reducer"));
|
|
6
|
+
exports["default"] = renderKitchenSimulator;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _client = _interopRequireDefault(require("react-dom/client"));
|
|
81
9
|
var _KitchenConfiguratorApp = _interopRequireDefault(require("./KitchenConfiguratorApp"));
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
// src/index.js
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Mounts the Kitchen Configurator micro-frontend into a DOM container.
|
|
15
|
+
* Returns an unmount() function for cleanup.
|
|
16
|
+
*/
|
|
17
|
+
function renderKitchenSimulator(container) {
|
|
18
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
|
+
if (!container) throw new Error('Container element is required');
|
|
20
|
+
var root = _client["default"].createRoot(container);
|
|
21
|
+
root.render(/*#__PURE__*/_react["default"].createElement(_KitchenConfiguratorApp["default"], props));
|
|
22
|
+
return {
|
|
23
|
+
root: root,
|
|
24
|
+
unmount: function unmount() {
|
|
25
|
+
root.unmount();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
package/lib/models.js
CHANGED
|
@@ -4,13 +4,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.Vertex = exports.State = exports.Scene = exports.Line = exports.Layer = exports.Item = exports.Hole = exports.HistoryStructure = exports.Group = exports.Grid = exports.ElementsSet = exports.DefaultLayers = exports.DefaultGrids = exports.CatalogElement = exports.Catalog = exports.Area = void 0;
|
|
7
|
+
exports["default"] = exports.Vertex = exports.State = exports.Scene = exports.Line = exports.Layer = exports.Item = exports.Hole = exports.HistoryStructure = exports.Group = exports.Grid = exports.ElementsSet = exports.DefaultLayers = exports.DefaultGrids = exports.CatalogElement = exports.Catalog = exports.Area = void 0;
|
|
8
8
|
var _immutable = require("immutable");
|
|
9
9
|
var _constants = require("./constants");
|
|
10
10
|
var _snap = require("./utils/snap");
|
|
11
11
|
var _helper = require("./utils/helper");
|
|
12
|
-
var
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
var _convertUnitsLite = require("./utils/convert-units-lite");
|
|
14
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
15
|
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; }
|
|
@@ -401,17 +400,17 @@ var Catalog = exports.Catalog = /*#__PURE__*/function (_Record10) {
|
|
|
401
400
|
width: new _immutable.Map({
|
|
402
401
|
_length: temp.width,
|
|
403
402
|
_unit: 'in',
|
|
404
|
-
length: (0,
|
|
403
|
+
length: (0, _convertUnitsLite.convert)(temp.width).from('in').to('cm')
|
|
405
404
|
}),
|
|
406
405
|
height: new _immutable.Map({
|
|
407
406
|
_length: temp.height,
|
|
408
407
|
_unit: 'in',
|
|
409
|
-
length: (0,
|
|
408
|
+
length: (0, _convertUnitsLite.convert)(temp.height).from('in').to('cm')
|
|
410
409
|
}),
|
|
411
410
|
depth: new _immutable.Map({
|
|
412
411
|
_length: temp.depth,
|
|
413
412
|
_unit: 'in',
|
|
414
|
-
length: (0,
|
|
413
|
+
length: (0, _convertUnitsLite.convert)(temp.depth).from('in').to('cm')
|
|
415
414
|
})
|
|
416
415
|
};
|
|
417
416
|
properties = properties.set('width', _sizeinfo.width).set('height', _sizeinfo.height).set('depth', _sizeinfo.depth);
|
|
@@ -514,4 +513,5 @@ var State = exports.State = /*#__PURE__*/function (_Record12) {
|
|
|
514
513
|
userId: 0,
|
|
515
514
|
isHelp: false,
|
|
516
515
|
isCabinetDrawing: false
|
|
517
|
-
}, 'State'));
|
|
516
|
+
}, 'State'));
|
|
517
|
+
var _default = exports["default"] = State;
|
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = _default;
|
|
7
7
|
var _constants = require("../constants");
|
|
8
|
-
var
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
8
|
+
var _convertUnitsLite = require("../utils/convert-units-lite");
|
|
10
9
|
function _default(state, action) {
|
|
11
10
|
var _state = state,
|
|
12
11
|
scene = _state.scene;
|
|
@@ -36,8 +35,8 @@ function _default(state, action) {
|
|
|
36
35
|
if (item.type.includes('Light')) {
|
|
37
36
|
var height = item.properties.getIn(['height', '_length']);
|
|
38
37
|
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
39
|
-
var newAltitude = action.value - (0,
|
|
40
|
-
item = item.setIn(['properties', 'altitude', '_length'], (0,
|
|
38
|
+
var newAltitude = action.value - (0, _convertUnitsLite.convert)(height).from(heightUnit).to('in');
|
|
39
|
+
item = item.setIn(['properties', 'altitude', '_length'], (0, _convertUnitsLite.convert)(newAltitude).from('in').to(_layer.unit));
|
|
41
40
|
}
|
|
42
41
|
return item;
|
|
43
42
|
});
|
|
@@ -7,8 +7,7 @@ exports["default"] = _default;
|
|
|
7
7
|
var _constants = require("../constants");
|
|
8
8
|
var _export = require("../class/export");
|
|
9
9
|
var _export2 = require("../utils/export");
|
|
10
|
-
var
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var _convertUnitsLite = require("../utils/convert-units-lite");
|
|
12
11
|
function _default(state, action) {
|
|
13
12
|
state = state.merge({
|
|
14
13
|
sceneHistory: _export2.history.historyPush(state.sceneHistory, state.scene)
|
|
@@ -41,8 +40,8 @@ function _default(state, action) {
|
|
|
41
40
|
if (item.type.includes('Light')) {
|
|
42
41
|
var height = item.properties.getIn(['height', '_length']);
|
|
43
42
|
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
44
|
-
var newAltitude = action.value - (0,
|
|
45
|
-
item = item.setIn(['properties', 'altitude', '_length'], (0,
|
|
43
|
+
var newAltitude = action.value - (0, _convertUnitsLite.convert)(height).from(heightUnit).to('in');
|
|
44
|
+
item = item.setIn(['properties', 'altitude', '_length'], (0, _convertUnitsLite.convert)(newAltitude).from('in').to(_layer.unit));
|
|
46
45
|
}
|
|
47
46
|
return item;
|
|
48
47
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.convert = convert;
|
|
7
|
+
var lengthFactors = {
|
|
8
|
+
m: 1,
|
|
9
|
+
cm: 100,
|
|
10
|
+
mm: 1000,
|
|
11
|
+
"in": 39.3701,
|
|
12
|
+
ft: 3.28084,
|
|
13
|
+
m2: 1,
|
|
14
|
+
cm2: 10000,
|
|
15
|
+
// (100^2)
|
|
16
|
+
mm2: 1000000,
|
|
17
|
+
// (1000^2)
|
|
18
|
+
in2: 1550.0031,
|
|
19
|
+
// (39.3701^2)
|
|
20
|
+
ft2: 10.7639 // (3.28084^2)
|
|
21
|
+
};
|
|
22
|
+
function convert(value) {
|
|
23
|
+
return {
|
|
24
|
+
from: function from(fromUnit) {
|
|
25
|
+
return {
|
|
26
|
+
to: function to(toUnit) {
|
|
27
|
+
if (!(fromUnit in lengthFactors) || !(toUnit in lengthFactors)) {
|
|
28
|
+
throw new Error("Unsupported unit conversion: ".concat(fromUnit, " \u2192 ").concat(toUnit));
|
|
29
|
+
}
|
|
30
|
+
return value / lengthFactors[fromUnit] * lengthFactors[toUnit];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
package/lib/utils/geometry.js
CHANGED
|
@@ -96,13 +96,12 @@ exports.verticesDistance = verticesDistance;
|
|
|
96
96
|
exports.verticesMidPoint = verticesMidPoint;
|
|
97
97
|
var _math = require("./math.js");
|
|
98
98
|
var _constants = require("../constants");
|
|
99
|
-
var
|
|
99
|
+
var _convertUnitsLite = require("./convert-units-lite");
|
|
100
100
|
var Three = _interopRequireWildcard(require("three"));
|
|
101
101
|
var _utils = require("../components/viewer2d/utils.js");
|
|
102
102
|
var _helper = require("./helper.js");
|
|
103
103
|
var _export = require("./export.js");
|
|
104
104
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
105
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
106
105
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
107
106
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
108
107
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
@@ -780,9 +779,9 @@ function getAllItems(scene, catalog, allLineRects) {
|
|
|
780
779
|
layoutpos: cat && cat.info.layoutpos,
|
|
781
780
|
is_corner: cat && cat.info.is_corner
|
|
782
781
|
});
|
|
783
|
-
width = (0,
|
|
784
|
-
height = (0,
|
|
785
|
-
depth = (0,
|
|
782
|
+
width = (0, _convertUnitsLite.convert)(sizeinfo.width).from(sizeinfo.widthUnit).to(scene.unit);
|
|
783
|
+
height = (0, _convertUnitsLite.convert)(sizeinfo.depth).from(sizeinfo.depthUnit).to(scene.unit);
|
|
784
|
+
depth = (0, _convertUnitsLite.convert)(sizeinfo.height).from(sizeinfo.heightUnit).to(scene.unit);
|
|
786
785
|
val.size = {
|
|
787
786
|
width: width,
|
|
788
787
|
height: height,
|
|
@@ -841,7 +840,7 @@ function getAllItemSpecified(scene, catalog, filter) {
|
|
|
841
840
|
var getSize = function getSize(key) {
|
|
842
841
|
var _props$getIn;
|
|
843
842
|
var length = props === null || props === void 0 || (_props$getIn = props.getIn) === null || _props$getIn === void 0 ? void 0 : _props$getIn.call(props, [key, '_length']);
|
|
844
|
-
return length != null ? (0,
|
|
843
|
+
return length != null ? (0, _convertUnitsLite.convert)(length).from('in').to(scene.unit) : 0;
|
|
845
844
|
};
|
|
846
845
|
val.size = {
|
|
847
846
|
width: getSize('width'),
|
|
@@ -1717,7 +1716,7 @@ function calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect,
|
|
|
1717
1716
|
//Check case.
|
|
1718
1717
|
//If item is 'blind base cabinet', it must be pulled from other 3".
|
|
1719
1718
|
if (allItemRect.cur && allItemRect.cur.itemInfo.sku_number.startsWith('BBC')) {
|
|
1720
|
-
var offset3inch = (0,
|
|
1719
|
+
var offset3inch = (0, _convertUnitsLite.convert)(3).from('in').to('cm');
|
|
1721
1720
|
var tx = nx,
|
|
1722
1721
|
ty = ny;
|
|
1723
1722
|
if (allItemRect.cur && allItemRect.cur.itemInfo.sku_number.endsWith('-L')) {
|
|
@@ -2070,14 +2069,14 @@ function needSnap(curItem, othItem) {
|
|
|
2070
2069
|
var blSnap = false;
|
|
2071
2070
|
if (curItem == undefined || curItem == null) return false;
|
|
2072
2071
|
var altitude = curItem.selectedItem.properties.get('altitude');
|
|
2073
|
-
var heightFromFloor = (0,
|
|
2072
|
+
var heightFromFloor = (0, _convertUnitsLite.convert)(altitude.get('_length')).from(altitude.get('_unit')).to('in');
|
|
2074
2073
|
var height = curItem.cat.info.sizeinfo.height;
|
|
2075
2074
|
var currentItem = {
|
|
2076
2075
|
heightFromFloor: heightFromFloor,
|
|
2077
2076
|
height: height
|
|
2078
2077
|
};
|
|
2079
2078
|
altitude = othItem.item.properties.get('altitude');
|
|
2080
|
-
heightFromFloor = (0,
|
|
2079
|
+
heightFromFloor = (0, _convertUnitsLite.convert)(altitude.get('_length')).from(altitude.get('_unit')).to('in');
|
|
2081
2080
|
height = othItem.cat && othItem.cat.info.sizeinfo.height;
|
|
2082
2081
|
var otherItem = {
|
|
2083
2082
|
heightFromFloor: heightFromFloor,
|
|
@@ -2138,7 +2137,7 @@ function isRightWall(v0, v1) {
|
|
|
2138
2137
|
* OVERLAP_LINK: two lines are linked at the common point, so they can be merged to one line
|
|
2139
2138
|
* OVERLAP_INCLUDED: destLine includes srcLine
|
|
2140
2139
|
* OVERLAP_SOME: two lines are overlapped with some common range, then returns the trimmed segments of srcLine
|
|
2141
|
-
*
|
|
2140
|
+
*
|
|
2142
2141
|
* //////// test - start /////////////
|
|
2143
2142
|
const p1 = { x1: 1413.1313131313132, y1: 1044.949494949495 };
|
|
2144
2143
|
const p2 = { x1: 1476.2626262626263, y1: 1108.0808080808079 };
|
|
@@ -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;
|
|
@@ -23,9 +23,8 @@ var _HDRCubeTextureLoader = require("three/examples/jsm/loaders/HDRCubeTextureLo
|
|
|
23
23
|
var _constants = require("../constants");
|
|
24
24
|
var Three = _interopRequireWildcard(require("three"));
|
|
25
25
|
var _utils = require("./../components/viewer2d/utils");
|
|
26
|
-
var
|
|
26
|
+
var _convertUnitsLite = require("./convert-units-lite");
|
|
27
27
|
var _math = require("./math");
|
|
28
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
29
28
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
29
|
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); }
|
|
31
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -33,78 +32,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
33
32
|
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
33
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
35
34
|
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
35
|
var textureCube = exports.textureCube = new _HDRCubeTextureLoader.HDRCubeTextureLoader().setPath('/catalog/envMap/').load(_constants.HDR_URLS, function () {
|
|
88
36
|
textureCube.magFilter = Three.LinearFilter;
|
|
89
37
|
textureCube.needsUpdate = true;
|
|
90
38
|
});
|
|
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
39
|
var base64Decode = exports.base64Decode = function base64Decode(targetStr) {
|
|
109
40
|
if (!targetStr) return null;
|
|
110
41
|
try {
|
|
@@ -157,9 +88,9 @@ var refineProductForSummaryPdf = exports.refineProductForSummaryPdf = function r
|
|
|
157
88
|
thumbnail: review.img,
|
|
158
89
|
sku: itemSKU,
|
|
159
90
|
sizeInfo: {
|
|
160
|
-
width: Math.round((0,
|
|
161
|
-
depth: Math.round((0,
|
|
162
|
-
height: Math.round((0,
|
|
91
|
+
width: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.width).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
92
|
+
depth: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.depth).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
93
|
+
height: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.height).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
163
94
|
_unit: measurementUnit._unit
|
|
164
95
|
},
|
|
165
96
|
doorstyle: doorStyleName,
|
|
@@ -275,7 +206,7 @@ var animateDoor = exports.animateDoor = function animateDoor(offsetData, doorObj
|
|
|
275
206
|
|
|
276
207
|
// Opening or Closing the drawer action
|
|
277
208
|
var translateDrawer = exports.translateDrawer = function translateDrawer(item, drawerObj, open_doors, mode) {
|
|
278
|
-
var animate_translate_unit = (0,
|
|
209
|
+
var animate_translate_unit = (0, _convertUnitsLite.convert)(item.properties.depth._length).from(item.properties.depth._unit).to('cm') * (1 / 2) / _constants.ANIMATE_STEP_MAX * 0.01;
|
|
279
210
|
// Check whether the object's drawer is opened in 2D.
|
|
280
211
|
if (mode === 'Opened2D') animate_translate_unit *= _constants.ANIMATE_STEP_MAX;
|
|
281
212
|
drawerObj.translateZ(open_doors ? -animate_translate_unit : animate_translate_unit);
|
|
@@ -338,7 +269,7 @@ function isCeilLimitation(layer, ceilHeight, ceilUnit) {
|
|
|
338
269
|
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
339
270
|
var altitude = item.properties.getIn(['altitude', '_length']);
|
|
340
271
|
var altitudeUnit = item.properties.getIn(['altitude', '_unit']);
|
|
341
|
-
var totalHeight = (0,
|
|
272
|
+
var totalHeight = (0, _convertUnitsLite.convert)(height).from(heightUnit).to(ceilUnit._unit) + (0, _convertUnitsLite.convert)(altitude).from(altitudeUnit).to(ceilUnit._unit);
|
|
342
273
|
return totalHeight > ceilHeight;
|
|
343
274
|
});
|
|
344
275
|
}
|
package/lib/utils/id-broker.js
CHANGED
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.IDBroker = void 0;
|
|
7
|
+
var _nanoid = require("nanoid");
|
|
7
8
|
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); }
|
|
8
9
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
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); } }
|
|
10
11
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
13
|
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); }
|
|
13
|
-
var shortid = require('shortid');
|
|
14
14
|
var IDBroker = exports.IDBroker = /*#__PURE__*/function () {
|
|
15
15
|
function IDBroker() {
|
|
16
16
|
_classCallCheck(this, IDBroker);
|
|
@@ -18,7 +18,7 @@ var IDBroker = exports.IDBroker = /*#__PURE__*/function () {
|
|
|
18
18
|
return _createClass(IDBroker, null, [{
|
|
19
19
|
key: "acquireID",
|
|
20
20
|
value: function acquireID() {
|
|
21
|
-
return
|
|
21
|
+
return (0, _nanoid.nanoid)();
|
|
22
22
|
}
|
|
23
23
|
}]);
|
|
24
24
|
}();
|