kitchen-simulator 11.27.0 → 11.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/actions/items-actions.js +20 -2
- package/es/assets/img/svg/3d_item_move.svg +9 -105
- package/es/assets/img/svg/3d_item_rotation.svg +3 -75
- package/es/assets/img/svg/accessories.svg +4 -4
- package/es/assets/img/svg/bottombar/elevation-back.svg +6 -6
- package/es/assets/img/svg/bottombar/elevation-front.svg +6 -6
- package/es/assets/img/svg/bottombar/elevation-left.svg +6 -6
- package/es/assets/img/svg/bottombar/elevation-right.svg +7 -7
- package/es/assets/img/svg/bottombar/elevation.svg +13 -13
- package/es/assets/img/svg/delete.svg +6 -2
- package/es/assets/img/svg/detail.svg +77 -77
- package/es/assets/img/svg/duplicate.svg +6 -6
- package/es/assets/img/svg/filtersActive.svg +19 -19
- package/es/assets/img/svg/invert.svg +12 -127
- package/es/assets/img/svg/menubar/login.svg +84 -84
- package/es/assets/img/svg/menubar/my_projects.svg +85 -85
- package/es/assets/img/svg/menubar/new_project.svg +110 -110
- package/es/assets/img/svg/menubar/save_project.svg +84 -84
- package/es/assets/img/svg/options.svg +3 -3
- package/es/assets/img/svg/positioning.svg +3 -3
- package/es/assets/img/svg/toggleFilters.svg +19 -19
- package/es/assets/img/svg/toolbar/shopping-cart.svg +13 -13
- package/es/assets/img/svg/wizardstep/detail_view.svg +87 -87
- package/es/assets/img/svg/wizardstep/tile_view.svg +95 -95
- package/es/catalog/utils/exporter.js +4 -0
- package/es/catalog/utils/item-loader.js +18 -8
- package/es/class/item.js +80 -2
- package/es/components/viewer2d/item.js +139 -125
- package/es/components/viewer2d/viewer2d.js +7 -4
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +556 -556
- package/es/components/viewer3d/scene-creator.js +18 -0
- package/es/components/viewer3d/viewer3d.js +137 -49
- package/es/constants.js +7 -1
- package/es/events/external/handleExternalEvent.js +36 -33
- package/es/events/external/handleExternalEvent.util.js +4 -2
- package/es/events/external/handlers.changeDoorStyle.js +28 -7
- package/es/events/external/handlers.elementOps.js +8 -0
- package/es/mappings/external-events/mapExternalEventPayload.js +4 -4
- package/es/mappings/external-events/mappers/addItemMapper.js +9 -9
- package/es/mappings/external-events/mappers/ccdfMapper.js +1 -1
- package/es/models.js +4 -0
- package/es/reducers/items-reducer.js +10 -1
- package/es/shared/domain/asset/sanitize-asset-url.js +5 -5
- package/es/shared/domain/cabinet-mirror.js +7 -0
- package/es/utils/geometry.js +5 -3
- package/es/utils/skinPanelEngine.js +14 -14
- package/lib/actions/items-actions.js +20 -0
- package/lib/assets/img/svg/3d_item_move.svg +9 -105
- package/lib/assets/img/svg/3d_item_rotation.svg +3 -75
- package/lib/assets/img/svg/accessories.svg +4 -4
- package/lib/assets/img/svg/bottombar/elevation-back.svg +6 -6
- package/lib/assets/img/svg/bottombar/elevation-front.svg +6 -6
- package/lib/assets/img/svg/bottombar/elevation-left.svg +6 -6
- package/lib/assets/img/svg/bottombar/elevation-right.svg +7 -7
- package/lib/assets/img/svg/bottombar/elevation.svg +13 -13
- package/lib/assets/img/svg/delete.svg +6 -2
- package/lib/assets/img/svg/detail.svg +77 -77
- package/lib/assets/img/svg/duplicate.svg +6 -6
- package/lib/assets/img/svg/filtersActive.svg +19 -19
- package/lib/assets/img/svg/invert.svg +12 -127
- package/lib/assets/img/svg/menubar/login.svg +84 -84
- package/lib/assets/img/svg/menubar/my_projects.svg +85 -85
- package/lib/assets/img/svg/menubar/new_project.svg +110 -110
- package/lib/assets/img/svg/menubar/save_project.svg +84 -84
- package/lib/assets/img/svg/options.svg +3 -3
- package/lib/assets/img/svg/positioning.svg +3 -3
- package/lib/assets/img/svg/toggleFilters.svg +19 -19
- package/lib/assets/img/svg/toolbar/shopping-cart.svg +13 -13
- package/lib/assets/img/svg/wizardstep/detail_view.svg +87 -87
- package/lib/assets/img/svg/wizardstep/tile_view.svg +95 -95
- package/lib/catalog/utils/exporter.js +4 -0
- package/lib/catalog/utils/item-loader.js +18 -8
- package/lib/class/item.js +79 -1
- package/lib/components/viewer2d/item.js +138 -124
- package/lib/components/viewer2d/viewer2d.js +7 -4
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +556 -556
- package/lib/components/viewer3d/scene-creator.js +18 -0
- package/lib/components/viewer3d/viewer3d.js +137 -49
- package/lib/constants.js +11 -5
- package/lib/events/external/handleExternalEvent.js +34 -31
- package/lib/events/external/handleExternalEvent.util.js +4 -2
- package/lib/events/external/handlers.changeDoorStyle.js +28 -7
- package/lib/events/external/handlers.elementOps.js +9 -0
- package/lib/mappings/external-events/mapExternalEventPayload.js +4 -4
- package/lib/mappings/external-events/mappers/addItemMapper.js +9 -9
- package/lib/mappings/external-events/mappers/ccdfMapper.js +1 -1
- package/lib/models.js +4 -0
- package/lib/reducers/items-reducer.js +9 -0
- package/lib/shared/domain/asset/sanitize-asset-url.js +5 -5
- package/lib/shared/domain/cabinet-mirror.js +13 -0
- package/lib/utils/geometry.js +5 -3
- package/lib/utils/skinPanelEngine.js +14 -14
- package/package.json +1 -1
|
@@ -1,26 +1,21 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
2
7
|
import React, { useState } from 'react';
|
|
3
8
|
import PropTypes from 'prop-types';
|
|
4
9
|
import RulerDist from "./rulerDist";
|
|
5
10
|
import { convert } from "../../utils/convert-units-lite";
|
|
6
11
|
import { MODE_ROTATING_ITEM, WALL_CABINET_LAYOUTPOS } from "../../constants";
|
|
7
12
|
import { isWarningCabinet } from "../../shared/domain/cabinet-warning";
|
|
8
|
-
import {
|
|
13
|
+
import { canMirrorCabinet } from "../../shared/domain/cabinet-mirror";
|
|
14
|
+
import { calcDistancesFromItemToWalls } from "../../utils/geometry";
|
|
9
15
|
import { isCornerCabinet } from "../../shared/domain/cabinet-corner";
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
var STYLE_CIRCLE = {
|
|
15
|
-
fill: '#0096fd',
|
|
16
|
-
stroke: '#0096fd',
|
|
17
|
-
cursor: 'ew-resize'
|
|
18
|
-
};
|
|
19
|
-
var STYLE_CIRCLE2 = {
|
|
20
|
-
fill: 'none',
|
|
21
|
-
stroke: '#0096fd',
|
|
22
|
-
cursor: 'ew-resize'
|
|
23
|
-
};
|
|
16
|
+
var ICON_WIDTH = 23;
|
|
17
|
+
var ICON_HEIGHT = 23;
|
|
18
|
+
var ICON_SPACING = 2.5;
|
|
24
19
|
export default function Item(_ref, _ref2) {
|
|
25
20
|
var _element$render2D;
|
|
26
21
|
var layer = _ref.layer,
|
|
@@ -97,116 +92,135 @@ export default function Item(_ref, _ref2) {
|
|
|
97
92
|
var isSmall = false;
|
|
98
93
|
if (width < 40) isSmall = true;
|
|
99
94
|
var parts = [];
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
"
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
95
|
+
var canMirror = canMirrorCabinet(item);
|
|
96
|
+
var isMirrored = item.mirrored === true;
|
|
97
|
+
if (item.selected) {
|
|
98
|
+
var iconsCount = canMirror ? 3 : 2;
|
|
99
|
+
var iconHeightStart = (ICON_HEIGHT * (iconsCount - 2) + ICON_SPACING * (iconsCount - 1)) / 2;
|
|
100
|
+
var iconsData = [{
|
|
101
|
+
key: 'duplicate',
|
|
102
|
+
part: 'duplicate',
|
|
103
|
+
href: '/assets/img/svg/duplicate.svg',
|
|
104
|
+
imageProps: {
|
|
105
|
+
x: ICON_WIDTH / 4,
|
|
106
|
+
y: -(3 / 4) * ICON_HEIGHT,
|
|
107
|
+
height: ICON_HEIGHT / 2,
|
|
108
|
+
width: ICON_WIDTH / 2
|
|
109
|
+
},
|
|
110
|
+
disabled: isWarningCabinet(item)
|
|
111
|
+
}, canMirror && {
|
|
112
|
+
key: 'mirror',
|
|
113
|
+
part: 'mirror',
|
|
114
|
+
href: '/assets/img/svg/invert.svg',
|
|
115
|
+
wrapperStyle: {
|
|
116
|
+
transformOrigin: 'center',
|
|
117
|
+
transformBox: 'fill-box',
|
|
118
|
+
transform: !isMirrored ? 'scaleX(-1)' : ''
|
|
119
|
+
},
|
|
120
|
+
imageProps: {
|
|
121
|
+
x: ICON_WIDTH / 2 - 7.5,
|
|
122
|
+
y: -ICON_HEIGHT / 2 - 7.5,
|
|
123
|
+
height: '15px',
|
|
124
|
+
width: '15px'
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: 'remove',
|
|
128
|
+
part: 'remove',
|
|
129
|
+
href: '/assets/img/svg/delete.svg',
|
|
130
|
+
imageProps: {
|
|
131
|
+
x: ICON_WIDTH / 4,
|
|
132
|
+
y: -(3 / 4) * ICON_HEIGHT,
|
|
133
|
+
height: ICON_HEIGHT / 2,
|
|
134
|
+
width: ICON_WIDTH / 2
|
|
135
|
+
}
|
|
136
|
+
}].filter(Boolean);
|
|
137
|
+
var icons = iconsData.map(function (icon, index) {
|
|
138
|
+
var translateY = iconHeightStart - index * (ICON_HEIGHT + ICON_SPACING);
|
|
139
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
140
|
+
key: icon.key,
|
|
141
|
+
style: {
|
|
142
|
+
cursor: icon.disabled ? 'default' : 'pointer',
|
|
143
|
+
transform: "rotate(".concat(360 - item.rotation, "deg)\n translate(").concat(-width / 2 - 27, "px, ").concat(translateY, "px)")
|
|
144
|
+
},
|
|
145
|
+
"data-element-root": true,
|
|
146
|
+
"data-prototype": item.prototype,
|
|
147
|
+
"data-id": item.id,
|
|
148
|
+
"data-selected": item.selected,
|
|
149
|
+
"data-layer": layer.id,
|
|
150
|
+
"data-part": icon.part
|
|
151
|
+
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
|
|
152
|
+
id: "shadow",
|
|
153
|
+
x: "-20%",
|
|
154
|
+
y: "-20%",
|
|
155
|
+
width: "140%",
|
|
156
|
+
height: "140%"
|
|
157
|
+
}, /*#__PURE__*/React.createElement("feDropShadow", {
|
|
158
|
+
dx: "0",
|
|
159
|
+
dy: "-1",
|
|
160
|
+
stdDeviation: "1.2",
|
|
161
|
+
"flood-color": "#000",
|
|
162
|
+
"flood-opacity": "0.16"
|
|
163
|
+
}))), /*#__PURE__*/React.createElement("g", {
|
|
164
|
+
style: icon.wrapperStyle
|
|
165
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
166
|
+
rx: "100%",
|
|
167
|
+
ry: "100%",
|
|
168
|
+
height: ICON_HEIGHT,
|
|
169
|
+
width: ICON_WIDTH,
|
|
170
|
+
fill: "white",
|
|
171
|
+
filter: "url(#shadow)"
|
|
172
|
+
}), /*#__PURE__*/React.createElement("image", _extends({
|
|
173
|
+
href: icon.href
|
|
174
|
+
}, icon.imageProps, {
|
|
175
|
+
style: _objectSpread({
|
|
176
|
+
transform: 'rotateX(180deg)'
|
|
177
|
+
}, icon.disabled ? {
|
|
178
|
+
opacity: 0.3,
|
|
179
|
+
filter: 'contrast(0)'
|
|
180
|
+
} : {})
|
|
181
|
+
}))));
|
|
182
|
+
});
|
|
183
|
+
parts = [/*#__PURE__*/React.createElement("g", {
|
|
184
|
+
key: 0,
|
|
185
|
+
"data-element-root": true,
|
|
186
|
+
"data-prototype": item.prototype,
|
|
187
|
+
"data-id": item.id,
|
|
188
|
+
"data-selected": item.selected,
|
|
189
|
+
"data-layer": layer.id,
|
|
190
|
+
"data-part": "rotation-anchor",
|
|
191
|
+
style: {
|
|
192
|
+
cursor: 'w-resize'
|
|
193
|
+
}
|
|
194
|
+
}, /*#__PURE__*/React.createElement("image", {
|
|
195
|
+
href: clockRotateState ? '/assets/img/svg/rotate.png' : '/assets/img/svg/blank_div.svg',
|
|
196
|
+
style: {
|
|
197
|
+
transform: "scale(-1, -1) translate(".concat(width / 2, "px, ").concat(height / 2, "px) rotate(25deg)")
|
|
198
|
+
},
|
|
199
|
+
height: "20",
|
|
200
|
+
width: "20",
|
|
201
|
+
onMouseEnter: function onMouseEnter() {
|
|
202
|
+
setClockRotateState(true);
|
|
203
|
+
setAntiClockRotateState(false);
|
|
204
|
+
},
|
|
205
|
+
onMouseLeave: function onMouseLeave() {
|
|
206
|
+
return setClockRotateState(mode === MODE_ROTATING_ITEM ? true : false);
|
|
207
|
+
}
|
|
208
|
+
}), /*#__PURE__*/React.createElement("image", {
|
|
209
|
+
href: antiClockRotateState ? '/assets/img/svg/rotate.png' : '/assets/img/svg/blank_div.svg',
|
|
210
|
+
style: {
|
|
211
|
+
transform: "scale(1, -1) translate(".concat(width / 2, "px, ").concat(height / 2, "px) rotate(25deg)")
|
|
212
|
+
},
|
|
213
|
+
height: "20",
|
|
214
|
+
width: "20",
|
|
215
|
+
onMouseEnter: function onMouseEnter() {
|
|
216
|
+
setAntiClockRotateState(true);
|
|
217
|
+
setClockRotateState(false);
|
|
218
|
+
},
|
|
219
|
+
onMouseLeave: function onMouseLeave() {
|
|
220
|
+
return setAntiClockRotateState(mode === MODE_ROTATING_ITEM ? true : false);
|
|
221
|
+
}
|
|
222
|
+
}))].concat(_toConsumableArray(icons));
|
|
223
|
+
}
|
|
210
224
|
var measure = item.layoutpos === WALL_CABINET_LAYOUTPOS ? showWallCabinetMeasure : showBaseCabinetMeasure;
|
|
211
225
|
return /*#__PURE__*/React.createElement("g", {
|
|
212
226
|
"data-element-root": true,
|
|
@@ -680,7 +680,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
680
680
|
endPoint.x = nx;
|
|
681
681
|
endPoint.y = ny;
|
|
682
682
|
}
|
|
683
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
683
|
+
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
684
684
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
685
685
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
686
686
|
endPoint.x = nx;
|
|
@@ -752,7 +752,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
752
752
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
753
753
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
754
754
|
}
|
|
755
|
-
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
755
|
+
if (allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Hood') || allItemRect.cur.itemInfo.cabinet_category.toLowerCase().includes('hood') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Range') || allItemRect.cur && allItemRect.cur.itemInfo.name.includes('Cook Top')) {
|
|
756
756
|
itemsActions.updateDraggingItemChanged(nx, ny, layerID, current_sel_obj_id);
|
|
757
757
|
itemsActions.updateRotatingItemChanged(rot, layerID, current_sel_obj_id);
|
|
758
758
|
}
|
|
@@ -803,7 +803,7 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
803
803
|
case 'items':
|
|
804
804
|
setToolbar('');
|
|
805
805
|
current_sel_obj_id = elementData.id;
|
|
806
|
-
if (elementData.part === 'rotation-anchor') itemsActions.beginRotatingItem(elementData.layer, elementData.id, x, y);else if (elementData.part === 'remove') break;else if (elementData.part === 'duplicate') break;else if (elementData.part === 'warning_edit') break;else {
|
|
806
|
+
if (elementData.part === 'rotation-anchor') itemsActions.beginRotatingItem(elementData.layer, elementData.id, x, y);else if (elementData.part === 'remove') break;else if (elementData.part === 'duplicate') break;else if (elementData.part === 'mirror') break;else if (elementData.part === 'warning_edit') break;else {
|
|
807
807
|
// closes the setting dialog
|
|
808
808
|
if (document.getElementById('setting_dialog')) {
|
|
809
809
|
document.getElementById('setting_dialog').style.display = 'none';
|
|
@@ -951,7 +951,10 @@ export default function Viewer2D(_ref, _ref2) {
|
|
|
951
951
|
holesActions.selectHole(elementData.layer, elementData.id);
|
|
952
952
|
break;
|
|
953
953
|
case 'items':
|
|
954
|
-
if (elementData.part === '
|
|
954
|
+
if (elementData.part === 'mirror') {
|
|
955
|
+
itemsActions.toggleItemMirror(elementData.layer, elementData.id, null, onInternalEvent);
|
|
956
|
+
break;
|
|
957
|
+
} else if (elementData.part === 'duplicate') {
|
|
955
958
|
var currentObject = state.getIn(['scene', 'layers', layerID, 'items', elementData.id]);
|
|
956
959
|
if (!isWarningCabinet(currentObject)) itemsActions.duplicateSelected(currentObject, onInternalEvent); // send draw internal event when duplicating
|
|
957
960
|
break;
|