Improve toolbox checklists, image browsing, and guide integration
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s

This commit is contained in:
Shinuwa 2026-09-27 22:26:39 +02:00
parent 00e73f0062
commit 386212041f
47 changed files with 744 additions and 112 deletions

View file

@ -0,0 +1,42 @@
// Rôle : affiche la collection d'un outil Images dans la galerie de la visionneuse.
import { useEffect, useRef } from "react";
export function ImageGallery({ images, activeIndex, focusIndex = -1, onSelect, textContent = {} }) {
const galleryRef = useRef(null);
useEffect(() => {
if (focusIndex < 0) return;
const frame = window.requestAnimationFrame(() => {
galleryRef.current?.querySelector(`[data-image-index="${focusIndex}"]`)?.focus();
});
return () => window.cancelAnimationFrame(frame);
}, [focusIndex]);
return (
<div ref={galleryRef} className="image-viewer-gallery themed-scrollbar">
{images.map((image, index) => {
const position = `${index + 1} / ${images.length}`;
const label = image.label || `${textContent.imageAlt || "Image"} ${index + 1}`;
return (
<button
className={`image-viewer-gallery-item nds-card ${index === activeIndex ? "is-active" : ""}`}
data-variant="interactive"
data-image-index={index}
type="button"
key={image.id || `${image.dataUrl}-${index}`}
onClick={() => onSelect(index)}
aria-label={`${textContent.galleryImageAriaLabel || "Afficher en grand"} : ${label}`}
>
<span className="image-viewer-gallery-frame">
<img src={image.dataUrl} alt="" loading="lazy" decoding="async" />
</span>
<span className="image-viewer-gallery-caption">
<strong>{label}</strong>
<small>{position}</small>
</span>
</button>
);
})}
</div>
);
}