|
|
|
@@ -3,6 +3,7 @@
|
|
|
|
// MILIEU : preview article (V1.2-P) - inseree au clic journal-item-click.
|
|
|
|
// MILIEU : preview article (V1.2-P) - inseree au clic journal-item-click.
|
|
|
|
// BAS : iframe carte AEP (toujours visible).
|
|
|
|
// BAS : iframe carte AEP (toujours visible).
|
|
|
|
// V1.3-D : ChatbotV2 retire du DOM (backlog V2). Pour reactivation -> reintroduire le tab + panel.
|
|
|
|
// V1.3-D : ChatbotV2 retire du DOM (backlog V2). Pour reactivation -> reintroduire le tab + panel.
|
|
|
|
|
|
|
|
// V1.4-C : cadre Carte O + bouton toggle desktop + drag fix (window listeners) + preview hydration (client:load) + transitions.
|
|
|
|
import CarteOWrapper from '../vue/CarteOWrapper.vue';
|
|
|
|
import CarteOWrapper from '../vue/CarteOWrapper.vue';
|
|
|
|
import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
|
|
|
import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
|
|
|
import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
@@ -19,11 +20,13 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
data-preview-open="false"
|
|
|
|
data-preview-open="false"
|
|
|
|
style="height: 100%; overflow-y: hidden;"
|
|
|
|
style="height: 100%; overflow-y: hidden;"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<!-- HAUT (default flex-1 base 33%) : V1.3-D bandeau "Sommaire editorial" + legende + Carte O plein espace -->
|
|
|
|
<!-- HAUT (default flex-1 base 33%) : V1.3-D bandeau "Sommaire editorial" + legende + Carte O plein espace
|
|
|
|
|
|
|
|
V1.4-C1 : cadre 1px renforce (border-neutral-300) + transition height pour toggle collapse desktop -->
|
|
|
|
<section
|
|
|
|
<section
|
|
|
|
id="col-centre-haut"
|
|
|
|
id="col-centre-haut"
|
|
|
|
class="border border-neutral-200 rounded flex flex-col overflow-hidden bg-white"
|
|
|
|
class="rounded flex flex-col overflow-hidden bg-white"
|
|
|
|
style="min-height: 0; flex: 1 1 33%;"
|
|
|
|
style="min-height: 0; flex: 1 1 33%; border: 1px solid #CBD5E1; border-radius: 6px; transition: flex-basis 0.3s ease, min-height 0.3s ease;"
|
|
|
|
|
|
|
|
data-collapsed="false"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<!-- V1.3-D : bandeau header (titre gauche + legende droite) -->
|
|
|
|
<!-- V1.3-D : bandeau header (titre gauche + legende droite) -->
|
|
|
|
<header
|
|
|
|
<header
|
|
|
|
@@ -33,32 +36,45 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
<span class="text-xs truncate" style="color: #475569;">
|
|
|
|
<span class="text-xs truncate" style="color: #475569;">
|
|
|
|
Sommaire éditorial d'architecture d'écologie politique
|
|
|
|
Sommaire éditorial d'architecture d'écologie politique
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<ul class="flex items-center gap-3 shrink-0 text-xs" style="color: #475569;" aria-label="Légende">
|
|
|
|
<div class="flex items-center gap-3 shrink-0">
|
|
|
|
<li class="flex items-center gap-1.5">
|
|
|
|
<ul class="flex items-center gap-3 shrink-0 text-xs" style="color: #475569;" aria-label="Légende">
|
|
|
|
<span
|
|
|
|
<li class="flex items-center gap-1.5">
|
|
|
|
aria-hidden="true"
|
|
|
|
<span
|
|
|
|
style="width: 8px; height: 8px; border-radius: 999px; background: #0F172A; display: inline-block;"
|
|
|
|
aria-hidden="true"
|
|
|
|
></span>
|
|
|
|
style="width: 8px; height: 8px; border-radius: 999px; background: #0F172A; display: inline-block;"
|
|
|
|
<span>publié</span>
|
|
|
|
></span>
|
|
|
|
</li>
|
|
|
|
<span>publié</span>
|
|
|
|
<li class="flex items-center gap-1.5">
|
|
|
|
</li>
|
|
|
|
<span
|
|
|
|
<li class="flex items-center gap-1.5">
|
|
|
|
aria-hidden="true"
|
|
|
|
<span
|
|
|
|
style="width: 8px; height: 8px; border-radius: 999px; background: transparent; border: 1px solid #0F172A; display: inline-block;"
|
|
|
|
aria-hidden="true"
|
|
|
|
></span>
|
|
|
|
style="width: 8px; height: 8px; border-radius: 999px; background: transparent; border: 1px solid #0F172A; display: inline-block;"
|
|
|
|
<span>à venir</span>
|
|
|
|
></span>
|
|
|
|
</li>
|
|
|
|
<span>à venir</span>
|
|
|
|
<li class="flex items-center gap-1.5">
|
|
|
|
</li>
|
|
|
|
<span
|
|
|
|
<li class="flex items-center gap-1.5">
|
|
|
|
aria-hidden="true"
|
|
|
|
<span
|
|
|
|
style="width: 8px; height: 8px; border-radius: 999px; background: #B45309; display: inline-block;"
|
|
|
|
aria-hidden="true"
|
|
|
|
></span>
|
|
|
|
style="width: 8px; height: 8px; border-radius: 999px; background: #B45309; display: inline-block;"
|
|
|
|
<span>projet</span>
|
|
|
|
></span>
|
|
|
|
</li>
|
|
|
|
<span>projet</span>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- V1.4-C2 : bouton toggle Carte O desktop (replier/deployer la zone HAUT) -->
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
id="col-centre-haut-toggle-desktop"
|
|
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
|
|
aria-label="Replier la Carte O"
|
|
|
|
|
|
|
|
class="hidden md:inline-flex items-center justify-center w-5 h-5 text-neutral-500 hover:text-neutral-900 cursor-pointer transition-colors"
|
|
|
|
|
|
|
|
style="font-size: 10px; line-height: 1;"
|
|
|
|
|
|
|
|
title="Replier la Carte O"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span id="col-centre-haut-toggle-icon">▼</span>
|
|
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex-1 overflow-hidden relative">
|
|
|
|
<div id="col-centre-haut-body" class="flex-1 overflow-hidden relative" style="transition: opacity 0.25s ease;">
|
|
|
|
<div id="panel-mindmap" class="absolute inset-0">
|
|
|
|
<div id="panel-mindmap" class="absolute inset-0">
|
|
|
|
<CarteOWrapper client:visible />
|
|
|
|
<CarteOWrapper client:visible />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@@ -86,16 +102,19 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
|
|
|
|
|
|
|
|
<!-- MILIEU (V1.2-P) : preview article inseree entre Carte O et iframe AEP.
|
|
|
|
<!-- MILIEU (V1.2-P) : preview article inseree entre Carte O et iframe AEP.
|
|
|
|
Pas de border ici - PreviewArticle.vue gere son propre conteneur.
|
|
|
|
Pas de border ici - PreviewArticle.vue gere son propre conteneur.
|
|
|
|
shrink-0 pour preserver sa taille auto, sinon flex pourrait l'ecraser. -->
|
|
|
|
shrink-0 pour preserver sa taille auto, sinon flex pourrait l'ecraser.
|
|
|
|
|
|
|
|
V1.4-E1 : client:load (vs client:visible) pour garantir hydration immediate des listeners
|
|
|
|
|
|
|
|
'preview-open' / 'journal-item-click' (le v-if rendait l'observer aveugle). -->
|
|
|
|
<div id="col-centre-preview-slot" class="shrink-0" style="display: contents;">
|
|
|
|
<div id="col-centre-preview-slot" class="shrink-0" style="display: contents;">
|
|
|
|
<PreviewArticle client:visible />
|
|
|
|
<PreviewArticle client:load />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- BAS (default flex-1 base 67%) : iframe carte AEP toujours visible -->
|
|
|
|
<!-- BAS (default flex-1 base 67%) : iframe carte AEP toujours visible
|
|
|
|
|
|
|
|
V1.4-E2 : transition flex-basis 0.3s ease (smooth quand preview ouvre/ferme) -->
|
|
|
|
<section
|
|
|
|
<section
|
|
|
|
id="col-centre-bas"
|
|
|
|
id="col-centre-bas"
|
|
|
|
class="border border-neutral-200 rounded overflow-hidden bg-white"
|
|
|
|
class="border border-neutral-200 rounded overflow-hidden bg-white"
|
|
|
|
style="min-height: 0; flex: 1 1 67%;"
|
|
|
|
style="min-height: 0; flex: 1 1 67%; transition: flex-basis 0.3s ease;"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="h-full min-h-[60vh] md:min-h-[400px]">
|
|
|
|
<div class="h-full min-h-[60vh] md:min-h-[400px]">
|
|
|
|
<EmbedDynamique client:visible />
|
|
|
|
<EmbedDynamique client:visible />
|
|
|
|
@@ -104,11 +123,14 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
// Poignee repli zone HAUT (mobile only)
|
|
|
|
// Poignee repli zone HAUT (mobile only) + toggle desktop V1.4-C2
|
|
|
|
const grid = document.getElementById('col-centre-grid');
|
|
|
|
const grid = document.getElementById('col-centre-grid');
|
|
|
|
const haut = document.getElementById('col-centre-haut');
|
|
|
|
const haut = document.getElementById('col-centre-haut');
|
|
|
|
const bas = document.getElementById('col-centre-bas');
|
|
|
|
const bas = document.getElementById('col-centre-bas');
|
|
|
|
const poignee = document.getElementById('col-centre-poignee');
|
|
|
|
const poignee = document.getElementById('col-centre-poignee');
|
|
|
|
|
|
|
|
const toggleDesktop = document.getElementById('col-centre-haut-toggle-desktop');
|
|
|
|
|
|
|
|
const toggleDesktopIcon = document.getElementById('col-centre-haut-toggle-icon');
|
|
|
|
|
|
|
|
const hautBody = document.getElementById('col-centre-haut-body');
|
|
|
|
|
|
|
|
|
|
|
|
// Sauvegarde flex-basis defaults pour restaure apres fermeture preview
|
|
|
|
// Sauvegarde flex-basis defaults pour restaure apres fermeture preview
|
|
|
|
let defaultHautFlex = '1 1 33%';
|
|
|
|
let defaultHautFlex = '1 1 33%';
|
|
|
|
@@ -140,6 +162,44 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
applyRepliState(next);
|
|
|
|
applyRepliState(next);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// V1.4-C2 : bouton toggle Carte O desktop (replier/deployer la zone HAUT).
|
|
|
|
|
|
|
|
// Etat distinct de l'etat mobile (clef differente) pour permettre persistance par device.
|
|
|
|
|
|
|
|
// Replie : flex 0 0 36px (juste le bandeau header reste visible), body masque.
|
|
|
|
|
|
|
|
// Deploye : restaure flex-basis precedent (default 33% ou drag-resize sauvegarde).
|
|
|
|
|
|
|
|
const applyDesktopCollapseState = (collapsed: boolean) => {
|
|
|
|
|
|
|
|
if (!haut) return;
|
|
|
|
|
|
|
|
if (grid && grid.dataset.previewOpen === 'true') return; // skip si preview ouverte (preview pilote la mise en page)
|
|
|
|
|
|
|
|
if (collapsed) {
|
|
|
|
|
|
|
|
haut.style.flex = '0 0 36px';
|
|
|
|
|
|
|
|
haut.dataset.collapsed = 'true';
|
|
|
|
|
|
|
|
if (hautBody) hautBody.style.opacity = '0';
|
|
|
|
|
|
|
|
if (toggleDesktopIcon) toggleDesktopIcon.textContent = '▶';
|
|
|
|
|
|
|
|
toggleDesktop?.setAttribute('aria-label', 'Deployer la Carte O');
|
|
|
|
|
|
|
|
toggleDesktop?.setAttribute('title', 'Deployer la Carte O');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Restaure flex-basis precedent (drag-resize ou default)
|
|
|
|
|
|
|
|
haut.style.flex = defaultHautFlex;
|
|
|
|
|
|
|
|
haut.dataset.collapsed = 'false';
|
|
|
|
|
|
|
|
if (hautBody) hautBody.style.opacity = '1';
|
|
|
|
|
|
|
|
if (toggleDesktopIcon) toggleDesktopIcon.textContent = '▼';
|
|
|
|
|
|
|
|
toggleDesktop?.setAttribute('aria-label', 'Replier la Carte O');
|
|
|
|
|
|
|
|
toggleDesktop?.setAttribute('title', 'Replier la Carte O');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const savedDesktopCollapsed = sessionStorage.getItem('tf-carte-o-collapsed') === 'true';
|
|
|
|
|
|
|
|
if (savedDesktopCollapsed) {
|
|
|
|
|
|
|
|
// applique apres que defaultHautFlex soit defini (deja le cas)
|
|
|
|
|
|
|
|
applyDesktopCollapseState(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toggleDesktop?.addEventListener('click', () => {
|
|
|
|
|
|
|
|
const current = sessionStorage.getItem('tf-carte-o-collapsed') === 'true';
|
|
|
|
|
|
|
|
const next = !current;
|
|
|
|
|
|
|
|
sessionStorage.setItem('tf-carte-o-collapsed', String(next));
|
|
|
|
|
|
|
|
applyDesktopCollapseState(next);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// V1.2-P : preview ouverte = container scrollable, Carte O et iframe AEP figes en vh.
|
|
|
|
// V1.2-P : preview ouverte = container scrollable, Carte O et iframe AEP figes en vh.
|
|
|
|
const applyPreviewState = (open: boolean) => {
|
|
|
|
const applyPreviewState = (open: boolean) => {
|
|
|
|
if (!grid || !haut || !bas) return;
|
|
|
|
if (!grid || !haut || !bas) return;
|
|
|
|
@@ -196,19 +256,27 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
let startHautH = 0;
|
|
|
|
let startHautH = 0;
|
|
|
|
let containerH = 0;
|
|
|
|
let containerH = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// V1.4-D : fix drag handle qui ne se "decliquait" pas au mouseup.
|
|
|
|
|
|
|
|
// - Listeners poses sur window (vs document) pour capter les events meme si la souris quitte l'iframe
|
|
|
|
|
|
|
|
// - Ajout mouseleave/blur/pointerup pour robustesse cross-browser / cross-flow utilisateur
|
|
|
|
|
|
|
|
// - Desactive aussi les transitions CSS pendant le drag (pas de lag visuel) puis restaure
|
|
|
|
dragHandle.addEventListener('mousedown', (e: MouseEvent) => {
|
|
|
|
dragHandle.addEventListener('mousedown', (e: MouseEvent) => {
|
|
|
|
if (grid.dataset.previewOpen === 'true') return;
|
|
|
|
if (grid.dataset.previewOpen === 'true') return;
|
|
|
|
if (sessionStorage.getItem('tf-haut-replie') === 'true') return;
|
|
|
|
if (sessionStorage.getItem('tf-haut-replie') === 'true') return;
|
|
|
|
|
|
|
|
if (sessionStorage.getItem('tf-carte-o-collapsed') === 'true') return;
|
|
|
|
isDragging = true;
|
|
|
|
isDragging = true;
|
|
|
|
startY = e.clientY;
|
|
|
|
startY = e.clientY;
|
|
|
|
startHautH = haut.getBoundingClientRect().height;
|
|
|
|
startHautH = haut.getBoundingClientRect().height;
|
|
|
|
containerH = grid.getBoundingClientRect().height;
|
|
|
|
containerH = grid.getBoundingClientRect().height;
|
|
|
|
document.body.style.cursor = 'row-resize';
|
|
|
|
document.body.style.cursor = 'row-resize';
|
|
|
|
document.body.style.userSelect = 'none';
|
|
|
|
document.body.style.userSelect = 'none';
|
|
|
|
|
|
|
|
// Suspend transitions pendant drag pour responsivite
|
|
|
|
|
|
|
|
haut.style.transition = 'none';
|
|
|
|
|
|
|
|
bas.style.transition = 'none';
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('mousemove', (e: MouseEvent) => {
|
|
|
|
const onMouseMove = (e: MouseEvent) => {
|
|
|
|
if (!isDragging) return;
|
|
|
|
if (!isDragging) return;
|
|
|
|
const delta = e.clientY - startY;
|
|
|
|
const delta = e.clientY - startY;
|
|
|
|
const newHautH = Math.min(Math.max(startHautH + delta, containerH * 0.2), containerH * 0.8);
|
|
|
|
const newHautH = Math.min(Math.max(startHautH + delta, containerH * 0.2), containerH * 0.8);
|
|
|
|
@@ -216,24 +284,37 @@ import PreviewArticle from '../vue/PreviewArticle.vue';
|
|
|
|
const basPct = 100 - hautPct;
|
|
|
|
const basPct = 100 - hautPct;
|
|
|
|
haut.style.flex = `1 1 ${hautPct.toFixed(1)}%`;
|
|
|
|
haut.style.flex = `1 1 ${hautPct.toFixed(1)}%`;
|
|
|
|
bas.style.flex = `1 1 ${basPct.toFixed(1)}%`;
|
|
|
|
bas.style.flex = `1 1 ${basPct.toFixed(1)}%`;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('mouseup', () => {
|
|
|
|
const stopDrag = () => {
|
|
|
|
if (isDragging) {
|
|
|
|
if (!isDragging) return;
|
|
|
|
isDragging = false;
|
|
|
|
isDragging = false;
|
|
|
|
document.body.style.cursor = '';
|
|
|
|
document.body.style.cursor = '';
|
|
|
|
document.body.style.userSelect = '';
|
|
|
|
document.body.style.userSelect = '';
|
|
|
|
const hf = haut.style.flex;
|
|
|
|
// Restaure transitions
|
|
|
|
const bf = bas.style.flex;
|
|
|
|
haut.style.transition = 'flex-basis 0.3s ease, min-height 0.3s ease';
|
|
|
|
if (hf) {
|
|
|
|
bas.style.transition = 'flex-basis 0.3s ease';
|
|
|
|
sessionStorage.setItem('tf-centre-haut-flex', hf);
|
|
|
|
const hf = haut.style.flex;
|
|
|
|
defaultHautFlex = hf;
|
|
|
|
const bf = bas.style.flex;
|
|
|
|
}
|
|
|
|
if (hf) {
|
|
|
|
if (bf) {
|
|
|
|
sessionStorage.setItem('tf-centre-haut-flex', hf);
|
|
|
|
sessionStorage.setItem('tf-centre-bas-flex', bf);
|
|
|
|
defaultHautFlex = hf;
|
|
|
|
defaultBasFlex = bf;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bf) {
|
|
|
|
|
|
|
|
sessionStorage.setItem('tf-centre-bas-flex', bf);
|
|
|
|
|
|
|
|
defaultBasFlex = bf;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Listeners multiples sur window pour couvrir tous les cas (sortie iframe, perte focus, etc.)
|
|
|
|
|
|
|
|
window.addEventListener('mousemove', onMouseMove);
|
|
|
|
|
|
|
|
window.addEventListener('mouseup', stopDrag);
|
|
|
|
|
|
|
|
window.addEventListener('pointerup', stopDrag);
|
|
|
|
|
|
|
|
window.addEventListener('mouseleave', stopDrag);
|
|
|
|
|
|
|
|
window.addEventListener('blur', stopDrag);
|
|
|
|
|
|
|
|
// Si on rentre dans la fenetre sans bouton souris enfonce, on stoppe (l'user a relache hors-page)
|
|
|
|
|
|
|
|
window.addEventListener('mouseenter', (e: MouseEvent) => {
|
|
|
|
|
|
|
|
if (isDragging && e.buttons === 0) stopDrag();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Restaurer position depuis sessionStorage
|
|
|
|
// Restaurer position depuis sessionStorage
|
|
|
|
|