@salla.sa/twilight-components 2.14.10 → 2.14.11

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 (46) hide show
  1. package/dist/cjs/{app-globals-29d166ce.js → app-globals-5486958c.js} +2 -2
  2. package/dist/cjs/app-globals-5486958c.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/salla-add-product-button_48.cjs.entry.js +16 -9
  5. package/dist/cjs/salla-add-product-button_48.cjs.entry.js.map +1 -1
  6. package/dist/cjs/twilight.cjs.js +1 -1
  7. package/dist/collection/components/salla-breadcrumb/salla-breadcrumb.js +16 -9
  8. package/dist/collection/components/salla-breadcrumb/salla-breadcrumb.js.map +1 -1
  9. package/dist/components/index.js +1 -1
  10. package/dist/components/index.js.map +1 -1
  11. package/dist/components/salla-breadcrumb.js +16 -9
  12. package/dist/components/salla-breadcrumb.js.map +1 -1
  13. package/dist/components/salla-quick-buy2.js.map +1 -1
  14. package/dist/esm/{app-globals-f51db284.js → app-globals-81d17271.js} +2 -2
  15. package/dist/esm/app-globals-81d17271.js.map +1 -0
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/salla-add-product-button_48.entry.js +16 -9
  18. package/dist/esm/salla-add-product-button_48.entry.js.map +1 -1
  19. package/dist/esm/twilight.js +1 -1
  20. package/dist/esm-es5/{app-globals-f51db284.js → app-globals-81d17271.js} +2 -2
  21. package/dist/esm-es5/app-globals-81d17271.js.map +1 -0
  22. package/dist/esm-es5/loader.js +1 -1
  23. package/dist/esm-es5/salla-add-product-button_48.entry.js +1 -1
  24. package/dist/esm-es5/salla-add-product-button_48.entry.js.map +1 -1
  25. package/dist/esm-es5/twilight.js +1 -1
  26. package/dist/twilight/{p-85437cd8.system.js → p-2cb89724.system.js} +2 -2
  27. package/dist/twilight/p-2cb89724.system.js.map +1 -0
  28. package/dist/twilight/{p-b3326820.system.entry.js → p-8fc87184.system.entry.js} +2 -2
  29. package/dist/twilight/p-8fc87184.system.entry.js.map +1 -0
  30. package/dist/twilight/{p-1d0fd8b5.js → p-aabec29e.js} +2 -2
  31. package/dist/twilight/p-aabec29e.js.map +1 -0
  32. package/dist/twilight/{p-d60b7588.entry.js → p-b135f146.entry.js} +2 -2
  33. package/dist/twilight/p-b135f146.entry.js.map +1 -0
  34. package/dist/twilight/{p-3d786e9f.system.js → p-e9f87bbd.system.js} +2 -2
  35. package/dist/twilight/twilight.esm.js +1 -1
  36. package/dist/twilight/twilight.js +1 -1
  37. package/package.json +5 -5
  38. package/dist/cjs/app-globals-29d166ce.js.map +0 -1
  39. package/dist/esm/app-globals-f51db284.js.map +0 -1
  40. package/dist/esm-es5/app-globals-f51db284.js.map +0 -1
  41. package/dist/twilight/p-1d0fd8b5.js.map +0 -1
  42. package/dist/twilight/p-85437cd8.system.js.map +0 -1
  43. package/dist/twilight/p-b3326820.system.entry.js.map +0 -1
  44. package/dist/twilight/p-d60b7588.entry.js.map +0 -1
  45. package/dist/types/global.d.ts +0 -20
  46. /package/dist/twilight/{p-3d786e9f.system.js.map → p-e9f87bbd.system.js.map} +0 -0
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { b as bootstrapLazy } from './index-5f58a56a.js';
5
5
  export { s as setNonce } from './index-5f58a56a.js';
6
- import { g as globalScripts } from './app-globals-f51db284.js';
6
+ import { g as globalScripts } from './app-globals-81d17271.js';
7
7
  import './_commonjsHelpers-1415ffd3.js';
8
8
 
9
9
  const defineCustomElements = (win, options) => {
@@ -428,10 +428,11 @@ const SallaBreadcrumb = class {
428
428
  return title.split('|').map(part => part.trim())[preferedIndex];
429
429
  }
430
430
  generateBreadcrumbs(page) {
431
+ var _a, _b;
431
432
  let breadcrumbs = [];
432
433
  if (page.slug === 'product.single') {
433
434
  const previousPage = JSON.parse(sessionStorage.getItem(this.sessionStorageKey) || '[]');
434
- if (previousPage && previousPage.length > 0 && previousPage[1].url == page.parent.url) {
435
+ if (previousPage.length > 0 && ((_a = previousPage[1]) === null || _a === void 0 ? void 0 : _a.url) === ((_b = page.parent) === null || _b === void 0 ? void 0 : _b.url)) {
435
436
  return this.setBreadcrumbsFromArray([...previousPage, page]);
436
437
  }
437
438
  }
@@ -439,24 +440,25 @@ const SallaBreadcrumb = class {
439
440
  let currentPage = page;
440
441
  // Traverse up to the parent pages
441
442
  while (currentPage) {
442
- !!currentPage.title && breadcrumbs.unshift({
443
- title: currentPage.title,
444
- url: currentPage.url,
445
- });
446
- // Move to the parent page, if exists
443
+ if (currentPage.title) {
444
+ breadcrumbs.unshift({
445
+ title: currentPage.title,
446
+ url: currentPage.url,
447
+ });
448
+ }
447
449
  currentPage = currentPage.parent;
448
450
  }
449
451
  // Additional logic based on page slug or title
450
452
  if (page.slug.includes("customer") && page.slug !== 'customer.profile') {
451
453
  breadcrumbs.unshift({ title: salla.lang.get('common.titles.profile'), url: salla.url.get('profile') });
452
454
  }
453
- if (page.slug.includes("blog")) {
455
+ if (page.slug.includes('blog')) {
454
456
  breadcrumbs.unshift({ title: salla.lang.get('blocks.footer.blog'), url: salla.url.get('blog') });
455
457
  }
456
- if (page.slug == 'brands.single') {
458
+ if (page.slug === 'brands.single') {
457
459
  breadcrumbs.unshift({ title: salla.lang.get('common.titles.brands'), url: salla.url.get('brands') });
458
460
  }
459
- if (!page.title && page.slug == "loyalty") {
461
+ if (!page.title && page.slug === 'loyalty') {
460
462
  breadcrumbs.unshift({ title: salla.lang.get('common.titles.loyalty_program'), url: salla.url.get('loyalty') });
461
463
  }
462
464
  // Add home breadcrumb
@@ -465,6 +467,11 @@ const SallaBreadcrumb = class {
465
467
  }
466
468
  storeBreadcrumbSnapshot() {
467
469
  try {
470
+ const page = salla.config.get("page");
471
+ // Skip storing breadcrumbs for product.single page
472
+ if ((page === null || page === void 0 ? void 0 : page.slug) === 'product.single') {
473
+ return;
474
+ }
468
475
  const items = [...this.breadcrumbs];
469
476
  // Find the last item and update its URL
470
477
  const lastItemIndex = items.length - 1;