@agence-zef/astro 0.11.0 → 0.11.2

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.
@@ -67,8 +67,11 @@ const locale = Astro.currentLocale ?? "";
67
67
  document.head.append(s);
68
68
  const w = window as unknown as { dataLayer: unknown[]; gtag: (...args: unknown[]) => void };
69
69
  w.dataLayer = w.dataLayer || [];
70
- w.gtag = (...args: unknown[]) => {
71
- w.dataLayer.push(args);
70
+ // `gtag.js` ne lit que l'objet `arguments` : un tableau (`...args`) est ignoré et aucune
71
+ // mesure ne part.
72
+ w.gtag = function () {
73
+ // biome-ignore lint/complexity/noArguments: exigé par gtag.js
74
+ w.dataLayer.push(arguments);
72
75
  };
73
76
  w.gtag("js", new Date());
74
77
  w.gtag("config", id, { anonymize_ip: true });
package/dist/reveal.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- /** Observe les nouveaux `data-reveal` de la page (rang dans la cascade, délai). */
1
+ /** Observe les nouveaux `data-reveal` de la page (contenu ajouté après le chargement compris). */
2
2
  export declare function scanReveals(scope?: ParentNode): void;
package/dist/reveal.js CHANGED
@@ -20,9 +20,18 @@ function done(el) {
20
20
  window.setTimeout(() => el.setAttribute("data-zef-done", ""), ms + 50);
21
21
  }
22
22
  function onIntersect(entries) {
23
+ // Cascade : rang parmi les éléments d'une même liste qui apparaissent ensemble (un élément
24
+ // qui arrive seul à l'écran, sur mobile, part tout de suite).
25
+ const ranks = new Map();
23
26
  for (const { target, isIntersecting } of entries) {
24
27
  const el = target;
25
28
  if (isIntersecting) {
29
+ const parent = el.closest("[data-reveal-stagger]");
30
+ if (parent) {
31
+ const rank = ranks.get(parent) ?? 0;
32
+ ranks.set(parent, rank + 1);
33
+ el.style.setProperty("--zef-reveal-index", String(rank));
34
+ }
26
35
  el.setAttribute("data-zef-visible", "");
27
36
  if (options.once) {
28
37
  observer?.unobserve(el);
@@ -34,18 +43,10 @@ function onIntersect(entries) {
34
43
  }
35
44
  }
36
45
  }
37
- /** Observe les nouveaux `data-reveal` de la page (rang dans la cascade, délai). */
46
+ /** Observe les nouveaux `data-reveal` de la page (contenu ajouté après le chargement compris). */
38
47
  export function scanReveals(scope = document) {
39
48
  if (!observer)
40
49
  return;
41
- for (const parent of scope.querySelectorAll("[data-reveal-stagger]")) {
42
- let index = 0;
43
- for (const el of parent.querySelectorAll("[data-reveal]")) {
44
- if (el.closest("[data-reveal-stagger]") !== parent)
45
- continue;
46
- el.style.setProperty("--zef-reveal-index", String(index++));
47
- }
48
- }
49
50
  for (const el of scope.querySelectorAll("[data-reveal]:not([data-reveal-scroll])")) {
50
51
  if (observed.has(el))
51
52
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agence-zef/astro",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Intégration Astro du CMS ZEF : routes, rendu des sections, aperçu, composants réutilisables sans style.",
5
5
  "license": "MIT",
6
6
  "type": "module",