kitchen-simulator 1.1.1-test.72 → 1.1.1-test.73
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/@history.js +2 -5
- package/es/AppContext.js +3 -6
- package/es/KitchenConfigurator.js +86 -86
- package/es/KitchenConfiguratorApp.js +134 -128
- package/es/actions/area-actions.js +5 -8
- package/es/actions/export.js +12 -24
- package/es/actions/groups-actions.js +27 -41
- package/es/actions/holes-actions.js +34 -51
- package/es/actions/items-actions.js +94 -141
- package/es/actions/lines-actions.js +21 -32
- package/es/actions/project-actions.js +94 -141
- package/es/actions/scene-actions.js +11 -17
- package/es/actions/vertices-actions.js +7 -11
- package/es/actions/viewer2d-actions.js +21 -32
- package/es/actions/viewer3d-actions.js +9 -14
- package/es/catalog/areas/area/planner-element.js +2 -5
- package/es/catalog/catalog.js +15 -17
- package/es/catalog/factories/area-factory-3d.js +22 -26
- package/es/catalog/factories/area-factory.js +13 -15
- package/es/catalog/factories/export.js +6 -10
- package/es/catalog/factories/wall-factory-3d.js +31 -36
- package/es/catalog/factories/wall-factory.js +21 -26
- package/es/catalog/holes/door-closet/planner-element.js +15 -19
- package/es/catalog/holes/door-double/planner-element.js +15 -19
- package/es/catalog/holes/door-exterior/planner-element.js +16 -20
- package/es/catalog/holes/door-interior/planner-element.js +16 -20
- package/es/catalog/holes/door-panic/planner-element.js +7 -11
- package/es/catalog/holes/door-panic-double/planner-element.js +15 -19
- package/es/catalog/holes/door-sliding/planner-element.js +17 -21
- package/es/catalog/holes/doorway-framed/planner-element.js +11 -15
- package/es/catalog/holes/doorway-frameless/planner-element.js +7 -11
- package/es/catalog/holes/export.js +13 -29
- package/es/catalog/holes/window-clear/planner-element.js +10 -14
- package/es/catalog/holes/window-cross/planner-element.js +10 -14
- package/es/catalog/holes/window-double-hung/planner-element.js +10 -14
- package/es/catalog/holes/window-vertical/planner-element.js +10 -14
- package/es/catalog/lines/wall/planner-element.js +2 -5
- package/es/catalog/molding/molding-dcm/planner-element.js +5 -9
- package/es/catalog/molding/molding-fbm/planner-element.js +5 -9
- package/es/catalog/molding/molding-lrm/planner-element.js +5 -9
- package/es/catalog/properties/export.js +20 -31
- package/es/catalog/properties/property-checkbox.js +28 -29
- package/es/catalog/properties/property-color.js +16 -19
- package/es/catalog/properties/property-enum.js +24 -27
- package/es/catalog/properties/property-hidden.js +9 -12
- package/es/catalog/properties/property-lenght-measure.js +38 -41
- package/es/catalog/properties/property-length-measure.js +36 -39
- package/es/catalog/properties/property-length-measure_hole.js +38 -41
- package/es/catalog/properties/property-number.js +17 -20
- package/es/catalog/properties/property-read-only.js +16 -19
- package/es/catalog/properties/property-string.js +16 -19
- package/es/catalog/properties/property-toggle.js +16 -19
- package/es/catalog/properties/shared-property-style.js +1 -3
- package/es/catalog/utils/FuseUtils.js +12 -13
- package/es/catalog/utils/exporter.js +10 -11
- package/es/catalog/utils/geom-utils.js +13 -24
- package/es/catalog/utils/item-loader.js +86 -92
- package/es/catalog/utils/load-obj.js +20 -24
- package/es/catalog/utils/mtl-loader.js +3 -4
- package/es/catalog/utils/obj-loader.js +3 -4
- package/es/class/FuseUtils.js +12 -13
- package/es/class/area.js +24 -24
- package/es/class/export.js +23 -36
- package/es/class/group.js +53 -55
- package/es/class/guide.js +15 -17
- package/es/class/hole.js +83 -85
- package/es/class/item.js +155 -155
- package/es/class/layer.js +59 -61
- package/es/class/line.js +135 -138
- package/es/class/project.js +93 -94
- package/es/class/vertex.js +29 -31
- package/es/components/content.js +19 -23
- package/es/components/disclaimer/disclaimer.js +10 -13
- package/es/components/export.js +8 -13
- package/es/components/style/button.js +25 -25
- package/es/components/style/cancel-button.js +7 -10
- package/es/components/style/content-container.js +11 -12
- package/es/components/style/content-title.js +13 -15
- package/es/components/style/delete-button.js +8 -12
- package/es/components/style/export.js +30 -46
- package/es/components/style/form-block.js +10 -11
- package/es/components/style/form-color-input.js +7 -10
- package/es/components/style/form-label.js +10 -11
- package/es/components/style/form-number-input.js +45 -43
- package/es/components/style/form-number-input_2.js +41 -39
- package/es/components/style/form-select.js +19 -20
- package/es/components/style/form-slider.js +10 -13
- package/es/components/style/form-submit-button.js +8 -12
- package/es/components/style/form-text-input.js +30 -28
- package/es/components/viewer2d/area.js +17 -20
- package/es/components/viewer2d/export.js +30 -46
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -13
- package/es/components/viewer2d/grids/grids.js +10 -14
- package/es/components/viewer2d/group.js +15 -19
- package/es/components/viewer2d/item.js +61 -65
- package/es/components/viewer2d/layer.js +23 -26
- package/es/components/viewer2d/line.js +101 -106
- package/es/components/viewer2d/ruler.js +22 -25
- package/es/components/viewer2d/rulerDist.js +21 -24
- package/es/components/viewer2d/rulerX.js +46 -44
- package/es/components/viewer2d/rulerY.js +44 -42
- package/es/components/viewer2d/scene.js +34 -34
- package/es/components/viewer2d/snap.js +13 -17
- package/es/components/viewer2d/state.js +18 -22
- package/es/components/viewer2d/utils.js +24 -33
- package/es/components/viewer2d/vertex.js +8 -12
- package/es/components/viewer2d/viewer2d.js +156 -159
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +21 -19
- package/es/components/viewer3d/dcm.js +1 -3
- package/es/components/viewer3d/fbm.js +1 -3
- package/es/components/viewer3d/front3D.js +12 -16
- package/es/components/viewer3d/grid-creator.js +8 -12
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -9
- package/es/components/viewer3d/grids/grid-streak.js +5 -8
- package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -9
- package/es/components/viewer3d/libs/first-person-controls.js +2 -5
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -3
- package/es/components/viewer3d/libs/mtl-loader.js +1 -3
- package/es/components/viewer3d/libs/obj-loader.js +1 -3
- package/es/components/viewer3d/libs/orbit-controls.js +2 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -4
- package/es/components/viewer3d/lrm.js +1 -3
- package/es/components/viewer3d/model.js +1 -3
- package/es/components/viewer3d/pointer-lock-navigation.js +3 -6
- package/es/components/viewer3d/ruler-utils/itemRect.js +18 -21
- package/es/components/viewer3d/ruler-utils/layer3D.js +59 -62
- package/es/components/viewer3d/ruler-utils/ruler3D.js +42 -43
- package/es/components/viewer3d/ruler-utils/scene3D.js +9 -13
- package/es/components/viewer3d/ruler-utils/state3D.js +4 -7
- package/es/components/viewer3d/scene-creator.js +197 -223
- package/es/components/viewer3d/three-memory-cleaner.js +3 -7
- package/es/components/viewer3d/viewer3d-first-person.js +42 -42
- package/es/components/viewer3d/viewer3d.js +200 -198
- package/es/constants.js +349 -354
- package/es/index.js +7 -11
- package/es/models.js +193 -191
- package/es/plugins/SVGLoader.js +48 -49
- package/es/plugins/autosave.js +3 -5
- package/es/plugins/console-debugger.js +6 -7
- package/es/plugins/export.js +8 -13
- package/es/plugins/keyboard.js +29 -31
- package/es/reducers/areas-reducer.js +7 -9
- package/es/reducers/export.js +24 -37
- package/es/reducers/groups-reducer.js +31 -33
- package/es/reducers/holes-reducer.js +43 -45
- package/es/reducers/items-reducer.js +106 -108
- package/es/reducers/lines-reducer.js +28 -30
- package/es/reducers/project-reducer.js +105 -107
- package/es/reducers/reducer.js +16 -19
- package/es/reducers/scene-reducer.js +15 -17
- package/es/reducers/user-reducer.js +5 -7
- package/es/reducers/vertices-reducer.js +11 -13
- package/es/reducers/viewer2d-reducer.js +18 -20
- package/es/reducers/viewer3d-reducer.js +16 -18
- package/es/shared-style.js +10 -12
- package/es/styles/export.js +3 -6
- package/es/translator/en.js +1 -3
- package/es/translator/it.js +1 -3
- package/es/translator/ru.js +1 -3
- package/es/translator/translator.js +13 -15
- package/es/utils/browser.js +2 -5
- package/es/utils/convert-units-lite.js +1 -3
- package/es/utils/email-validator.js +1 -3
- package/es/utils/export.js +15 -29
- package/es/utils/geometry.js +190 -280
- package/es/utils/get-edges-of-subgraphs.js +2 -5
- package/es/utils/graph-cycles.js +8 -7
- package/es/utils/graph-inner-cycles.js +10 -14
- package/es/utils/graph.js +9 -13
- package/es/utils/helper.js +41 -58
- package/es/utils/history.js +8 -11
- package/es/utils/id-broker.js +8 -11
- package/es/utils/logger.js +1 -3
- package/es/utils/math.js +5 -8
- package/es/utils/molding.js +130 -146
- package/es/utils/name-generator.js +7 -9
- package/es/utils/objects-utils.js +7 -14
- package/es/utils/phone-validator.js +1 -3
- package/es/utils/process-black-list.js +5 -6
- package/es/utils/react-if.js +7 -9
- package/es/utils/snap-scene.js +27 -30
- package/es/utils/snap.js +53 -57
- package/es/utils/summarizeCart.js +1 -3
- package/es/utils/threeCSG.es6.js +13 -17
- package/es/version.js +1 -3
- package/package.json +1 -1
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
7
|
-
var _regenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regenerator"));
|
|
8
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
var _reactRedux = require("react-redux");
|
|
14
|
-
var _redux = require("redux");
|
|
15
|
-
var _models = _interopRequireWildcard(require("./models"));
|
|
16
|
-
var Models = _models;
|
|
17
|
-
var _reducer = _interopRequireDefault(require("./reducers/reducer"));
|
|
18
|
-
var _KitchenConfigurator = _interopRequireDefault(require("./KitchenConfigurator"));
|
|
19
|
-
var _AppContext = _interopRequireDefault(require("./AppContext"));
|
|
20
|
-
var _catalog = _interopRequireDefault(require("./catalog/catalog"));
|
|
21
|
-
var _SVGLoader = require("three/addons/loaders/SVGLoader");
|
|
22
|
-
var _helper = require("./utils/helper");
|
|
23
|
-
var _constants = require("./constants");
|
|
24
|
-
var Areas = _interopRequireWildcard(require("./catalog/areas/area/planner-element"));
|
|
25
|
-
var Lines = _interopRequireWildcard(require("./catalog/lines/wall/planner-element"));
|
|
26
|
-
var Holes = _interopRequireWildcard(require("./catalog/holes/export"));
|
|
27
|
-
var _itemLoader = require("./catalog/utils/item-loader");
|
|
28
|
-
var _export2 = require("./plugins/export");
|
|
29
|
-
var _immutable = require("immutable");
|
|
30
|
-
var Sentry = _interopRequireWildcard(require("@sentry/react"));
|
|
31
|
-
var _projectActions = require("./actions/project-actions");
|
|
32
|
-
var _exporter = _interopRequireDefault(require("./catalog/utils/exporter"));
|
|
33
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
34
6
|
var _excluded = ["width", "height", "projectElement", "categoryData", "dataBundle", "configData", "options", "user", "auth", "featureFlags", "sentry", "analytics", "onEvent", "onSave", "onError"];
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
import React, { useEffect } from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
import { Provider } from 'react-redux';
|
|
12
|
+
import { createStore } from 'redux';
|
|
13
|
+
import * as Models from "./models";
|
|
14
|
+
import { State } from "./models";
|
|
15
|
+
import PlannerReducer from "./reducers/reducer";
|
|
16
|
+
import KitchenConfigurator from "./KitchenConfigurator";
|
|
17
|
+
import AppContext from "./AppContext";
|
|
18
|
+
import Catalog from "./catalog/catalog";
|
|
19
|
+
import { SVGLoader } from 'three/addons/loaders/SVGLoader';
|
|
20
|
+
import { isEmpty } from "./utils/helper";
|
|
21
|
+
import { TOE_KICK_MOLDING } from "./constants";
|
|
22
|
+
import * as Areas from "./catalog/areas/area/planner-element";
|
|
23
|
+
import * as Lines from "./catalog/lines/wall/planner-element";
|
|
24
|
+
import * as Holes from "./catalog/holes/export";
|
|
25
|
+
import { render2DItem, render3DApplianceItem, render3DItem, render3DLightingItem } from "./catalog/utils/item-loader";
|
|
26
|
+
import { ConsoleDebugger, Keyboard } from "./plugins/export";
|
|
27
|
+
import { Map } from 'immutable';
|
|
28
|
+
import * as Sentry from '@sentry/react';
|
|
29
|
+
import { loadProject, rename } from "./actions/project-actions";
|
|
30
|
+
import exporter from "./catalog/utils/exporter";
|
|
31
|
+
import * as THREE from 'three';
|
|
35
32
|
if (typeof window !== 'undefined') window.THREE = THREE;
|
|
36
33
|
|
|
37
34
|
/* ============================== component ============================= */
|
|
38
|
-
var MyCatalog = new
|
|
39
|
-
var AppState =
|
|
40
|
-
KitchenConfigurator: new
|
|
35
|
+
var MyCatalog = new Catalog();
|
|
36
|
+
var AppState = Map({
|
|
37
|
+
KitchenConfigurator: new State()
|
|
41
38
|
});
|
|
42
39
|
console.log('Version: 378.45-202509_DIY-364-mbox-crash');
|
|
43
40
|
isProduction && Sentry.init({
|
|
@@ -49,11 +46,11 @@ isProduction && Sentry.init({
|
|
|
49
46
|
var reducer = function reducer(state, action) {
|
|
50
47
|
state = state || AppState;
|
|
51
48
|
state = state.update('KitchenConfigurator', function (plannerState) {
|
|
52
|
-
return (
|
|
49
|
+
return PlannerReducer(plannerState, action);
|
|
53
50
|
});
|
|
54
51
|
return state;
|
|
55
52
|
};
|
|
56
|
-
var store =
|
|
53
|
+
var store = createStore(reducer, null, !isProduction && window.devToolsExtension ? window.devToolsExtension({
|
|
57
54
|
features: {
|
|
58
55
|
pause: true,
|
|
59
56
|
// start/pause recording of dispatched actions
|
|
@@ -79,8 +76,8 @@ var store = (0, _redux.createStore)(reducer, null, !isProduction && window.devTo
|
|
|
79
76
|
}) : function (f) {
|
|
80
77
|
return f;
|
|
81
78
|
});
|
|
82
|
-
var plugins = [
|
|
83
|
-
function KitchenConfiguratorApp(props) {
|
|
79
|
+
var plugins = [Keyboard(), ConsoleDebugger()];
|
|
80
|
+
export default function KitchenConfiguratorApp(props) {
|
|
84
81
|
var width = props.width,
|
|
85
82
|
height = props.height,
|
|
86
83
|
projectElement = props.projectElement,
|
|
@@ -96,7 +93,7 @@ function KitchenConfiguratorApp(props) {
|
|
|
96
93
|
onEvent = props.onEvent,
|
|
97
94
|
onSave = props.onSave,
|
|
98
95
|
onError = props.onError,
|
|
99
|
-
passThrough = (
|
|
96
|
+
passThrough = _objectWithoutProperties(props, _excluded);
|
|
100
97
|
var _ref = categoryData && categoryData.data || {},
|
|
101
98
|
catalogs = _ref.catalogs,
|
|
102
99
|
colorAlias = _ref.colorAlias,
|
|
@@ -110,25 +107,25 @@ function KitchenConfiguratorApp(props) {
|
|
|
110
107
|
furnishing = _ref2$furnishing === void 0 ? [] : _ref2$furnishing,
|
|
111
108
|
_ref2$lighting = _ref2.lighting,
|
|
112
109
|
lighting = _ref2$lighting === void 0 ? [] : _ref2$lighting;
|
|
113
|
-
var _projectElement = (
|
|
110
|
+
var _projectElement = _slicedToArray(projectElement, 1),
|
|
114
111
|
project_data = _projectElement[0].project_data;
|
|
115
112
|
var id = configData.id,
|
|
116
113
|
logoImg = configData.logoImg,
|
|
117
114
|
companyUrl = configData.companyUrl;
|
|
118
|
-
var _React$useState =
|
|
119
|
-
_React$useState2 = (
|
|
115
|
+
var _React$useState = React.useState([]),
|
|
116
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
120
117
|
outlineSVGData = _React$useState2[0],
|
|
121
118
|
setOutlineSVGData = _React$useState2[1];
|
|
122
|
-
var _React$useState3 =
|
|
123
|
-
_React$useState4 = (
|
|
119
|
+
var _React$useState3 = React.useState(false),
|
|
120
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
124
121
|
catalogInitiated = _React$useState4[0],
|
|
125
122
|
setCatalogInitiated = _React$useState4[1];
|
|
126
|
-
|
|
123
|
+
useEffect(function () {
|
|
127
124
|
var initMyCatalog = /*#__PURE__*/function () {
|
|
128
|
-
var _ref3 = (
|
|
125
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
129
126
|
var x, _x, _x2;
|
|
130
|
-
return
|
|
131
|
-
while (1) switch (_context.
|
|
127
|
+
return regeneratorRuntime.wrap(function (_context) {
|
|
128
|
+
while (1) switch (_context.prev = _context.next) {
|
|
132
129
|
case 0:
|
|
133
130
|
for (x in Areas) MyCatalog.registerElement(Areas[x]);
|
|
134
131
|
for (_x in Lines) MyCatalog.registerElement(Lines[_x]);
|
|
@@ -136,7 +133,8 @@ function KitchenConfiguratorApp(props) {
|
|
|
136
133
|
MyCatalog.registerCategory('Windows', 'Windows', [Holes.windowClear, Holes.windowCross, Holes.windowDoubleHung, Holes.windowVertical]);
|
|
137
134
|
MyCatalog.registerCategory('Doors', 'Doors', [Holes.doorInterior, Holes.doorExterior, Holes.doorCloset, Holes.doorSliding, Holes.doorwayFramed, Holes.doorwayFrameless]);
|
|
138
135
|
case 1:
|
|
139
|
-
|
|
136
|
+
case "end":
|
|
137
|
+
return _context.stop();
|
|
140
138
|
}
|
|
141
139
|
}, _callee);
|
|
142
140
|
}));
|
|
@@ -145,10 +143,10 @@ function KitchenConfiguratorApp(props) {
|
|
|
145
143
|
};
|
|
146
144
|
}();
|
|
147
145
|
var loadMoldings = /*#__PURE__*/function () {
|
|
148
|
-
var _ref4 = (
|
|
146
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
149
147
|
var door_color_alias, subgroup_ids, door_color_alias_ids, doorStyleData, molding, toeMoldingData, cabinets, promises;
|
|
150
|
-
return
|
|
151
|
-
while (1) switch (_context2.
|
|
148
|
+
return regeneratorRuntime.wrap(function (_context2) {
|
|
149
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
152
150
|
case 0:
|
|
153
151
|
door_color_alias = [];
|
|
154
152
|
subgroup_ids = catalogs.filter(function (item) {
|
|
@@ -182,7 +180,7 @@ function KitchenConfiguratorApp(props) {
|
|
|
182
180
|
return dc.door_style_id === elem.id && (dc.door_style_name = elem.name);
|
|
183
181
|
});
|
|
184
182
|
});
|
|
185
|
-
dca.alias_installation_type =
|
|
183
|
+
dca.alias_installation_type = isEmpty(dca.alias_installation_type) ? [] : dca.alias_installation_type.split(',').map(function (n) {
|
|
186
184
|
return parseInt(n);
|
|
187
185
|
});
|
|
188
186
|
categoryData.data.doorStyles.items.forEach(function (item) {
|
|
@@ -203,7 +201,7 @@ function KitchenConfiguratorApp(props) {
|
|
|
203
201
|
return molding.push(item);
|
|
204
202
|
});
|
|
205
203
|
}
|
|
206
|
-
if (index.name.includes(
|
|
204
|
+
if (index.name.includes(TOE_KICK_MOLDING)) {
|
|
207
205
|
index.items.forEach(function (item) {
|
|
208
206
|
return toeMoldingData.push(item);
|
|
209
207
|
});
|
|
@@ -214,7 +212,7 @@ function KitchenConfiguratorApp(props) {
|
|
|
214
212
|
return new Promise(function (resolve, reject) {
|
|
215
213
|
var url = child === null || child === void 0 ? void 0 : child.shape_svg;
|
|
216
214
|
if (!url) return resolve();
|
|
217
|
-
var loader = new
|
|
215
|
+
var loader = new SVGLoader();
|
|
218
216
|
loader.load(url, function (data) {
|
|
219
217
|
var _data$xml$viewBox$ani, _data$xml, _data$xml$viewBox$ani2, _data$xml2;
|
|
220
218
|
child.data = {
|
|
@@ -229,7 +227,10 @@ function KitchenConfiguratorApp(props) {
|
|
|
229
227
|
});
|
|
230
228
|
});
|
|
231
229
|
});
|
|
232
|
-
return _context2.
|
|
230
|
+
return _context2.abrupt("return", Promise.all(promises));
|
|
231
|
+
case 1:
|
|
232
|
+
case "end":
|
|
233
|
+
return _context2.stop();
|
|
233
234
|
}
|
|
234
235
|
}, _callee2);
|
|
235
236
|
}));
|
|
@@ -238,53 +239,56 @@ function KitchenConfiguratorApp(props) {
|
|
|
238
239
|
};
|
|
239
240
|
}();
|
|
240
241
|
var loadSVGs = /*#__PURE__*/function () {
|
|
241
|
-
var _ref5 = (
|
|
242
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
242
243
|
var svgLoadPromises, outlineData;
|
|
243
|
-
return
|
|
244
|
-
while (1) switch (_context4.
|
|
244
|
+
return regeneratorRuntime.wrap(function (_context4) {
|
|
245
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
245
246
|
case 0:
|
|
246
247
|
svgLoadPromises = data.map(/*#__PURE__*/function () {
|
|
247
|
-
var _ref6 = (
|
|
248
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(item) {
|
|
248
249
|
var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
|
|
249
|
-
return
|
|
250
|
-
while (1) switch (_context3.
|
|
250
|
+
return regeneratorRuntime.wrap(function (_context3) {
|
|
251
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
251
252
|
case 0:
|
|
252
253
|
if (item.outline) {
|
|
253
|
-
_context3.
|
|
254
|
+
_context3.next = 1;
|
|
254
255
|
break;
|
|
255
256
|
}
|
|
256
|
-
return _context3.
|
|
257
|
+
return _context3.abrupt("return", null);
|
|
257
258
|
case 1:
|
|
258
|
-
_context3.
|
|
259
|
-
_context3.
|
|
259
|
+
_context3.prev = 1;
|
|
260
|
+
_context3.next = 2;
|
|
260
261
|
return fetch(item.outline, {
|
|
261
262
|
cache: 'no-store'
|
|
262
263
|
});
|
|
263
264
|
case 2:
|
|
264
|
-
response = _context3.
|
|
265
|
-
_context3.
|
|
265
|
+
response = _context3.sent;
|
|
266
|
+
_context3.next = 3;
|
|
266
267
|
return response.text();
|
|
267
268
|
case 3:
|
|
268
|
-
svgText = _context3.
|
|
269
|
-
loader = new
|
|
269
|
+
svgText = _context3.sent;
|
|
270
|
+
loader = new SVGLoader();
|
|
270
271
|
parsed = loader.parse(svgText);
|
|
271
|
-
if (!
|
|
272
|
-
_context3.
|
|
272
|
+
if (!isEmpty(parsed.paths)) {
|
|
273
|
+
_context3.next = 4;
|
|
273
274
|
break;
|
|
274
275
|
}
|
|
275
|
-
return _context3.
|
|
276
|
+
return _context3.abrupt("return", null);
|
|
276
277
|
case 4:
|
|
277
|
-
return _context3.
|
|
278
|
+
return _context3.abrupt("return", {
|
|
278
279
|
paths: parsed.paths,
|
|
279
280
|
svgWidth: parseFloat(parsed.xml.getAttribute('width')) || ((_parsed$xml$viewBox = parsed.xml.viewBox) === null || _parsed$xml$viewBox === void 0 || (_parsed$xml$viewBox = _parsed$xml$viewBox.animVal) === null || _parsed$xml$viewBox === void 0 ? void 0 : _parsed$xml$viewBox.width) || 0,
|
|
280
281
|
svgHeight: parseFloat(parsed.xml.getAttribute('height')) || ((_parsed$xml$viewBox2 = parsed.xml.viewBox) === null || _parsed$xml$viewBox2 === void 0 || (_parsed$xml$viewBox2 = _parsed$xml$viewBox2.animVal) === null || _parsed$xml$viewBox2 === void 0 ? void 0 : _parsed$xml$viewBox2.height) || 0,
|
|
281
282
|
reverse: !parseFloat(parsed.xml.getAttribute('height'))
|
|
282
283
|
});
|
|
283
284
|
case 5:
|
|
284
|
-
_context3.
|
|
285
|
-
_t = _context3
|
|
285
|
+
_context3.prev = 5;
|
|
286
|
+
_t = _context3["catch"](1);
|
|
286
287
|
console.error('Failed to load SVG:', item.outline, _t);
|
|
287
|
-
return _context3.
|
|
288
|
+
return _context3.abrupt("return", null);
|
|
289
|
+
case 6:
|
|
290
|
+
case "end":
|
|
291
|
+
return _context3.stop();
|
|
288
292
|
}
|
|
289
293
|
}, _callee3, null, [[1, 5]]);
|
|
290
294
|
}));
|
|
@@ -292,13 +296,14 @@ function KitchenConfiguratorApp(props) {
|
|
|
292
296
|
return _ref6.apply(this, arguments);
|
|
293
297
|
};
|
|
294
298
|
}());
|
|
295
|
-
_context4.
|
|
299
|
+
_context4.next = 1;
|
|
296
300
|
return Promise.all(svgLoadPromises);
|
|
297
301
|
case 1:
|
|
298
|
-
outlineData = _context4.
|
|
302
|
+
outlineData = _context4.sent;
|
|
299
303
|
setOutlineSVGData(outlineData);
|
|
300
304
|
case 2:
|
|
301
|
-
|
|
305
|
+
case "end":
|
|
306
|
+
return _context4.stop();
|
|
302
307
|
}
|
|
303
308
|
}, _callee4);
|
|
304
309
|
}));
|
|
@@ -307,23 +312,24 @@ function KitchenConfiguratorApp(props) {
|
|
|
307
312
|
};
|
|
308
313
|
}();
|
|
309
314
|
var initCatalog = /*#__PURE__*/function () {
|
|
310
|
-
var _ref7 = (
|
|
311
|
-
return
|
|
312
|
-
while (1) switch (_context5.
|
|
315
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
316
|
+
return regeneratorRuntime.wrap(function (_context5) {
|
|
317
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
313
318
|
case 0:
|
|
314
319
|
setCatalogInitiated(false);
|
|
315
|
-
_context5.
|
|
320
|
+
_context5.next = 1;
|
|
316
321
|
return initMyCatalog();
|
|
317
322
|
case 1:
|
|
318
|
-
_context5.
|
|
323
|
+
_context5.next = 2;
|
|
319
324
|
return loadMoldings();
|
|
320
325
|
case 2:
|
|
321
|
-
_context5.
|
|
326
|
+
_context5.next = 3;
|
|
322
327
|
return loadSVGs();
|
|
323
328
|
case 3:
|
|
324
329
|
setCatalogInitiated(true);
|
|
325
330
|
case 4:
|
|
326
|
-
|
|
331
|
+
case "end":
|
|
332
|
+
return _context5.stop();
|
|
327
333
|
}
|
|
328
334
|
}, _callee5);
|
|
329
335
|
}));
|
|
@@ -336,43 +342,43 @@ function KitchenConfiguratorApp(props) {
|
|
|
336
342
|
}, [categoryData, data, id, catalogs, colorAlias, subgroups]);
|
|
337
343
|
|
|
338
344
|
// Register items once SVGs are loaded
|
|
339
|
-
|
|
345
|
+
useEffect(function () {
|
|
340
346
|
if (!outlineSVGData.length) return;
|
|
341
347
|
var Item = [];
|
|
342
348
|
data.forEach(function (obj, index) {
|
|
343
|
-
Item.push((
|
|
349
|
+
Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
|
|
344
350
|
type: 'cabinet',
|
|
345
351
|
outlineSVGData: outlineSVGData[index],
|
|
346
|
-
render2DItem:
|
|
347
|
-
render3DItem:
|
|
352
|
+
render2DItem: render2DItem,
|
|
353
|
+
render3DItem: render3DItem
|
|
348
354
|
})));
|
|
349
355
|
});
|
|
350
356
|
appliances.forEach(function (obj) {
|
|
351
|
-
Item.push((
|
|
352
|
-
render2DItem:
|
|
353
|
-
render3DItem:
|
|
357
|
+
Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
|
|
358
|
+
render2DItem: render2DItem,
|
|
359
|
+
render3DItem: render3DApplianceItem,
|
|
354
360
|
type: 'appliance'
|
|
355
361
|
})));
|
|
356
362
|
});
|
|
357
363
|
lighting.forEach(function (obj) {
|
|
358
|
-
Item.push((
|
|
364
|
+
Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
|
|
359
365
|
type: 'lighting',
|
|
360
|
-
render2DItem:
|
|
361
|
-
render3DItem:
|
|
366
|
+
render2DItem: render2DItem,
|
|
367
|
+
render3DItem: render3DLightingItem
|
|
362
368
|
})));
|
|
363
369
|
});
|
|
364
370
|
furnishing.forEach(function (obj) {
|
|
365
|
-
Item.push((
|
|
371
|
+
Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
|
|
366
372
|
type: 'furnishing',
|
|
367
|
-
render2DItem:
|
|
368
|
-
render3DItem:
|
|
373
|
+
render2DItem: render2DItem,
|
|
374
|
+
render3DItem: render3DApplianceItem
|
|
369
375
|
})));
|
|
370
376
|
});
|
|
371
377
|
for (var x in Item) MyCatalog.registerElement(Item[x]);
|
|
372
378
|
}, [outlineSVGData, data, appliances, furnishing, lighting]);
|
|
373
379
|
|
|
374
380
|
// Forward updates/save moments to host
|
|
375
|
-
|
|
381
|
+
useEffect(function () {
|
|
376
382
|
if (!onEvent && !onSave && !onError) return;
|
|
377
383
|
var unsubscribe = store.subscribe(function () {
|
|
378
384
|
var _state$get, _state$get$get, _state$get$get$get;
|
|
@@ -407,11 +413,11 @@ function KitchenConfiguratorApp(props) {
|
|
|
407
413
|
return unsubscribe();
|
|
408
414
|
};
|
|
409
415
|
}, [store, onEvent, onSave, onError]);
|
|
410
|
-
|
|
416
|
+
useEffect(function () {
|
|
411
417
|
if (projectElement.length === 0) return;
|
|
412
418
|
if (!catalogInitiated) return;
|
|
413
419
|
sessionStorage.setItem('projectTitle', projectElement[0].title);
|
|
414
|
-
store.dispatch(
|
|
420
|
+
store.dispatch(rename(projectElement[0].title));
|
|
415
421
|
sessionStorage.setItem('projectId', projectElement[0].id);
|
|
416
422
|
sessionStorage.setItem('email', projectElement[0].email);
|
|
417
423
|
sessionStorage.setItem('firstName', projectElement[0].firstName);
|
|
@@ -420,11 +426,11 @@ function KitchenConfiguratorApp(props) {
|
|
|
420
426
|
var jsonData;
|
|
421
427
|
jsonData = JSON.parse(projectElement[0].project_data);
|
|
422
428
|
jsonData.isLoadingCabinet = false;
|
|
423
|
-
store.dispatch(
|
|
429
|
+
store.dispatch(loadProject(jsonData, categoryData));
|
|
424
430
|
}, [project_data, catalogInitiated]);
|
|
425
|
-
return /*#__PURE__*/
|
|
431
|
+
return /*#__PURE__*/React.createElement(AppContext.Provider, null, /*#__PURE__*/React.createElement(Provider, {
|
|
426
432
|
store: store
|
|
427
|
-
}, /*#__PURE__*/
|
|
433
|
+
}, /*#__PURE__*/React.createElement(KitchenConfigurator, _extends({
|
|
428
434
|
catalog: MyCatalog,
|
|
429
435
|
width: width,
|
|
430
436
|
height: height,
|
|
@@ -446,25 +452,25 @@ function KitchenConfiguratorApp(props) {
|
|
|
446
452
|
/* ============================== prop types ============================== */
|
|
447
453
|
|
|
448
454
|
KitchenConfiguratorApp.propTypes = {
|
|
449
|
-
width:
|
|
450
|
-
height:
|
|
451
|
-
projectElement:
|
|
452
|
-
categoryData:
|
|
453
|
-
dataBundle:
|
|
454
|
-
configData:
|
|
455
|
-
catalog:
|
|
456
|
-
logoImg:
|
|
457
|
-
companyUrl:
|
|
458
|
-
options:
|
|
459
|
-
user:
|
|
460
|
-
auth:
|
|
461
|
-
featureFlags:
|
|
462
|
-
sentry:
|
|
463
|
-
dsn:
|
|
464
|
-
environment:
|
|
455
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
456
|
+
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
457
|
+
projectElement: PropTypes.arrayOf(PropTypes.object),
|
|
458
|
+
categoryData: PropTypes.any,
|
|
459
|
+
dataBundle: PropTypes.any,
|
|
460
|
+
configData: PropTypes.any,
|
|
461
|
+
catalog: PropTypes.oneOfType([PropTypes.object, PropTypes.instanceOf(Models.Catalog)]),
|
|
462
|
+
logoImg: PropTypes.any,
|
|
463
|
+
companyUrl: PropTypes.string,
|
|
464
|
+
options: PropTypes.object,
|
|
465
|
+
user: PropTypes.object,
|
|
466
|
+
auth: PropTypes.object,
|
|
467
|
+
featureFlags: PropTypes.object,
|
|
468
|
+
sentry: PropTypes.shape({
|
|
469
|
+
dsn: PropTypes.string,
|
|
470
|
+
environment: PropTypes.string
|
|
465
471
|
}),
|
|
466
|
-
onEvent:
|
|
467
|
-
onSave:
|
|
468
|
-
onError:
|
|
469
|
-
store:
|
|
472
|
+
onEvent: PropTypes.func,
|
|
473
|
+
onSave: PropTypes.func,
|
|
474
|
+
onError: PropTypes.func,
|
|
475
|
+
store: PropTypes.object
|
|
470
476
|
};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.setFloorStyles = setFloorStyles;
|
|
4
|
-
var _constants = require("../constants");
|
|
5
|
-
function selectArea(layerID, areaID) {
|
|
1
|
+
import { SELECT_AREA, SET_FLOOR_STYLES } from "../constants";
|
|
2
|
+
export function selectArea(layerID, areaID) {
|
|
6
3
|
return {
|
|
7
|
-
type:
|
|
4
|
+
type: SELECT_AREA,
|
|
8
5
|
layerID: layerID,
|
|
9
6
|
areaID: areaID
|
|
10
7
|
};
|
|
11
8
|
}
|
|
12
|
-
function setFloorStyles(texture) {
|
|
9
|
+
export function setFloorStyles(texture) {
|
|
13
10
|
return {
|
|
14
|
-
type:
|
|
11
|
+
type: SET_FLOOR_STYLES,
|
|
15
12
|
texture: texture
|
|
16
13
|
};
|
|
17
14
|
}
|
package/es/actions/export.js
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.holesActions = holesActions;
|
|
14
|
-
var sceneActions = _interopRequireWildcard(require("./scene-actions"));
|
|
15
|
-
exports.sceneActions = sceneActions;
|
|
16
|
-
var verticesActions = _interopRequireWildcard(require("./vertices-actions"));
|
|
17
|
-
exports.verticesActions = verticesActions;
|
|
18
|
-
var itemsActions = _interopRequireWildcard(require("./items-actions"));
|
|
19
|
-
exports.itemsActions = itemsActions;
|
|
20
|
-
var areaActions = _interopRequireWildcard(require("./area-actions"));
|
|
21
|
-
exports.areaActions = areaActions;
|
|
22
|
-
var groupsActions = _interopRequireWildcard(require("./groups-actions"));
|
|
23
|
-
exports.groupsActions = groupsActions;
|
|
24
|
-
var _default = exports["default"] = {
|
|
1
|
+
import * as projectActions from "./project-actions";
|
|
2
|
+
import * as viewer2DActions from "./viewer2d-actions";
|
|
3
|
+
import * as viewer3DActions from "./viewer3d-actions";
|
|
4
|
+
import * as linesActions from "./lines-actions";
|
|
5
|
+
import * as holesActions from "./holes-actions";
|
|
6
|
+
import * as sceneActions from "./scene-actions";
|
|
7
|
+
import * as verticesActions from "./vertices-actions";
|
|
8
|
+
import * as itemsActions from "./items-actions";
|
|
9
|
+
import * as areaActions from "./area-actions";
|
|
10
|
+
import * as groupsActions from "./groups-actions";
|
|
11
|
+
export { projectActions, viewer2DActions, viewer3DActions, linesActions, holesActions, sceneActions, verticesActions, itemsActions, areaActions, groupsActions };
|
|
12
|
+
export default {
|
|
25
13
|
projectActions: projectActions,
|
|
26
14
|
viewer2DActions: viewer2DActions,
|
|
27
15
|
viewer3DActions: viewer3DActions,
|