kitchen-simulator 4.0.11-react-18 → 4.1.0-react-18
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/LiteKitchenConfigurator.js +14 -4
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/catalog/factories/area-factory-3d.js +17 -17
- package/es/catalog/utils/item-loader.js +197 -197
- package/es/class/item.js +7 -0
- package/es/components/viewer2d/viewer2d.js +7 -7
- package/es/components/viewer3d/viewer3d.js +28 -12
- package/lib/LiteKitchenConfigurator.js +14 -4
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/catalog/factories/area-factory-3d.js +14 -14
- package/lib/catalog/utils/item-loader.js +194 -194
- package/lib/class/item.js +7 -0
- package/lib/components/viewer2d/viewer2d.js +7 -7
- package/lib/components/viewer3d/viewer3d.js +28 -12
- package/package.json +1 -1
|
@@ -313,14 +313,23 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
313
313
|
state = _this$props.state,
|
|
314
314
|
projectActions = _this$props.projectActions,
|
|
315
315
|
catalog = _this$props.catalog,
|
|
316
|
-
externalEvent = _this$props.externalEvent
|
|
317
|
-
onInternalEvent = _this$props.onInternalEvent;
|
|
318
|
-
handleExternalEvent(this.props);
|
|
316
|
+
externalEvent = _this$props.externalEvent;
|
|
319
317
|
var plannerState = stateExtractor(state);
|
|
320
318
|
var catalogReady = plannerState.getIn(['catalog', 'ready']);
|
|
321
319
|
if (!catalogReady) {
|
|
322
320
|
projectActions.initCatalog(catalog);
|
|
323
321
|
}
|
|
322
|
+
if (prevProps.externalEvent !== externalEvent && externalEvent) {
|
|
323
|
+
var _externalEvent$id, _externalEvent$payloa, _externalEvent$payloa2;
|
|
324
|
+
var key = (_externalEvent$id = externalEvent.id) !== null && _externalEvent$id !== void 0 ? _externalEvent$id : JSON.stringify({
|
|
325
|
+
type: externalEvent.type,
|
|
326
|
+
payload: (_externalEvent$payloa = (_externalEvent$payloa2 = externalEvent.payload) === null || _externalEvent$payloa2 === void 0 ? void 0 : _externalEvent$payloa2.mode) !== null && _externalEvent$payloa !== void 0 ? _externalEvent$payloa : externalEvent.payload
|
|
327
|
+
});
|
|
328
|
+
if (key !== this.lastHandledExternalEventKey) {
|
|
329
|
+
this.lastHandledExternalEventKey = key;
|
|
330
|
+
handleExternalEvent(this.props);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
324
333
|
}
|
|
325
334
|
}, {
|
|
326
335
|
key: "isProjectEmpty",
|
|
@@ -394,7 +403,8 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
|
|
|
394
403
|
style: _objectSpread(_objectSpread({}, wrapperStyle), {}, {
|
|
395
404
|
height: height,
|
|
396
405
|
display: 'flex',
|
|
397
|
-
justifyContent: 'center'
|
|
406
|
+
justifyContent: 'center',
|
|
407
|
+
position: 'relative'
|
|
398
408
|
})
|
|
399
409
|
}, /*#__PURE__*/React.createElement(Content, _extends({
|
|
400
410
|
width: contentW,
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as Three from
|
|
2
|
-
import { Box3, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, RepeatWrapping, Shape, TextureLoader, Vector2 } from
|
|
1
|
+
import * as Three from "three";
|
|
2
|
+
import { Box3, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, RepeatWrapping, Shape, TextureLoader, Vector2 } from "three";
|
|
3
3
|
import * as SharedStyle from "../../shared-style";
|
|
4
|
-
import { RGBELoader } from
|
|
4
|
+
import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader";
|
|
5
5
|
var params = {
|
|
6
|
-
envMap:
|
|
6
|
+
envMap: "HDR",
|
|
7
7
|
roughness: 0.9,
|
|
8
8
|
metalness: 0.8,
|
|
9
9
|
exposure: 1.0
|
|
@@ -58,7 +58,7 @@ var assignUVs = function assignUVs(geometry) {
|
|
|
58
58
|
var y3 = position.getY(i + 2);
|
|
59
59
|
uvArray.push((x1 + offset.x) / range.x, (y1 + offset.y) / range.y, (x2 + offset.x) / range.x, (y2 + offset.y) / range.y, (x3 + offset.x) / range.x, (y3 + offset.y) / range.y);
|
|
60
60
|
}
|
|
61
|
-
geometry.setAttribute(
|
|
61
|
+
geometry.setAttribute("uv", new Three.BufferAttribute(new Float32Array(uvArray), 2));
|
|
62
62
|
geometry.needsUpdate = true;
|
|
63
63
|
};
|
|
64
64
|
export function createArea(element, layer, scene, textures) {
|
|
@@ -69,15 +69,15 @@ export function createArea(element, layer, scene, textures) {
|
|
|
69
69
|
var texture = element.texture;
|
|
70
70
|
texture.lengthRepeatScale = 0.01;
|
|
71
71
|
texture.heightRepeatScale = 0.01;
|
|
72
|
-
var color = element.properties.get(
|
|
72
|
+
var color = element.properties.get("patternColor");
|
|
73
73
|
if (element.selected) {
|
|
74
74
|
color = SharedStyle.AREA_MESH_COLOR.selected;
|
|
75
75
|
} else {
|
|
76
76
|
color = SharedStyle.AREA_MESH_COLOR.unselected;
|
|
77
77
|
}
|
|
78
|
-
if (texture.uri === undefined || texture.uri ==
|
|
78
|
+
if (texture.uri === undefined || texture.uri == "") {
|
|
79
79
|
// @todo THIS IS A TEMPORARY FIX TO HAVE A DEFAULT FLOOR TEXTURE
|
|
80
|
-
texture.uri = layer.floorStyle.uri ||
|
|
80
|
+
texture.uri = layer.floorStyle.uri || "https://media.test.diydesignspace.com/uploads/CountTop/202203162950_2/texture/oak-barcelona-s.jpg";
|
|
81
81
|
}
|
|
82
82
|
var shape = new Shape();
|
|
83
83
|
shape.moveTo(vertices[0].x, vertices[0].y);
|
|
@@ -85,7 +85,7 @@ export function createArea(element, layer, scene, textures) {
|
|
|
85
85
|
shape.lineTo(vertices[i].x, vertices[i].y);
|
|
86
86
|
}
|
|
87
87
|
function loadFloorENV() {
|
|
88
|
-
return new RGBELoader().load(
|
|
88
|
+
return new RGBELoader().load("/assets/Window.hdr", function (texture) {
|
|
89
89
|
texture.mapping = Three.EquirectangularReflectionMapping;
|
|
90
90
|
return texture;
|
|
91
91
|
});
|
|
@@ -105,8 +105,8 @@ export function createArea(element, layer, scene, textures) {
|
|
|
105
105
|
/* Create holes for the area */
|
|
106
106
|
element.holes.forEach(function (holeID) {
|
|
107
107
|
var holeCoords = [];
|
|
108
|
-
layer.getIn([
|
|
109
|
-
var _layer$getIn = layer.getIn([
|
|
108
|
+
layer.getIn(["areas", holeID, "vertices"]).forEach(function (vertexID) {
|
|
109
|
+
var _layer$getIn = layer.getIn(["vertices", vertexID]),
|
|
110
110
|
x = _layer$getIn.x,
|
|
111
111
|
y = _layer$getIn.y;
|
|
112
112
|
holeCoords.push([x, y]);
|
|
@@ -133,7 +133,7 @@ export function createArea(element, layer, scene, textures) {
|
|
|
133
133
|
var area = new Mesh(shapeGeometry, areaMaterial);
|
|
134
134
|
area.rotation.x -= Math.PI / 2;
|
|
135
135
|
area.receiveShadow = true;
|
|
136
|
-
area.name =
|
|
136
|
+
area.name = "floor";
|
|
137
137
|
// This mesh is use for creating ceiling mesh
|
|
138
138
|
|
|
139
139
|
var shapeGeometry2 = new Three.ShapeGeometry(shape);
|
|
@@ -144,7 +144,7 @@ export function createArea(element, layer, scene, textures) {
|
|
|
144
144
|
area2.castShadow = true;
|
|
145
145
|
area2.rotation.x -= Math.PI / 2;
|
|
146
146
|
area2.receiveShadow = true;
|
|
147
|
-
area2.name =
|
|
147
|
+
area2.name = "floorSupport";
|
|
148
148
|
var floorSupport = area2.clone();
|
|
149
149
|
area.userData.floorSupport = floorSupport;
|
|
150
150
|
return Promise.resolve(area);
|
|
@@ -154,13 +154,13 @@ export function updatedArea(element, layer, scene, textures, mesh, oldElement, d
|
|
|
154
154
|
selfDestroy();
|
|
155
155
|
return selfBuild();
|
|
156
156
|
};
|
|
157
|
-
var floor = mesh.getObjectByName(
|
|
157
|
+
var floor = mesh.getObjectByName("floor");
|
|
158
158
|
floor.receiveShadow = true;
|
|
159
|
-
if (differences[0] ==
|
|
159
|
+
if (differences[0] == "selected") {
|
|
160
160
|
var color = element.selected ? SharedStyle.AREA_MESH_COLOR.selected : SharedStyle.AREA_MESH_COLOR.unselected;
|
|
161
161
|
floor.material.color.set(color);
|
|
162
|
-
} else if (differences[0] ==
|
|
163
|
-
if (differences[1] ===
|
|
162
|
+
} else if (differences[0] == "properties") {
|
|
163
|
+
if (differences[1] === "texture") {
|
|
164
164
|
return noPerf();
|
|
165
165
|
}
|
|
166
166
|
} else return noPerf();
|