@crystaldesign/product-detail-page 25.2.0-beta.28 → 25.2.0-beta.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.
@@ -1385,9 +1385,6 @@ function recursiveReplaceActions(content, productVariants, product, language, se
1385
1385
  return content;
1386
1386
  }
1387
1387
 
1388
- 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; } } }; }
1389
- 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; } }
1390
- 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; }
1391
1388
  var LOG = getLogger('ProductDetailPage', 'ProductDetailPage');
1392
1389
  function useDetailPage(_ref) {
1393
1390
  var settings = _ref.settings,
@@ -1429,6 +1426,7 @@ function useDetailPage(_ref) {
1429
1426
  setParsedContent = _useState10[1];
1430
1427
  useEffect(function () {
1431
1428
  DivaUtils$1.businessMetrics.setConfiguratorSessionId();
1429
+ LOG.businessEvent('onOpenPDP', 'ProductDetailPage', 'User in Product Detail Page');
1432
1430
  }, []);
1433
1431
  useEffect(function () {
1434
1432
  updateCssInDom(settings.cssUrl, settings.css);
@@ -1437,7 +1435,7 @@ function useDetailPage(_ref) {
1437
1435
  if (!productId) throw new Error('productId is required');
1438
1436
  (function () {
1439
1437
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(productId) {
1440
- var newVariants, products, _iterator, _step, product;
1438
+ var newVariants, products;
1441
1439
  return _regeneratorRuntime.wrap(function _callee$(_context) {
1442
1440
  while (1) switch (_context.prev = _context.next) {
1443
1441
  case 0:
@@ -1460,60 +1458,29 @@ function useDetailPage(_ref) {
1460
1458
  setProductVariants(products);
1461
1459
  newVariants = products;
1462
1460
  case 13:
1463
- _iterator = _createForOfIteratorHelper(newVariants);
1464
- _context.prev = 14;
1465
- _iterator.s();
1466
- case 16:
1467
- if ((_step = _iterator.n()).done) {
1468
- _context.next = 23;
1469
- break;
1470
- }
1471
- product = _step.value;
1472
- if (!(product._id == productId)) {
1473
- _context.next = 21;
1474
- break;
1475
- }
1476
- LOG.businessEvent('onLoadProductPDP', 'ProductDetailPage', 'Neues Product in PDP geladen.', {
1477
- productId: productId,
1478
- catalogName: product.modelName,
1479
- catalogCodex: product.catCodex
1480
- });
1481
- return _context.abrupt("break", 23);
1482
- case 21:
1483
- _context.next = 16;
1484
- break;
1485
- case 23:
1486
- _context.next = 28;
1487
- break;
1488
- case 25:
1489
- _context.prev = 25;
1490
- _context.t0 = _context["catch"](14);
1491
- _iterator.e(_context.t0);
1492
- case 28:
1493
- _context.prev = 28;
1494
- _iterator.f();
1495
- return _context.finish(28);
1496
- case 31:
1497
1461
  selectProduct(productId, newVariants);
1498
- _context.next = 38;
1462
+ _context.next = 20;
1499
1463
  break;
1500
- case 34:
1501
- _context.prev = 34;
1502
- _context.t1 = _context["catch"](2);
1464
+ case 16:
1465
+ _context.prev = 16;
1466
+ _context.t0 = _context["catch"](2);
1503
1467
  //TODO: show the diva error page?
1504
1468
  LOG.error(new DivaError('Error loading products', {
1505
- cause: _context.t1
1469
+ cause: _context.t0
1506
1470
  }));
1507
1471
  setError(true);
1508
- case 38:
1509
- _context.prev = 38;
1472
+ case 20:
1473
+ _context.prev = 20;
1510
1474
  setLoading(false);
1511
- return _context.finish(38);
1512
- case 41:
1475
+ LOG.businessEvent('onLoadProductPDP', 'ProductDetailPage', 'Neues Product in PDP geladen.', {
1476
+ productId: productId
1477
+ });
1478
+ return _context.finish(20);
1479
+ case 24:
1513
1480
  case "end":
1514
1481
  return _context.stop();
1515
1482
  }
1516
- }, _callee, null, [[2, 34, 38, 41], [14, 25, 28, 31]]);
1483
+ }, _callee, null, [[2, 16, 20, 24]]);
1517
1484
  }));
1518
1485
  return function (_x) {
1519
1486
  return _ref2.apply(this, arguments);
@@ -1572,13 +1539,8 @@ function useDetailPage(_ref) {
1572
1539
  if (event.type == 'closeConfiguratorOverlay' && currentProduct) {
1573
1540
  closeComponentInFullscreen();
1574
1541
  }
1575
- if (event.type == 'onFullscreenClose' && currentProduct) {
1542
+ if (event.type == 'onFullscreenClose') {
1576
1543
  DivaUtils$1.businessMetrics.setConfiguratorSessionId();
1577
- LOG.businessEvent('onLoadProductPDP', 'ProductDetailPage', 'Neues Product in PDP geladen.', {
1578
- productId: productId,
1579
- catalogName: currentProduct.modelName,
1580
- catalogCodex: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.catCodex
1581
- });
1582
1544
  }
1583
1545
  };
1584
1546
  return {
@@ -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"}