@infrab4a/connect 5.5.6-beta.2 → 5.5.6-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.
package/index.cjs.js CHANGED
@@ -2454,18 +2454,18 @@ class ShopSettings extends BaseModel {
2454
2454
  : true;
2455
2455
  return rulesMatch;
2456
2456
  });
2457
- return { ...section, highlights: filteredHighlights };
2457
+ const sortedHighlights = !displayRules.beautyProfile
2458
+ ? filteredHighlights.sort((a, b) => (a.starred === b.starred ? 0 : a.starred ? -1 : 1))
2459
+ : filteredHighlights;
2460
+ return { ...section, highlights: sortedHighlights };
2458
2461
  }
2459
2462
  // Filtra collections
2460
2463
  if (section.type === ShopPageSectionType.COLLECTION) {
2461
- console.warn('SECTION', section.title, section.slug, displayRules);
2462
2464
  const rulesMatch = section.displayRules.length
2463
2465
  ? section.displayRules.some((rule) => Object.keys(rule).every((key) => rule[key] === displayRules[key]))
2464
2466
  : true;
2465
- console.warn('RULES MATCH', rulesMatch);
2466
2467
  const publishOk = !section.publishDate || now >= new Date(section.publishDate);
2467
2468
  const expireOk = !section.expirationDate || now <= new Date(section.expirationDate);
2468
- console.warn('PUBLISH OK', publishOk, 'EXPIRE OK', expireOk);
2469
2469
  return rulesMatch && publishOk && expireOk ? section : null;
2470
2470
  }
2471
2471
  // Filtra banners
@@ -2480,6 +2480,9 @@ class ShopSettings extends BaseModel {
2480
2480
  if (section.type === ShopPageSectionType.LIVE) {
2481
2481
  return section.active ? section : null;
2482
2482
  }
2483
+ if (section.type === ShopPageSectionType.PLANS || section.type === ShopPageSectionType.SINGLE_PLAN) {
2484
+ return displayRules.notSubscriber ? section : null;
2485
+ }
2483
2486
  // Demais seções retornam normalmente
2484
2487
  return section;
2485
2488
  })
package/index.esm.js CHANGED
@@ -2430,18 +2430,18 @@ class ShopSettings extends BaseModel {
2430
2430
  : true;
2431
2431
  return rulesMatch;
2432
2432
  });
2433
- return { ...section, highlights: filteredHighlights };
2433
+ const sortedHighlights = !displayRules.beautyProfile
2434
+ ? filteredHighlights.sort((a, b) => (a.starred === b.starred ? 0 : a.starred ? -1 : 1))
2435
+ : filteredHighlights;
2436
+ return { ...section, highlights: sortedHighlights };
2434
2437
  }
2435
2438
  // Filtra collections
2436
2439
  if (section.type === ShopPageSectionType.COLLECTION) {
2437
- console.warn('SECTION', section.title, section.slug, displayRules);
2438
2440
  const rulesMatch = section.displayRules.length
2439
2441
  ? section.displayRules.some((rule) => Object.keys(rule).every((key) => rule[key] === displayRules[key]))
2440
2442
  : true;
2441
- console.warn('RULES MATCH', rulesMatch);
2442
2443
  const publishOk = !section.publishDate || now >= new Date(section.publishDate);
2443
2444
  const expireOk = !section.expirationDate || now <= new Date(section.expirationDate);
2444
- console.warn('PUBLISH OK', publishOk, 'EXPIRE OK', expireOk);
2445
2445
  return rulesMatch && publishOk && expireOk ? section : null;
2446
2446
  }
2447
2447
  // Filtra banners
@@ -2456,6 +2456,9 @@ class ShopSettings extends BaseModel {
2456
2456
  if (section.type === ShopPageSectionType.LIVE) {
2457
2457
  return section.active ? section : null;
2458
2458
  }
2459
+ if (section.type === ShopPageSectionType.PLANS || section.type === ShopPageSectionType.SINGLE_PLAN) {
2460
+ return displayRules.notSubscriber ? section : null;
2461
+ }
2459
2462
  // Demais seções retornam normalmente
2460
2463
  return section;
2461
2464
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "5.5.6-beta.2",
3
+ "version": "5.5.6-beta.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },