@bebranded/bb-contents 1.0.121 → 1.0.122

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 +39 -3
  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.121
4
+ * @version 1.0.122
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.121');
35
+ console.log('bb-contents | v1.0.122');
36
36
 
37
37
  // Configuration
38
38
  const config = {
39
- version: '1.0.121',
39
+ version: '1.0.122',
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)
@@ -310,6 +310,42 @@
310
310
 
311
311
  const mainBlock = document.createElement('div');
312
312
  mainBlock.innerHTML = originalHTML;
313
+
314
+ // Permettre le retour à la ligne pour le texte dans les items du marquee
315
+ // Le white-space: nowrap sur le conteneur flex empêche les items de se retourner,
316
+ // mais ne doit pas empêcher le texte à l'intérieur des items de faire plusieurs lignes
317
+ if (!isVertical) {
318
+ setTimeout(() => {
319
+ const marqueeItems = mainBlock.querySelectorAll('.bb-marquee_item, [role="listitem"]');
320
+ marqueeItems.forEach(item => {
321
+ // Préserver la largeur de l'item définie dans Webflow
322
+ const computedStyle = getComputedStyle(item);
323
+ const itemWidth = computedStyle.width;
324
+ if (itemWidth && itemWidth !== 'auto' && itemWidth !== '0px') {
325
+ item.style.minWidth = itemWidth;
326
+ item.style.width = itemWidth;
327
+ }
328
+
329
+ // Permettre le retour à la ligne pour les conteneurs de texte
330
+ const textContainers = item.querySelectorAll('.use-case_client, .testimonial_client-info, [class*="text"], p, span');
331
+ textContainers.forEach(container => {
332
+ const containerComputed = getComputedStyle(container);
333
+ // Si l'élément a une largeur définie, la préserver
334
+ if (containerComputed.width && containerComputed.width !== 'auto' && containerComputed.width !== '0px') {
335
+ container.style.width = containerComputed.width;
336
+ } else {
337
+ // Sinon, prendre 100% de la largeur du parent
338
+ container.style.width = '100%';
339
+ }
340
+ // Forcer le retour à la ligne
341
+ container.style.whiteSpace = 'normal';
342
+ container.style.wordWrap = 'break-word';
343
+ container.style.overflowWrap = 'break-word';
344
+ });
345
+ });
346
+ }, 0);
347
+ }
348
+
313
349
  mainBlock.style.cssText = `
314
350
  display: flex;
315
351
  ${isVertical ? 'flex-direction: column;' : ''}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.121",
3
+ "version": "1.0.122",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {