kitchen-simulator 5.0.0-test.66 → 5.0.0-test.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "5.0.0-test.66",
3
+ "version": "5.0.0-test.67",
4
4
  "description": "It is a kitchen simulator.",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import convert from 'convert-units';
2
+ import * as convert from 'convert-units';
3
3
  import { Plugins as PlannerPlugins } from './index';
4
4
  import * as PropTypes from 'prop-types';
5
5
  import React, { Component } from 'react';
@@ -15,7 +15,7 @@ import { isElevationView } from '../../../src/utils/helper';
15
15
 
16
16
  import * as SharedStyle from '../../shared-style';
17
17
  import { LINE_THICKNESS, UNIT_CENTIMETER } from '../../constants';
18
- import convert from 'convert-units';
18
+ import * as convert from 'convert-units';
19
19
  import ThreeBSP from '../../utils/threeCSG.es6';
20
20
 
21
21
  const params = {
@@ -6,7 +6,7 @@ import {
6
6
  UNITS_LENGTH,
7
7
  UNIT_INCH
8
8
  } from './../../constants';
9
- import convert from 'convert-units';
9
+ import * as convert from 'convert-units';
10
10
  import {
11
11
  FormLabel,
12
12
  FormNumberInput,
@@ -9,7 +9,7 @@ import {
9
9
  BASE_CABINET_LAYOUTPOS,
10
10
  TALL_CABINET_LAYOUTPOS
11
11
  } from '../../constants';
12
- import convert from 'convert-units';
12
+ import * as convert from 'convert-units';
13
13
  import {
14
14
  FormLabel,
15
15
  FormNumberInput,
@@ -7,7 +7,7 @@ import {
7
7
  BASE_CABINET_LAYOUTPOS,
8
8
  TALL_CABINET_LAYOUTPOS
9
9
  } from '../../constants';
10
- import convert from 'convert-units';
10
+ import * as convert from 'convert-units';
11
11
  import {
12
12
  FormLabel,
13
13
  FormNumberInput1,
@@ -1,4 +1,4 @@
1
- import convert from 'convert-units';
1
+ import * as convert from 'convert-units';
2
2
 
3
3
  export default function ({
4
4
  itemID,
@@ -1,4 +1,4 @@
1
- import convert from 'convert-units';
1
+ import * as convert from 'convert-units';
2
2
  import { fromJS, Map } from 'immutable';
3
3
  import React, { useState } from 'react';
4
4
  import * as Three from 'three';
package/src/class/item.js CHANGED
@@ -1,4 +1,4 @@
1
- import convert from 'convert-units';
1
+ import * as convert from 'convert-units';
2
2
  import { Layer, Group, Hole } from './export';
3
3
  import {
4
4
  IDBroker,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
3
  import polylabel from 'polylabel';
4
4
  import areapolygon from 'area-polygon';
5
- import convert from 'convert-units';
5
+ import * as convert from 'convert-units';
6
6
  import { formatNumber } from '../../utils/math';
7
7
  import { DECIMAL_PLACES_2 } from '../../constants';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
3
  import { List } from 'immutable';
4
- import convert from 'convert-units';
4
+ import * as convert from 'convert-units';
5
5
 
6
6
  export default function GridHorizontalStreak({ width, height, grid }) {
7
7
  let step = grid.properties.get('step');
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
3
  import { List } from 'immutable';
4
- import convert from 'convert-units';
4
+ import * as convert from 'convert-units';
5
5
 
6
6
  export default function GridStreak({ width, height, grid }) {
7
7
  let step = grid.properties.get('step');
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
3
  import { List } from 'immutable';
4
- import convert from 'convert-units';
4
+ import * as convert from 'convert-units';
5
5
 
6
6
  export default function GridVerticalStreak({ width, height, grid }) {
7
7
  let step = grid.properties.get('step');
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useState } from 'react';
3
3
  import * as PropTypes from 'prop-types';
4
4
  import RulerDist from './rulerDist';
5
- import convert from 'convert-units';
5
+ import * as convert from 'convert-units';
6
6
  import { GeometryUtils } from '../../utils/export';
7
7
  import { MODE_ROTATING_ITEM, WALL_CABINET_LAYOUTPOS } from '../../constants';
8
8
  import { returnReplaceableDeepSearchType } from './utils';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
- import convert from 'convert-units';
3
+ import * as convert from 'convert-units';
4
4
  import IDBroker from '../../utils/id-broker';
5
5
  import {
6
6
  LINE_THICKNESS,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import * as PropTypes from 'prop-types';
3
- import convert from 'convert-units';
3
+ import * as convert from 'convert-units';
4
4
 
5
5
  const ARROW_STYLE = {
6
6
  stroke: '#1183B7',
@@ -23,7 +23,7 @@ import * as SharedStyle from '../../shared-style';
23
23
  import { RulerX, RulerY } from './export';
24
24
  import { GeometryUtils } from '../../utils/export';
25
25
  import FormNumberInput from '../../components/style/form-number-input';
26
- import convert from 'convert-units';
26
+ import * as convert from 'convert-units';
27
27
  import { Map } from 'immutable';
28
28
  import { formatNumber } from '../../../src/utils/math';
29
29
  import { isEmpty } from '../../utils/helper';
@@ -1,91 +1,91 @@
1
- import React from 'react';
2
- import {
3
- MODE_BACK_ELEVATION_VIEW,
4
- MODE_FRONT_ELEVATION_VIEW,
5
- MODE_LEFT_ELEVATION_VIEW,
6
- MODE_RIGHT_ELEVATION_VIEW
7
- } from '../../../constants';
8
- import convert from 'convert-units';
9
-
10
- export default function ItemRect({
11
- scene,
12
- layer,
13
- calcrect,
14
- v0,
15
- v1,
16
- mode,
17
- frontRect,
18
- scale,
19
- sideFlag
20
- }) {
21
- const { rect } = calcrect;
22
- const { x: x0, y: y0 } = v0;
23
- const { x: x1, y: y1 } = v1;
24
-
25
- const translateY =
26
- frontRect.height / 2 -
27
- convert(Math.abs(calcrect.itemInfo.properties.altitude._length))
28
- .from(calcrect.itemInfo.properties.altitude._unit)
29
- .to(layer.unit) *
30
- scale;
31
- let translateX = -frontRect.width / 2;
32
-
33
- const itemWidth =
34
- convert(calcrect.size.width).from(scene.unit).to(layer.unit) * scale;
35
- const itemDepth =
36
- convert(calcrect.size.depth).from(scene.unit).to(layer.unit) * scale;
37
- const itemHeight =
38
- convert(calcrect.size.height).from(scene.unit).to(layer.unit) * scale;
39
-
40
- switch (mode) {
41
- case MODE_FRONT_ELEVATION_VIEW:
42
- case MODE_BACK_ELEVATION_VIEW:
43
- translateX +=
44
- convert(Math.abs(rect[3].x - x0))
45
- .from(scene.unit)
46
- .to(layer.unit) * scale;
47
- break;
48
- case MODE_RIGHT_ELEVATION_VIEW:
49
- case MODE_LEFT_ELEVATION_VIEW:
50
- translateX +=
51
- convert(Math.abs(rect[3].y - y1))
52
- .from(scene.unit)
53
- .to(layer.unit) * scale;
54
- break;
55
- }
56
-
57
- let dimension;
58
- switch (sideFlag) {
59
- case 0:
60
- dimension = (
61
- <polygon
62
- points={`0,0 0,-${itemHeight} ${itemWidth},-${itemHeight} ${itemWidth},0`}
63
- fill="none"
64
- stroke="black"
65
- />
66
- );
67
- break;
68
- case 1:
69
- dimension = (
70
- <polygon
71
- points={`0,0 0,-${itemHeight} ${itemDepth},-${itemHeight} ${itemDepth},0`}
72
- fill="none"
73
- stroke="black"
74
- />
75
- );
76
- break;
77
- case 2:
78
- dimension = (
79
- <polygon
80
- points={`0,0 0,-${itemHeight} -${itemDepth},-${itemHeight} -${itemDepth},0`}
81
- fill="none"
82
- stroke="black"
83
- />
84
- );
85
- break;
86
- }
87
-
88
- return (
89
- <g transform={`translate(${translateX}, ${translateY})`}>{dimension}</g>
90
- );
91
- }
1
+ import React from 'react';
2
+ import {
3
+ MODE_BACK_ELEVATION_VIEW,
4
+ MODE_FRONT_ELEVATION_VIEW,
5
+ MODE_LEFT_ELEVATION_VIEW,
6
+ MODE_RIGHT_ELEVATION_VIEW
7
+ } from '../../../constants';
8
+ import * as convert from 'convert-units';
9
+
10
+ export default function ItemRect({
11
+ scene,
12
+ layer,
13
+ calcrect,
14
+ v0,
15
+ v1,
16
+ mode,
17
+ frontRect,
18
+ scale,
19
+ sideFlag
20
+ }) {
21
+ const { rect } = calcrect;
22
+ const { x: x0, y: y0 } = v0;
23
+ const { x: x1, y: y1 } = v1;
24
+
25
+ const translateY =
26
+ frontRect.height / 2 -
27
+ convert(Math.abs(calcrect.itemInfo.properties.altitude._length))
28
+ .from(calcrect.itemInfo.properties.altitude._unit)
29
+ .to(layer.unit) *
30
+ scale;
31
+ let translateX = -frontRect.width / 2;
32
+
33
+ const itemWidth =
34
+ convert(calcrect.size.width).from(scene.unit).to(layer.unit) * scale;
35
+ const itemDepth =
36
+ convert(calcrect.size.depth).from(scene.unit).to(layer.unit) * scale;
37
+ const itemHeight =
38
+ convert(calcrect.size.height).from(scene.unit).to(layer.unit) * scale;
39
+
40
+ switch (mode) {
41
+ case MODE_FRONT_ELEVATION_VIEW:
42
+ case MODE_BACK_ELEVATION_VIEW:
43
+ translateX +=
44
+ convert(Math.abs(rect[3].x - x0))
45
+ .from(scene.unit)
46
+ .to(layer.unit) * scale;
47
+ break;
48
+ case MODE_RIGHT_ELEVATION_VIEW:
49
+ case MODE_LEFT_ELEVATION_VIEW:
50
+ translateX +=
51
+ convert(Math.abs(rect[3].y - y1))
52
+ .from(scene.unit)
53
+ .to(layer.unit) * scale;
54
+ break;
55
+ }
56
+
57
+ let dimension;
58
+ switch (sideFlag) {
59
+ case 0:
60
+ dimension = (
61
+ <polygon
62
+ points={`0,0 0,-${itemHeight} ${itemWidth},-${itemHeight} ${itemWidth},0`}
63
+ fill="none"
64
+ stroke="black"
65
+ />
66
+ );
67
+ break;
68
+ case 1:
69
+ dimension = (
70
+ <polygon
71
+ points={`0,0 0,-${itemHeight} ${itemDepth},-${itemHeight} ${itemDepth},0`}
72
+ fill="none"
73
+ stroke="black"
74
+ />
75
+ );
76
+ break;
77
+ case 2:
78
+ dimension = (
79
+ <polygon
80
+ points={`0,0 0,-${itemHeight} -${itemDepth},-${itemHeight} -${itemDepth},0`}
81
+ fill="none"
82
+ stroke="black"
83
+ />
84
+ );
85
+ break;
86
+ }
87
+
88
+ return (
89
+ <g transform={`translate(${translateX}, ${translateY})`}>{dimension}</g>
90
+ );
91
+ }