kitchen-simulator 4.4.6 → 5.0.0-new-api.1
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/LiteRenderer.js +15 -53
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/factories/area-factory-3d.js +0 -4
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/utils/exporter.js +2 -0
- package/es/catalog/utils/item-loader.js +0 -4
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/class/item.js +17 -6
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +0 -1
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +11 -6
- package/es/devLiteRenderer.js +124 -84
- package/es/mappings/external-events/mapExternalEventPayload.js +28 -0
- package/es/mappings/external-events/mappers/addItemMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfToCDSMapper.js +31 -0
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +37 -0
- package/es/mappings/external-events/mappers/loadProjectMapper.js +62 -0
- package/es/mappings/holesToCatalog.js +139 -0
- package/es/models.js +12 -1
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/isolate-event-handler.js +57 -45
- package/es/utils/molding.js +5 -3
- package/lib/LiteRenderer.js +17 -55
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/factories/area-factory-3d.js +0 -4
- package/lib/catalog/holes/door-double/door_double.png +0 -0
- package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
- package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/lib/catalog/holes/gate/gate.jpg +0 -0
- package/lib/catalog/holes/window-clear/texture.png +0 -0
- package/lib/catalog/holes/window-cross/texture.png +0 -0
- package/lib/catalog/holes/window-double-hung/texture.png +0 -0
- package/lib/catalog/holes/window-vertical/texture.png +0 -0
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/catalog/utils/item-loader.js +0 -4
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/class/item.js +17 -6
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +0 -1
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +16 -11
- package/lib/devLiteRenderer.js +126 -86
- package/lib/mappings/external-events/mapExternalEventPayload.js +33 -0
- package/lib/mappings/external-events/mappers/addItemMapper.js +92 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +93 -0
- package/lib/mappings/external-events/mappers/ccdfToCDSMapper.js +37 -0
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +44 -0
- package/lib/mappings/external-events/mappers/loadProjectMapper.js +70 -0
- package/lib/mappings/holesToCatalog.js +148 -0
- package/lib/models.js +12 -1
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/isolate-event-handler.js +57 -45
- package/lib/utils/molding.js +5 -3
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- 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/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- 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-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- 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/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- 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-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
import { DEFAULT_INTERIOR_URL } from "../../../constants";
|
|
5
|
+
import { isEmpty } from "../../../utils/helper";
|
|
6
|
+
export function mapChangeDoorStyleEvent(evt, state) {
|
|
7
|
+
var _evt$payload, _layer$toJS;
|
|
8
|
+
if (isEmpty(evt)) return null;
|
|
9
|
+
var targetDoorStyle = evt === null || evt === void 0 || (_evt$payload = evt.payload) === null || _evt$payload === void 0 ? void 0 : _evt$payload.doorStyle;
|
|
10
|
+
if (isEmpty(targetDoorStyle)) return evt;
|
|
11
|
+
var layerId = state.getIn(['scene', 'selectedLayer']);
|
|
12
|
+
var layer = state.getIn(['scene', 'layers', layerId]);
|
|
13
|
+
if (isEmpty(layer)) return evt;
|
|
14
|
+
var handleTexture = layer.get('doorHandle');
|
|
15
|
+
var counterToptexture = layer === null || layer === void 0 || (_layer$toJS = layer.toJS()) === null || _layer$toJS === void 0 || (_layer$toJS = _layer$toJS.counterTop) === null || _layer$toJS === void 0 ? void 0 : _layer$toJS.uri;
|
|
16
|
+
|
|
17
|
+
// make doorStyles and update the doorStyle payload
|
|
18
|
+
var Max_PH = 9;
|
|
19
|
+
var doorStyles = {
|
|
20
|
+
base: targetDoorStyle.texture,
|
|
21
|
+
counttop: counterToptexture,
|
|
22
|
+
interior: DEFAULT_INTERIOR_URL
|
|
23
|
+
};
|
|
24
|
+
for (var i = 1; i <= Max_PH; i++) {
|
|
25
|
+
doorStyles['base_door_' + i] = targetDoorStyle.texture;
|
|
26
|
+
doorStyles['base_fixed_drawer_door_' + i] = targetDoorStyle.texture;
|
|
27
|
+
doorStyles['base_drawer_' + i] = targetDoorStyle.texture;
|
|
28
|
+
doorStyles['base_drawer_door_' + i] = targetDoorStyle.texture;
|
|
29
|
+
doorStyles['door_handle_' + i] = handleTexture;
|
|
30
|
+
doorStyles['fixed_drawer_door_handle_' + i] = handleTexture;
|
|
31
|
+
doorStyles['drawer_door_handle_' + i] = handleTexture;
|
|
32
|
+
}
|
|
33
|
+
evt.payload.doorStyle = _objectSpread(_objectSpread({}, targetDoorStyle), {}, {
|
|
34
|
+
doorStyles: doorStyles
|
|
35
|
+
});
|
|
36
|
+
return evt;
|
|
37
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
import { DEFAULT_DOOR_HANDLE_TEXTURE_URL, DEFAULT_INTERIOR_URL } from "../../../constants";
|
|
5
|
+
import { isEmpty } from "../../../utils/helper";
|
|
6
|
+
export function mapLoadProjectEvent(evt, state) {
|
|
7
|
+
// preprocessing for loading project
|
|
8
|
+
// this function make doorStyles using item's doorStyle
|
|
9
|
+
if (isEmpty(evt)) return null;
|
|
10
|
+
var layerId = evt.payload.layers['layer-1'].id;
|
|
11
|
+
var layer = evt.payload.layers;
|
|
12
|
+
var itemKeys = Object.keys(layer[layerId].items);
|
|
13
|
+
if (isEmpty(layer)) return evt;
|
|
14
|
+
var handleTexture = !isEmpty(layer.doorHandle) ? layer.doorHandle : DEFAULT_DOOR_HANDLE_TEXTURE_URL;
|
|
15
|
+
var counterToptexture = layer.counterTop;
|
|
16
|
+
// make doorStyles and update the doorStyle payload
|
|
17
|
+
var Max_PH = 9;
|
|
18
|
+
for (var i = 0; i < itemKeys.length; i++) {
|
|
19
|
+
var item = layer[layerId].items[itemKeys[i]];
|
|
20
|
+
var doorStyle = item.doorStyle;
|
|
21
|
+
var doorStyles = {
|
|
22
|
+
base: doorStyle.texture,
|
|
23
|
+
counttop: counterToptexture,
|
|
24
|
+
interior: DEFAULT_INTERIOR_URL
|
|
25
|
+
};
|
|
26
|
+
for (var _i = 1; _i <= Max_PH; _i++) {
|
|
27
|
+
doorStyles['base_door_' + _i] = doorStyle.texture;
|
|
28
|
+
doorStyles['base_fixed_drawer_door_' + _i] = doorStyle.texture;
|
|
29
|
+
doorStyles['base_drawer_' + _i] = doorStyle.texture;
|
|
30
|
+
doorStyles['base_drawer_door_' + _i] = doorStyle.texture;
|
|
31
|
+
doorStyles['door_handle_' + _i] = handleTexture;
|
|
32
|
+
doorStyles['fixed_drawer_door_handle_' + _i] = handleTexture;
|
|
33
|
+
doorStyles['drawer_door_handle_' + _i] = handleTexture;
|
|
34
|
+
}
|
|
35
|
+
item.doorStyle = _objectSpread(_objectSpread({}, doorStyle), {}, {
|
|
36
|
+
doorStyles: doorStyles
|
|
37
|
+
});
|
|
38
|
+
layer[layerId].items[itemKeys[i]] = item;
|
|
39
|
+
}
|
|
40
|
+
return evt;
|
|
41
|
+
}
|
|
42
|
+
export function updateProjectWithCDSList(project, cdsList) {
|
|
43
|
+
//This function updates the project json using CDSList
|
|
44
|
+
if (isEmpty(project) || isEmpty(cdsList)) return project;
|
|
45
|
+
var layerId = project.layers['layer-1'].id;
|
|
46
|
+
var layer = project.layers;
|
|
47
|
+
var itemKeys = Object.keys(layer[layerId].items);
|
|
48
|
+
if (isEmpty(itemKeys)) return project;
|
|
49
|
+
var _loop = function _loop(i) {
|
|
50
|
+
cdsList.forEach(function (cds) {
|
|
51
|
+
var _layer$layerId;
|
|
52
|
+
if (((_layer$layerId = layer[layerId]) === null || _layer$layerId === void 0 || (_layer$layerId = _layer$layerId.items[itemKeys[i]]) === null || _layer$layerId === void 0 ? void 0 : _layer$layerId.itemID) === (cds === null || cds === void 0 ? void 0 : cds.itemID)) {
|
|
53
|
+
layer[layerId].items[itemKeys[i]].doorStyle.cds = cds;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
for (var i = 0; i < itemKeys.length; i++) {
|
|
58
|
+
_loop(i);
|
|
59
|
+
}
|
|
60
|
+
project.layers = layer;
|
|
61
|
+
return project;
|
|
62
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
import * as Holes from "../catalog/holes/export";
|
|
6
|
+
var INCH_TO_CM = 2.54;
|
|
7
|
+
var normalizeKey = function normalizeKey(value) {
|
|
8
|
+
return (value !== null && value !== void 0 ? value : '').toString().toLowerCase().replace(/[^a-z0-9]+/g, '');
|
|
9
|
+
};
|
|
10
|
+
var safeParseJson = function safeParseJson(value) {
|
|
11
|
+
if (!value) return null;
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(value);
|
|
14
|
+
} catch (_unused) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var toCatalogLength = function toCatalogLength(value, prop) {
|
|
19
|
+
var _prop$defaultValue;
|
|
20
|
+
if (value == null) return null;
|
|
21
|
+
var unit = prop === null || prop === void 0 || (_prop$defaultValue = prop.defaultValue) === null || _prop$defaultValue === void 0 ? void 0 : _prop$defaultValue.unit;
|
|
22
|
+
if (unit && unit.toLowerCase() === 'in') return value;
|
|
23
|
+
return value * INCH_TO_CM;
|
|
24
|
+
};
|
|
25
|
+
var overrideLengthProperty = function overrideLengthProperty(prop, value) {
|
|
26
|
+
if (!prop || value == null) return prop;
|
|
27
|
+
var length = toCatalogLength(value, prop);
|
|
28
|
+
if (length == null) return prop;
|
|
29
|
+
return _objectSpread(_objectSpread({}, prop), {}, {
|
|
30
|
+
defaultValue: _objectSpread(_objectSpread({}, prop.defaultValue), {}, {
|
|
31
|
+
length: length
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
var findBaseHoleTemplate = function findBaseHoleTemplate(hole, templates) {
|
|
36
|
+
var target = normalizeKey(hole === null || hole === void 0 ? void 0 : hole.name);
|
|
37
|
+
if (!target) return null;
|
|
38
|
+
return templates.find(function (template) {
|
|
39
|
+
var _template$info, _template$info2;
|
|
40
|
+
var candidates = [template === null || template === void 0 ? void 0 : template.name, template === null || template === void 0 || (_template$info = template.info) === null || _template$info === void 0 ? void 0 : _template$info.title, template === null || template === void 0 || (_template$info2 = template.info) === null || _template$info2 === void 0 ? void 0 : _template$info2.description].map(normalizeKey);
|
|
41
|
+
return candidates.includes(target);
|
|
42
|
+
}) || null;
|
|
43
|
+
};
|
|
44
|
+
var buildHoleElementFromTemplate = function buildHoleElementFromTemplate(hole, base) {
|
|
45
|
+
var _base$info, _base$info2, _base$info3, _base$info4, _base$info5, _base$structure_json;
|
|
46
|
+
if (!hole || !base) return null;
|
|
47
|
+
var nextInfo = _objectSpread(_objectSpread({}, base.info), {}, {
|
|
48
|
+
title: hole.name || ((_base$info = base.info) === null || _base$info === void 0 ? void 0 : _base$info.title),
|
|
49
|
+
description: ((_base$info2 = base.info) === null || _base$info2 === void 0 ? void 0 : _base$info2.description) || hole.name || ((_base$info3 = base.info) === null || _base$info3 === void 0 ? void 0 : _base$info3.title),
|
|
50
|
+
image: hole.menu_thumbnail || ((_base$info4 = base.info) === null || _base$info4 === void 0 ? void 0 : _base$info4.image),
|
|
51
|
+
url: hole.gltf || ((_base$info5 = base.info) === null || _base$info5 === void 0 ? void 0 : _base$info5.url)
|
|
52
|
+
});
|
|
53
|
+
var nextProperties = _objectSpread({}, base.properties);
|
|
54
|
+
if (nextProperties.width) {
|
|
55
|
+
nextProperties.width = overrideLengthProperty(nextProperties.width, hole.width);
|
|
56
|
+
}
|
|
57
|
+
if (nextProperties.height) {
|
|
58
|
+
nextProperties.height = overrideLengthProperty(nextProperties.height, hole.height);
|
|
59
|
+
}
|
|
60
|
+
if (nextProperties.length) {
|
|
61
|
+
nextProperties.length = overrideLengthProperty(nextProperties.length, hole.length);
|
|
62
|
+
}
|
|
63
|
+
var customConfig = safeParseJson(hole.custom_config);
|
|
64
|
+
var customProps = (customConfig === null || customConfig === void 0 ? void 0 : customConfig.properties) || {};
|
|
65
|
+
Object.keys(customProps).forEach(function (key) {
|
|
66
|
+
if (!nextProperties[key]) return;
|
|
67
|
+
nextProperties[key] = overrideLengthProperty(nextProperties[key], customProps[key]);
|
|
68
|
+
});
|
|
69
|
+
return _objectSpread(_objectSpread({}, base), {}, {
|
|
70
|
+
name: hole.name || base.name,
|
|
71
|
+
info: nextInfo,
|
|
72
|
+
properties: nextProperties,
|
|
73
|
+
structure_json: _objectSpread(_objectSpread({}, base.structure_json || {}), {}, {
|
|
74
|
+
hole_id: hole.id || ((_base$structure_json = base.structure_json) === null || _base$structure_json === void 0 ? void 0 : _base$structure_json.hole_id)
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export var buildHoleElements = function buildHoleElements(holes) {
|
|
79
|
+
var categories = {
|
|
80
|
+
Doors: [],
|
|
81
|
+
Windows: []
|
|
82
|
+
};
|
|
83
|
+
var elements = [];
|
|
84
|
+
if (!Array.isArray(holes)) return {
|
|
85
|
+
elements: elements,
|
|
86
|
+
categories: categories
|
|
87
|
+
};
|
|
88
|
+
var templates = Object.values(Holes);
|
|
89
|
+
var usedNames = new Set();
|
|
90
|
+
holes.forEach(function (hole) {
|
|
91
|
+
var _base$info6;
|
|
92
|
+
if (!hole || hole.is_deleted) return;
|
|
93
|
+
var base = findBaseHoleTemplate(hole, templates);
|
|
94
|
+
if (!base) return;
|
|
95
|
+
var element = buildHoleElementFromTemplate(hole, base);
|
|
96
|
+
if (!element || !element.name || usedNames.has(element.name)) return;
|
|
97
|
+
usedNames.add(element.name);
|
|
98
|
+
elements.push(element);
|
|
99
|
+
var typeKey = normalizeKey(hole.type);
|
|
100
|
+
if (typeKey === 'window') {
|
|
101
|
+
categories.Windows.push(element);
|
|
102
|
+
} else if (typeKey === 'door') {
|
|
103
|
+
categories.Doors.push(element);
|
|
104
|
+
} else if ((_base$info6 = base.info) !== null && _base$info6 !== void 0 && (_base$info6 = _base$info6.tag) !== null && _base$info6 !== void 0 && _base$info6.includes('window')) {
|
|
105
|
+
categories.Windows.push(element);
|
|
106
|
+
} else {
|
|
107
|
+
categories.Doors.push(element);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
elements: elements,
|
|
112
|
+
categories: categories
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export var registerDynamicHoles = function registerDynamicHoles(catalog, holePayload) {
|
|
116
|
+
if (!catalog) return;
|
|
117
|
+
var holeElements = (holePayload === null || holePayload === void 0 ? void 0 : holePayload.elements) || [];
|
|
118
|
+
holeElements.forEach(function (element) {
|
|
119
|
+
if (!catalog.hasElement(element.name)) {
|
|
120
|
+
catalog.registerElement(element);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var categories = (holePayload === null || holePayload === void 0 ? void 0 : holePayload.categories) || {};
|
|
124
|
+
Object.entries(categories).forEach(function (_ref) {
|
|
125
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
126
|
+
name = _ref2[0],
|
|
127
|
+
elements = _ref2[1];
|
|
128
|
+
if (!elements.length) return;
|
|
129
|
+
if (!catalog.hasCategory(name)) {
|
|
130
|
+
catalog.registerCategory(name, name, elements);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
elements.forEach(function (element) {
|
|
134
|
+
if (!catalog.categoryHasElement(name, element.name)) {
|
|
135
|
+
catalog.addToCategory(name, element);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
};
|
package/es/models.js
CHANGED
|
@@ -180,6 +180,15 @@ export var Item = /*#__PURE__*/function (_Record7) {
|
|
|
180
180
|
_inherits(Item, _Record7);
|
|
181
181
|
return _createClass(Item);
|
|
182
182
|
}(Record(_objectSpread(_objectSpread({}, sharedAttributes), {}, {
|
|
183
|
+
long_name: '',
|
|
184
|
+
sizeinfo: new Map(),
|
|
185
|
+
description: '',
|
|
186
|
+
base: '',
|
|
187
|
+
shape_svg: '',
|
|
188
|
+
gltf: '',
|
|
189
|
+
is_corner: -1,
|
|
190
|
+
obj_property: new Map(),
|
|
191
|
+
outline: '',
|
|
183
192
|
prototype: 'items',
|
|
184
193
|
x: 0,
|
|
185
194
|
y: 0,
|
|
@@ -336,13 +345,15 @@ export var CatalogElement = /*#__PURE__*/function (_Record1) {
|
|
|
336
345
|
}(Record({
|
|
337
346
|
itemID: -1,
|
|
338
347
|
name: '',
|
|
348
|
+
long_name: '',
|
|
339
349
|
prototype: '',
|
|
340
350
|
info: new Map(),
|
|
341
351
|
properties: new Map(),
|
|
342
352
|
obj: new Map(),
|
|
343
353
|
type: '',
|
|
344
354
|
cds: new Map(),
|
|
345
|
-
structure_json: {}
|
|
355
|
+
structure_json: {},
|
|
356
|
+
gltf: ''
|
|
346
357
|
}, 'CatalogElement'));
|
|
347
358
|
export var Catalog = /*#__PURE__*/function (_Record10) {
|
|
348
359
|
function Catalog() {
|
package/es/plugins/keyboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MODE_IDLE,
|
|
1
|
+
import { MODE_IDLE, MODE_3D_VIEW, MODE_SNAPPING, KEYBOARD_BUTTON_CODE, MODE_IDLE_3D, MODE_DRAWING_ITEM_3D, MODE_DRAWING_ITEM } from "../constants";
|
|
2
2
|
import { rollback, undo, redo, recreate, uncreate, remove, toggleSnap, copyProperties, pasteProperties, shift2doff, shift2don } from "../actions/project-actions";
|
|
3
3
|
export default function keyboard() {
|
|
4
4
|
return function (store, stateExtractor) {
|
package/es/reducers/export.js
CHANGED
|
@@ -8,8 +8,7 @@ import KitchenConfiguratorSceneReducer from "./scene-reducer";
|
|
|
8
8
|
import KitchenConfiguratorVerticesReducer from "./vertices-reducer";
|
|
9
9
|
import KitchenConfiguratorViewer2dReducer from "./viewer2d-reducer";
|
|
10
10
|
import KitchenConfiguratorViewer3dReducer from "./viewer3d-reducer";
|
|
11
|
-
|
|
12
|
-
export { KitchenConfiguratorAreasReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer, KitchenConfiguratorUserReducer };
|
|
11
|
+
export { KitchenConfiguratorAreasReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer };
|
|
13
12
|
export default {
|
|
14
13
|
KitchenConfiguratorAreasReducer: KitchenConfiguratorAreasReducer,
|
|
15
14
|
KitchenConfiguratorHolesReducer: KitchenConfiguratorHolesReducer,
|
|
@@ -20,6 +19,5 @@ export default {
|
|
|
20
19
|
KitchenConfiguratorSceneReducer: KitchenConfiguratorSceneReducer,
|
|
21
20
|
KitchenConfiguratorVerticesReducer: KitchenConfiguratorVerticesReducer,
|
|
22
21
|
KitchenConfiguratorViewer2dReducer: KitchenConfiguratorViewer2dReducer,
|
|
23
|
-
KitchenConfiguratorViewer3dReducer: KitchenConfiguratorViewer3dReducer
|
|
24
|
-
KitchenConfiguratorUserReducer: KitchenConfiguratorUserReducer
|
|
22
|
+
KitchenConfiguratorViewer3dReducer: KitchenConfiguratorViewer3dReducer
|
|
25
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Item, Area } from "../class/export";
|
|
2
2
|
import { history } from "../utils/export";
|
|
3
|
-
import { TOGGLE_LOADING_CABINET, SELECT_TOOL_DRAWING_ITEM, UPDATE_DRAWING_ITEM, END_DRAWING_ITEM, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D,
|
|
3
|
+
import { TOGGLE_LOADING_CABINET, SELECT_TOOL_DRAWING_ITEM, UPDATE_DRAWING_ITEM, END_DRAWING_ITEM, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, UPDATE_ROTATING_ITEM, UPDATE_ROTATING_ITEM_CHANGED, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, REPLACE_SUBMODULE, SELECT_ITEM, ANIMATE_OBJECT, REMOVE_REPLACE_SUBMODULE, ITEM_MOVE_UP, SELECT_TOOL_DRAWING_ITEM_3D, SET_DOOR_STYLE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, UPDATE_ITEM_POSITION, SET_DOOR_HANDLE, SET_WALL_COLOR, END_CREATING_CABINET, UPDATE_POPUP_OPEN, SET_MODELLING, SET_COUNTER_TOP, SET_BACKSPLASH, SET_BACKSPLASH_VISIBLE, SET_APPLIANCE_MATERIAL, DUPLICATE_SELECTED, EDIT_WIDTH, END_LOADING, SET_MOLDING, UPDATE_MOLDING, STORE_DIST_ARRAY, VALIDATE_ITEM_POSTIONS, REPLACE_ITEM
|
|
4
4
|
// SET_MOVE_STATUS,
|
|
5
5
|
// SET_ROTATE_STATUS
|
|
6
6
|
} from "../constants";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { history } from "../utils/export";
|
|
2
|
-
import { LOAD_PROJECT, NEW_PROJECT, OPEN_CATALOG, SELECT_TOOL_EDIT, MODE_IDLE, UNSELECT_ALL, SELECT_ALL, SET_PROPERTIES, SET_ITEMS_ATTRIBUTES, SET_LINES_ATTRIBUTES, SET_HOLES_ATTRIBUTES, REMOVE,
|
|
2
|
+
import { LOAD_PROJECT, NEW_PROJECT, OPEN_CATALOG, SELECT_TOOL_EDIT, MODE_IDLE, UNSELECT_ALL, SELECT_ALL, SET_PROPERTIES, SET_ITEMS_ATTRIBUTES, SET_LINES_ATTRIBUTES, SET_HOLES_ATTRIBUTES, REMOVE, UNDO, REDO, RECREATE, UNCREATE, PROJECT_RE_NAME, ROLLBACK, SET_PROJECT_PROPERTIES, SET_PROJECT_ID, OPEN_PROJECT_CONFIGURATOR, INIT_CATALOG, UPDATE_MOUSE_COORDS, UPDATE_ZOOM_SCALE, TOGGLE_SNAP, CHANGE_CATALOG_PAGE, GO_BACK_TO_CATALOG_PAGE, THROW_ERROR, THROW_WARNING, COPY_PROPERTIES, PASTE_PROPERTIES, PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY, ALTERATE_STATE, SET_MODE, ADD_HORIZONTAL_GUIDE, ADD_VERTICAL_GUIDE, ADD_CIRCULAR_GUIDE, REMOVE_HORIZONTAL_GUIDE, REMOVE_VERTICAL_GUIDE, REMOVE_CIRCULAR_GUIDE, REMOVE_DRAWING_SUPPORT, SET_STATE_PROPERTIES, SHIFT2DON, SHIFT2DOFF, MODE_DRAWING_LINE, SET_IS_HELP, SET_IS_CABINET_DRAWING, ADD_ELEMENT_TO_CATALOG, CREATE_ROOM_WITH_SHAPE } from "../constants";
|
|
3
3
|
import { Project } from "../class/export";
|
|
4
4
|
export default function (state, action) {
|
|
5
5
|
switch (action.type) {
|
package/es/reducers/reducer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PROJECT_ACTIONS, VIEWER2D_ACTIONS, VIEWER3D_ACTIONS, GROUP_ACTIONS, ITEMS_ACTIONS, HOLE_ACTIONS, LINE_ACTIONS, AREA_ACTIONS, SCENE_ACTIONS, VERTEX_ACTIONS
|
|
2
|
-
import { KitchenConfiguratorAreasReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer
|
|
1
|
+
import { PROJECT_ACTIONS, VIEWER2D_ACTIONS, VIEWER3D_ACTIONS, GROUP_ACTIONS, ITEMS_ACTIONS, HOLE_ACTIONS, LINE_ACTIONS, AREA_ACTIONS, SCENE_ACTIONS, VERTEX_ACTIONS } from "../constants";
|
|
2
|
+
import { KitchenConfiguratorAreasReducer, KitchenConfiguratorHolesReducer, KitchenConfiguratorItemsReducer, KitchenConfiguratorLinesReducer, KitchenConfiguratorGroupsReducer, KitchenConfiguratorProjectReducer, KitchenConfiguratorSceneReducer, KitchenConfiguratorVerticesReducer, KitchenConfiguratorViewer2dReducer, KitchenConfiguratorViewer3dReducer } from "./export";
|
|
3
3
|
import { State } from "../models";
|
|
4
4
|
export var initialState = new State();
|
|
5
5
|
export default function appReducer(state, action) {
|
|
@@ -14,6 +14,5 @@ export default function appReducer(state, action) {
|
|
|
14
14
|
if (GROUP_ACTIONS[action.type]) return KitchenConfiguratorGroupsReducer.apply(void 0, arguments);
|
|
15
15
|
if (SCENE_ACTIONS[action.type]) return KitchenConfiguratorSceneReducer.apply(void 0, arguments);
|
|
16
16
|
if (VERTEX_ACTIONS[action.type]) return KitchenConfiguratorVerticesReducer.apply(void 0, arguments);
|
|
17
|
-
if (USER_ACTIONS[action.type]) return KitchenConfiguratorUserReducer.apply(void 0, arguments);
|
|
18
17
|
return state || initialState;
|
|
19
18
|
}
|