kitchen-simulator 3.1.2 → 4.0.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/README.md +0 -3
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +15 -25
- package/es/LiteRenderer.js +2 -5
- package/es/actions/export.js +12 -25
- package/es/catalog/catalog.js +5 -21
- package/es/components/content.js +2 -5
- package/es/components/export.js +6 -4
- package/es/components/style/export.js +2 -28
- package/es/components/style/form-number-input.js +22 -11
- package/es/components/viewer2d/group.js +4 -5
- package/es/components/viewer2d/item.js +4 -5
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +47 -17
- package/es/components/viewer2d/rulerX.js +0 -3
- package/es/components/viewer2d/rulerY.js +0 -3
- package/es/components/viewer2d/scene.js +1 -4
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/viewer2d.js +43 -28
- package/es/components/viewer3d/viewer3d-first-person.js +0 -8
- package/es/components/viewer3d/viewer3d.js +0 -9
- package/es/devLiteRenderer.js +148 -317
- package/es/index.js +12 -4
- package/es/mocks/appliancePayload.json +27 -0
- package/es/mocks/cabinetPayload.json +1914 -0
- package/es/mocks/cabinetPayload2.json +76 -0
- package/es/mocks/dataBundle2.json +4 -0
- package/es/mocks/distancePayload.json +6 -0
- package/es/mocks/doorStylePayload2.json +84 -0
- package/es/mocks/furnishingPayload.json +23 -0
- package/es/mocks/itemCDSPayload.json +27 -0
- package/es/mocks/lightingPayload.json +23 -0
- package/es/mocks/mockProps.json +43 -0
- package/es/mocks/mockProps2.json +9 -0
- package/es/mocks/moldingPayload.json +19 -0
- package/es/mocks/projectItemsCatalog.json +133 -0
- package/es/mocks/rectangleShape.json +238 -0
- package/es/mocks/replaceCabinetPayload.json +81 -0
- package/es/mocks/roomShapePayload.json +5 -0
- package/es/useAppContext.js +8 -0
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +15 -25
- package/lib/LiteRenderer.js +2 -5
- package/lib/actions/export.js +39 -35
- package/lib/catalog/catalog.js +4 -20
- package/lib/components/content.js +2 -5
- package/lib/components/export.js +26 -6
- package/lib/components/style/export.js +1 -105
- package/lib/components/style/form-number-input.js +22 -11
- package/lib/components/viewer2d/group.js +4 -5
- package/lib/components/viewer2d/item.js +4 -5
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +47 -17
- package/lib/components/viewer2d/rulerX.js +0 -3
- package/lib/components/viewer2d/rulerY.js +0 -3
- package/lib/components/viewer2d/scene.js +1 -4
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +42 -27
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -8
- package/lib/components/viewer3d/viewer3d.js +0 -9
- package/lib/devLiteRenderer.js +147 -316
- package/lib/index.js +12 -4
- package/lib/mocks/appliancePayload.json +27 -0
- package/lib/mocks/cabinetPayload.json +1914 -0
- package/lib/mocks/cabinetPayload2.json +76 -0
- package/lib/mocks/dataBundle2.json +4 -0
- package/lib/mocks/distancePayload.json +6 -0
- package/lib/mocks/doorStylePayload2.json +84 -0
- package/lib/mocks/furnishingPayload.json +23 -0
- package/lib/mocks/itemCDSPayload.json +27 -0
- package/lib/mocks/lightingPayload.json +23 -0
- package/lib/mocks/mockProps.json +43 -0
- package/lib/mocks/mockProps2.json +9 -0
- package/lib/mocks/moldingPayload.json +19 -0
- package/lib/mocks/projectItemsCatalog.json +133 -0
- package/lib/mocks/rectangleShape.json +238 -0
- package/lib/mocks/replaceCabinetPayload.json +81 -0
- package/lib/mocks/roomShapePayload.json +5 -0
- package/lib/useAppContext.js +16 -0
- package/package.json +16 -21
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-submit-button.js +0 -25
- package/es/components/style/form-text-input.js +0 -69
- package/es/plugins/SVGLoader.js +0 -1414
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/plugins/SVGLoader.js +0 -1419
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
package/es/devLiteRenderer.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import React, { useState
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { createRoot } from 'react-dom/client';
|
|
6
|
+
import useMeasure from 'react-use-measure';
|
|
5
7
|
import { Map } from 'immutable';
|
|
6
|
-
import
|
|
8
|
+
import { Button } from 'antd';
|
|
9
|
+
import LiteRenderer from "./LiteRenderer";
|
|
7
10
|
import projectItemsCatalog from "./mocks/projectItemsCatalog.json";
|
|
8
11
|
import mockProps from "./mocks/mockProps.json";
|
|
9
12
|
import cabinetPaylod from "./mocks/cabinetPayload2.json";
|
|
@@ -13,12 +16,8 @@ import roomShapePayload from "./mocks/roomShapePayload.json";
|
|
|
13
16
|
import itemCDSPayload from "./mocks/itemCDSPayload.json";
|
|
14
17
|
import lightingPayload from "./mocks/lightingPayload.json";
|
|
15
18
|
import furnishingPayload from "./mocks/furnishingPayload.json";
|
|
16
|
-
import rectangleData from "./mocks/rectangleShape.json";
|
|
17
19
|
import moldingPayload from "./mocks/moldingPayload.json";
|
|
18
20
|
import replaceCabinetPayload from "./mocks/replaceCabinetPayload.json";
|
|
19
|
-
import ReactDOM from 'react-dom';
|
|
20
|
-
import LiteRenderer from "./LiteRenderer";
|
|
21
|
-
import { Button } from 'antd';
|
|
22
21
|
import { LEFT, RIGHT, TOP, BOTTOM, EXTERNAL_EVENT_ADD_ITEM, EXTERNAL_EVENT_ADD_WALL, EXTERNAL_EVENT_TOGGLE_TO_3D, EXTERNAL_EVENT_TOGGLE_TO_2D, EXTERNAL_EVENT_TOGGLE_TO_ELEVATION, EXTERNAL_EVENT_MOVE_PAN, EXTERNAL_EVENT_NEW_PROJECT, EXTERNAL_EVENT_CHANGE_DOORSTYLE, EXTERNAL_EVENT_ADD_ROOM_SHAPE, EXTERNAL_EVENT_ZOOM_IN, EXTERNAL_EVENT_ZOOM_OUT, EXTERNAL_EVENT_UNDO, EXTERNAL_EVENT_REDO, EXTERNAL_EVENT_SET_MOLDING, EXTERNAL_EVENT_PROJECT_SETTING, PROJECT_SETTING_OPTION, EXTERNAL_EVENT_SYNC_SCENE, EXTERNAL_EVENT_UPDATE_ATTRIBUTE, BACK_DIST_ANG, ATT_ITEM_POS, ATT_ITEM_ROTATION, ATT_LINE_LENGTH, EXTERNAL_EVENT_UPDATE_PROPERTY, PROP_FLIP_DOOR_HANDLE, PROP_OPEN_DOORS, EXTERNAL_EVENT_LOAD_PROJECT, INTERNAL_EVENT_ITEMS_CATALOG, EXTERNAL_EVENT_ADD_HOLE, HOLE_NAMES, EXTERNAL_EVENT_CENTERING_2D, PROP_ALTITUDE, EXTERNAL_EVENT_DUPLICATE_ELEMENT, ELEMENT_ITEM, EXTERNAL_EVENT_DELETE_ELEMENT, PROP_RESIZE_WIDTH, EXTERNAL_EVENT_REPLACE_CABINET, EXTERNAL_EVENT_SET_FINISHING, FINISHING_TYPE } from "./constants";
|
|
23
22
|
import { convert } from "./utils/convert-units-lite";
|
|
24
23
|
|
|
@@ -27,12 +26,15 @@ var options = {
|
|
|
27
26
|
unit: 'in',
|
|
28
27
|
enable3D: true
|
|
29
28
|
};
|
|
29
|
+
|
|
30
|
+
// internal event handler
|
|
30
31
|
var onInternalEvent = /*#__PURE__*/function () {
|
|
31
32
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(evt, callback) {
|
|
32
33
|
var _t;
|
|
33
34
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
34
35
|
while (1) switch (_context.prev = _context.next) {
|
|
35
36
|
case 0:
|
|
37
|
+
// eslint-disable-next-line no-console
|
|
36
38
|
console.log('EVENT:', evt.type, evt.value);
|
|
37
39
|
_t = evt.type;
|
|
38
40
|
_context.next = _t === INTERNAL_EVENT_ITEMS_CATALOG ? 1 : 3;
|
|
@@ -41,8 +43,10 @@ var onInternalEvent = /*#__PURE__*/function () {
|
|
|
41
43
|
_context.next = 2;
|
|
42
44
|
return callback(projectItemsCatalog);
|
|
43
45
|
case 2:
|
|
44
|
-
return _context.abrupt("continue",
|
|
46
|
+
return _context.abrupt("continue", 4);
|
|
45
47
|
case 3:
|
|
48
|
+
return _context.abrupt("continue", 4);
|
|
49
|
+
case 4:
|
|
46
50
|
case "end":
|
|
47
51
|
return _context.stop();
|
|
48
52
|
}
|
|
@@ -52,8 +56,9 @@ var onInternalEvent = /*#__PURE__*/function () {
|
|
|
52
56
|
return _ref.apply(this, arguments);
|
|
53
57
|
};
|
|
54
58
|
}();
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
function WorkSpace(_ref2) {
|
|
60
|
+
var width = _ref2.width,
|
|
61
|
+
height = _ref2.height;
|
|
57
62
|
var _useState = useState(null),
|
|
58
63
|
_useState2 = _slicedToArray(_useState, 2),
|
|
59
64
|
externalEvent = _useState2[0],
|
|
@@ -62,338 +67,213 @@ function WorkSpace(props) {
|
|
|
62
67
|
return /*#__PURE__*/React.createElement("div", {
|
|
63
68
|
className: "flex gap-4"
|
|
64
69
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
65
|
-
actionType: "danger",
|
|
66
70
|
onClick: function onClick() {
|
|
67
|
-
|
|
71
|
+
return setExternalEvent({
|
|
68
72
|
type: EXTERNAL_EVENT_SYNC_SCENE,
|
|
69
|
-
// send request for sync scene data to 3DTool
|
|
70
73
|
payload: {}
|
|
71
|
-
};
|
|
72
|
-
setExternalEvent(evt);
|
|
74
|
+
});
|
|
73
75
|
}
|
|
74
76
|
}, "Event-sync"), /*#__PURE__*/React.createElement(Button, {
|
|
75
|
-
actionType: "danger",
|
|
76
77
|
onClick: function onClick() {
|
|
77
|
-
|
|
78
|
+
return setExternalEvent({
|
|
78
79
|
type: EXTERNAL_EVENT_LOAD_PROJECT,
|
|
79
|
-
// send request for sync scene data to 3DTool
|
|
80
80
|
payload: JSON.parse(mockProps.projectElement[0].project_data)
|
|
81
|
-
};
|
|
82
|
-
setExternalEvent(evt);
|
|
81
|
+
});
|
|
83
82
|
}
|
|
84
83
|
}, "Load Project"), /*#__PURE__*/React.createElement(Button, {
|
|
85
|
-
actionType: "primary",
|
|
86
84
|
onClick: function onClick() {
|
|
87
|
-
|
|
85
|
+
return setExternalEvent({
|
|
88
86
|
type: EXTERNAL_EVENT_TOGGLE_TO_2D,
|
|
89
87
|
payload: {}
|
|
90
|
-
};
|
|
91
|
-
setExternalEvent(evt);
|
|
88
|
+
});
|
|
92
89
|
}
|
|
93
90
|
}, "2D"), /*#__PURE__*/React.createElement(Button, {
|
|
94
|
-
actionType: "primary",
|
|
95
91
|
onClick: function onClick() {
|
|
96
|
-
|
|
92
|
+
return setExternalEvent({
|
|
97
93
|
type: EXTERNAL_EVENT_TOGGLE_TO_3D,
|
|
98
94
|
payload: {}
|
|
99
|
-
};
|
|
100
|
-
setExternalEvent(evt);
|
|
95
|
+
});
|
|
101
96
|
}
|
|
102
97
|
}, "3D"), /*#__PURE__*/React.createElement(Button, {
|
|
103
|
-
actionType: "primary",
|
|
104
98
|
onClick: function onClick() {
|
|
105
|
-
|
|
99
|
+
return setExternalEvent({
|
|
106
100
|
type: EXTERNAL_EVENT_TOGGLE_TO_ELEVATION,
|
|
107
101
|
payload: {}
|
|
108
|
-
};
|
|
109
|
-
setExternalEvent(evt);
|
|
102
|
+
});
|
|
110
103
|
}
|
|
111
104
|
}, "Elevation"), /*#__PURE__*/React.createElement(Button, {
|
|
112
|
-
actionType: "primary",
|
|
113
105
|
onClick: function onClick() {
|
|
114
|
-
|
|
106
|
+
return setExternalEvent({
|
|
115
107
|
type: EXTERNAL_EVENT_MOVE_PAN,
|
|
116
108
|
payload: {
|
|
117
109
|
moveType: LEFT,
|
|
118
110
|
moveValue: offset
|
|
119
111
|
}
|
|
120
|
-
};
|
|
121
|
-
setExternalEvent(evt);
|
|
112
|
+
});
|
|
122
113
|
}
|
|
123
114
|
}, /*#__PURE__*/React.createElement("img", {
|
|
115
|
+
alt: "left",
|
|
124
116
|
src: "/assets/img/svg/bottombar/arrow-left.svg"
|
|
125
117
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
126
|
-
actionType: "primary",
|
|
127
118
|
onClick: function onClick() {
|
|
128
|
-
|
|
119
|
+
return setExternalEvent({
|
|
129
120
|
type: EXTERNAL_EVENT_MOVE_PAN,
|
|
130
121
|
payload: {
|
|
131
122
|
moveType: TOP,
|
|
132
123
|
moveValue: offset
|
|
133
124
|
}
|
|
134
|
-
};
|
|
135
|
-
setExternalEvent(evt);
|
|
125
|
+
});
|
|
136
126
|
}
|
|
137
127
|
}, /*#__PURE__*/React.createElement("img", {
|
|
128
|
+
alt: "up",
|
|
138
129
|
src: "/assets/img/svg/bottombar/arrow-up.svg"
|
|
139
130
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
140
|
-
actionType: "primary",
|
|
141
131
|
onClick: function onClick() {
|
|
142
|
-
|
|
132
|
+
return setExternalEvent({
|
|
143
133
|
type: EXTERNAL_EVENT_MOVE_PAN,
|
|
144
134
|
payload: {
|
|
145
135
|
moveType: BOTTOM,
|
|
146
136
|
moveValue: offset
|
|
147
137
|
}
|
|
148
|
-
};
|
|
149
|
-
setExternalEvent(evt);
|
|
138
|
+
});
|
|
150
139
|
}
|
|
151
140
|
}, /*#__PURE__*/React.createElement("img", {
|
|
141
|
+
alt: "down",
|
|
152
142
|
src: "/assets/img/svg/bottombar/arrow-down.svg"
|
|
153
143
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
154
|
-
actionType: "primary",
|
|
155
144
|
onClick: function onClick() {
|
|
156
|
-
|
|
145
|
+
return setExternalEvent({
|
|
157
146
|
type: EXTERNAL_EVENT_MOVE_PAN,
|
|
158
147
|
payload: {
|
|
159
148
|
moveType: RIGHT,
|
|
160
149
|
moveValue: offset
|
|
161
150
|
}
|
|
162
|
-
};
|
|
163
|
-
setExternalEvent(evt);
|
|
151
|
+
});
|
|
164
152
|
}
|
|
165
153
|
}, /*#__PURE__*/React.createElement("img", {
|
|
154
|
+
alt: "right",
|
|
166
155
|
src: "/assets/img/svg/bottombar/arrow-right.svg"
|
|
167
156
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
168
|
-
actionType: "primary",
|
|
169
157
|
onClick: function onClick() {
|
|
170
|
-
|
|
158
|
+
return setExternalEvent({
|
|
171
159
|
type: EXTERNAL_EVENT_ZOOM_OUT,
|
|
172
160
|
payload: {}
|
|
173
|
-
};
|
|
174
|
-
setExternalEvent(evt);
|
|
161
|
+
});
|
|
175
162
|
}
|
|
176
163
|
}, /*#__PURE__*/React.createElement("img", {
|
|
164
|
+
alt: "-",
|
|
177
165
|
src: "/assets/img/svg/bottombar/arrow-minus.svg"
|
|
178
166
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
179
|
-
actionType: "primary",
|
|
180
167
|
onClick: function onClick() {
|
|
181
|
-
|
|
168
|
+
return setExternalEvent({
|
|
182
169
|
type: EXTERNAL_EVENT_ZOOM_IN,
|
|
183
170
|
payload: {}
|
|
184
|
-
};
|
|
185
|
-
setExternalEvent(evt);
|
|
171
|
+
});
|
|
186
172
|
}
|
|
187
173
|
}, /*#__PURE__*/React.createElement("img", {
|
|
174
|
+
alt: "+",
|
|
188
175
|
src: "/assets/img/svg/bottombar/arrow-plus.svg"
|
|
189
176
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
190
|
-
actionType: "primary",
|
|
191
177
|
onClick: function onClick() {
|
|
192
|
-
|
|
178
|
+
return setExternalEvent({
|
|
193
179
|
type: EXTERNAL_EVENT_NEW_PROJECT,
|
|
194
180
|
payload: {}
|
|
195
|
-
};
|
|
196
|
-
setExternalEvent(evt);
|
|
181
|
+
});
|
|
197
182
|
}
|
|
198
183
|
}, "New Project"), /*#__PURE__*/React.createElement(Button, {
|
|
199
|
-
actionType: "secondary",
|
|
200
184
|
onClick: function onClick() {
|
|
201
|
-
|
|
185
|
+
return setExternalEvent({
|
|
202
186
|
type: EXTERNAL_EVENT_ADD_WALL,
|
|
203
187
|
payload: {}
|
|
204
|
-
};
|
|
205
|
-
setExternalEvent(evt);
|
|
188
|
+
});
|
|
206
189
|
}
|
|
207
190
|
}, "Add Walls"), /*#__PURE__*/React.createElement(Button, {
|
|
208
|
-
actionType: "danger",
|
|
209
191
|
onClick: function onClick() {
|
|
210
|
-
|
|
192
|
+
return setExternalEvent({
|
|
211
193
|
type: EXTERNAL_EVENT_ADD_ITEM,
|
|
212
194
|
payload: cabinetPaylod
|
|
213
|
-
};
|
|
214
|
-
setExternalEvent(evt);
|
|
195
|
+
});
|
|
215
196
|
}
|
|
216
197
|
}, "Add B12 Cabinet"), /*#__PURE__*/React.createElement(Button, {
|
|
217
|
-
actionType: "danger",
|
|
218
198
|
onClick: function onClick() {
|
|
219
|
-
|
|
199
|
+
return setExternalEvent({
|
|
220
200
|
type: EXTERNAL_EVENT_CHANGE_DOORSTYLE,
|
|
221
201
|
payload: {
|
|
222
202
|
doorStyle: doorStylePaylod2,
|
|
223
203
|
itemCDS: itemCDSPayload,
|
|
224
204
|
isAll: true
|
|
225
205
|
}
|
|
226
|
-
};
|
|
227
|
-
setExternalEvent(evt);
|
|
206
|
+
});
|
|
228
207
|
}
|
|
229
|
-
}, "DoorStyle (Change
|
|
230
|
-
actionType: "danger",
|
|
208
|
+
}, "DoorStyle (Change)"), /*#__PURE__*/React.createElement(Button, {
|
|
231
209
|
onClick: function onClick() {
|
|
232
|
-
|
|
210
|
+
return setExternalEvent({
|
|
233
211
|
type: EXTERNAL_EVENT_ADD_ROOM_SHAPE,
|
|
234
212
|
payload: {
|
|
235
213
|
roomShapeType: 'rectangle',
|
|
236
214
|
width: 250,
|
|
237
215
|
height: 100,
|
|
238
|
-
doorStyle:
|
|
239
|
-
id: 36,
|
|
240
|
-
type: 'door',
|
|
241
|
-
name: 'Brilliant White Shaker',
|
|
242
|
-
thumbnail: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/thumbnail/Brilliant%20White%20Shaker%20-%20RTA.jpg',
|
|
243
|
-
texture: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
244
|
-
color: '#ffffff',
|
|
245
|
-
glossness: 1,
|
|
246
|
-
door_style_id: 42,
|
|
247
|
-
brightness: 1,
|
|
248
|
-
sku: 'SW',
|
|
249
|
-
color_family: ',10,',
|
|
250
|
-
color_sku_alias: 'SW',
|
|
251
|
-
door_style_name: 'Shaker',
|
|
252
|
-
install: '',
|
|
253
|
-
doorStyles: {
|
|
254
|
-
base: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
255
|
-
counttop: 'https://media.test.diydesignspace.com/uploads/CountTop/202105074107_5/texture/Unique_Calcatta_texture.jpg',
|
|
256
|
-
interior: 'https://media.test.diydesignspace.com/uploads/assets/default/maple.jpg',
|
|
257
|
-
base_door_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
258
|
-
base_fixed_drawer_door_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
259
|
-
base_drawer_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
260
|
-
base_drawer_door_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
261
|
-
door_handle_1: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
262
|
-
fixed_drawer_door_handle_1: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
263
|
-
drawer_door_handle_1: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
264
|
-
base_door_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
265
|
-
base_fixed_drawer_door_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
266
|
-
base_drawer_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
267
|
-
base_drawer_door_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
268
|
-
door_handle_2: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
269
|
-
fixed_drawer_door_handle_2: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
270
|
-
drawer_door_handle_2: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
271
|
-
base_door_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
272
|
-
base_fixed_drawer_door_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
273
|
-
base_drawer_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
274
|
-
base_drawer_door_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
275
|
-
door_handle_3: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
276
|
-
fixed_drawer_door_handle_3: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
277
|
-
drawer_door_handle_3: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
278
|
-
base_door_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
279
|
-
base_fixed_drawer_door_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
280
|
-
base_drawer_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
281
|
-
base_drawer_door_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
282
|
-
door_handle_4: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
283
|
-
fixed_drawer_door_handle_4: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
284
|
-
drawer_door_handle_4: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
285
|
-
base_door_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
286
|
-
base_fixed_drawer_door_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
287
|
-
base_drawer_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
288
|
-
base_drawer_door_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
289
|
-
door_handle_5: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
290
|
-
fixed_drawer_door_handle_5: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
291
|
-
drawer_door_handle_5: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
292
|
-
base_door_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
293
|
-
base_fixed_drawer_door_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
294
|
-
base_drawer_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
295
|
-
base_drawer_door_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
296
|
-
door_handle_6: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
297
|
-
fixed_drawer_door_handle_6: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
298
|
-
drawer_door_handle_6: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
299
|
-
base_door_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
300
|
-
base_fixed_drawer_door_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
301
|
-
base_drawer_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
302
|
-
base_drawer_door_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
303
|
-
door_handle_7: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
304
|
-
fixed_drawer_door_handle_7: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
305
|
-
drawer_door_handle_7: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
306
|
-
base_door_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
307
|
-
base_fixed_drawer_door_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
308
|
-
base_drawer_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
309
|
-
base_drawer_door_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
310
|
-
door_handle_8: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
311
|
-
fixed_drawer_door_handle_8: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
312
|
-
drawer_door_handle_8: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
313
|
-
base_door_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
314
|
-
base_fixed_drawer_door_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
315
|
-
base_drawer_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
316
|
-
base_drawer_door_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
317
|
-
door_handle_9: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
318
|
-
fixed_drawer_door_handle_9: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg',
|
|
319
|
-
drawer_door_handle_9: 'https://media.test.diydesignspace.com/uploads/assets/default/steel.jpg'
|
|
320
|
-
},
|
|
321
|
-
installation_types: [125, 124]
|
|
322
|
-
}
|
|
216
|
+
doorStyle: doorStylePaylod2
|
|
323
217
|
}
|
|
324
|
-
};
|
|
325
|
-
setExternalEvent(evt);
|
|
218
|
+
});
|
|
326
219
|
}
|
|
327
220
|
}, "Add Room shape(rectangle)"), /*#__PURE__*/React.createElement(Button, {
|
|
328
|
-
actionType: "danger",
|
|
329
221
|
onClick: function onClick() {
|
|
330
|
-
|
|
222
|
+
return setExternalEvent({
|
|
331
223
|
type: EXTERNAL_EVENT_UNDO,
|
|
332
224
|
payload: {}
|
|
333
|
-
};
|
|
334
|
-
setExternalEvent(evt);
|
|
225
|
+
});
|
|
335
226
|
}
|
|
336
227
|
}, "Undo"), /*#__PURE__*/React.createElement(Button, {
|
|
337
|
-
actionType: "danger",
|
|
338
228
|
onClick: function onClick() {
|
|
339
|
-
|
|
229
|
+
return setExternalEvent({
|
|
340
230
|
type: EXTERNAL_EVENT_REDO,
|
|
341
231
|
payload: {}
|
|
342
|
-
};
|
|
343
|
-
setExternalEvent(evt);
|
|
232
|
+
});
|
|
344
233
|
}
|
|
345
234
|
}, "Redo"), /*#__PURE__*/React.createElement(Button, {
|
|
346
|
-
actionType: "danger",
|
|
347
235
|
onClick: function onClick() {
|
|
348
|
-
|
|
236
|
+
return setExternalEvent({
|
|
349
237
|
type: EXTERNAL_EVENT_SET_MOLDING,
|
|
350
238
|
payload: {
|
|
351
239
|
isGlobal: true,
|
|
352
240
|
moldingInfo: moldingPayload
|
|
353
241
|
}
|
|
354
|
-
};
|
|
355
|
-
setExternalEvent(evt);
|
|
242
|
+
});
|
|
356
243
|
}
|
|
357
|
-
}, "Global Molding
|
|
358
|
-
actionType: "danger",
|
|
244
|
+
}, "Global Molding"), /*#__PURE__*/React.createElement(Button, {
|
|
359
245
|
onClick: function onClick() {
|
|
360
|
-
|
|
246
|
+
return setExternalEvent({
|
|
361
247
|
type: EXTERNAL_EVENT_SET_MOLDING,
|
|
362
248
|
payload: {
|
|
363
249
|
isGlobal: false,
|
|
364
250
|
moldingInfo: moldingPayload
|
|
365
251
|
}
|
|
366
|
-
};
|
|
367
|
-
setExternalEvent(evt);
|
|
252
|
+
});
|
|
368
253
|
}
|
|
369
|
-
}, "Individual Molding
|
|
370
|
-
actionType: "danger",
|
|
254
|
+
}, "Individual Molding"), /*#__PURE__*/React.createElement(Button, {
|
|
371
255
|
onClick: function onClick() {
|
|
372
|
-
|
|
256
|
+
return setExternalEvent({
|
|
373
257
|
type: EXTERNAL_EVENT_PROJECT_SETTING,
|
|
374
258
|
payload: {
|
|
375
259
|
option: PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT,
|
|
376
|
-
value: 100
|
|
260
|
+
value: 100
|
|
377
261
|
}
|
|
378
|
-
};
|
|
379
|
-
setExternalEvent(evt);
|
|
262
|
+
});
|
|
380
263
|
}
|
|
381
264
|
}, "Setting-CeilingHeight"), /*#__PURE__*/React.createElement(Button, {
|
|
382
|
-
actionType: "danger",
|
|
383
265
|
onClick: function onClick() {
|
|
384
|
-
|
|
266
|
+
return setExternalEvent({
|
|
385
267
|
type: EXTERNAL_EVENT_PROJECT_SETTING,
|
|
386
268
|
payload: {
|
|
387
269
|
option: PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE,
|
|
388
|
-
value: 1
|
|
270
|
+
value: 1
|
|
389
271
|
}
|
|
390
|
-
};
|
|
391
|
-
setExternalEvent(evt);
|
|
272
|
+
});
|
|
392
273
|
}
|
|
393
274
|
}, "Setting-WallLength"), /*#__PURE__*/React.createElement(Button, {
|
|
394
|
-
actionType: "danger",
|
|
395
275
|
onClick: function onClick() {
|
|
396
|
-
|
|
276
|
+
return setExternalEvent({
|
|
397
277
|
type: EXTERNAL_EVENT_UPDATE_ATTRIBUTE,
|
|
398
278
|
payload: {
|
|
399
279
|
attributeName: ATT_ITEM_POS,
|
|
@@ -402,286 +282,226 @@ function WorkSpace(props) {
|
|
|
402
282
|
oldDistance: 0,
|
|
403
283
|
newDistance: 10
|
|
404
284
|
}
|
|
405
|
-
},
|
|
406
|
-
callback: function callback(updatedAttributeForm) {
|
|
407
|
-
console.log(updatedAttributeForm);
|
|
408
|
-
// Do something here with new attributes
|
|
409
285
|
}
|
|
410
|
-
};
|
|
411
|
-
setExternalEvent(evt);
|
|
286
|
+
});
|
|
412
287
|
}
|
|
413
288
|
}, "OP-Cabinet Back Distance to 10"), /*#__PURE__*/React.createElement(Button, {
|
|
414
|
-
actionType: "danger",
|
|
415
289
|
onClick: function onClick() {
|
|
416
|
-
|
|
290
|
+
return setExternalEvent({
|
|
417
291
|
type: EXTERNAL_EVENT_UPDATE_ATTRIBUTE,
|
|
418
292
|
payload: {
|
|
419
293
|
attributeName: ATT_ITEM_ROTATION,
|
|
420
294
|
value: 45
|
|
421
|
-
},
|
|
422
|
-
callback: function callback(updatedAttributeForm) {
|
|
423
|
-
console.log(updatedAttributeForm);
|
|
424
|
-
// Do something here with new attributes
|
|
425
295
|
}
|
|
426
|
-
};
|
|
427
|
-
setExternalEvent(evt);
|
|
296
|
+
});
|
|
428
297
|
}
|
|
429
298
|
}, "OP-Cabinet Rotation to 45"), /*#__PURE__*/React.createElement(Button, {
|
|
430
|
-
actionType: "danger",
|
|
431
299
|
onClick: function onClick() {
|
|
432
|
-
|
|
300
|
+
return setExternalEvent({
|
|
433
301
|
type: EXTERNAL_EVENT_UPDATE_ATTRIBUTE,
|
|
434
302
|
payload: {
|
|
435
303
|
attributeName: ATT_LINE_LENGTH,
|
|
436
304
|
value: 100
|
|
437
305
|
}
|
|
438
|
-
};
|
|
439
|
-
setExternalEvent(evt);
|
|
306
|
+
});
|
|
440
307
|
}
|
|
441
308
|
}, "OP-Wall Length to 100"), /*#__PURE__*/React.createElement(Button, {
|
|
442
|
-
actionType: "danger",
|
|
443
309
|
onClick: function onClick() {
|
|
444
|
-
|
|
310
|
+
return setExternalEvent({
|
|
445
311
|
type: EXTERNAL_EVENT_UPDATE_PROPERTY,
|
|
446
312
|
payload: {
|
|
447
313
|
propertyName: PROP_FLIP_DOOR_HANDLE,
|
|
448
314
|
value: true
|
|
449
315
|
}
|
|
450
|
-
};
|
|
451
|
-
setExternalEvent(evt);
|
|
316
|
+
});
|
|
452
317
|
}
|
|
453
318
|
}, "Flip Door Handle"), /*#__PURE__*/React.createElement(Button, {
|
|
454
|
-
actionType: "danger",
|
|
455
319
|
onClick: function onClick() {
|
|
456
|
-
|
|
320
|
+
return setExternalEvent({
|
|
457
321
|
type: EXTERNAL_EVENT_UPDATE_PROPERTY,
|
|
458
322
|
payload: {
|
|
459
323
|
propertyName: PROP_OPEN_DOORS,
|
|
460
324
|
value: true
|
|
461
325
|
}
|
|
462
|
-
};
|
|
463
|
-
setExternalEvent(evt);
|
|
326
|
+
});
|
|
464
327
|
}
|
|
465
328
|
}, "Open Doors"), /*#__PURE__*/React.createElement(Button, {
|
|
466
|
-
actionType: "danger",
|
|
467
329
|
onClick: function onClick() {
|
|
468
|
-
|
|
330
|
+
return setExternalEvent({
|
|
469
331
|
type: EXTERNAL_EVENT_UPDATE_PROPERTY,
|
|
470
332
|
payload: {
|
|
471
333
|
propertyName: PROP_ALTITUDE,
|
|
472
|
-
// this property should be Map
|
|
473
334
|
value: new Map({
|
|
474
335
|
length: 25.399999187200024,
|
|
475
|
-
// cm
|
|
476
336
|
_length: 10,
|
|
477
|
-
// inch
|
|
478
337
|
_unit: 'in'
|
|
479
338
|
})
|
|
480
339
|
}
|
|
481
|
-
};
|
|
482
|
-
setExternalEvent(evt);
|
|
340
|
+
});
|
|
483
341
|
}
|
|
484
342
|
}, "Distance from floor 10\""), /*#__PURE__*/React.createElement(Button, {
|
|
485
|
-
actionType: "danger",
|
|
486
343
|
onClick: function onClick() {
|
|
487
|
-
|
|
344
|
+
return setExternalEvent({
|
|
488
345
|
type: EXTERNAL_EVENT_DUPLICATE_ELEMENT,
|
|
489
346
|
payload: {
|
|
490
347
|
elementPrototype: ELEMENT_ITEM,
|
|
491
|
-
elementId: ''
|
|
348
|
+
elementId: ''
|
|
492
349
|
}
|
|
493
|
-
};
|
|
494
|
-
setExternalEvent(evt);
|
|
350
|
+
});
|
|
495
351
|
}
|
|
496
352
|
}, "Duplicate Item"), /*#__PURE__*/React.createElement(Button, {
|
|
497
|
-
actionType: "danger",
|
|
498
353
|
onClick: function onClick() {
|
|
499
|
-
|
|
354
|
+
return setExternalEvent({
|
|
500
355
|
type: EXTERNAL_EVENT_DELETE_ELEMENT,
|
|
501
356
|
payload: {
|
|
502
357
|
elementPrototype: ELEMENT_ITEM,
|
|
503
|
-
elementId: ''
|
|
358
|
+
elementId: ''
|
|
504
359
|
}
|
|
505
|
-
};
|
|
506
|
-
setExternalEvent(evt);
|
|
360
|
+
});
|
|
507
361
|
}
|
|
508
362
|
}, "Delete Item"), /*#__PURE__*/React.createElement(Button, {
|
|
509
|
-
actionType: "danger",
|
|
510
363
|
onClick: function onClick() {
|
|
511
|
-
|
|
364
|
+
return setExternalEvent({
|
|
512
365
|
type: EXTERNAL_EVENT_ADD_HOLE,
|
|
513
366
|
payload: {
|
|
514
367
|
holeName: HOLE_NAMES.WINDOW_CROSS
|
|
515
368
|
}
|
|
516
|
-
};
|
|
517
|
-
setExternalEvent(evt);
|
|
369
|
+
});
|
|
518
370
|
}
|
|
519
371
|
}, "Add Hole (Cross Window)"), /*#__PURE__*/React.createElement(Button, {
|
|
520
|
-
actionType: "danger",
|
|
521
372
|
onClick: function onClick() {
|
|
522
|
-
|
|
373
|
+
return setExternalEvent({
|
|
523
374
|
type: EXTERNAL_EVENT_ADD_HOLE,
|
|
524
375
|
payload: {
|
|
525
376
|
holeName: HOLE_NAMES.DOOR_EXTERIOR
|
|
526
377
|
}
|
|
527
|
-
};
|
|
528
|
-
setExternalEvent(evt);
|
|
378
|
+
});
|
|
529
379
|
}
|
|
530
380
|
}, "Add Hole (DOOR_EXTERIOR)"), /*#__PURE__*/React.createElement(Button, {
|
|
531
|
-
actionType: "danger",
|
|
532
381
|
onClick: function onClick() {
|
|
533
|
-
|
|
382
|
+
return setExternalEvent({
|
|
534
383
|
type: EXTERNAL_EVENT_ADD_ITEM,
|
|
535
384
|
payload: appliancePaylod
|
|
536
|
-
};
|
|
537
|
-
setExternalEvent(evt);
|
|
385
|
+
});
|
|
538
386
|
}
|
|
539
|
-
}, "Add Appliance
|
|
540
|
-
actionType: "danger",
|
|
387
|
+
}, "Add Appliance"), /*#__PURE__*/React.createElement(Button, {
|
|
541
388
|
onClick: function onClick() {
|
|
542
|
-
|
|
389
|
+
return setExternalEvent({
|
|
543
390
|
type: EXTERNAL_EVENT_ADD_ITEM,
|
|
544
391
|
payload: lightingPayload
|
|
545
|
-
};
|
|
546
|
-
setExternalEvent(evt);
|
|
392
|
+
});
|
|
547
393
|
}
|
|
548
394
|
}, "Add Lighting"), /*#__PURE__*/React.createElement(Button, {
|
|
549
|
-
actionType: "danger",
|
|
550
395
|
onClick: function onClick() {
|
|
551
|
-
|
|
396
|
+
return setExternalEvent({
|
|
552
397
|
type: EXTERNAL_EVENT_ADD_ITEM,
|
|
553
398
|
payload: furnishingPayload
|
|
554
|
-
};
|
|
555
|
-
setExternalEvent(evt);
|
|
399
|
+
});
|
|
556
400
|
}
|
|
557
401
|
}, "Add Furnishing"), /*#__PURE__*/React.createElement(Button, {
|
|
558
|
-
actionType: "danger",
|
|
559
402
|
onClick: function onClick() {
|
|
560
|
-
|
|
403
|
+
return setExternalEvent({
|
|
561
404
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
562
405
|
payload: {
|
|
563
406
|
category: FINISHING_TYPE.COUNTER_TOP,
|
|
564
407
|
texture: 'https://media.test.diydesignspace.com/uploads/CountTop/202111302746_7/texture/Arabescato_texture.jpg'
|
|
565
408
|
}
|
|
566
|
-
};
|
|
567
|
-
setExternalEvent(evt);
|
|
409
|
+
});
|
|
568
410
|
}
|
|
569
411
|
}, "Set Finishing (CounterTop)"), /*#__PURE__*/React.createElement(Button, {
|
|
570
|
-
actionType: "danger",
|
|
571
412
|
onClick: function onClick() {
|
|
572
|
-
|
|
413
|
+
return setExternalEvent({
|
|
573
414
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
574
415
|
payload: {
|
|
575
416
|
category: FINISHING_TYPE.BACKSPLASH,
|
|
576
417
|
texture: 'https://media.test.diydesignspace.com/uploads/CountTop/202305225249_14/texture/Unique_Marquina_texture.jpg'
|
|
577
418
|
}
|
|
578
|
-
};
|
|
579
|
-
setExternalEvent(evt);
|
|
419
|
+
});
|
|
580
420
|
}
|
|
581
421
|
}, "Set Finishing (Backsplash)"), /*#__PURE__*/React.createElement(Button, {
|
|
582
|
-
actionType: "danger",
|
|
583
422
|
onClick: function onClick() {
|
|
584
|
-
|
|
423
|
+
return setExternalEvent({
|
|
585
424
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
586
425
|
payload: {
|
|
587
426
|
category: FINISHING_TYPE.FLOOR_STYLE,
|
|
588
427
|
texture: 'https://media.test.diydesignspace.com/uploads/CountTop/202203163338_3/texture/oak-chestnut.webp'
|
|
589
428
|
}
|
|
590
|
-
};
|
|
591
|
-
setExternalEvent(evt);
|
|
429
|
+
});
|
|
592
430
|
}
|
|
593
431
|
}, "Set Finishing (Floor Style)"), /*#__PURE__*/React.createElement(Button, {
|
|
594
|
-
actionType: "danger",
|
|
595
432
|
onClick: function onClick() {
|
|
596
|
-
|
|
433
|
+
return setExternalEvent({
|
|
597
434
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
598
435
|
payload: {
|
|
599
436
|
category: FINISHING_TYPE.WALL_COLOR,
|
|
600
437
|
color: '#bab863'
|
|
601
438
|
}
|
|
602
|
-
};
|
|
603
|
-
setExternalEvent(evt);
|
|
439
|
+
});
|
|
604
440
|
}
|
|
605
441
|
}, "Set Finishing (Wall Color)"), /*#__PURE__*/React.createElement(Button, {
|
|
606
|
-
actionType: "danger",
|
|
607
442
|
onClick: function onClick() {
|
|
608
|
-
|
|
443
|
+
return setExternalEvent({
|
|
609
444
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
610
445
|
payload: {
|
|
611
446
|
category: FINISHING_TYPE.DOOR_HANDLE,
|
|
612
447
|
gltf: 'https://media.test.diydesignspace.com/uploads/DoorHandle/202107294150_29/gltf/Handle1.gltf'
|
|
613
448
|
}
|
|
614
|
-
};
|
|
615
|
-
setExternalEvent(evt);
|
|
449
|
+
});
|
|
616
450
|
}
|
|
617
451
|
}, "Set Finishing (Door handle)"), /*#__PURE__*/React.createElement(Button, {
|
|
618
|
-
actionType: "danger",
|
|
619
452
|
onClick: function onClick() {
|
|
620
|
-
|
|
453
|
+
return setExternalEvent({
|
|
621
454
|
type: EXTERNAL_EVENT_CENTERING_2D,
|
|
622
455
|
payload: {}
|
|
623
|
-
};
|
|
624
|
-
setExternalEvent(evt);
|
|
456
|
+
});
|
|
625
457
|
}
|
|
626
458
|
}, "Centering Viewer2D"), /*#__PURE__*/React.createElement(Button, {
|
|
627
|
-
actionType: "danger",
|
|
628
459
|
onClick: function onClick() {
|
|
629
|
-
|
|
460
|
+
return setExternalEvent({
|
|
630
461
|
type: EXTERNAL_EVENT_UPDATE_PROPERTY,
|
|
631
462
|
payload: {
|
|
632
463
|
propertyName: PROP_RESIZE_WIDTH,
|
|
633
|
-
// this property should be Map
|
|
634
464
|
value: new Map({
|
|
635
465
|
length: 68.57999780544007,
|
|
636
|
-
// cm
|
|
637
466
|
_length: 27,
|
|
638
|
-
// inch
|
|
639
467
|
_unit: 'in'
|
|
640
468
|
})
|
|
641
469
|
}
|
|
642
|
-
};
|
|
643
|
-
setExternalEvent(evt);
|
|
470
|
+
});
|
|
644
471
|
}
|
|
645
472
|
}, "Change width to 27\""), /*#__PURE__*/React.createElement(Button, {
|
|
646
|
-
actionType: "danger",
|
|
647
473
|
onClick: function onClick() {
|
|
648
|
-
|
|
474
|
+
return setExternalEvent({
|
|
649
475
|
type: EXTERNAL_EVENT_REPLACE_CABINET,
|
|
650
|
-
payload: replaceCabinetPayload
|
|
651
|
-
};
|
|
652
|
-
setExternalEvent(evt);
|
|
476
|
+
payload: replaceCabinetPayload
|
|
477
|
+
});
|
|
653
478
|
}
|
|
654
479
|
}, "Replace cabinet to B12"), /*#__PURE__*/React.createElement(Button, {
|
|
655
|
-
actionType: "danger",
|
|
656
480
|
onClick: function onClick() {
|
|
657
|
-
|
|
481
|
+
return setExternalEvent({
|
|
658
482
|
type: EXTERNAL_EVENT_ADD_ROOM_SHAPE,
|
|
659
483
|
payload: roomShapePayload
|
|
660
|
-
};
|
|
661
|
-
setExternalEvent(evt);
|
|
484
|
+
});
|
|
662
485
|
}
|
|
663
|
-
}, "Add room shape
|
|
664
|
-
actionType: "danger",
|
|
486
|
+
}, "Add room shape (payload)"), /*#__PURE__*/React.createElement(Button, {
|
|
665
487
|
onClick: function onClick() {
|
|
666
488
|
var _tl = Math.floor(Math.random() * 50);
|
|
667
489
|
var tl = convert(_tl).from('in').to('cm');
|
|
668
|
-
|
|
490
|
+
setExternalEvent({
|
|
669
491
|
type: EXTERNAL_EVENT_UPDATE_PROPERTY,
|
|
670
492
|
payload: {
|
|
671
493
|
propertyName: PROP_RESIZE_WIDTH,
|
|
672
494
|
value: new Map({
|
|
673
495
|
_length: _tl,
|
|
674
|
-
// inch
|
|
675
496
|
_unit: 'in',
|
|
676
|
-
length: tl
|
|
497
|
+
length: tl
|
|
677
498
|
})
|
|
678
499
|
}
|
|
679
|
-
};
|
|
680
|
-
setExternalEvent(evt);
|
|
500
|
+
});
|
|
681
501
|
}
|
|
682
502
|
}, "random width")), /*#__PURE__*/React.createElement(LiteRenderer, {
|
|
683
|
-
width:
|
|
684
|
-
height:
|
|
503
|
+
width: width,
|
|
504
|
+
height: height,
|
|
685
505
|
configData: mockProps.configData,
|
|
686
506
|
options: options,
|
|
687
507
|
logoImg: "/assets/logo.png",
|
|
@@ -690,22 +510,33 @@ function WorkSpace(props) {
|
|
|
690
510
|
externalEvent: externalEvent,
|
|
691
511
|
onInternalEvent: onInternalEvent,
|
|
692
512
|
onError: function onError(payload) {
|
|
693
|
-
// payload = {
|
|
694
|
-
// type: 'render-error' | 'runtime-error' | 'unhandled-rejection',
|
|
695
|
-
// error: { name?, message, stack?, raw? },
|
|
696
|
-
// info?: { componentStack? },
|
|
697
|
-
// externalEvent: { id?, type, payload } | null,
|
|
698
|
-
// meta?: { filename?, lineno?, colno? }
|
|
699
|
-
// }
|
|
700
513
|
console.error('TOOL ERROR:', payload);
|
|
701
514
|
}
|
|
702
515
|
}));
|
|
703
516
|
}
|
|
704
|
-
|
|
705
|
-
var
|
|
706
|
-
|
|
707
|
-
|
|
517
|
+
function App() {
|
|
518
|
+
var _useMeasure = useMeasure(),
|
|
519
|
+
_useMeasure2 = _slicedToArray(_useMeasure, 2),
|
|
520
|
+
ref = _useMeasure2[0],
|
|
521
|
+
bounds = _useMeasure2[1];
|
|
522
|
+
|
|
523
|
+
// Provide usable dimensions immediately
|
|
524
|
+
var width = Math.max(1, Math.floor(bounds.width || window.innerWidth || 1));
|
|
525
|
+
var height = Math.max(1, Math.floor(bounds.height || window.innerHeight || 1));
|
|
526
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
527
|
+
ref: ref,
|
|
528
|
+
style: {
|
|
529
|
+
width: '100%',
|
|
530
|
+
height: '100vh'
|
|
531
|
+
}
|
|
532
|
+
}, /*#__PURE__*/React.createElement(WorkSpace, {
|
|
708
533
|
width: width,
|
|
709
534
|
height: height
|
|
710
|
-
});
|
|
711
|
-
}
|
|
535
|
+
}));
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// React 18 entry
|
|
539
|
+
var mountEl = document.getElementById('app');
|
|
540
|
+
if (mountEl) {
|
|
541
|
+
createRoot(mountEl).render(/*#__PURE__*/React.createElement(App, null));
|
|
542
|
+
}
|