@crystaldesign/product-detail-page 25.2.0-beta.35 → 25.2.0-beta.5

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.
@@ -898,7 +898,6 @@ function useVariants (_ref) {
898
898
  })) === null || _variant$media === void 0 ? void 0 : _variant$media.url,
899
899
  variant: variant,
900
900
  optName: variantAny[_key3].optName,
901
- opt: variantAny[_key3].opt,
902
901
  opvName: variantAny[_key3].opvName
903
902
  });
904
903
  },
@@ -910,15 +909,6 @@ function useVariants (_ref) {
910
909
  });
911
910
  var irrelevantGroups = [];
912
911
  for (var _key4 in sortedGroups) {
913
- var _firstItem$variant, _firstItem$variant2;
914
- var group = sortedGroups[_key4];
915
- var firstItem = group[0];
916
- var variants = firstItem !== null && firstItem !== void 0 && firstItem.opt ? firstItem === null || firstItem === void 0 || (_firstItem$variant = firstItem.variant) === null || _firstItem$variant === void 0 || (_firstItem$variant = _firstItem$variant.configuration) === null || _firstItem$variant === void 0 || (_firstItem$variant = _firstItem$variant.OrderSets[0].Variant) === null || _firstItem$variant === void 0 ? void 0 : _firstItem$variant['OPT' + firstItem.opt] : undefined;
917
- if (firstItem !== null && firstItem !== void 0 && (_firstItem$variant2 = firstItem.variant) !== null && _firstItem$variant2 !== void 0 && _firstItem$variant2.configuration && !variants) {
918
- irrelevantGroups.push(_key4);
919
- } else if (group.length <= 1) {
920
- irrelevantGroups.push(_key4);
921
- }
922
912
  if (sortedGroups[_key4].length <= 1) {
923
913
  irrelevantGroups.push(_key4);
924
914
  }
@@ -1395,9 +1385,6 @@ function recursiveReplaceActions(content, productVariants, product, language, se
1395
1385
  return content;
1396
1386
  }
1397
1387
 
1398
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1399
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
1400
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1401
1388
  var LOG = getLogger('ProductDetailPage', 'ProductDetailPage');
1402
1389
  function useDetailPage(_ref) {
1403
1390
  var settings = _ref.settings,
@@ -1439,6 +1426,7 @@ function useDetailPage(_ref) {
1439
1426
  setParsedContent = _useState10[1];
1440
1427
  useEffect(function () {
1441
1428
  DivaUtils$1.businessMetrics.setConfiguratorSessionId();
1429
+ LOG.businessEvent('onOpenPDP', 'ProductDetailPage', 'User in Product Detail Page');
1442
1430
  }, []);
1443
1431
  useEffect(function () {
1444
1432
  updateCssInDom(settings.cssUrl, settings.css);
@@ -1447,7 +1435,7 @@ function useDetailPage(_ref) {
1447
1435
  if (!productId) throw new Error('productId is required');
1448
1436
  (function () {
1449
1437
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(productId) {
1450
- var newVariants, products, _iterator, _step, product;
1438
+ var newVariants, products;
1451
1439
  return _regeneratorRuntime.wrap(function _callee$(_context) {
1452
1440
  while (1) switch (_context.prev = _context.next) {
1453
1441
  case 0:
@@ -1470,60 +1458,29 @@ function useDetailPage(_ref) {
1470
1458
  setProductVariants(products);
1471
1459
  newVariants = products;
1472
1460
  case 13:
1473
- _iterator = _createForOfIteratorHelper(newVariants);
1474
- _context.prev = 14;
1475
- _iterator.s();
1476
- case 16:
1477
- if ((_step = _iterator.n()).done) {
1478
- _context.next = 23;
1479
- break;
1480
- }
1481
- product = _step.value;
1482
- if (!(product._id == productId)) {
1483
- _context.next = 21;
1484
- break;
1485
- }
1486
- LOG.businessEvent('onLoadProductPDP', 'ProductDetailPage', 'Neues Product in PDP geladen.', {
1487
- productId: productId,
1488
- catalogName: product.modelName,
1489
- catalogCodex: product.catCodex
1490
- });
1491
- return _context.abrupt("break", 23);
1492
- case 21:
1493
- _context.next = 16;
1494
- break;
1495
- case 23:
1496
- _context.next = 28;
1497
- break;
1498
- case 25:
1499
- _context.prev = 25;
1500
- _context.t0 = _context["catch"](14);
1501
- _iterator.e(_context.t0);
1502
- case 28:
1503
- _context.prev = 28;
1504
- _iterator.f();
1505
- return _context.finish(28);
1506
- case 31:
1507
1461
  selectProduct(productId, newVariants);
1508
- _context.next = 38;
1462
+ _context.next = 20;
1509
1463
  break;
1510
- case 34:
1511
- _context.prev = 34;
1512
- _context.t1 = _context["catch"](2);
1464
+ case 16:
1465
+ _context.prev = 16;
1466
+ _context.t0 = _context["catch"](2);
1513
1467
  //TODO: show the diva error page?
1514
1468
  LOG.error(new DivaError('Error loading products', {
1515
- cause: _context.t1
1469
+ cause: _context.t0
1516
1470
  }));
1517
1471
  setError(true);
1518
- case 38:
1519
- _context.prev = 38;
1472
+ case 20:
1473
+ _context.prev = 20;
1520
1474
  setLoading(false);
1521
- return _context.finish(38);
1522
- case 41:
1475
+ LOG.businessEvent('onLoadProductPDP', 'ProductDetailPage', 'Neues Product in PDP geladen.', {
1476
+ productId: productId
1477
+ });
1478
+ return _context.finish(20);
1479
+ case 24:
1523
1480
  case "end":
1524
1481
  return _context.stop();
1525
1482
  }
1526
- }, _callee, null, [[2, 34, 38, 41], [14, 25, 28, 31]]);
1483
+ }, _callee, null, [[2, 16, 20, 24]]);
1527
1484
  }));
1528
1485
  return function (_x) {
1529
1486
  return _ref2.apply(this, arguments);
@@ -1582,13 +1539,8 @@ function useDetailPage(_ref) {
1582
1539
  if (event.type == 'closeConfiguratorOverlay' && currentProduct) {
1583
1540
  closeComponentInFullscreen();
1584
1541
  }
1585
- if (event.type == 'onFullscreenClose' && currentProduct) {
1542
+ if (event.type == 'onFullscreenClose') {
1586
1543
  DivaUtils$1.businessMetrics.setConfiguratorSessionId();
1587
- LOG.businessEvent('onLoadProductPDP', 'ProductDetailPage', 'Neues Product in PDP geladen.', {
1588
- productId: productId,
1589
- catalogName: currentProduct.modelName,
1590
- catalogCodex: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.catCodex
1591
- });
1592
1544
  }
1593
1545
  };
1594
1546
  return {
@@ -16,7 +16,6 @@ export interface Group {
16
16
  link?: string;
17
17
  name: string;
18
18
  optName?: string;
19
- opt?: string;
20
19
  opvName?: string;
21
20
  variant: ProductData;
22
21
  position: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useVariants.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/mainComponents/Variants/useVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,UAAU,KAAK;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,oBAAoB,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAAA;KAAE,CAAC;IACtE,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,WAAW,MAAM;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,EAAE,KAAK;;EAuH1E"}
1
+ {"version":3,"file":"useVariants.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/mainComponents/Variants/useVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,UAAU,KAAK;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,oBAAoB,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAAA;KAAE,CAAC;IACtE,OAAO,EAAE,WAAW,CAAC;CACtB;AACD,MAAM,WAAW,MAAM;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,EAAE,KAAK;;EA6G1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/useDetailPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,WAAW,EAAoD,MAAM,0BAA0B,CAAC;AAGnI,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAmB,SAAS,EAAE,MAAM,SAAS,CAAC;AAUrD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,KAAK;;;;;;+BAqFjE,MAAM,gBAAgB,WAAW,EAAE;;;EAoDlD"}
1
+ {"version":3,"file":"useDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/useDetailPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,WAAW,EAAyC,MAAM,0BAA0B,CAAC;AAGnI,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAmB,SAAS,EAAE,MAAM,SAAS,CAAC;AAUrD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,KAAK;;;;;;+BA6EjE,MAAM,gBAAgB,WAAW,EAAE;;;EA+ClD"}