kitchen-simulator 1.1.1-test.54 → 1.1.1-test.56

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 (57) hide show
  1. package/es/KitchenConfigurator.js +1 -1
  2. package/es/catalog/factories/wall-factory-3d.js +1 -1
  3. package/es/catalog/properties/property-lenght-measure.js +2 -2
  4. package/es/catalog/properties/property-length-measure.js +1 -1
  5. package/es/catalog/properties/property-length-measure_hole.js +2 -2
  6. package/es/catalog/utils/exporter.js +1 -1
  7. package/es/catalog/utils/item-loader.js +1 -1
  8. package/es/class/item.js +1 -1
  9. package/es/components/viewer2d/area.js +1 -1
  10. package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
  11. package/es/components/viewer2d/grids/grid-streak.js +0 -1
  12. package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -1
  13. package/es/components/viewer2d/item.js +3 -5
  14. package/es/components/viewer2d/ruler.js +2 -3
  15. package/es/components/viewer2d/rulerDist.js +1 -1
  16. package/es/components/viewer2d/viewer2d.js +2 -2
  17. package/es/components/viewer3d/ruler-utils/itemRect.js +1 -1
  18. package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
  19. package/es/components/viewer3d/ruler-utils/scene3D.js +1 -1
  20. package/es/components/viewer3d/scene-creator.js +1 -1
  21. package/es/components/viewer3d/viewer3d.js +1 -1
  22. package/es/models.js +1 -1
  23. package/es/reducers/viewer2d-reducer.js +1 -1
  24. package/es/reducers/viewer3d-reducer.js +1 -1
  25. package/es/utils/convert-units-lite.js +21 -0
  26. package/es/utils/geometry.js +4 -4
  27. package/es/utils/helper.js +1 -1
  28. package/es/utils/molding.js +34 -34
  29. package/lib/KitchenConfigurator.js +2 -2
  30. package/lib/catalog/factories/wall-factory-3d.js +2 -2
  31. package/lib/catalog/properties/property-lenght-measure.js +3 -3
  32. package/lib/catalog/properties/property-length-measure.js +5 -5
  33. package/lib/catalog/properties/property-length-measure_hole.js +3 -3
  34. package/lib/catalog/utils/exporter.js +5 -6
  35. package/lib/catalog/utils/item-loader.js +20 -21
  36. package/lib/class/item.js +10 -11
  37. package/lib/components/viewer2d/area.js +2 -2
  38. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
  39. package/lib/components/viewer2d/grids/grid-streak.js +0 -1
  40. package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -1
  41. package/lib/components/viewer2d/item.js +7 -8
  42. package/lib/components/viewer2d/ruler.js +6 -7
  43. package/lib/components/viewer2d/rulerDist.js +4 -4
  44. package/lib/components/viewer2d/viewer2d.js +17 -15
  45. package/lib/components/viewer3d/ruler-utils/itemRect.js +7 -7
  46. package/lib/components/viewer3d/ruler-utils/layer3D.js +32 -32
  47. package/lib/components/viewer3d/ruler-utils/scene3D.js +2 -2
  48. package/lib/components/viewer3d/scene-creator.js +24 -24
  49. package/lib/components/viewer3d/viewer3d.js +11 -11
  50. package/lib/models.js +4 -5
  51. package/lib/reducers/viewer2d-reducer.js +3 -4
  52. package/lib/reducers/viewer3d-reducer.js +3 -4
  53. package/lib/utils/convert-units-lite.js +27 -0
  54. package/lib/utils/geometry.js +9 -10
  55. package/lib/utils/helper.js +6 -7
  56. package/lib/utils/molding.js +52 -52
  57. package/package.json +6 -6
@@ -29,7 +29,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
29
29
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
30
30
  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); }
31
31
  import axios from 'axios';
32
- import * as convert from 'convert-units';
32
+ import { convert } from "./utils/convert-units-lite";
33
33
  import { Autosave } from "./plugins/export";
34
34
  import PropTypes from 'prop-types';
35
35
  import React, { Component } from 'react';
@@ -4,7 +4,7 @@ import { verticesDistance } from "../../utils/geometry";
4
4
  import { isElevationView } from "../../utils/helper";
5
5
  import * as SharedStyle from "../../shared-style";
6
6
  import { LINE_THICKNESS, UNIT_CENTIMETER } from "../../constants";
7
- import convert from 'convert-units';
7
+ import { convert } from "../../utils/convert-units-lite";
8
8
  import ThreeBSP from "../../utils/threeCSG.es6";
9
9
  var params = {
10
10
  envMap: 'HDR',
@@ -4,8 +4,8 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
4
4
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
5
  import React from 'react';
6
6
  import PropTypes from 'prop-types';
7
- import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNITS_LENGTH, UNIT_INCH } from "./../../constants";
8
- import convert from 'convert-units';
7
+ import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNIT_INCH, UNITS_LENGTH } from "./../../constants";
8
+ import { convert } from "../../utils/convert-units-lite";
9
9
  import { FormLabel, FormNumberInput, FormSelect } from "../../components/style/export";
10
10
  import { Map } from 'immutable';
11
11
  import { toFixedFloat } from "../../utils/math";
@@ -11,7 +11,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
11
11
  import React from 'react';
12
12
  import PropTypes from 'prop-types';
13
13
  import { BASE_CABINET_LAYOUTPOS, DEFAULT_FONT_FAMILY, TALL_CABINET_LAYOUTPOS, TEXT_COLOR_NEUTRAL_0, UNIT_CENTIMETER, UNIT_INCH } from "../../constants";
14
- import convert from 'convert-units';
14
+ import { convert } from "../../utils/convert-units-lite";
15
15
  import { FormNumberInput } from "../../components/style/export";
16
16
  import { Map } from 'immutable';
17
17
  import { toFixedFloat } from "../../utils/math";
@@ -4,8 +4,8 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
4
4
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
5
  import React from 'react';
6
6
  import PropTypes from 'prop-types';
7
- import { UNITS_LENGTH, UNIT_INCH, UNIT_CENTIMETER, BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS } from "../../constants";
8
- import convert from 'convert-units';
7
+ import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNIT_INCH, UNITS_LENGTH } from "../../constants";
8
+ import { convert } from "../../utils/convert-units-lite";
9
9
  import { FormLabel, FormNumberInput1, FormSelect } from "../../components/style/export";
10
10
  import { Map } from 'immutable';
11
11
  import { toFixedFloat } from "../../utils/math";
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  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); }
7
- import convert from 'convert-units';
7
+ import { convert } from "../../utils/convert-units-lite";
8
8
  export default function (_ref) {
9
9
  var itemID = _ref.itemID,
10
10
  type = _ref.type,
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
10
10
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
- import convert from 'convert-units';
13
+ import { convert } from "../../utils/convert-units-lite";
14
14
  import { fromJS, Map } from 'immutable';
15
15
  import React, { useState } from 'react';
16
16
  import * as Three from 'three';
package/es/class/item.js CHANGED
@@ -13,7 +13,7 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
13
13
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  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); }
16
- import convert from 'convert-units';
16
+ import { convert } from "../utils/convert-units-lite";
17
17
  import { Group, Hole, Layer } from "./export";
18
18
  import { GeometryUtils, IDBroker, MoldingUtils, NameGenerator } from "../utils/export";
19
19
  import { fromJS, Map } from 'immutable';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import polylabel from 'polylabel';
4
- import convert from 'convert-units';
4
+ import { convert } from "../../utils/convert-units-lite";
5
5
  import { formatNumber } from "../../utils/math";
6
6
  import { DECIMAL_PLACES_2 } from "../../constants";
7
7
  import { areaPolygon } from "./utils";
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { List } from 'immutable';
4
- import convert from 'convert-units';
5
4
  export default function GridHorizontalStreak(_ref) {
6
5
  var width = _ref.width,
7
6
  height = _ref.height,
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { List } from 'immutable';
4
- import convert from 'convert-units';
5
4
  export default function GridStreak(_ref) {
6
5
  var width = _ref.width,
7
6
  height = _ref.height,
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { List } from 'immutable';
4
- import convert from 'convert-units';
5
4
  export default function GridVerticalStreak(_ref) {
6
5
  var width = _ref.width,
7
6
  height = _ref.height,
@@ -4,14 +4,12 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
4
4
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
5
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
- import React from 'react';
8
- import { useState } from 'react';
7
+ import React, { useState } from 'react';
9
8
  import PropTypes from 'prop-types';
10
- import If from "../../utils/react-if";
11
9
  import RulerDist from "./rulerDist";
12
- import convert from 'convert-units';
10
+ import { convert } from "../../utils/convert-units-lite";
13
11
  import { GeometryUtils } from "../../utils/export";
14
- import { MODE_ROTATING_ITEM, SECONDARY_PURPLE_COLOR, STATUS_NEGATIVE_COLOR, BG_COLOR_1, STATUS_WARNING_COLOR, WALL_CABINET_LAYOUTPOS } from "../../constants";
12
+ import { MODE_ROTATING_ITEM, WALL_CABINET_LAYOUTPOS } from "../../constants";
15
13
  import { returnReplaceableDeepSearchType } from "./utils";
16
14
  var STYLE_LINE = {
17
15
  fill: '#0096fd',
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import convert from 'convert-units';
3
+ import { convert } from "../../utils/convert-units-lite";
4
4
  import IDBroker from "../../utils/id-broker";
5
- import { FormNumberInput2 } from "../style/export";
6
- import { LINE_THICKNESS, SHADE_LIGHT_BLUE_COLOR, TEXT_COLOR_NEUTRAL_7 } from "../../constants";
5
+ import { LINE_THICKNESS, TEXT_COLOR_NEUTRAL_7 } from "../../constants";
7
6
  var STYLE = {
8
7
  stroke: TEXT_COLOR_NEUTRAL_7,
9
8
  strokeWidth: '1px'
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import convert from 'convert-units';
3
+ import { convert } from "../../utils/convert-units-lite";
4
4
  var ARROW_STYLE = {
5
5
  stroke: '#1183B7',
6
6
  strokeWidth: '2px',
@@ -24,10 +24,10 @@ import { RulerX, RulerY } from "./export";
24
24
  import { DECIMAL_PLACES_2, LINE_THICKNESS, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_ELEVATION_VIEW, MODE_IDLE, UNIT_ANGLE } from "../../constants";
25
25
  import { GeometryUtils } from "../../utils/export";
26
26
  import FormNumberInput from "../style/form-number-input";
27
- import convert from 'convert-units';
27
+ import { convert } from "../../utils/convert-units-lite";
28
28
  import { Map } from 'immutable';
29
29
  import { formatNumber } from "../../utils/math";
30
- import { isEmpty } from "../../utils/helper";
30
+ import { isEmpty } from "../../utils/helper"; // variables
31
31
 
32
32
  // variables
33
33
  var pinFlag = false;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MODE_BACK_ELEVATION_VIEW, MODE_FRONT_ELEVATION_VIEW, MODE_LEFT_ELEVATION_VIEW, MODE_RIGHT_ELEVATION_VIEW } from "../../../constants";
3
- import convert from 'convert-units';
3
+ import { convert } from "../../../utils/convert-units-lite";
4
4
  export default function ItemRect(_ref) {
5
5
  var scene = _ref.scene,
6
6
  layer = _ref.layer,
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import Ruler3D from "./ruler3D";
3
- import convert from 'convert-units';
3
+ import { convert } from "../../../utils/convert-units-lite";
4
4
  import { GeometryUtils } from "../../../utils/export";
5
5
  import { returnReplaceableDeepSearchType } from "../../../components/viewer2d/utils";
6
- import { DELTA, DISTANCE_EPSILON, DECIMAL_PLACES_2 } from "../../../constants";
6
+ import { DECIMAL_PLACES_2, DELTA, DISTANCE_EPSILON } from "../../../constants";
7
7
  import { formatNumber, isNonZeroText } from "../../../utils/math";
8
8
  export default function Layer3D(_ref) {
9
9
  var layer = _ref.layer,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { verticesDistance } from "../../../utils/geometry";
3
- import convert from 'convert-units';
3
+ import { convert } from "../../../utils/convert-units-lite";
4
4
  import Layer3D from "./layer3D";
5
5
  export function compareVertices(v0, v1) {
6
6
  return v0.x === v1.x ? v0.y - v1.y : v0.x - v1.x;
@@ -17,7 +17,7 @@ import createGrid from "./grid-creator";
17
17
  import { disposeObject } from "./three-memory-cleaner";
18
18
  import { ANIMATE_STEP_MAX, ANIMATE_STEP_MIN, ARRAY_3D_MODES, ARROW_TEXT_BACKCOLOR, ARROW_TEXT_FONTFACE, ARROW_TEXT_FORECOLOR, BASE_CABINET_LAYOUTPOS, BOTTOM_MOLDING_LOCATION, DECIMAL_PLACES_2, DIFFERENT_VALUES_PATH_LENGTH, DISTANCE_EPSILON, EPSILON, MIDDLE_MOLDING_LOCATION, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_ITEM_3D, MODE_IDLE, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, OBJTYPE_MESH, SHADE_DARK_PURPLE_COLOR, TOP_MOLDING_LOCATION, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS } from "../../constants";
19
19
  import { GeometryUtils, IDBroker, MoldingUtils } from "../../utils/export";
20
- import convert from 'convert-units';
20
+ import { convert } from "../../utils/convert-units-lite";
21
21
  import { verticesDistance } from "../../utils/geometry";
22
22
  import * as GeomUtils from "../../catalog/utils/geom-utils";
23
23
  import { loadTexture } from "../../catalog/utils/item-loader";
@@ -27,7 +27,7 @@ import diff from 'immutablediff';
27
27
  import * as SharedStyle from "../../shared-style";
28
28
  import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS } from "../../constants";
29
29
  import { verticesDistance } from "../../utils/geometry";
30
- import convert from 'convert-units';
30
+ import { convert } from "../../utils/convert-units-lite";
31
31
  import { GeometryUtils } from "../../utils/export";
32
32
  import { handleCamRect, isElevationView, isEmpty } from "../../utils/helper";
33
33
  import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';
package/es/models.js CHANGED
@@ -18,7 +18,7 @@ import { fromJS, List, Map, Record } from 'immutable';
18
18
  import { MODE_IDLE, UNIT_INCH } from "./constants";
19
19
  import { SNAP_MASK } from "./utils/snap";
20
20
  import { isEmpty } from "./utils/helper";
21
- import convert from 'convert-units';
21
+ import { convert } from "./utils/convert-units-lite";
22
22
  var safeLoadMapList = function safeLoadMapList(mapList, Model, defaultMap) {
23
23
  return mapList ? new Map(mapList).map(function (m) {
24
24
  return new Model(m);
@@ -1,5 +1,5 @@
1
1
  import { CHANGE_BASE_CABINET_MEASURE, CHANGE_WALL_CABINET_MEASURE, CHANGE_WALL_LENGTH_MEASURE, CHANGE_WINDOW_DOOR_MEASURE, MODE_2D_PAN, MODE_2D_ZOOM_IN, MODE_2D_ZOOM_OUT, SELECT_TOOL_PAN, SELECT_TOOL_ZOOM_IN, SELECT_TOOL_ZOOM_OUT, UPDATE_2D_CAMERA, UPDATE_CEIL_HEIGHT, UPDATE_CEIL_HEIGHT_UNIT } from "../constants";
2
- import convert from 'convert-units';
2
+ import { convert } from "../utils/convert-units-lite";
3
3
  export default function (state, action) {
4
4
  var _state = state,
5
5
  scene = _state.scene;
@@ -1,7 +1,7 @@
1
1
  import { MODE_3D_FIRST_PERSON, MODE_3D_VIEW, SELECT_TOOL_3D_FIRST_PERSON, SELECT_TOOL_3D_VIEW, UPDATE_3D_CEIL_HEIGHT, UPDATE_3D_CEIL_HEIGHT_UNIT } from "../constants";
2
2
  import { Project } from "../class/export";
3
3
  import { history } from "../utils/export";
4
- import convert from 'convert-units';
4
+ import { convert } from "../utils/convert-units-lite";
5
5
  export default function (state, action) {
6
6
  state = state.merge({
7
7
  sceneHistory: history.historyPush(state.sceneHistory, state.scene)
@@ -0,0 +1,21 @@
1
+ var lengthFactors = {
2
+ m: 1,
3
+ cm: 100,
4
+ mm: 1000,
5
+ "in": 39.3701,
6
+ ft: 3.28084
7
+ };
8
+ export function convert(value) {
9
+ return {
10
+ from: function from(fromUnit) {
11
+ return {
12
+ to: function to(toUnit) {
13
+ if (!(fromUnit in lengthFactors) || !(toUnit in lengthFactors)) {
14
+ throw new Error("Unsupported unit conversion: ".concat(fromUnit, " \u2192 ").concat(toUnit));
15
+ }
16
+ return value / lengthFactors[fromUnit] * lengthFactors[toUnit];
17
+ }
18
+ };
19
+ }
20
+ };
21
+ }
@@ -22,9 +22,9 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
22
22
  * @param {number} y1 Vertex 1 y
23
23
  * @return {number}
24
24
  */
25
- import { toFixedFloat, fAbs } from "./math.js";
26
- import { BASE_CABINET_LAYOUTPOS, EPSILON, LINE_THICKNESS, MEPSILON, OVERLAP_INCLUDED, OVERLAP_LINK, OVERLAP_NONE, OVERLAP_SAME, OVERLAP_SOME, WALL_CABINET_LAYOUTPOS, UNIT_ANGLE, MIN_ANGLE_DISALLOW_DRAW_WALL } from "../constants";
27
- import convert from 'convert-units';
25
+ import { fAbs, toFixedFloat } from "./math.js";
26
+ import { BASE_CABINET_LAYOUTPOS, EPSILON, LINE_THICKNESS, MEPSILON, OVERLAP_INCLUDED, OVERLAP_LINK, OVERLAP_NONE, OVERLAP_SAME, OVERLAP_SOME, UNIT_ANGLE, WALL_CABINET_LAYOUTPOS } from "../constants";
27
+ import { convert } from "./convert-units-lite";
28
28
  import * as Three from 'three';
29
29
  import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils.js";
30
30
  import { isEmpty } from "./helper.js";
@@ -2042,7 +2042,7 @@ export function isRightWall(v0, v1) {
2042
2042
  * OVERLAP_LINK: two lines are linked at the common point, so they can be merged to one line
2043
2043
  * OVERLAP_INCLUDED: destLine includes srcLine
2044
2044
  * OVERLAP_SOME: two lines are overlapped with some common range, then returns the trimmed segments of srcLine
2045
- *
2045
+ *
2046
2046
  * //////// test - start /////////////
2047
2047
  const p1 = { x1: 1413.1313131313132, y1: 1044.949494949495 };
2048
2048
  const p2 = { x1: 1476.2626262626263, y1: 1108.0808080808079 };
@@ -8,7 +8,7 @@ import { HDRCubeTextureLoader } from 'three/examples/jsm/loaders/HDRCubeTextureL
8
8
  import { ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT, ANIMATE_STEP_MAX, DECIMAL_PLACES_2, HDR_URLS, MODE_ELEVATION_VIEW } from "../constants";
9
9
  import * as Three from 'three';
10
10
  import { returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
11
- import convert from 'convert-units';
11
+ import { convert } from "./convert-units-lite";
12
12
  import { formatNumber } from "./math";
13
13
  export var textureCube = new HDRCubeTextureLoader().setPath('/catalog/envMap/').load(HDR_URLS, function () {
14
14
  textureCube.magFilter = Three.LinearFilter;
@@ -13,7 +13,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
13
13
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
14
  import { BASE_CABINET_LAYOUTPOS, BOTTOM_MOLDING_LOCATION, EPSILON, MIDDLE_MOLDING_LOCATION, MOLDING_LOCATIONS, OVERLAP_INCLUDED, OVERLAP_LINK, OVERLAP_SAME, OVERLAP_SOME, TALL_CABINET_LAYOUTPOS, TOP_MOLDING_LOCATION, WALL_CABINET_LAYOUTPOS } from "../constants";
15
15
  import * as Three from 'three';
16
- import convert from 'convert-units';
16
+ import { convert } from "./convert-units-lite";
17
17
  import IDBroker from "./id-broker";
18
18
  import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
19
19
  import { GeometryUtils } from "./export";
@@ -69,16 +69,16 @@ export function isEnableItemForMolding(layer, selItem) {
69
69
  else return result && hasMoldingLayout(molding, selItem.layoutpos);
70
70
  }
71
71
 
72
- /**
73
- * Check two line segments are overlap. The direction of the two line segments must be opposite.
74
- * s1 c2 s2 c1
75
- * |--------|------|-----------|
76
- * Decision Formular: L(s1,c1) + L(s2, c2) = L(s1, s2) + L(c1, c2)
77
- * @param {*} selRectPos1
78
- * @param {*} selRectPos2
79
- * @param {*} curRectPos1
80
- * @param {*} curRectPos2
81
- * @returns L(s1,c1) + L(s2, c2) - L(s1, s2) - L(c1, c2)
72
+ /**
73
+ * Check two line segments are overlap. The direction of the two line segments must be opposite.
74
+ * s1 c2 s2 c1
75
+ * |--------|------|-----------|
76
+ * Decision Formular: L(s1,c1) + L(s2, c2) = L(s1, s2) + L(c1, c2)
77
+ * @param {*} selRectPos1
78
+ * @param {*} selRectPos2
79
+ * @param {*} curRectPos1
80
+ * @param {*} curRectPos2
81
+ * @returns L(s1,c1) + L(s2, c2) - L(s1, s2) - L(c1, c2)
82
82
  */
83
83
  function getDelta(selRectPos1, selRectPos2, curRectPos1, curRectPos2) {
84
84
  return (
@@ -168,11 +168,11 @@ function tryMergeItemWithLocation(curItem, itemGroup, location) {
168
168
  });
169
169
  }
170
170
 
171
- /**
172
- * Make the molding group array with [items].
173
- * @param {*} layer
174
- * @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
175
- * @returns MG array
171
+ /**
172
+ * Make the molding group array with [items].
173
+ * @param {*} layer
174
+ * @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
175
+ * @returns MG array
176
176
  */
177
177
  export function getAllMoldingGroups(layer) {
178
178
  var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
@@ -347,12 +347,12 @@ export function mergeOverlappedLines(line1, line2) {
347
347
  }
348
348
  }
349
349
 
350
- /**
351
- * Get the contour line array of moldingGroup items
352
- * @param {*} moldingGroup
353
- * @param {*} layer
354
- * @param {*} catalog
355
- * @returns contour line array of moldingGroup items
350
+ /**
351
+ * Get the contour line array of moldingGroup items
352
+ * @param {*} moldingGroup
353
+ * @param {*} layer
354
+ * @param {*} catalog
355
+ * @returns contour line array of moldingGroup items
356
356
  */
357
357
  export function getLinesFromItems2(moldingGroup, layer, catalog) {
358
358
  // wall lines
@@ -507,13 +507,13 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
507
507
  return newMGlines;
508
508
  }
509
509
 
510
- /**
511
- * Get the line that colinear linked with [line], and merge them to a new line
512
- * @param {*} line
513
- * @param {*} MGlines
514
- * @returns
515
- * - returns merged new line
516
- * - returns filtered new line group (remove linked line from [MGlines])
510
+ /**
511
+ * Get the line that colinear linked with [line], and merge them to a new line
512
+ * @param {*} line
513
+ * @param {*} MGlines
514
+ * @returns
515
+ * - returns merged new line
516
+ * - returns filtered new line group (remove linked line from [MGlines])
517
517
  */
518
518
  function getMergedLine(line, MGlines, cnt) {
519
519
  try {
@@ -566,11 +566,11 @@ function getMergedLine(line, MGlines, cnt) {
566
566
  }
567
567
  }
568
568
 
569
- /**
570
- * Get the contour line segments from [lineSegs]
571
- * @param {*} lineSegs
572
- * @param {*} otherLines
573
- * @returns
569
+ /**
570
+ * Get the contour line segments from [lineSegs]
571
+ * @param {*} lineSegs
572
+ * @param {*} otherLines
573
+ * @returns
574
574
  */
575
575
  function getTrimmedContourLineSegs(lineSegs, otherLines, cnt) {
576
576
  try {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _axios = _interopRequireDefault(require("axios"));
8
- var convert = _interopRequireWildcard(require("convert-units"));
8
+ var _convertUnitsLite = require("./utils/convert-units-lite");
9
9
  var _export = require("./plugins/export");
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
  var _react = _interopRequireWildcard(require("react"));
@@ -558,7 +558,7 @@ var KitchenConfigurator = /*#__PURE__*/function (_Component) {
558
558
  var firstVisit = this.state.wizardStepOpend && this.isProjectEmpty(extractedState.scene);
559
559
  var allVisible = firstVisit || signOpen || myProjectsOpen;
560
560
  var _scene = extractedState.getIn(['scene']);
561
- var len = convert(_scene.width).from(_scene.unit).to('cm');
561
+ var len = (0, _convertUnitsLite.convert)(_scene.width).from(_scene.unit).to('cm');
562
562
  var _viewer2D = extractedState.getIn(['viewer2D']);
563
563
  if (_viewer2D.size > 0) {
564
564
  var scaleX = width / len * 3;
@@ -12,7 +12,7 @@ var _geometry = require("../../utils/geometry");
12
12
  var _helper = require("../../utils/helper");
13
13
  var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
14
14
  var _constants = require("../../constants");
15
- var _convertUnits = _interopRequireDefault(require("convert-units"));
15
+ var _convertUnitsLite = require("../../utils/convert-units-lite");
16
16
  var _threeCSG = _interopRequireDefault(require("../../utils/threeCSG.es6"));
17
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
18
18
  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); }
@@ -69,7 +69,7 @@ function buildWall(element, layer, scene, textures, mode) {
69
69
  // Get height and thickness of the wall converting them into the current scene units
70
70
  // let height = element.properties.getIn(['height', 'length']);
71
71
  // let thickness = element.properties.getIn(['thickness', 'length']);
72
- var height = (0, _convertUnits["default"])(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER);
72
+ var height = (0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER);
73
73
  var thickness = 2.0;
74
74
  var distance = (0, _geometry.verticesDistance)(vertex0, vertex1);
75
75
  var soulMaterial = new Three.MeshPhongMaterial({
@@ -7,7 +7,7 @@ exports["default"] = PropertyLengthMeasure;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _constants = require("./../../constants");
10
- var _convertUnits = _interopRequireDefault(require("convert-units"));
10
+ var _convertUnitsLite = require("../../utils/convert-units-lite");
11
11
  var _export = require("../../components/style/export");
12
12
  var _immutable = require("immutable");
13
13
  var _math = require("../../utils/math");
@@ -47,12 +47,12 @@ function PropertyLengthMeasure(_ref, _ref2) {
47
47
  var merged = null;
48
48
  if (type === 0) {
49
49
  merged = value.merge({
50
- length: unitInput !== _constants.UNIT_INCH ? (0, _convertUnits["default"])(newLength).from(unitInput).to(_constants.UNIT_INCH) : newLength,
50
+ length: unitInput !== _constants.UNIT_INCH ? (0, _convertUnitsLite.convert)(newLength).from(unitInput).to(_constants.UNIT_INCH) : newLength,
51
51
  _length: newLength
52
52
  });
53
53
  } else {
54
54
  merged = value.merge({
55
- _length: (0, _convertUnits["default"])(newLength).from(_constants.UNIT_INCH).to(unitInput),
55
+ _length: (0, _convertUnitsLite.convert)(newLength).from(_constants.UNIT_INCH).to(unitInput),
56
56
  _unit: unitInput
57
57
  });
58
58
  }
@@ -7,7 +7,7 @@ exports["default"] = PropertyLengthMeasure;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _constants = require("../../constants");
10
- var _convertUnits = _interopRequireDefault(require("convert-units"));
10
+ var _convertUnitsLite = require("../../utils/convert-units-lite");
11
11
  var _export = require("../../components/style/export");
12
12
  var _immutable = require("immutable");
13
13
  var _math = require("../../utils/math");
@@ -68,7 +68,7 @@ function PropertyLengthMeasure(_ref, _ref2) {
68
68
  var _length = value.get('_length') || length; // in _unit
69
69
  if (!_unit) {
70
70
  _unit = _constants.UNIT_INCH;
71
- _length = (0, _convertUnits["default"])(length).from(_constants.UNIT_CENTIMETER).to(_constants.UNIT_INCH);
71
+ _length = (0, _convertUnitsLite.convert)(length).from(_constants.UNIT_CENTIMETER).to(_constants.UNIT_INCH);
72
72
  }
73
73
  var type = value.get('type') || _constants.BASE_CABINET_LAYOUTPOS;
74
74
  var hook = configs.hook,
@@ -81,11 +81,11 @@ function PropertyLengthMeasure(_ref, _ref2) {
81
81
  merged = value.merge({
82
82
  _length: newLength,
83
83
  _unit: unitInput,
84
- length: (0, _convertUnits["default"])(newLength).from(unitInput).to(_constants.UNIT_CENTIMETER)
84
+ length: (0, _convertUnitsLite.convert)(newLength).from(unitInput).to(_constants.UNIT_CENTIMETER)
85
85
  });
86
86
  } else {
87
87
  merged = value.merge({
88
- _length: (0, _convertUnits["default"])(newLength).from(_constants.UNIT_CENTIMETER).to(unitInput),
88
+ _length: (0, _convertUnitsLite.convert)(newLength).from(_constants.UNIT_CENTIMETER).to(unitInput),
89
89
  _unit: unitInput,
90
90
  length: newLength
91
91
  });
@@ -116,7 +116,7 @@ function PropertyLengthMeasure(_ref, _ref2) {
116
116
  style: styles.distanceFloorTitle(fontSize)
117
117
  }, label), /*#__PURE__*/_react["default"].createElement(_export.FormNumberInput, _extends({
118
118
  disabled: type === _constants.TALL_CABINET_LAYOUTPOS,
119
- value: (0, _convertUnits["default"])(_length).from('in').to(unit),
119
+ value: (0, _convertUnitsLite.convert)(_length).from('in').to(unit),
120
120
  onChange: function onChange(event) {
121
121
  return update(event.target.value, _unit, 0);
122
122
  },
@@ -7,7 +7,7 @@ exports["default"] = PropertyLengthMeasureHole;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _constants = require("../../constants");
10
- var _convertUnits = _interopRequireDefault(require("convert-units"));
10
+ var _convertUnitsLite = require("../../utils/convert-units-lite");
11
11
  var _export = require("../../components/style/export");
12
12
  var _immutable = require("immutable");
13
13
  var _math = require("../../utils/math");
@@ -48,11 +48,11 @@ function PropertyLengthMeasureHole(_ref, _ref2) {
48
48
  if (type === 0) {
49
49
  merged = value.merge({
50
50
  _length: newLength,
51
- length: (0, _convertUnits["default"])(newLength).from(unitInput).to('cm')
51
+ length: (0, _convertUnitsLite.convert)(newLength).from(unitInput).to('cm')
52
52
  });
53
53
  } else {
54
54
  merged = value.merge({
55
- _length: (0, _convertUnits["default"])(newLength).from(_constants.UNIT_INCH).to(unitInput),
55
+ _length: (0, _convertUnitsLite.convert)(newLength).from(_constants.UNIT_INCH).to(unitInput),
56
56
  _unit: unitInput
57
57
  });
58
58
  }
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = _default;
7
- var _convertUnits = _interopRequireDefault(require("convert-units"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
7
+ var _convertUnitsLite = require("../../utils/convert-units-lite");
9
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); }
10
9
  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; }
11
10
  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; }
@@ -42,7 +41,7 @@ function _default(_ref) {
42
41
  defaultValue: {
43
42
  _length: sizeinfo.width,
44
43
  _unit: 'in',
45
- length: (0, _convertUnits["default"])(sizeinfo.width).from('in').to('cm')
44
+ length: (0, _convertUnitsLite.convert)(sizeinfo.width).from('in').to('cm')
46
45
  }
47
46
  }
48
47
  };
@@ -55,7 +54,7 @@ function _default(_ref) {
55
54
  defaultValue: {
56
55
  _length: sizeinfo.width,
57
56
  _unit: 'in',
58
- length: (0, _convertUnits["default"])(sizeinfo.width).from('in').to('cm')
57
+ length: (0, _convertUnitsLite.convert)(sizeinfo.width).from('in').to('cm')
59
58
  }
60
59
  },
61
60
  depth: {
@@ -64,7 +63,7 @@ function _default(_ref) {
64
63
  defaultValue: {
65
64
  _length: sizeinfo.depth,
66
65
  _unit: 'in',
67
- length: (0, _convertUnits["default"])(sizeinfo.depth).from('in').to('cm')
66
+ length: (0, _convertUnitsLite.convert)(sizeinfo.depth).from('in').to('cm')
68
67
  }
69
68
  },
70
69
  height: {
@@ -73,7 +72,7 @@ function _default(_ref) {
73
72
  defaultValue: {
74
73
  _length: sizeinfo.height,
75
74
  _unit: 'in',
76
- length: (0, _convertUnits["default"])(sizeinfo.height).from('in').to('cm')
75
+ length: (0, _convertUnitsLite.convert)(sizeinfo.height).from('in').to('cm')
77
76
  }
78
77
  }
79
78
  };