@configuratorware/configurator-frontendgui 1.44.1 → 1.44.3

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.
@@ -402,7 +402,6 @@ var ConfiguratorService = exports["default"] = /*#__PURE__*/function (_AbstractC
402
402
  defaultDesignAreaIdentifier,
403
403
  areasWithDesign,
404
404
  screenshotAreaIdentifier,
405
- screenshotArea,
406
405
  usedAreas,
407
406
  firstDesignViewIdentifier,
408
407
  usedViews,
@@ -436,12 +435,9 @@ var ConfiguratorService = exports["default"] = /*#__PURE__*/function (_AbstractC
436
435
  return (0, _get["default"])(designData[designAreaIdentifier], 'canvasData.objects.length');
437
436
  }); // use the default design area, or the first that contains a design
438
437
  screenshotAreaIdentifier = areasWithDesign && (areasWithDesign.indexOf(defaultDesignAreaIdentifier) !== -1 ? defaultDesignAreaIdentifier : areasWithDesign[0]) || defaultDesignAreaIdentifier;
439
- screenshotArea = (0, _find["default"])(designAreas, {
440
- identifier: screenshotAreaIdentifier
441
- });
442
- usedAreas = screenshotAreaIdentifier && [screenshotAreaIdentifier];
443
- firstDesignViewIdentifier = (0, _get["default"])(_ServiceLocator.Services.store.state.designView, 'designViews[0].identifier');
444
- usedViews = [screenshotArea ? screenshotArea.designView.identifier : firstDesignViewIdentifier];
438
+ usedAreas = screenshotAreaIdentifier ? [screenshotAreaIdentifier] : [];
439
+ firstDesignViewIdentifier = (0, _Selectors2.getCameraViewListForDesignAreaList)(designAreas, usedAreas).pop();
440
+ usedViews = [firstDesignViewIdentifier];
445
441
  variants = (0, _Selectors.getChildren)(this.state).map(function (_ref3) {
446
442
  var identifier = _ref3.identifier;
447
443
  return identifier;
@@ -449,42 +445,42 @@ var ConfiguratorService = exports["default"] = /*#__PURE__*/function (_AbstractC
449
445
  if (!variants[0]) {
450
446
  variants = [(0, _Selectors.getItem)(this.state).identifier];
451
447
  }
452
- _context5.prev = 20;
453
- _context5.next = 23;
448
+ _context5.prev = 19;
449
+ _context5.next = 22;
454
450
  return _ServiceLocator.Services.visualization.getScreenshots({
455
451
  areaList: usedAreas,
456
452
  viewList: usedViews,
457
453
  variantList: variants,
458
454
  size: size
459
455
  });
460
- case 23:
456
+ case 22:
461
457
  screenshots = _context5.sent;
462
458
  if (screenshots) {
463
- _context5.next = 26;
459
+ _context5.next = 25;
464
460
  break;
465
461
  }
466
462
  return _context5.abrupt("return", {});
467
- case 26:
463
+ case 25:
468
464
  images = {};
469
465
  Object.keys(screenshots).forEach(function (identifier) {
470
466
  images[variants.length === 1 ? variants[0] : identifier] = (0, _getFirstDataURLFromScreenshotsObj.getFirstDataURLFromScreenshotsObj)(screenshots[identifier]);
471
467
  });
472
468
  cached.setValue(images);
473
469
  return _context5.abrupt("return", images);
474
- case 32:
475
- _context5.prev = 32;
476
- _context5.t0 = _context5["catch"](20);
470
+ case 31:
471
+ _context5.prev = 31;
472
+ _context5.t0 = _context5["catch"](19);
477
473
  // eslint-disable-next-line no-console
478
474
  console.error('Error occurred while generating preview images:', _context5.t0);
479
- case 35:
480
- _context5.prev = 35;
475
+ case 34:
476
+ _context5.prev = 34;
481
477
  memo.restore();
482
- return _context5.finish(35);
483
- case 38:
478
+ return _context5.finish(34);
479
+ case 37:
484
480
  case "end":
485
481
  return _context5.stop();
486
482
  }
487
- }, _callee5, this, [[20, 32, 35, 38]]);
483
+ }, _callee5, this, [[19, 31, 34, 37]]);
488
484
  }));
489
485
  function getPreviewImagesForVariants() {
490
486
  return _getPreviewImagesForVariants.apply(this, arguments);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-frontendgui",
3
- "version": "1.44.1",
3
+ "version": "1.44.3",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./index.js",
7
7
  "dependencies": {
8
8
  "@babel/polyfill": "^7.12.1",
9
- "@configuratorware/scripts": "1.44.1",
9
+ "@configuratorware/scripts": "1.44.3",
10
10
  "@material-ui/core": "^4.12.4",
11
11
  "@material-ui/icons": "^4.11.3",
12
12
  "@material-ui/lab": "^4.0.0-alpha.61",
@@ -36,8 +36,8 @@
36
36
  "react-router-dom": "^5.3.4",
37
37
  "react-swipeable": "^5.5.1",
38
38
  "react-zoom-pan-pinch": "^2.1.3",
39
- "redhotmagma-graphics-editor": "1.44.1",
40
- "redhotmagma-visualization": "1.44.1",
39
+ "redhotmagma-graphics-editor": "1.44.3",
40
+ "redhotmagma-visualization": "1.44.3",
41
41
  "redux": "^4.1.0",
42
42
  "redux-logger": "^3.0.6",
43
43
  "redux-persist": "^5.10.0",
@@ -307,12 +307,11 @@ export default class ConfiguratorService extends AbstractConfiguratorService {
307
307
  ? defaultDesignAreaIdentifier
308
308
  : areasWithDesign[0])) ||
309
309
  defaultDesignAreaIdentifier;
310
- const screenshotArea = find(designAreas, { identifier: screenshotAreaIdentifier });
311
310
 
312
- const usedAreas = screenshotAreaIdentifier && [screenshotAreaIdentifier];
311
+ const usedAreas = screenshotAreaIdentifier ? [screenshotAreaIdentifier] : [];
313
312
 
314
- const firstDesignViewIdentifier = get(Services.store.state.designView, 'designViews[0].identifier');
315
- const usedViews = [screenshotArea ? screenshotArea.designView.identifier : firstDesignViewIdentifier];
313
+ const firstDesignViewIdentifier = getCameraViewListForDesignAreaList(designAreas, usedAreas).pop();
314
+ const usedViews = [firstDesignViewIdentifier];
316
315
 
317
316
  let variants = getChildren(this.state).map(({ identifier }) => identifier);
318
317
  if (!variants[0]) {
@@ -506,6 +506,9 @@ describe('Services/ConfiguratorService', () => {
506
506
  designView: {
507
507
  identifier: 'view1',
508
508
  },
509
+ customData: {
510
+ selectedCameraView: 'view1',
511
+ },
509
512
  },
510
513
  ],
511
514
  },
@@ -644,7 +647,7 @@ describe('Services/ConfiguratorService', () => {
644
647
  const screenshots = await configuratorSrv.getPreviewImagesForVariants();
645
648
  expect(visualizationSrvc.getScreenshots).toHaveBeenCalledWith({
646
649
  areaList: ['area1'],
647
- viewList: ['view1'],
650
+ viewList: ['default'],
648
651
  variantList: ['rootItem'],
649
652
  size: { width: 100, height: 100 },
650
653
  });
@@ -714,8 +717,8 @@ describe('Services/ConfiguratorService', () => {
714
717
  size: { width: 200, height: 200 },
715
718
  });
716
719
  expect(visualizationSrvc.getScreenshots).toHaveBeenCalledWith({
717
- areaList: null,
718
- viewList: ['view1'],
720
+ areaList: [],
721
+ viewList: ['default'],
719
722
  variantList: ['rootItem'],
720
723
  size: { width: 200, height: 200 },
721
724
  });