nodebb-plugin-ezoic-infinite 1.7.21 → 1.7.23

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/package.json +1 -1
  2. package/public/client.js +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.7.21",
3
+ "version": "1.7.23",
4
4
  "description": "Production-ready Ezoic infinite ads integration for NodeBB 4.x",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/public/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * NodeBB Ezoic Infinite Ads — client.js v28
2
+ * NodeBB Ezoic Infinite Ads — client.js v29
3
3
  *
4
4
  * Historique des corrections majeures
5
5
  * ────────────────────────────────────
@@ -27,7 +27,15 @@
27
27
  *
28
28
  * v27 pruneOrphans supprimé (faux-orphelins sur virtualisation NodeBB).
29
29
  *
30
- * v28 decluster supprimé.
30
+ * v28 decluster supprimé. pruneOrphans supprimé (v27). Wraps persistants sur session.
31
+ *
32
+ * v29 Fix ancrage topics : data-index → data-tid.
33
+ * data-index = position relative dans le batch NodeBB, pas un ID stable.
34
+ * Lors du scroll infini, les nouveaux batches démarrent à data-index=0,
35
+ * ce qui créait des collisions de clés d'ancrage → mauvaise déduplication
36
+ * → wraps non injectés sur les nouveaux topics, puis réinjection en haut.
37
+ * Fix : anchorAttr = data-tid (stable et unique par topic).
38
+ * ordinalAttr reste data-index pour le calcul de l'intervalle.
31
39
  * Analyse : decluster appelait dropWrap() qui faisait S.mountedIds.delete(id).
32
40
  * Un wrap vide adjacent à un autre wrap → supprimé → id libéré → réinjecté
33
41
  * en haut au prochain scroll. Exactement le bug observé.
@@ -75,7 +83,7 @@
75
83
  */
76
84
  const KIND = {
77
85
  'ezoic-ad-message': { sel: SEL.post, baseTag: '', anchorAttr: 'data-pid', ordinalAttr: 'data-index' },
78
- 'ezoic-ad-between': { sel: SEL.topic, baseTag: 'li', anchorAttr: 'data-index', ordinalAttr: 'data-index' },
86
+ 'ezoic-ad-between': { sel: SEL.topic, baseTag: 'li', anchorAttr: 'data-tid', ordinalAttr: 'data-index' },
79
87
  'ezoic-ad-categories': { sel: SEL.category, baseTag: 'li', anchorAttr: 'data-cid', ordinalAttr: null },
80
88
  };
81
89