@bebranded/bb-contents 1.0.86 → 1.0.88

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 +23 -12
  2. package/package.json +1 -1
package/bb-contents.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * BeBranded Contents
3
3
  * Contenus additionnels français pour Webflow
4
- * @version 1.0.86
4
+ * @version 1.0.88
5
5
  * @author BeBranded
6
6
  * @license MIT
7
7
  * @website https://www.bebranded.xyz
@@ -32,11 +32,11 @@
32
32
  window._bbContentsInitialized = true;
33
33
 
34
34
  // Log de démarrage simple (une seule fois)
35
- console.log('bb-contents | v1.0.86');
35
+ console.log('bb-contents | v1.0.88');
36
36
 
37
37
  // Configuration
38
38
  const config = {
39
- version: '1.0.86',
39
+ version: '1.0.88',
40
40
  debug: false, // Debug désactivé pour rendu propre
41
41
  prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
42
42
  youtubeEndpoint: null, // URL du worker YouTube (à définir par l'utilisateur)
@@ -289,9 +289,9 @@
289
289
  mainContainer.style.cssText = `
290
290
  position: relative;
291
291
  width: 100%;
292
- height: ${isVertical ? (height === 'auto' ? 'auto' : height + 'px') : 'auto'};
293
- overflow: hidden;
294
- min-height: ${isVertical ? '100px' : '50px'};
292
+ height: auto;
293
+ overflow: visible;
294
+ min-height: auto;
295
295
  ${minHeight ? `min-height: ${minHeight};` : ''}
296
296
  `;
297
297
 
@@ -395,6 +395,8 @@
395
395
  // OPTIMISATION: Préserver les styles CSS existants (object-fit, etc.)
396
396
  const originalObjectFit = img.style.objectFit || getComputedStyle(img).objectFit;
397
397
  const originalObjectPosition = img.style.objectPosition || getComputedStyle(img).objectPosition;
398
+ const originalWidth = img.style.width;
399
+ const originalHeight = img.style.height;
398
400
 
399
401
  img.onload = () => {
400
402
  // OPTIMISATION: Restaurer les styles CSS après chargement
@@ -404,6 +406,15 @@
404
406
  if (originalObjectPosition && originalObjectPosition !== 'initial') {
405
407
  img.style.objectPosition = originalObjectPosition;
406
408
  }
409
+
410
+ // OPTIMISATION: Préserver les dimensions naturelles des images
411
+ if (!originalWidth || originalWidth === '') {
412
+ img.style.width = 'auto';
413
+ }
414
+ if (!originalHeight || originalHeight === '') {
415
+ img.style.height = 'auto';
416
+ }
417
+
407
418
  imagesLoaded++;
408
419
  };
409
420
  img.onerror = () => {
@@ -475,11 +486,11 @@
475
486
  const step = (parseFloat(speed) * (isVertical ? 1.5 : 0.8)) / 60;
476
487
  let isPaused = false;
477
488
 
478
- // Ajuster la taille du conteneur
489
+ // Ajuster la taille du conteneur - respecter les dimensions naturelles
479
490
  if (isVertical && !useAutoHeight) {
480
- scrollContainer.style.height = totalSize + 'px';
491
+ scrollContainer.style.height = 'auto';
481
492
  } else if (!isVertical) {
482
- scrollContainer.style.width = totalSize + 'px';
493
+ scrollContainer.style.width = 'auto';
483
494
  }
484
495
 
485
496
  // Position initiale optimisée pour Safari
@@ -558,11 +569,11 @@
558
569
  currentPosition = 0;
559
570
  }
560
571
 
561
- // Ajuster la taille du conteneur
572
+ // Ajuster la taille du conteneur - respecter les dimensions naturelles
562
573
  if (isVertical && !useAutoHeight) {
563
- scrollContainer.style.height = totalSize + 'px';
574
+ scrollContainer.style.height = 'auto';
564
575
  } else if (!isVertical) {
565
- scrollContainer.style.width = totalSize + 'px';
576
+ scrollContainer.style.width = 'auto';
566
577
  }
567
578
 
568
579
  // Fonction d'animation standard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {