kitchen-simulator 1.0.0-alin.9 → 1.0.0-clark.100

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.
Files changed (85) hide show
  1. package/es/LiteKitchenConfigurator.js +17 -175
  2. package/es/LiteRenderer.js +29 -114
  3. package/es/actions/items-actions.js +11 -6
  4. package/es/actions/project-actions.js +2 -3
  5. package/es/assets/img/svg/logo.svg +11 -0
  6. package/es/assets/img/svg/logo_with_text.svg +25 -0
  7. package/es/catalog/areas/area/planner-element.js +10 -5
  8. package/es/catalog/catalog.js +1 -4
  9. package/es/catalog/factories/wall-factory.js +8 -8
  10. package/es/catalog/lines/wall/planner-element.js +18 -9
  11. package/es/catalog/utils/exporter.js +5 -1
  12. package/es/catalog/utils/item-loader.js +112 -31
  13. package/es/catalog/utils/mtl-loader.js +2 -2
  14. package/es/catalog/utils/obj-loader.js +2 -2
  15. package/es/class/item.js +111 -145
  16. package/es/class/line.js +27 -12
  17. package/es/class/project.js +9 -23
  18. package/es/components/content.js +10 -5
  19. package/es/components/viewer2d/grids/grid-streak.js +1 -1
  20. package/es/components/viewer2d/item.js +20 -81
  21. package/es/components/viewer2d/layer.js +1 -1
  22. package/es/components/viewer2d/line.js +334 -259
  23. package/es/components/viewer2d/ruler.js +15 -35
  24. package/es/components/viewer2d/rulerDist.js +18 -32
  25. package/es/components/viewer2d/viewer2d.js +123 -95
  26. package/es/components/viewer3d/libs/mtl-loader.js +2 -2
  27. package/es/components/viewer3d/libs/obj-loader.js +2 -2
  28. package/es/components/viewer3d/libs/orbit-controls.js +3 -4
  29. package/es/components/viewer3d/libs/pointer-lock-controls.js +6 -7
  30. package/es/components/viewer3d/viewer3d.js +91 -70
  31. package/es/constants.js +38 -3
  32. package/es/devLiteRenderer.js +165 -10
  33. package/es/index.js +52 -3
  34. package/es/models.js +7 -5
  35. package/es/reducers/items-reducer.js +8 -4
  36. package/es/reducers/project-reducer.js +1 -1
  37. package/es/shared-style.js +4 -4
  38. package/es/utils/get-edges-of-subgraphs.js +1 -1
  39. package/es/utils/graph-cycles.js +1 -1
  40. package/es/utils/graph.js +1 -1
  41. package/es/utils/helper.js +1 -1
  42. package/es/utils/isolate-event-handler.js +567 -46
  43. package/lib/LiteKitchenConfigurator.js +18 -176
  44. package/lib/LiteRenderer.js +29 -114
  45. package/lib/actions/items-actions.js +11 -5
  46. package/lib/actions/project-actions.js +2 -3
  47. package/lib/assets/img/svg/logo.svg +11 -0
  48. package/lib/assets/img/svg/logo_with_text.svg +25 -0
  49. package/lib/catalog/areas/area/planner-element.js +11 -5
  50. package/lib/catalog/catalog.js +1 -4
  51. package/lib/catalog/factories/wall-factory.js +8 -8
  52. package/lib/catalog/lines/wall/planner-element.js +19 -9
  53. package/lib/catalog/utils/exporter.js +5 -1
  54. package/lib/catalog/utils/item-loader.js +111 -31
  55. package/lib/catalog/utils/mtl-loader.js +9 -2
  56. package/lib/catalog/utils/obj-loader.js +10 -2
  57. package/lib/class/item.js +111 -145
  58. package/lib/class/line.js +27 -12
  59. package/lib/class/project.js +9 -23
  60. package/lib/components/content.js +10 -5
  61. package/lib/components/viewer2d/grids/grid-streak.js +1 -1
  62. package/lib/components/viewer2d/item.js +20 -81
  63. package/lib/components/viewer2d/layer.js +1 -1
  64. package/lib/components/viewer2d/line.js +334 -258
  65. package/lib/components/viewer2d/ruler.js +15 -35
  66. package/lib/components/viewer2d/rulerDist.js +18 -32
  67. package/lib/components/viewer2d/viewer2d.js +121 -93
  68. package/lib/components/viewer3d/libs/mtl-loader.js +9 -2
  69. package/lib/components/viewer3d/libs/obj-loader.js +9 -2
  70. package/lib/components/viewer3d/libs/orbit-controls.js +11 -5
  71. package/lib/components/viewer3d/libs/pointer-lock-controls.js +13 -7
  72. package/lib/components/viewer3d/viewer3d.js +90 -69
  73. package/lib/constants.js +42 -7
  74. package/lib/devLiteRenderer.js +164 -9
  75. package/lib/index.js +52 -3
  76. package/lib/models.js +7 -5
  77. package/lib/reducers/items-reducer.js +7 -3
  78. package/lib/reducers/project-reducer.js +1 -1
  79. package/lib/shared-style.js +4 -4
  80. package/lib/utils/get-edges-of-subgraphs.js +6 -1
  81. package/lib/utils/graph-cycles.js +7 -8
  82. package/lib/utils/graph.js +6 -1
  83. package/lib/utils/helper.js +2 -2
  84. package/lib/utils/isolate-event-handler.js +567 -45
  85. package/package.json +5 -9
@@ -1,15 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
3
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
5
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
6
6
  import _createClass from "@babel/runtime/helpers/esm/createClass";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
9
9
  import _inherits from "@babel/runtime/helpers/esm/inherits";
10
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
11
10
  var _excluded = ["width", "height", "state", "stateExtractor"];
12
- import _regeneratorRuntime from "@babel/runtime/regenerator";
13
11
  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; }
14
12
  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; }
15
13
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -42,23 +40,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
42
40
  _this = _callSuper(this, LiteKitchenConfigurator, [props]);
43
41
 
44
42
  // utm tracking
45
- _defineProperty(_this, "handleBeforeUnload", function (e) {
46
- var areas = _this.props.stateExtractor(_this.props.state).getIn(['scene', 'layers', _this.props.stateExtractor(_this.props.state).scene.selectedLayer, 'areas']);
47
- if (!_this.state.isSaved && areas.size > 0) {
48
- setTimeout(function () {
49
- _this.setState({
50
- savePromptVisible: true,
51
- isLeaving: true
52
- });
53
- }, 500);
54
- _this.saveProjectToStorage();
55
-
56
- // This line is required to trigger the browser confirmation dialog
57
- e.preventDefault();
58
- e.returnValue = '';
59
- return '';
60
- }
61
- });
62
43
  var utmDetailParams = new URLSearchParams(_this.props.location && _this.props.location.search);
63
44
  var utmStrEncoded = utmDetailParams.get('details');
64
45
  var utmRequestData = null;
@@ -331,139 +312,20 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
331
312
  catalog: this.props.catalog
332
313
  });
333
314
  }
334
- }, {
335
- key: "saveProjectToStorage",
336
- value: function saveProjectToStorage() {
337
- var _this$props = this.props,
338
- state = _this$props.state,
339
- stateExtractor = _this$props.stateExtractor;
340
- var extractedState = stateExtractor(state);
341
- var projectData = JSON.stringify(extractedState.get('scene').toJS());
342
- sessionStorage.setItem(window.location.href, projectData);
343
- }
344
315
  }, {
345
316
  key: "componentDidMount",
346
317
  value: function componentDidMount() {
347
- var _this3 = this;
348
- window.addEventListener('beforeunload', this.handleBeforeUnload);
349
318
  console.log('context =>', this.context);
350
319
  window.forRedo = [];
351
320
  var store = this.context.store;
352
- var _this$props2 = this.props,
353
- projectActions = _this$props2.projectActions,
354
- catalog = _this$props2.catalog,
355
- stateExtractor = _this$props2.stateExtractor,
356
- state = _this$props2.state,
357
- plugins = _this$props2.plugins;
358
- projectActions.initCatalog(catalog);
359
- var match = this.props.match;
360
- if (sessionStorage.getItem(window.location.href)) {
361
- var jsonData = sessionStorage.getItem(window.location.href);
362
- projectActions.loadProject(JSON.parse(jsonData), this.props.categoryData);
363
- sessionStorage.removeItem(window.location.href);
364
- return;
365
- }
321
+ var _this$props = this.props,
322
+ stateExtractor = _this$props.stateExtractor,
323
+ plugins = _this$props.plugins;
366
324
  var newplugins = _toConsumableArray(plugins);
367
325
  newplugins.forEach(function (newplugin) {
368
326
  return newplugin(store, stateExtractor);
369
327
  });
370
- if (match && match.params.pid === undefined) {
371
- projectActions.newProject();
372
- sessionStorage.setItem('projectTitle', 'Untitled');
373
- projectActions.rename('Untitled');
374
- sessionStorage.removeItem('projectId');
375
- sessionStorage.removeItem('email');
376
- sessionStorage.removeItem('firstName');
377
- sessionStorage.removeItem('lastName');
378
- sessionStorage.removeItem('usedObjects');
379
- return;
380
- }
381
- if (match && match.params.pid !== undefined) {
382
- if (match.params.pid === 'new') {
383
- projectActions.newProject();
384
- sessionStorage.setItem('projectTitle', 'Untitled');
385
- projectActions.rename('Untitled');
386
- sessionStorage.removeItem('projectId');
387
- sessionStorage.removeItem('email');
388
- sessionStorage.removeItem('firstName');
389
- sessionStorage.removeItem('lastName');
390
- sessionStorage.removeItem('usedObjects');
391
- } else {
392
- axios.post("".concat(constants.API_SERVER_URL, "/api/project/loadPidProject"), {
393
- pid: match.params.pid,
394
- visualizerName: sessionStorage.getItem('visualizerName')
395
- }).then(/*#__PURE__*/function () {
396
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
397
- var projectElement, jsonData, _t;
398
- return _regeneratorRuntime.wrap(function (_context) {
399
- while (1) switch (_context.prev = _context.next) {
400
- case 0:
401
- projectElement = response.data.projectElement;
402
- if (!(projectElement.length === 0)) {
403
- _context.next = 1;
404
- break;
405
- }
406
- return _context.abrupt("return");
407
- case 1:
408
- sessionStorage.setItem('projectTitle', projectElement[0].title);
409
- projectActions.rename(projectElement[0].title);
410
- sessionStorage.setItem('projectId', projectElement[0].id);
411
- sessionStorage.setItem('email', projectElement[0].email);
412
- sessionStorage.setItem('firstName', projectElement[0].firstName);
413
- sessionStorage.setItem('lastName', projectElement[0].lastName);
414
- sessionStorage.setItem('phone', projectElement[0].phone);
415
- if (!projectElement[0].project_data) {
416
- _context.next = 2;
417
- break;
418
- }
419
- jsonData = JSON.parse(projectElement[0].project_data);
420
- _context.next = 5;
421
- break;
422
- case 2:
423
- _context.prev = 2;
424
- _context.next = 3;
425
- return axios.post("".concat(constants.API_SERVER_URL, "/api/project/loadPidData"), {
426
- pid: match.params.pid
427
- }).data.data;
428
- case 3:
429
- jsonData = _context.sent;
430
- _context.next = 5;
431
- break;
432
- case 4:
433
- _context.prev = 4;
434
- _t = _context["catch"](2);
435
- _this3.setState({
436
- isSnackBarOpen: true,
437
- snackBarMessage: _t
438
- });
439
- case 5:
440
- jsonData.isLoadingCabinet = false;
441
- projectActions.loadProject(jsonData, _this3.props.categoryData);
442
- case 6:
443
- case "end":
444
- return _context.stop();
445
- }
446
- }, _callee, null, [[2, 4]]);
447
- }));
448
- return function (_x) {
449
- return _ref.apply(this, arguments);
450
- };
451
- }());
452
- }
453
- sessionStorage.removeItem('user_type');
454
- sessionStorage.removeItem('project_type');
455
- sessionStorage.removeItem('project_timeline');
456
- }
457
328
  }
458
- }, {
459
- key: "componentWillUnmount",
460
- value: function componentWillUnmount() {
461
- window.addEventListener('beforeunload', this.handleBeforeUnload);
462
- window.onbeforeunload = null;
463
- }
464
- }, {
465
- key: "componentWillMount",
466
- value: function componentWillMount() {}
467
329
  }, {
468
330
  key: "componentWillReceiveProps",
469
331
  value: function componentWillReceiveProps(nextProps) {
@@ -471,11 +333,12 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
471
333
  state = nextProps.state,
472
334
  projectActions = nextProps.projectActions,
473
335
  catalog = nextProps.catalog,
474
- externalEvent = nextProps.externalEvent;
336
+ externalEvent = nextProps.externalEvent,
337
+ onInternalEvent = nextProps.onInternalEvent;
475
338
 
476
339
  // handle external events
477
340
  if (this.props.externalEvent !== externalEvent) {
478
- handleExternalEvent(externalEvent, this.props);
341
+ handleExternalEvent(nextProps);
479
342
  }
480
343
  var plannerState = stateExtractor(state);
481
344
  var catalogReady = plannerState.getIn(['catalog', 'ready']);
@@ -494,12 +357,12 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
494
357
  }, {
495
358
  key: "render",
496
359
  value: function render() {
497
- var _this$props3 = this.props,
498
- width = _this$props3.width,
499
- height = _this$props3.height,
500
- state = _this$props3.state,
501
- stateExtractor = _this$props3.stateExtractor,
502
- props = _objectWithoutProperties(_this$props3, _excluded);
360
+ var _this$props2 = this.props,
361
+ width = _this$props2.width,
362
+ height = _this$props2.height,
363
+ state = _this$props2.state,
364
+ stateExtractor = _this$props2.stateExtractor,
365
+ props = _objectWithoutProperties(_this$props2, _excluded);
503
366
  var _this$state = this.state,
504
367
  savePopupVisible = _this$state.savePopupVisible,
505
368
  quotePopupVisible = _this$state.quotePopupVisible,
@@ -507,8 +370,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
507
370
  signOpen = _this$state.signOpen,
508
371
  myProjectsOpen = _this$state.myProjectsOpen;
509
372
  var contentW = width - toolbarW;
510
- var categoryData = this.props.categoryData;
511
- // console.log(categoryData);
512
373
  // let contentW = width - toolbarW - sidebarW;
513
374
  // let toolbarH = height - footerBarH;
514
375
  // let contentH = height - footerBarH;
@@ -519,27 +380,6 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
519
380
  var headerW = width;
520
381
  var headerH = 60;
521
382
  var extractedState = stateExtractor(state);
522
- var doorStyle = extractedState.get('doorStyle');
523
- if (extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']) !== undefined && extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']) !== null) {
524
- var extractedStateData = extractedState.getIn(['scene', 'layers', extractedState.scene.selectedLayer, 'doorStyle']);
525
- var doorIdAvailable = false;
526
- if (this.props.categoryData.doorStyles && this.props.categoryData.doorStyles.items) {
527
- this.props.categoryData.doorStyles.items.find(function (category) {
528
- doorIdAvailable = category.items.find(function (style) {
529
- var item = style.items.find(function (it) {
530
- return it.id === extractedStateData.id;
531
- });
532
- if (item) {
533
- colorItem = item;
534
- return true;
535
- } else {
536
- return false;
537
- }
538
- });
539
- });
540
- }
541
- if (doorIdAvailable) doorStyle = extractedStateData;
542
- }
543
383
  var firstVisit = this.state.wizardStepOpend && this.isProjectEmpty(extractedState.scene);
544
384
  var allVisible = firstVisit || signOpen || myProjectsOpen;
545
385
  var _scene = extractedState.getIn(['scene']);
@@ -582,7 +422,8 @@ var LiteKitchenConfigurator = /*#__PURE__*/function (_Component) {
582
422
  }, props, {
583
423
  onWheel: function onWheel(event) {
584
424
  return event.preventDefault();
585
- }
425
+ },
426
+ onInternalEvent: this.props.onInternalEvent
586
427
  }))));
587
428
  }
588
429
  }]);
@@ -601,7 +442,8 @@ LiteKitchenConfigurator.propTypes = {
601
442
  footerbarComponents: PropTypes.array,
602
443
  customContents: PropTypes.object,
603
444
  softwareSignature: PropTypes.string,
604
- configData: PropTypes.object
445
+ configData: PropTypes.object,
446
+ onInternalEvent: PropTypes.func
605
447
  };
606
448
  LiteKitchenConfigurator.contextTypes = {
607
449
  store: PropTypes.object.isRequired
@@ -8,7 +8,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
8
8
  import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
9
9
  import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
10
10
  import _inherits from "@babel/runtime/helpers/esm/inherits";
11
- var _excluded = ["width", "height", "projectElement", "categoryData", "dataBundle", "configData", "options", "user", "auth", "featureFlags", "sentry", "analytics", "externalEvent", "onError"];
11
+ var _excluded = ["width", "height", "projectElement", "dataBundle", "configData", "options", "user", "auth", "featureFlags", "sentry", "analytics", "externalEvent", "onInternalEvent", "onError"];
12
12
  import _regeneratorRuntime from "@babel/runtime/regenerator";
13
13
  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; }
14
14
  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; }
@@ -33,7 +33,6 @@ import { render2DItem, render3DApplianceItem, render3DItem, render3DLightingItem
33
33
  import { ConsoleDebugger, Keyboard } from "./plugins/export";
34
34
  import { Map } from 'immutable';
35
35
  import * as Sentry from '@sentry/react';
36
- import { loadProject, rename } from "./actions/project-actions";
37
36
  import exporter from "./catalog/utils/exporter";
38
37
  import * as THREE from 'three';
39
38
  import LiteKitchenConfigurator from "./LiteKitchenConfigurator";
@@ -145,7 +144,6 @@ export default function LiteRenderer(props) {
145
144
  var width = props.width,
146
145
  height = props.height,
147
146
  projectElement = props.projectElement,
148
- categoryData = props.categoryData,
149
147
  dataBundle = props.dataBundle,
150
148
  configData = props.configData,
151
149
  options = props.options,
@@ -155,6 +153,7 @@ export default function LiteRenderer(props) {
155
153
  sentry = props.sentry,
156
154
  analytics = props.analytics,
157
155
  externalEvent = props.externalEvent,
156
+ onInternalEvent = props.onInternalEvent,
158
157
  onError = props.onError,
159
158
  passThrough = _objectWithoutProperties(props, _excluded);
160
159
 
@@ -244,21 +243,15 @@ export default function LiteRenderer(props) {
244
243
  emit(lastExternalEventRef.current, last.errors);
245
244
  }
246
245
  }, [externalEvent, emit]);
247
- var _ref = categoryData && categoryData.data || {},
248
- catalogs = _ref.catalogs,
249
- colorAlias = _ref.colorAlias,
250
- subgroups = _ref.subgroups;
251
- var _ref2 = dataBundle || {},
252
- _ref2$data = _ref2.data,
253
- data = _ref2$data === void 0 ? [] : _ref2$data,
254
- _ref2$appliances = _ref2.appliances,
255
- appliances = _ref2$appliances === void 0 ? [] : _ref2$appliances,
256
- _ref2$furnishing = _ref2.furnishing,
257
- furnishing = _ref2$furnishing === void 0 ? [] : _ref2$furnishing,
258
- _ref2$lighting = _ref2.lighting,
259
- lighting = _ref2$lighting === void 0 ? [] : _ref2$lighting;
260
- var _projectElement = _slicedToArray(projectElement, 1),
261
- project_data = _projectElement[0].project_data;
246
+ var _ref = dataBundle || {},
247
+ _ref$data = _ref.data,
248
+ data = _ref$data === void 0 ? [] : _ref$data,
249
+ _ref$appliances = _ref.appliances,
250
+ appliances = _ref$appliances === void 0 ? [] : _ref$appliances,
251
+ _ref$furnishing = _ref.furnishing,
252
+ furnishing = _ref$furnishing === void 0 ? [] : _ref$furnishing,
253
+ _ref$lighting = _ref.lighting,
254
+ lighting = _ref$lighting === void 0 ? [] : _ref$lighting;
262
255
  var id = configData.id,
263
256
  logoImg = configData.logoImg,
264
257
  companyUrl = configData.companyUrl;
@@ -266,13 +259,9 @@ export default function LiteRenderer(props) {
266
259
  _React$useState2 = _slicedToArray(_React$useState, 2),
267
260
  outlineSVGData = _React$useState2[0],
268
261
  setOutlineSVGData = _React$useState2[1];
269
- var _React$useState3 = React.useState(false),
270
- _React$useState4 = _slicedToArray(_React$useState3, 2),
271
- catalogInitiated = _React$useState4[0],
272
- setCatalogInitiated = _React$useState4[1];
273
262
  useEffect(function () {
274
263
  var initMyCatalog = /*#__PURE__*/function () {
275
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
264
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
276
265
  var x, _x, _x2;
277
266
  return _regeneratorRuntime.wrap(function (_context) {
278
267
  while (1) switch (_context.prev = _context.next) {
@@ -289,75 +278,19 @@ export default function LiteRenderer(props) {
289
278
  }, _callee);
290
279
  }));
291
280
  return function initMyCatalog() {
292
- return _ref3.apply(this, arguments);
281
+ return _ref2.apply(this, arguments);
293
282
  };
294
283
  }();
295
284
  var loadMoldings = /*#__PURE__*/function () {
296
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
297
- var door_color_alias, subgroup_ids, door_color_alias_ids, doorStyleData, molding, toeMoldingData, cabinets, promises;
285
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
286
+ var molding, toeMoldingData, moldingData, promises;
298
287
  return _regeneratorRuntime.wrap(function (_context2) {
299
288
  while (1) switch (_context2.prev = _context2.next) {
300
289
  case 0:
301
- door_color_alias = [];
302
- subgroup_ids = catalogs.filter(function (item) {
303
- return item.id == id;
304
- })[0].manufacturer_subgroup_ids.split(',');
305
- door_color_alias_ids = [];
306
- subgroups.forEach(function (subgroup) {
307
- if (subgroup_ids.some(function (id) {
308
- return id == subgroup.id.toString();
309
- })) {
310
- subgroup.door_color_alias_ids.split(',').forEach(function (item) {
311
- item != '' && door_color_alias_ids.push(item);
312
- });
313
- }
314
- });
315
- colorAlias.forEach(function (color) {
316
- return door_color_alias_ids.some(function (id) {
317
- return id == color.id.toString();
318
- }) && door_color_alias.push(color);
319
- });
320
- doorStyleData = categoryData.data.doorStyles.items;
321
- categoryData.data.doorStyles.items = doorStyleData.treeStruct;
322
- door_color_alias.forEach(function (dca) {
323
- doorStyleData.doorColorData.forEach(function (dc) {
324
- dc.door_style_id = parseInt(dc.door_style_id);
325
- if (dc.id !== dca.door_color_id) return;
326
- dc.name = dca.alias_name;
327
- dc.color_sku_alias = dca.sku_alias_name;
328
- doorStyleData.treeStruct.forEach(function (el) {
329
- el.items.forEach(function (elem) {
330
- return dc.door_style_id === elem.id && (dc.door_style_name = elem.name);
331
- });
332
- });
333
- dca.alias_installation_type = isEmpty(dca.alias_installation_type) ? [] : dca.alias_installation_type.split(',').map(function (n) {
334
- return parseInt(n);
335
- });
336
- categoryData.data.doorStyles.items.forEach(function (item) {
337
- if (dca.alias_installation_type.some(function (ait) {
338
- return ait === item.id;
339
- })) item.items.forEach(function (ds) {
340
- if (ds.name === dc.door_style_name) ds.items.push(dc);
341
- });
342
- });
343
- });
344
- });
345
290
  molding = [];
346
- toeMoldingData = [];
347
- cabinets = categoryData.data.cabinets;
348
- cabinets[cabinets.length - 1].items.forEach(function (index) {
349
- if (index.name.toLowerCase().includes('molding')) {
350
- index.items.forEach(function (item) {
351
- return molding.push(item);
352
- });
353
- }
354
- if (index.name.includes(TOE_KICK_MOLDING)) {
355
- index.items.forEach(function (item) {
356
- return toeMoldingData.push(item);
357
- });
358
- }
359
- });
360
- categoryData.data.toeMoldingData = toeMoldingData;
291
+ toeMoldingData = {};
292
+ moldingData = {};
293
+ if (moldingData.name = TOE_KICK_MOLDING) toeMoldingData = moldingData;
361
294
  promises = molding.map(function (child) {
362
295
  return new Promise(function (resolve, reject) {
363
296
  var url = child === null || child === void 0 ? void 0 : child.shape_svg;
@@ -385,17 +318,17 @@ export default function LiteRenderer(props) {
385
318
  }, _callee2);
386
319
  }));
387
320
  return function loadMoldings() {
388
- return _ref4.apply(this, arguments);
321
+ return _ref3.apply(this, arguments);
389
322
  };
390
323
  }();
391
324
  var loadSVGs = /*#__PURE__*/function () {
392
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
325
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
393
326
  var svgLoadPromises, outlineData;
394
327
  return _regeneratorRuntime.wrap(function (_context4) {
395
328
  while (1) switch (_context4.prev = _context4.next) {
396
329
  case 0:
397
330
  svgLoadPromises = data.map(/*#__PURE__*/function () {
398
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(item) {
331
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(item) {
399
332
  var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
400
333
  return _regeneratorRuntime.wrap(function (_context3) {
401
334
  while (1) switch (_context3.prev = _context3.next) {
@@ -443,7 +376,7 @@ export default function LiteRenderer(props) {
443
376
  }, _callee3, null, [[1, 5]]);
444
377
  }));
445
378
  return function (_x3) {
446
- return _ref6.apply(this, arguments);
379
+ return _ref5.apply(this, arguments);
447
380
  };
448
381
  }());
449
382
  _context4.next = 1;
@@ -458,15 +391,14 @@ export default function LiteRenderer(props) {
458
391
  }, _callee4);
459
392
  }));
460
393
  return function loadSVGs() {
461
- return _ref5.apply(this, arguments);
394
+ return _ref4.apply(this, arguments);
462
395
  };
463
396
  }();
464
397
  var initCatalog = /*#__PURE__*/function () {
465
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
398
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
466
399
  return _regeneratorRuntime.wrap(function (_context5) {
467
400
  while (1) switch (_context5.prev = _context5.next) {
468
401
  case 0:
469
- setCatalogInitiated(false);
470
402
  _context5.next = 1;
471
403
  return initMyCatalog();
472
404
  case 1:
@@ -476,20 +408,18 @@ export default function LiteRenderer(props) {
476
408
  _context5.next = 3;
477
409
  return loadSVGs();
478
410
  case 3:
479
- setCatalogInitiated(true);
480
- case 4:
481
411
  case "end":
482
412
  return _context5.stop();
483
413
  }
484
414
  }, _callee5);
485
415
  }));
486
416
  return function initCatalog() {
487
- return _ref7.apply(this, arguments);
417
+ return _ref6.apply(this, arguments);
488
418
  };
489
419
  }();
490
420
  initCatalog();
491
421
  // eslint-disable-next-line react-hooks/exhaustive-deps
492
- }, [categoryData, data, id, catalogs, colorAlias, subgroups]);
422
+ }, [data, id]);
493
423
 
494
424
  // Register items once SVGs are loaded
495
425
  useEffect(function () {
@@ -526,21 +456,6 @@ export default function LiteRenderer(props) {
526
456
  });
527
457
  for (var x in Item) MyCatalog.registerElement(Item[x]);
528
458
  }, [outlineSVGData, data, appliances, furnishing, lighting]);
529
- useEffect(function () {
530
- if (projectElement.length === 0) return;
531
- if (!catalogInitiated) return;
532
- sessionStorage.setItem('projectTitle', projectElement[0].title);
533
- store.dispatch(rename(projectElement[0].title));
534
- sessionStorage.setItem('projectId', projectElement[0].id);
535
- sessionStorage.setItem('email', projectElement[0].email);
536
- sessionStorage.setItem('firstName', projectElement[0].firstName);
537
- sessionStorage.setItem('lastName', projectElement[0].lastName);
538
- sessionStorage.setItem('phone', projectElement[0].phone);
539
- var jsonData;
540
- jsonData = JSON.parse(projectElement[0].project_data);
541
- jsonData.isLoadingCabinet = false;
542
- store.dispatch(loadProject(jsonData, categoryData));
543
- }, [project_data, catalogInitiated]);
544
459
  return /*#__PURE__*/React.createElement(AppContext.Provider, null, /*#__PURE__*/React.createElement(Provider, {
545
460
  store: store
546
461
  }, /*#__PURE__*/React.createElement(ToolErrorBoundary, {
@@ -555,10 +470,10 @@ export default function LiteRenderer(props) {
555
470
  stateExtractor: function stateExtractor(state) {
556
471
  return state.get('KitchenConfigurator');
557
472
  },
558
- categoryData: categoryData,
559
473
  data: data,
560
474
  configData: configData,
561
- externalEvent: externalEvent
475
+ externalEvent: externalEvent,
476
+ onInternalEvent: onInternalEvent
562
477
  }, passThrough)))));
563
478
  }
564
479
 
@@ -568,7 +483,6 @@ LiteRenderer.propTypes = {
568
483
  width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
569
484
  height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
570
485
  projectElement: PropTypes.arrayOf(PropTypes.object),
571
- categoryData: PropTypes.any,
572
486
  dataBundle: PropTypes.any,
573
487
  configData: PropTypes.any,
574
488
  catalog: PropTypes.oneOfType([PropTypes.object, PropTypes.instanceOf(Models.Catalog)]),
@@ -583,6 +497,7 @@ LiteRenderer.propTypes = {
583
497
  environment: PropTypes.string
584
498
  }),
585
499
  externalEvent: PropTypes.object,
500
+ onInternalEvent: PropTypes.func,
586
501
  onError: PropTypes.func,
587
502
  store: PropTypes.object
588
503
  };
@@ -1,4 +1,4 @@
1
- import { TOGGLE_LOADING_CABINET, SELECT_ITEM, SELECT_TOOL_DRAWING_ITEM, UPDATE_DRAWING_ITEM, END_DRAWING_ITEM, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_ROTATING_ITEM_CHANGED, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, UPDATE_ROTATING_ITEM, UPDATE_ROTATING, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, REPLACE_SUBMODULE, ANIMATE_OBJECT, REMOVE_REPLACE_SUBMODULE, ITEM_MOVE_UP, SELECT_TOOL_DRAWING_ITEM_3D, SET_DOOR_STYLE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, SET_DISTANT, 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, STORE_DIST_ARRAY, SET_MOLDING, UPDATE_MOLDING, VALIDATE_ITEM_POSTIONS, REPLACE_ITEM, SET_MOVE_STATUS, SET_ROTATE_STATUS } from "../constants";
1
+ import { TOGGLE_LOADING_CABINET, SELECT_ITEM, SELECT_TOOL_DRAWING_ITEM, UPDATE_DRAWING_ITEM, END_DRAWING_ITEM, BEGIN_DRAGGING_ITEM, BEGIN_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM, UPDATE_DRAGGING_ITEM_3DX, UPDATE_DRAGGING_ITEM_3DY, END_DRAGGING_ITEM, END_DRAGGING_ITEM_3D, UPDATE_DRAGGING_ITEM_CHANGED, UPDATE_ROTATING_ITEM_CHANGED, BEGIN_ROTATING_ITEM, BEGIN_ROTATING_ITEM_3D, UPDATE_ROTATING_ITEM, UPDATE_ROTATING, END_ROTATING_ITEM, END_ROTATING_ITEM_3D, REPLACE_SUBMODULE, ANIMATE_OBJECT, REMOVE_REPLACE_SUBMODULE, ITEM_MOVE_UP, SELECT_TOOL_DRAWING_ITEM_3D, SET_DOOR_STYLE, CHANGE_DISTANCE, SET_HANDLE_MATERIAL, SET_INITIAL_DOOR_STYLE, SET_DISTANT, 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, STORE_DIST_ARRAY, SET_MOLDING, UPDATE_MOLDING, VALIDATE_ITEM_POSTIONS, REPLACE_ITEM, SET_MOVE_STATUS, SET_ROTATE_STATUS } from "../constants";
2
2
  export function storeDistArray(layerID, itemID, distArray) {
3
3
  return {
4
4
  type: STORE_DIST_ARRAY,
@@ -223,14 +223,20 @@ export function updateItemsAltitude(layerID, itemID, value) {
223
223
  value: value
224
224
  };
225
225
  }
226
- export function setDoorStyle(doorStyle, pathes, isAll) {
226
+ export function setDoorStyle(doorStyle, itemCDS, isAll) {
227
227
  return {
228
228
  type: SET_DOOR_STYLE,
229
229
  doorStyle: doorStyle,
230
- pathes: pathes,
230
+ itemCDS: itemCDS,
231
231
  isAll: isAll
232
232
  };
233
233
  }
234
+ export function changeDistance(distancePayload) {
235
+ return {
236
+ type: CHANGE_DISTANCE,
237
+ distancePayload: distancePayload
238
+ };
239
+ }
234
240
  export function setCounterTop(counterTop) {
235
241
  return {
236
242
  type: SET_COUNTER_TOP,
@@ -292,11 +298,10 @@ export function setModelling(model) {
292
298
  model: model
293
299
  };
294
300
  }
295
- export function setInitialDoorStyle(doorStyle, oStyle) {
301
+ export function setInitialDoorStyle(doorStyle) {
296
302
  return {
297
303
  type: SET_INITIAL_DOOR_STYLE,
298
- doorStyle: doorStyle,
299
- oStyle: oStyle
304
+ doorStyle: doorStyle
300
305
  };
301
306
  }
302
307
  export function setMoveStatus(status) {
@@ -17,11 +17,10 @@ export function setStateProperties(properties) {
17
17
  properties: properties
18
18
  };
19
19
  }
20
- export function loadProject(sceneJSON, categoryData) {
20
+ export function loadProject(sceneJSON) {
21
21
  return {
22
22
  type: LOAD_PROJECT,
23
- sceneJSON: sceneJSON,
24
- categoryData: categoryData
23
+ sceneJSON: sceneJSON
25
24
  };
26
25
  }
27
26
  export function newProject() {
@@ -0,0 +1,11 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M2.53725 5.07449C3.93853 5.07449 5.07449 3.93853 5.07449 2.53725C5.07449 1.13596 3.93853 0 2.53725 0C1.13596 0 0 1.13596 0 2.53725C0 3.93853 1.13596 5.07449 2.53725 5.07449Z" fill="#6332AC"/>
3
+ <path d="M11.9788 5.07449C13.3801 5.07449 14.5161 3.93853 14.5161 2.53725C14.5161 1.13596 13.3801 0 11.9788 0C10.5775 0 9.44156 1.13596 9.44156 2.53725C9.44156 3.93853 10.5775 5.07449 11.9788 5.07449Z" fill="#4DCBCB"/>
4
+ <path d="M21.4628 5.07449C22.8641 5.07449 24 3.93853 24 2.53725C24 1.13596 22.8641 0 21.4628 0C20.0615 0 18.9255 1.13596 18.9255 2.53725C18.9255 3.93853 20.0615 5.07449 21.4628 5.07449Z" fill="#154AC5"/>
5
+ <path d="M2.53728 14.5169C3.93856 14.5169 5.07452 13.3809 5.07452 11.9796C5.07452 10.5783 3.93856 9.44238 2.53728 9.44238C1.13599 9.44238 3.05176e-05 10.5783 3.05176e-05 11.9796C3.05176e-05 13.3809 1.13599 14.5169 2.53728 14.5169Z" fill="#0C389D"/>
6
+ <path d="M11.9788 14.5169C13.3801 14.5169 14.5161 13.3809 14.5161 11.9796C14.5161 10.5783 13.3801 9.44238 11.9788 9.44238C10.5775 9.44238 9.44156 10.5783 9.44156 11.9796C9.44156 13.3809 10.5775 14.5169 11.9788 14.5169Z" fill="#4C12A1"/>
7
+ <path d="M21.4628 14.5169C22.8641 14.5169 24 13.3809 24 11.9796C24 10.5783 22.8641 9.44238 21.4628 9.44238C20.0615 9.44238 18.9255 10.5783 18.9255 11.9796C18.9255 13.3809 20.0615 14.5169 21.4628 14.5169Z" fill="#008D8D"/>
8
+ <path d="M2.53728 24C3.93856 24 5.07452 22.8641 5.07452 21.4628C5.07452 20.0615 3.93856 18.9255 2.53728 18.9255C1.13599 18.9255 3.05176e-05 20.0615 3.05176e-05 21.4628C3.05176e-05 22.8641 1.13599 24 2.53728 24Z" fill="#00B9B9"/>
9
+ <path d="M11.9788 24C13.3801 24 14.5161 22.8641 14.5161 21.4628C14.5161 20.0615 13.3801 18.9255 11.9788 18.9255C10.5775 18.9255 9.44156 20.0615 9.44156 21.4628C9.44156 22.8641 10.5775 24 11.9788 24Z" fill="#3A66CA"/>
10
+ <path d="M21.4628 24C22.8641 24 24 22.8641 24 21.4628C24 20.0615 22.8641 18.9255 21.4628 18.9255C20.0615 18.9255 18.9255 20.0615 18.9255 21.4628C18.9255 22.8641 20.0615 24 21.4628 24Z" fill="#3A0B80"/>
11
+ </svg>