@bebranded/bb-contents 1.0.152 → 1.0.154

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 (2) hide show
  1. package/bb-contents.js +26 -7
  2. package/package.json +1 -1
package/bb-contents.js CHANGED
@@ -32,7 +32,7 @@
32
32
  window._bbContentsInitialized = true;
33
33
 
34
34
  // Log de démarrage simple (une seule fois)
35
- console.log('bb-contents | v1.0.152');
35
+ console.log('bb-contents | v1.0.153');
36
36
 
37
37
  // Configuration
38
38
  const config = {
@@ -321,15 +321,26 @@
321
321
  const useAutoHeight = isVertical && height === 'auto';
322
322
 
323
323
  // Vérifier le overflow du parent pour respecter overflow: visible
324
+ // Si le parent a overflow: visible, on laisse passer
325
+ // Sinon (hidden, clip, auto, scroll), on contient les logos avec overflow: hidden
324
326
  const parentComputedStyle = getComputedStyle(element);
325
327
  const parentOverflow = parentComputedStyle.overflow;
326
- const shouldHideOverflow = parentOverflow !== 'visible' && parentOverflow !== '';
328
+ const parentOverflowX = parentComputedStyle.overflowX;
329
+ const parentOverflowY = parentComputedStyle.overflowY;
330
+
331
+ // Vérifier si le parent a explicitement overflow: visible (ou les deux axes)
332
+ const isParentOverflowVisible = (parentOverflow === 'visible' || parentOverflow === '') &&
333
+ (parentOverflowX === 'visible' || parentOverflowX === '') &&
334
+ (parentOverflowY === 'visible' || parentOverflowY === '');
335
+
336
+ // Si le parent a overflow: visible, on laisse passer, sinon on contient avec hidden
337
+ const mainContainerOverflow = isParentOverflowVisible ? 'visible' : 'hidden';
327
338
 
328
339
  mainContainer.style.cssText = `
329
340
  position: relative;
330
341
  width: 100%;
331
342
  height: ${isVertical ? (height === 'auto' ? 'auto' : height + 'px') : 'auto'};
332
- ${shouldHideOverflow ? 'overflow: hidden;' : 'overflow: visible;'}
343
+ overflow: ${mainContainerOverflow};
333
344
  min-height: auto;
334
345
  ${minHeight ? `min-height: ${minHeight};` : ''}
335
346
  `;
@@ -460,10 +471,11 @@
460
471
  const textContainers = item.querySelectorAll('.use-case_client, .testimonial_client-info, [class*="text"], p, span');
461
472
  textContainers.forEach(container => {
462
473
  // Exclure les éléments qui doivent garder leur taille auto (tags, badges, etc.)
474
+ const containerStyle = container.getAttribute('style');
463
475
  const shouldPreserveAuto = container.classList.contains('tag-m') ||
464
476
  container.classList.contains('tag') ||
465
477
  container.classList.contains('badge') ||
466
- container.getAttribute('style') && container.getAttribute('style').includes('width');
478
+ (containerStyle && containerStyle.includes('width'));
467
479
 
468
480
  if (shouldPreserveAuto) {
469
481
  // Ne pas toucher à ces éléments, ils gardent leur taille auto
@@ -665,8 +677,10 @@
665
677
  waitForImagesRender(repeatBlock2),
666
678
  forceFullRender() // NOUVEAU: Forcer le rendu complet
667
679
  ]).then(function() {
668
- // Retirer les copies du conteneur temporaire
669
- document.body.removeChild(tempContainer);
680
+ // Retirer les copies du conteneur temporaire (si toujours présent)
681
+ if (tempContainer && tempContainer.parentNode === document.body) {
682
+ document.body.removeChild(tempContainer);
683
+ }
670
684
 
671
685
  // Maintenant ajouter les copies au scrollContainer
672
686
  // Les images sont maintenant complètement rendues
@@ -726,7 +740,12 @@
726
740
  });
727
741
  }.bind(this));
728
742
  }.bind(this)).catch(function() {
729
- // En cas d'erreur, créer les copies quand même et démarrer
743
+ // En cas d'erreur, nettoyer le tempContainer s'il existe
744
+ if (tempContainer && tempContainer.parentNode === document.body) {
745
+ document.body.removeChild(tempContainer);
746
+ }
747
+
748
+ // Créer les copies quand même et démarrer
730
749
  const repeatBlock1 = mainBlock.cloneNode(true);
731
750
  const repeatBlock2 = mainBlock.cloneNode(true);
732
751
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.152",
3
+ "version": "1.0.154",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {