Compare commits
11 Commits
feat/v12-m
...
e43ec60ecf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e43ec60ecf | ||
|
|
1033099663 | ||
|
|
9bb55bc311 | ||
|
|
7ec0efdeb5 | ||
|
|
12a2d40371 | ||
|
|
a1d6271b65 | ||
|
|
e613fc1ca3 | ||
|
|
d12f77554f | ||
|
|
397484a35e | ||
|
|
3f2783e3fc | ||
|
|
7791054ca0 |
@@ -4,30 +4,21 @@
|
|||||||
# statut: gestation (draft/en cours) | edite (publie)
|
# statut: gestation (draft/en cours) | edite (publie)
|
||||||
# nature: essai (texte politique) | projet (projet archi)
|
# nature: essai (texte politique) | projet (projet archi)
|
||||||
# niveau: 0 (centre) | 1 (concepts force) | 2 (thematiques/projets)
|
# niveau: 0 (centre) | 1 (concepts force) | 2 (thematiques/projets)
|
||||||
|
# domain (optionnel) : domaine plateforme source pour logo Brandfetch CDN
|
||||||
|
# - affiche logo en bas-droite du node si zoom > 1.5x
|
||||||
|
# - V1.2 par defaut : substack.com pour tous les essais AEP
|
||||||
|
|
||||||
version: "1.1"
|
version: "1.1"
|
||||||
|
|
||||||
centre:
|
centre:
|
||||||
id: "nouveau-contrat-social"
|
id: "contrat-social-medecine-corps-social"
|
||||||
label: "Nouveau Contrat Social"
|
label: "Contrat social + Medecine du corps social"
|
||||||
niveau: 0
|
niveau: 0
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
resume: "Assemblage de tout ce que j'ecris qui s'entrechoque - inventer un nouveau contrat social."
|
resume: "Manifeste central AEP : inventer un nouveau contrat social et diagnostiquer/soigner les pathologies du corps social."
|
||||||
|
|
||||||
concepts_force:
|
concepts_force: []
|
||||||
- id: "ncs-politique"
|
|
||||||
label: "Nouveau contrat social"
|
|
||||||
niveau: 1
|
|
||||||
nature: essai
|
|
||||||
statut: gestation
|
|
||||||
resume: "L'ecriture politique d'un futur habitable - essai central AEP."
|
|
||||||
- id: "medecine-corps-social"
|
|
||||||
label: "Medecine du corps social"
|
|
||||||
niveau: 1
|
|
||||||
nature: essai
|
|
||||||
statut: gestation
|
|
||||||
resume: "Diagnostiquer et soigner les pathologies du corps social - concept AEP mdcs."
|
|
||||||
|
|
||||||
thematiques:
|
thematiques:
|
||||||
- id: "systemique"
|
- id: "systemique"
|
||||||
@@ -35,76 +26,91 @@ thematiques:
|
|||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "pratiques-collectives"
|
- id: "pratiques-collectives"
|
||||||
label: "Pratiques collectives"
|
label: "Pratiques collectives"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "art-narration"
|
- id: "art-narration"
|
||||||
label: "Art & narration"
|
label: "Art & narration"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "pouvoir-domination"
|
- id: "pouvoir-domination"
|
||||||
label: "Rapport au pouvoir"
|
label: "Rapport au pouvoir"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "medias-critique"
|
- id: "medias-critique"
|
||||||
label: "Medias & pensee critique"
|
label: "Medias & pensee critique"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "justice-securite"
|
- id: "justice-securite"
|
||||||
label: "Justice & securite"
|
label: "Justice & securite"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "sante-globale"
|
- id: "sante-globale"
|
||||||
label: "Sante globale"
|
label: "Sante globale"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "agriculture"
|
- id: "agriculture"
|
||||||
label: "Agriculture"
|
label: "Agriculture"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "post-croissance"
|
- id: "post-croissance"
|
||||||
label: "Post-croissance"
|
label: "Post-croissance"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "anthropocene"
|
- id: "anthropocene"
|
||||||
label: "Anthropocene & effondrement"
|
label: "Anthropocene & effondrement"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "education"
|
- id: "education"
|
||||||
label: "Education a la transformation"
|
label: "Education a la transformation"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "urbanisme"
|
- id: "urbanisme"
|
||||||
label: "Urbanisme"
|
label: "Urbanisme"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "geopolitique"
|
- id: "geopolitique"
|
||||||
label: "Geopolitique & decolonisation"
|
label: "Geopolitique & decolonisation"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "ia-technologie"
|
- id: "ia-technologie"
|
||||||
label: "IA & technologie"
|
label: "IA & technologie"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
- id: "spiritualite"
|
- id: "spiritualite"
|
||||||
label: "Spiritualite"
|
label: "Spiritualite"
|
||||||
niveau: 2
|
niveau: 2
|
||||||
nature: essai
|
nature: essai
|
||||||
statut: gestation
|
statut: gestation
|
||||||
|
domain: "substack.com"
|
||||||
|
|
||||||
projets:
|
projets:
|
||||||
- id: "tmip"
|
- id: "tmip"
|
||||||
|
|||||||
@@ -1,35 +1,15 @@
|
|||||||
{
|
{
|
||||||
"version": "1.1",
|
"version": "1.1",
|
||||||
"generatedAt": "2026-05-11T13:04:29.806Z",
|
"generatedAt": "2026-05-11T16:47:45.459Z",
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"id": "nouveau-contrat-social",
|
"id": "contrat-social-medecine-corps-social",
|
||||||
"label": "Nouveau Contrat Social",
|
"label": "Contrat social + Medecine du corps social",
|
||||||
"niveau": 0,
|
"niveau": 0,
|
||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": "Assemblage de tout ce que j'ecris qui s'entrechoque - inventer un nouveau contrat social.",
|
"resume": "Manifeste central AEP : inventer un nouveau contrat social et diagnostiquer/soigner les pathologies du corps social.",
|
||||||
"radius": 28,
|
"radius": 30,
|
||||||
"family": "concept"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "ncs-politique",
|
|
||||||
"label": "Nouveau contrat social",
|
|
||||||
"niveau": 1,
|
|
||||||
"nature": "essai",
|
|
||||||
"statut": "gestation",
|
|
||||||
"resume": "L'ecriture politique d'un futur habitable - essai central AEP.",
|
|
||||||
"radius": 18,
|
|
||||||
"family": "concept"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "medecine-corps-social",
|
|
||||||
"label": "Medecine du corps social",
|
|
||||||
"niveau": 1,
|
|
||||||
"nature": "essai",
|
|
||||||
"statut": "gestation",
|
|
||||||
"resume": "Diagnostiquer et soigner les pathologies du corps social - concept AEP mdcs.",
|
|
||||||
"radius": 18,
|
|
||||||
"family": "concept"
|
"family": "concept"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -39,8 +19,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "pratiques-collectives",
|
"id": "pratiques-collectives",
|
||||||
@@ -49,8 +30,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "art-narration",
|
"id": "art-narration",
|
||||||
@@ -59,8 +41,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "pouvoir-domination",
|
"id": "pouvoir-domination",
|
||||||
@@ -69,8 +52,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "medias-critique",
|
"id": "medias-critique",
|
||||||
@@ -79,8 +63,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "justice-securite",
|
"id": "justice-securite",
|
||||||
@@ -89,8 +74,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "sante-globale",
|
"id": "sante-globale",
|
||||||
@@ -99,8 +85,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "agriculture",
|
"id": "agriculture",
|
||||||
@@ -109,8 +96,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "post-croissance",
|
"id": "post-croissance",
|
||||||
@@ -119,8 +107,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "anthropocene",
|
"id": "anthropocene",
|
||||||
@@ -129,8 +118,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "education",
|
"id": "education",
|
||||||
@@ -139,8 +129,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "urbanisme",
|
"id": "urbanisme",
|
||||||
@@ -149,8 +140,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "geopolitique",
|
"id": "geopolitique",
|
||||||
@@ -159,8 +151,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ia-technologie",
|
"id": "ia-technologie",
|
||||||
@@ -169,8 +162,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "spiritualite",
|
"id": "spiritualite",
|
||||||
@@ -179,8 +173,9 @@
|
|||||||
"nature": "essai",
|
"nature": "essai",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": null,
|
"resume": null,
|
||||||
"radius": 10,
|
"radius": 12,
|
||||||
"family": "concept"
|
"family": "concept",
|
||||||
|
"domain": "substack.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "tmip",
|
"id": "tmip",
|
||||||
@@ -189,77 +184,69 @@
|
|||||||
"nature": "projet",
|
"nature": "projet",
|
||||||
"statut": "gestation",
|
"statut": "gestation",
|
||||||
"resume": "Transport, mobilite, industrie, politique - projet archi. Exemple de projet archi relie aux thematiques AEP.",
|
"resume": "Transport, mobilite, industrie, politique - projet archi. Exemple de projet archi relie aux thematiques AEP.",
|
||||||
"radius": 14,
|
"radius": 18,
|
||||||
"family": "ressource"
|
"family": "ressource"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"edges": [
|
"edges": [
|
||||||
{
|
{
|
||||||
"source": "nouveau-contrat-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "ncs-politique"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "nouveau-contrat-social",
|
|
||||||
"target": "medecine-corps-social"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "ncs-politique",
|
|
||||||
"target": "systemique"
|
"target": "systemique"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "ncs-politique",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "pratiques-collectives"
|
"target": "pratiques-collectives"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "medecine-corps-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "art-narration"
|
"target": "art-narration"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "ncs-politique",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "pouvoir-domination"
|
"target": "pouvoir-domination"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "nouveau-contrat-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "medias-critique"
|
"target": "medias-critique"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "nouveau-contrat-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "justice-securite"
|
"target": "justice-securite"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "medecine-corps-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "sante-globale"
|
"target": "sante-globale"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "nouveau-contrat-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "agriculture"
|
"target": "agriculture"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "ncs-politique",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "post-croissance"
|
"target": "post-croissance"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "medecine-corps-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "anthropocene"
|
"target": "anthropocene"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "ncs-politique",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "education"
|
"target": "education"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "nouveau-contrat-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "urbanisme"
|
"target": "urbanisme"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "nouveau-contrat-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "geopolitique"
|
"target": "geopolitique"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "medecine-corps-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "ia-technologie"
|
"target": "ia-technologie"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "medecine-corps-social",
|
"source": "contrat-social-medecine-corps-social",
|
||||||
"target": "spiritualite"
|
"target": "spiritualite"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ const REPO_ROOT = path.resolve(__dirname, '..')
|
|||||||
const SOURCE = path.join(REPO_ROOT, 'public/data/carte-o-source.yaml')
|
const SOURCE = path.join(REPO_ROOT, 'public/data/carte-o-source.yaml')
|
||||||
const OUTPUT = path.join(REPO_ROOT, 'public/data/carte-o.json')
|
const OUTPUT = path.join(REPO_ROOT, 'public/data/carte-o.json')
|
||||||
|
|
||||||
// radius par niveau + nature
|
// radius par niveau + nature (V1.2-N palette minimaliste)
|
||||||
function getRadius(niveau, nature) {
|
function getRadius(niveau, nature) {
|
||||||
if (niveau === 0) return 28
|
if (niveau === 0) return 30
|
||||||
if (niveau === 1) return 18
|
if (nature === 'projet') return 18
|
||||||
if (niveau === 2 && nature === 'projet') return 14
|
if (niveau === 1) return 16
|
||||||
return 10
|
return 12
|
||||||
}
|
}
|
||||||
|
|
||||||
// compat backward : nature -> family
|
// compat backward : nature -> family
|
||||||
@@ -24,30 +24,8 @@ function getFamily(nature) {
|
|||||||
return nature === 'projet' ? 'ressource' : 'concept'
|
return nature === 'projet' ? 'ressource' : 'concept'
|
||||||
}
|
}
|
||||||
|
|
||||||
// thematiques rattachees directement au centre (ni ncs-politique ni medecine-corps-social)
|
// V1.2-N : noeud central fusionne -> toutes les thematiques sont rattachees au centre
|
||||||
const CENTRE_THEMATIQUES = new Set([
|
// (les anciens groupes NCS_THEMATIQUES / MDCS_THEMATIQUES sont supprimes avec leurs sous-noeuds)
|
||||||
'medias-critique',
|
|
||||||
'justice-securite',
|
|
||||||
'agriculture',
|
|
||||||
'urbanisme',
|
|
||||||
'geopolitique',
|
|
||||||
])
|
|
||||||
|
|
||||||
const NCS_THEMATIQUES = new Set([
|
|
||||||
'systemique',
|
|
||||||
'pratiques-collectives',
|
|
||||||
'pouvoir-domination',
|
|
||||||
'post-croissance',
|
|
||||||
'education',
|
|
||||||
])
|
|
||||||
|
|
||||||
const MDCS_THEMATIQUES = new Set([
|
|
||||||
'art-narration',
|
|
||||||
'sante-globale',
|
|
||||||
'spiritualite',
|
|
||||||
'ia-technologie',
|
|
||||||
'anthropocene',
|
|
||||||
])
|
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const raw = await fs.readFile(SOURCE, 'utf-8')
|
const raw = await fs.readFile(SOURCE, 'utf-8')
|
||||||
@@ -65,7 +43,7 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addNode(obj) {
|
function addNode(obj) {
|
||||||
nodes.push({
|
const node = {
|
||||||
id: obj.id,
|
id: obj.id,
|
||||||
label: obj.label,
|
label: obj.label,
|
||||||
niveau: obj.niveau,
|
niveau: obj.niveau,
|
||||||
@@ -74,26 +52,25 @@ async function main() {
|
|||||||
resume: obj.resume || null,
|
resume: obj.resume || null,
|
||||||
radius: getRadius(obj.niveau, obj.nature),
|
radius: getRadius(obj.niveau, obj.nature),
|
||||||
family: getFamily(obj.nature),
|
family: getFamily(obj.nature),
|
||||||
})
|
}
|
||||||
|
// V1.2-O : propage le champ optionnel domain (logo plateforme via Brandfetch CDN)
|
||||||
|
if (obj.domain) node.domain = obj.domain
|
||||||
|
nodes.push(node)
|
||||||
}
|
}
|
||||||
|
|
||||||
const centreId = data.centre.id
|
const centreId = data.centre.id
|
||||||
addNode(data.centre)
|
addNode(data.centre)
|
||||||
|
|
||||||
for (const cf of data.concepts_force) {
|
// concepts_force vide en V1.2-N (fusionne dans le centre)
|
||||||
|
for (const cf of (data.concepts_force || [])) {
|
||||||
addNode(cf)
|
addNode(cf)
|
||||||
addEdge(centreId, cf.id)
|
addEdge(centreId, cf.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// toutes les thematiques rattachees directement au noeud central
|
||||||
for (const th of data.thematiques) {
|
for (const th of data.thematiques) {
|
||||||
addNode(th)
|
addNode(th)
|
||||||
if (NCS_THEMATIQUES.has(th.id)) {
|
addEdge(centreId, th.id)
|
||||||
addEdge('ncs-politique', th.id)
|
|
||||||
} else if (MDCS_THEMATIQUES.has(th.id)) {
|
|
||||||
addEdge('medecine-corps-social', th.id)
|
|
||||||
} else if (CENTRE_THEMATIQUES.has(th.id)) {
|
|
||||||
addEdge(centreId, th.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const proj of data.projets) {
|
for (const proj of data.projets) {
|
||||||
|
|||||||
@@ -1,13 +1,30 @@
|
|||||||
---
|
---
|
||||||
// Centre - HAUT : tabs (Carte O mindmap | Chatbot RAG branche PC7).
|
// Centre - HAUT : tabs (Carte O mindmap | Chatbot RAG branche PC7).
|
||||||
// BAS : iframe carte AEP + scroll articles Substack (PC4).
|
// MILIEU : preview article (V1.2-P) - inseree au clic journal-item-click.
|
||||||
|
// BAS : iframe carte AEP (toujours visible).
|
||||||
import CarteOWrapper from '../vue/CarteOWrapper.vue';
|
import CarteOWrapper from '../vue/CarteOWrapper.vue';
|
||||||
import ChatbotV2 from '../vue/ChatbotV2.vue';
|
import ChatbotV2 from '../vue/ChatbotV2.vue';
|
||||||
import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
||||||
|
import PreviewArticle from '../vue/PreviewArticle.vue';
|
||||||
---
|
---
|
||||||
<div id="col-centre-grid" class="h-full grid gap-2 p-2" style="grid-template-rows: 1fr 2fr;">
|
<!--
|
||||||
<!-- HAUT 50% : tabs Carte O / Chatbot -->
|
V1.2-P : Col centre = flex column container.
|
||||||
<section id="col-centre-haut" class="border border-neutral-200 rounded flex flex-col overflow-hidden bg-white" style="min-height: 0;">
|
- Default : Carte O (1/3) + iframe AEP (2/3), pas de scroll vertical (h-full).
|
||||||
|
- Preview ouverte : Carte O (33vh fixe) + Preview (auto) + iframe AEP (67vh fixe), overflow-y-auto.
|
||||||
|
Flex-basis dynamique pilote via JS.
|
||||||
|
-->
|
||||||
|
<div
|
||||||
|
id="col-centre-grid"
|
||||||
|
class="flex flex-col gap-2 p-2"
|
||||||
|
data-preview-open="false"
|
||||||
|
style="height: 100%; overflow-y: hidden;"
|
||||||
|
>
|
||||||
|
<!-- HAUT (default flex-1 base 33%) : tabs Carte O / Chatbot -->
|
||||||
|
<section
|
||||||
|
id="col-centre-haut"
|
||||||
|
class="border border-neutral-200 rounded flex flex-col overflow-hidden bg-white"
|
||||||
|
style="min-height: 0; flex: 1 1 33%;"
|
||||||
|
>
|
||||||
<nav role="tablist" aria-label="Vues centrales" class="flex border-b border-neutral-200 px-1 pt-1">
|
<nav role="tablist" aria-label="Vues centrales" class="flex border-b border-neutral-200 px-1 pt-1">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -58,7 +75,7 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
|||||||
<!-- Drag handle desktop - redimensionnement vertical md+ -->
|
<!-- Drag handle desktop - redimensionnement vertical md+ -->
|
||||||
<div
|
<div
|
||||||
id="col-centre-drag-handle"
|
id="col-centre-drag-handle"
|
||||||
class="hidden md:flex items-center justify-center h-2 cursor-row-resize hover:bg-neutral-200 transition-colors w-full -mt-1 -mb-1"
|
class="hidden md:flex items-center justify-center h-2 cursor-row-resize hover:bg-neutral-200 transition-colors w-full -mt-1 -mb-1 shrink-0"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
>
|
>
|
||||||
<span class="block w-10 h-0.5 bg-neutral-300 rounded-full"></span>
|
<span class="block w-10 h-0.5 bg-neutral-300 rounded-full"></span>
|
||||||
@@ -69,13 +86,24 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
|||||||
id="col-centre-poignee"
|
id="col-centre-poignee"
|
||||||
type="button"
|
type="button"
|
||||||
aria-label="Replier ou deployer la Carte O"
|
aria-label="Replier ou deployer la Carte O"
|
||||||
class="md:hidden flex items-center justify-center h-6 bg-neutral-100 border-y border-neutral-200 cursor-pointer w-full -mt-2 -mb-2 hover:bg-neutral-200 transition-colors"
|
class="md:hidden flex items-center justify-center h-6 bg-neutral-100 border-y border-neutral-200 cursor-pointer w-full -mt-2 -mb-2 hover:bg-neutral-200 transition-colors shrink-0"
|
||||||
>
|
>
|
||||||
<span class="block w-8 h-0.5 bg-neutral-400 rounded-full"></span>
|
<span class="block w-8 h-0.5 bg-neutral-400 rounded-full"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- BAS 50% : embed dynamique (carte AEP default, article journal au click) -->
|
<!-- MILIEU (V1.2-P) : preview article inseree entre Carte O et iframe AEP.
|
||||||
<section class="border border-neutral-200 rounded overflow-hidden bg-white" style="min-height: 0;">
|
Pas de border ici - PreviewArticle.vue gere son propre conteneur.
|
||||||
|
shrink-0 pour preserver sa taille auto, sinon flex pourrait l'ecraser. -->
|
||||||
|
<div id="col-centre-preview-slot" class="shrink-0" style="display: contents;">
|
||||||
|
<PreviewArticle client:visible />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- BAS (default flex-1 base 67%) : iframe carte AEP toujours visible -->
|
||||||
|
<section
|
||||||
|
id="col-centre-bas"
|
||||||
|
class="border border-neutral-200 rounded overflow-hidden bg-white"
|
||||||
|
style="min-height: 0; flex: 1 1 67%;"
|
||||||
|
>
|
||||||
<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 />
|
||||||
</div>
|
</div>
|
||||||
@@ -83,29 +111,32 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Poignee repli zone HAUT (mobile only, D.3)
|
// Poignee repli zone HAUT (mobile only)
|
||||||
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 poignee = document.getElementById('col-centre-poignee');
|
const poignee = document.getElementById('col-centre-poignee');
|
||||||
|
|
||||||
|
// Sauvegarde flex-basis defaults pour restaure apres fermeture preview
|
||||||
|
let defaultHautFlex = '1 1 33%';
|
||||||
|
let defaultBasFlex = '1 1 67%';
|
||||||
|
|
||||||
const applyRepliState = (replie: boolean) => {
|
const applyRepliState = (replie: boolean) => {
|
||||||
if (!grid || !haut) return;
|
if (!grid || !haut) return;
|
||||||
|
if (grid.dataset.previewOpen === 'true') return; // skip si preview ouverte
|
||||||
if (replie) {
|
if (replie) {
|
||||||
grid.classList.remove('grid-rows-2');
|
haut.style.flex = '0 0 0%';
|
||||||
grid.style.gridTemplateRows = '0fr 1fr';
|
|
||||||
haut.style.overflow = 'hidden';
|
haut.style.overflow = 'hidden';
|
||||||
haut.style.minHeight = '0';
|
haut.style.minHeight = '0';
|
||||||
poignee?.setAttribute('aria-label', 'Deployer la Carte O');
|
poignee?.setAttribute('aria-label', 'Deployer la Carte O');
|
||||||
} else {
|
} else {
|
||||||
grid.classList.remove('grid-rows-2');
|
haut.style.flex = defaultHautFlex;
|
||||||
grid.style.gridTemplateRows = '1fr 2fr';
|
|
||||||
haut.style.overflow = '';
|
haut.style.overflow = '';
|
||||||
haut.style.minHeight = '';
|
haut.style.minHeight = '0';
|
||||||
poignee?.setAttribute('aria-label', 'Replier la Carte O');
|
poignee?.setAttribute('aria-label', 'Replier la Carte O');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Etat initial depuis sessionStorage
|
|
||||||
const savedRepli = sessionStorage.getItem('tf-haut-replie');
|
const savedRepli = sessionStorage.getItem('tf-haut-replie');
|
||||||
applyRepliState(savedRepli === 'true');
|
applyRepliState(savedRepli === 'true');
|
||||||
|
|
||||||
@@ -116,53 +147,78 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
|||||||
applyRepliState(next);
|
applyRepliState(next);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Drag-resize desktop (>=768px)
|
// V1.2-P : preview ouverte = container scrollable, Carte O et iframe AEP figes en vh.
|
||||||
const dragHandle = document.getElementById('col-centre-drag-handle');
|
const applyPreviewState = (open: boolean) => {
|
||||||
const gridEl = document.getElementById('col-centre-grid');
|
if (!grid || !haut || !bas) return;
|
||||||
|
grid.dataset.previewOpen = String(open);
|
||||||
|
if (open) {
|
||||||
|
// Memorise les flex actuels avant override (au cas ou l'user a drag-resize)
|
||||||
|
const curHautFlex = haut.style.flex;
|
||||||
|
const curBasFlex = bas.style.flex;
|
||||||
|
if (curHautFlex && !curHautFlex.startsWith('0 0')) defaultHautFlex = curHautFlex;
|
||||||
|
if (curBasFlex) defaultBasFlex = curBasFlex;
|
||||||
|
|
||||||
if (dragHandle && gridEl) {
|
// Figer hauteurs : Carte O 33vh, iframe AEP 67vh - on perd le flex
|
||||||
|
haut.style.flex = '0 0 33vh';
|
||||||
|
bas.style.flex = '0 0 67vh';
|
||||||
|
// Le container reste a 100% du parent (overflow-hidden de <main>),
|
||||||
|
// mais on active le scroll interne pour passer Carte O -> Preview -> iframe AEP.
|
||||||
|
grid.style.height = '100%';
|
||||||
|
grid.style.minHeight = '';
|
||||||
|
grid.style.overflowY = 'auto';
|
||||||
|
} else {
|
||||||
|
haut.style.flex = defaultHautFlex;
|
||||||
|
bas.style.flex = defaultBasFlex;
|
||||||
|
grid.style.height = '100%';
|
||||||
|
grid.style.minHeight = '';
|
||||||
|
grid.style.overflowY = 'hidden';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('journal-item-click', () => {
|
||||||
|
applyPreviewState(true);
|
||||||
|
// Scroll vers la preview apres mount
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
const preview = document.querySelector('.preview-article');
|
||||||
|
if (preview && grid) {
|
||||||
|
const previewTop = (preview as HTMLElement).offsetTop;
|
||||||
|
grid.scrollTo({ top: Math.max(0, previewTop - 8), behavior: 'smooth' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
window.addEventListener('preview-close', () => {
|
||||||
|
applyPreviewState(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Drag-resize desktop (>=768px) - desactive quand preview ouverte
|
||||||
|
const dragHandle = document.getElementById('col-centre-drag-handle');
|
||||||
|
|
||||||
|
if (dragHandle && grid && haut && bas) {
|
||||||
let isDragging = false;
|
let isDragging = false;
|
||||||
let startY = 0;
|
let startY = 0;
|
||||||
let startTop = 0;
|
let startHautH = 0;
|
||||||
|
let containerH = 0;
|
||||||
const getGridHeight = () => gridEl.getBoundingClientRect().height;
|
|
||||||
|
|
||||||
const getHautPercent = (): number => {
|
|
||||||
const rows = gridEl.style.gridTemplateRows;
|
|
||||||
if (rows && rows.includes('fr')) {
|
|
||||||
const parts = rows.split(' ');
|
|
||||||
if (parts.length >= 2) {
|
|
||||||
const top = parseFloat(parts[0]) || 1;
|
|
||||||
const bot = parseFloat(parts[parts.length - 1]) || 1;
|
|
||||||
return (top / (top + bot)) * 100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rows && rows.includes('%')) {
|
|
||||||
const parts = rows.split(' ');
|
|
||||||
return parseFloat(parts[0]) || 50;
|
|
||||||
}
|
|
||||||
return 33.33;
|
|
||||||
};
|
|
||||||
|
|
||||||
dragHandle.addEventListener('mousedown', (e: MouseEvent) => {
|
dragHandle.addEventListener('mousedown', (e: MouseEvent) => {
|
||||||
|
if (grid.dataset.previewOpen === 'true') return;
|
||||||
if (sessionStorage.getItem('tf-haut-replie') === 'true') return;
|
if (sessionStorage.getItem('tf-haut-replie') === 'true') return;
|
||||||
isDragging = true;
|
isDragging = true;
|
||||||
startY = e.clientY;
|
startY = e.clientY;
|
||||||
startTop = (getHautPercent() / 100) * getGridHeight();
|
startHautH = haut.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';
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('mousemove', (e: MouseEvent) => {
|
document.addEventListener('mousemove', (e: MouseEvent) => {
|
||||||
if (!isDragging || !gridEl) return;
|
if (!isDragging) return;
|
||||||
const delta = e.clientY - startY;
|
const delta = e.clientY - startY;
|
||||||
const totalH = getGridHeight();
|
const newHautH = Math.min(Math.max(startHautH + delta, containerH * 0.2), containerH * 0.8);
|
||||||
const newTop = Math.min(Math.max(startTop + delta, totalH * 0.2), totalH * 0.8);
|
const hautPct = (newHautH / containerH) * 100;
|
||||||
const topPct = (newTop / totalH) * 100;
|
const basPct = 100 - hautPct;
|
||||||
const botPct = 100 - topPct;
|
haut.style.flex = `1 1 ${hautPct.toFixed(1)}%`;
|
||||||
gridEl.style.gridTemplateRows = `${topPct.toFixed(1)}% ${botPct.toFixed(1)}%`;
|
bas.style.flex = `1 1 ${basPct.toFixed(1)}%`;
|
||||||
gridEl.classList.remove('grid-rows-2');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('mouseup', () => {
|
document.addEventListener('mouseup', () => {
|
||||||
@@ -170,23 +226,37 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
|
|||||||
isDragging = false;
|
isDragging = false;
|
||||||
document.body.style.cursor = '';
|
document.body.style.cursor = '';
|
||||||
document.body.style.userSelect = '';
|
document.body.style.userSelect = '';
|
||||||
const rows = gridEl.style.gridTemplateRows;
|
const hf = haut.style.flex;
|
||||||
if (rows) sessionStorage.setItem('tf-centre-rows', rows);
|
const bf = bas.style.flex;
|
||||||
|
if (hf) {
|
||||||
|
sessionStorage.setItem('tf-centre-haut-flex', hf);
|
||||||
|
defaultHautFlex = hf;
|
||||||
|
}
|
||||||
|
if (bf) {
|
||||||
|
sessionStorage.setItem('tf-centre-bas-flex', bf);
|
||||||
|
defaultBasFlex = bf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Restaurer position depuis sessionStorage
|
// Restaurer position depuis sessionStorage
|
||||||
const savedRows = sessionStorage.getItem('tf-centre-rows');
|
const savedHF = sessionStorage.getItem('tf-centre-haut-flex');
|
||||||
if (savedRows && sessionStorage.getItem('tf-haut-replie') !== 'true') {
|
const savedBF = sessionStorage.getItem('tf-centre-bas-flex');
|
||||||
gridEl.style.gridTemplateRows = savedRows;
|
if (savedHF && savedBF && sessionStorage.getItem('tf-haut-replie') !== 'true') {
|
||||||
gridEl.classList.remove('grid-rows-2');
|
haut.style.flex = savedHF;
|
||||||
|
bas.style.flex = savedBF;
|
||||||
|
defaultHautFlex = savedHF;
|
||||||
|
defaultBasFlex = savedBF;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Double-click sur drag handle = reset default 1/3 + 2/3
|
// Double-click sur drag handle = reset default 1/3 + 2/3
|
||||||
dragHandle.addEventListener('dblclick', () => {
|
dragHandle.addEventListener('dblclick', () => {
|
||||||
gridEl.style.gridTemplateRows = '1fr 2fr';
|
haut.style.flex = '1 1 33%';
|
||||||
gridEl.classList.remove('grid-rows-2');
|
bas.style.flex = '1 1 67%';
|
||||||
sessionStorage.removeItem('tf-centre-rows');
|
sessionStorage.removeItem('tf-centre-haut-flex');
|
||||||
|
sessionStorage.removeItem('tf-centre-bas-flex');
|
||||||
|
defaultHautFlex = '1 1 33%';
|
||||||
|
defaultBasFlex = '1 1 67%';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,15 @@ interface CarteNode {
|
|||||||
slug?: string
|
slug?: string
|
||||||
theme?: string
|
theme?: string
|
||||||
path?: string
|
path?: string
|
||||||
|
domain?: string // V1.2-O : domaine plateforme source (logo Brandfetch CDN)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// V1.2-O : logos plateforme via Brandfetch CDN (visible zoom > 1.5x seulement)
|
||||||
|
const BRANDFETCH_CLIENT_ID = '4ae58bd85c8140eab0cee72f40656120'
|
||||||
|
const LOGO_ZOOM_THRESHOLD = 1.5
|
||||||
|
const logoUrl = (domain: string) =>
|
||||||
|
`https://cdn.brandfetch.io/${domain}/w/64/h/64?c=${BRANDFETCH_CLIENT_ID}`
|
||||||
|
|
||||||
interface CarteEdge {
|
interface CarteEdge {
|
||||||
source: string | CarteNode
|
source: string | CarteNode
|
||||||
target: string | CarteNode
|
target: string | CarteNode
|
||||||
@@ -64,32 +71,46 @@ let zoomBehavior: d3.ZoomBehavior<SVGSVGElement, unknown> | null = null
|
|||||||
const isMobile = computed(() => width.value < 600)
|
const isMobile = computed(() => width.value < 600)
|
||||||
const nodeRadius = computed(() => isMobile.value ? 10 : 14)
|
const nodeRadius = computed(() => isMobile.value ? 10 : 14)
|
||||||
|
|
||||||
|
// V1.2-N palette : encre / papier / ocre
|
||||||
|
// - central niveau 0 : fill encre #0F172A, label blanc inscrit dans le cercle
|
||||||
|
// - essais (niveaux 1-2) : fill papier #FFFFFF, stroke encre, label encre a droite
|
||||||
|
// - projets : fill ocre #B45309, label blanc inscrit dans le cercle
|
||||||
|
// - statut "edite" : stroke epaissi (l'epaisseur conserve l'info, pas la couleur)
|
||||||
function colorFor(d: SimNode): string {
|
function colorFor(d: SimNode): string {
|
||||||
if (d.nature === 'projet') return '#b45309'
|
if (d.nature === 'projet') return '#B45309'
|
||||||
if (d.niveau === 0) return '#1d4ed8'
|
if (d.niveau === 0) return '#0F172A'
|
||||||
if (d.niveau === 1) return '#2563eb'
|
return '#FFFFFF'
|
||||||
if (d.niveau === 2) return '#60a5fa'
|
|
||||||
return props.familyColors[d.family] || '#9ca3af'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRadius(d: SimNode): number {
|
function getRadius(d: SimNode): number {
|
||||||
return d.radius ?? nodeRadius.value
|
if (d.radius != null) return d.radius
|
||||||
|
if (d.niveau === 0) return 30
|
||||||
|
if (d.nature === 'projet') return 18
|
||||||
|
return nodeRadius.value
|
||||||
}
|
}
|
||||||
|
|
||||||
function strokeFor(d: SimNode): string {
|
function strokeFor(d: SimNode): string {
|
||||||
return d.statut === 'edite' ? '#0f172a' : '#94a3b8'
|
if (d.nature === 'projet') return '#B45309'
|
||||||
|
if (d.niveau === 0) return '#0F172A'
|
||||||
|
return '#0F172A'
|
||||||
}
|
}
|
||||||
|
|
||||||
function strokeWidthFor(d: SimNode): number {
|
function strokeWidthFor(d: SimNode): number {
|
||||||
return d.statut === 'edite' ? 2.5 : 1
|
return d.statut === 'edite' ? 2.5 : 1.5
|
||||||
}
|
}
|
||||||
|
|
||||||
function labelWeightFor(d: SimNode): string {
|
function labelWeightFor(d: SimNode): string {
|
||||||
return d.statut === 'edite' ? 'bold' : 'normal'
|
return d.statut === 'edite' ? 'bold' : 'normal'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Label inscrit dans le cercle (fond fonce) pour central + projets
|
||||||
|
function labelInsideFor(d: SimNode): boolean {
|
||||||
|
return d.niveau === 0 || d.nature === 'projet'
|
||||||
|
}
|
||||||
|
|
||||||
function labelColorFor(d: SimNode): string {
|
function labelColorFor(d: SimNode): string {
|
||||||
return d.statut === 'edite' ? '#0f172a' : '#6b7280'
|
if (labelInsideFor(d)) return '#FFFFFF'
|
||||||
|
return d.statut === 'edite' ? '#0F172A' : '#475569'
|
||||||
}
|
}
|
||||||
|
|
||||||
function truncate(str: string, max: number): string {
|
function truncate(str: string, max: number): string {
|
||||||
@@ -97,6 +118,27 @@ function truncate(str: string, max: number): string {
|
|||||||
return str.length > max ? str.slice(0, max - 1) + '…' : str
|
return str.length > max ? str.slice(0, max - 1) + '…' : str
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Split intelligent du label central sur 2-3 lignes (autour de "+")
|
||||||
|
function splitCentralLabel(label: string): string[] {
|
||||||
|
if (!label) return ['']
|
||||||
|
// priorite : split sur " + " si present
|
||||||
|
if (label.includes(' + ')) {
|
||||||
|
const parts = label.split(' + ')
|
||||||
|
return [parts[0].trim(), '+', parts.slice(1).join(' + ').trim()]
|
||||||
|
}
|
||||||
|
// fallback : split a peu pres au milieu sur un espace
|
||||||
|
if (label.length > 14) {
|
||||||
|
const mid = Math.floor(label.length / 2)
|
||||||
|
const left = label.lastIndexOf(' ', mid)
|
||||||
|
const right = label.indexOf(' ', mid)
|
||||||
|
const cut = (mid - left <= right - mid && left > 0) ? left : right
|
||||||
|
if (cut > 0) {
|
||||||
|
return [label.slice(0, cut).trim(), label.slice(cut).trim()]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [label]
|
||||||
|
}
|
||||||
|
|
||||||
function buildSimNodes(): SimNode[] {
|
function buildSimNodes(): SimNode[] {
|
||||||
return props.nodes.map(n => ({ ...n }))
|
return props.nodes.map(n => ({ ...n }))
|
||||||
}
|
}
|
||||||
@@ -152,6 +194,11 @@ function initSvg() {
|
|||||||
.scaleExtent([0.3, 4])
|
.scaleExtent([0.3, 4])
|
||||||
.on('zoom', (event) => {
|
.on('zoom', (event) => {
|
||||||
gZoom!.attr('transform', event.transform.toString())
|
gZoom!.attr('transform', event.transform.toString())
|
||||||
|
// V1.2-O : toggle visibilite logos plateforme selon le niveau de zoom
|
||||||
|
// (evite la surcharge visuelle au niveau d'ensemble, montre detail au drill-down)
|
||||||
|
const scale = event.transform.k
|
||||||
|
gZoom!.selectAll('.logo-overlay')
|
||||||
|
.style('opacity', scale > LOGO_ZOOM_THRESHOLD ? 1 : 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
svgRoot.call(zoomBehavior as any)
|
svgRoot.call(zoomBehavior as any)
|
||||||
@@ -167,14 +214,14 @@ function render() {
|
|||||||
|
|
||||||
const fontSize = isMobile.value ? 9 : 11
|
const fontSize = isMobile.value ? 9 : 11
|
||||||
|
|
||||||
// Liens
|
// Liens — gris doux papier
|
||||||
gLinks!
|
gLinks!
|
||||||
.selectAll<SVGLineElement, SimLink>('line')
|
.selectAll<SVGLineElement, SimLink>('line')
|
||||||
.data(simLinks)
|
.data(simLinks)
|
||||||
.join('line')
|
.join('line')
|
||||||
.attr('stroke', '#94a3b8')
|
.attr('stroke', '#94A3B8')
|
||||||
.attr('stroke-opacity', 0.45)
|
.attr('stroke-opacity', 0.4)
|
||||||
.attr('stroke-width', 1.2)
|
.attr('stroke-width', 1)
|
||||||
|
|
||||||
// Noeuds = groupe <g> par node
|
// Noeuds = groupe <g> par node
|
||||||
const nodeGroups = gNodes!
|
const nodeGroups = gNodes!
|
||||||
@@ -202,17 +249,84 @@ function render() {
|
|||||||
.attr('stroke', d => strokeFor(d))
|
.attr('stroke', d => strokeFor(d))
|
||||||
.attr('stroke-width', d => strokeWidthFor(d))
|
.attr('stroke-width', d => strokeWidthFor(d))
|
||||||
|
|
||||||
// Label
|
// Label : inscrit dans le cercle pour central + projets, a droite sinon
|
||||||
nodeGroups.append('text')
|
// Pour le noeud central (label long), on passe en multi-lignes
|
||||||
.attr('text-anchor', 'start')
|
nodeGroups.each(function (d) {
|
||||||
.attr('dominant-baseline', 'central')
|
const g = d3.select(this)
|
||||||
.attr('dx', d => getRadius(d) + 4)
|
const inside = labelInsideFor(d)
|
||||||
.attr('font-size', fontSize)
|
|
||||||
.attr('font-family', 'system-ui, sans-serif')
|
if (inside && d.niveau === 0) {
|
||||||
.attr('font-weight', d => labelWeightFor(d))
|
// Noeud central : label en 2 lignes inscrites au centre
|
||||||
.attr('fill', d => labelColorFor(d))
|
const parts = splitCentralLabel(d.label)
|
||||||
|
const lineHeight = isMobile.value ? 10 : 12
|
||||||
|
const fs = isMobile.value ? 9 : 11
|
||||||
|
const startY = -((parts.length - 1) * lineHeight) / 2
|
||||||
|
parts.forEach((line, i) => {
|
||||||
|
g.append('text')
|
||||||
|
.attr('text-anchor', 'middle')
|
||||||
|
.attr('dominant-baseline', 'central')
|
||||||
|
.attr('x', 0)
|
||||||
|
.attr('y', startY + i * lineHeight)
|
||||||
|
.attr('font-size', fs)
|
||||||
|
.attr('font-family', 'system-ui, sans-serif')
|
||||||
|
.attr('font-weight', 'bold')
|
||||||
|
.attr('fill', '#FFFFFF')
|
||||||
|
.attr('pointer-events', 'none')
|
||||||
|
.text(line)
|
||||||
|
})
|
||||||
|
} else if (inside) {
|
||||||
|
// Projets : label centre dans le cercle (court)
|
||||||
|
g.append('text')
|
||||||
|
.attr('text-anchor', 'middle')
|
||||||
|
.attr('dominant-baseline', 'central')
|
||||||
|
.attr('x', 0)
|
||||||
|
.attr('y', 0)
|
||||||
|
.attr('font-size', fontSize)
|
||||||
|
.attr('font-family', 'system-ui, sans-serif')
|
||||||
|
.attr('font-weight', labelWeightFor(d))
|
||||||
|
.attr('fill', '#FFFFFF')
|
||||||
|
.attr('pointer-events', 'none')
|
||||||
|
.text(truncate(d.label, 6))
|
||||||
|
} else {
|
||||||
|
// Essais : label a droite du cercle
|
||||||
|
g.append('text')
|
||||||
|
.attr('text-anchor', 'start')
|
||||||
|
.attr('dominant-baseline', 'central')
|
||||||
|
.attr('dx', getRadius(d) + 4)
|
||||||
|
.attr('font-size', fontSize)
|
||||||
|
.attr('font-family', 'system-ui, sans-serif')
|
||||||
|
.attr('font-weight', labelWeightFor(d))
|
||||||
|
.attr('fill', labelColorFor(d))
|
||||||
|
.attr('pointer-events', 'none')
|
||||||
|
.text(truncate(d.label, isMobile.value ? 18 : 30))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// V1.2-O : Logo plateforme (visible zoom > 1.5x seulement)
|
||||||
|
// Cercle blanc 14px en bas-droite du node (offset +60% x/+60% y du radius)
|
||||||
|
// Image clip-path circle pour avatar style. Hidden par defaut (opacity 0).
|
||||||
|
const nodeGroupsWithLogo = nodeGroups.filter(d => !!d.domain)
|
||||||
|
|
||||||
|
const logoOverlay = nodeGroupsWithLogo.append('g')
|
||||||
|
.attr('class', 'logo-overlay')
|
||||||
|
.style('opacity', 0)
|
||||||
.attr('pointer-events', 'none')
|
.attr('pointer-events', 'none')
|
||||||
.text(d => truncate(d.label, isMobile.value ? 18 : 30))
|
|
||||||
|
logoOverlay.append('circle')
|
||||||
|
.attr('cx', d => getRadius(d) * 0.6)
|
||||||
|
.attr('cy', d => getRadius(d) * 0.6)
|
||||||
|
.attr('r', 9)
|
||||||
|
.attr('fill', '#FFFFFF')
|
||||||
|
.attr('stroke', '#0F172A')
|
||||||
|
.attr('stroke-width', 0.5)
|
||||||
|
|
||||||
|
logoOverlay.append('image')
|
||||||
|
.attr('href', d => logoUrl(d.domain!))
|
||||||
|
.attr('x', d => getRadius(d) * 0.6 - 7)
|
||||||
|
.attr('y', d => getRadius(d) * 0.6 - 7)
|
||||||
|
.attr('width', 14)
|
||||||
|
.attr('height', 14)
|
||||||
|
.attr('clip-path', d => `circle(7px at ${getRadius(d) * 0.6}px ${getRadius(d) * 0.6}px)`)
|
||||||
|
|
||||||
// Tooltip <title>
|
// Tooltip <title>
|
||||||
nodeGroups.append('title')
|
nodeGroups.append('title')
|
||||||
@@ -325,7 +439,7 @@ onUnmounted(() => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #fafafa;
|
background: #FAFAF7;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,31 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
interface JournalItem {
|
|
||||||
id: string
|
|
||||||
platform: 'substack' | 'gitea' | 'github' | 'instagram' | 'castopod' | 'blog' | 'linkedin'
|
|
||||||
hashtag: string
|
|
||||||
date: string
|
|
||||||
titre: string
|
|
||||||
extrait: string
|
|
||||||
url: string
|
|
||||||
thumbnail: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectedItem = ref<JournalItem | null>(null)
|
|
||||||
const iframeRef = ref<HTMLIFrameElement | null>(null)
|
const iframeRef = ref<HTMLIFrameElement | null>(null)
|
||||||
|
const wrapperRef = ref<HTMLDivElement | null>(null)
|
||||||
const skeletonHidden = ref(false)
|
const skeletonHidden = ref(false)
|
||||||
|
|
||||||
const onJournalItemClick = (e: Event) => {
|
// Force rendu desktop de l'iframe AEP : viewport simulee 1440px + scale dynamique
|
||||||
const ce = e as CustomEvent
|
const VIEWPORT_W = 1440
|
||||||
if (ce.detail?.item) selectedItem.value = ce.detail.item
|
const iframeScale = ref(0.42)
|
||||||
|
let resizeObs: ResizeObserver | null = null
|
||||||
|
|
||||||
|
const updateScale = () => {
|
||||||
|
if (!wrapperRef.value) return
|
||||||
|
const w = wrapperRef.value.clientWidth
|
||||||
|
if (w > 0) iframeScale.value = w / VIEWPORT_W
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
const iframeStyle = computed(() => ({
|
||||||
window.addEventListener('journal-item-click', onJournalItemClick as EventListener)
|
width: VIEWPORT_W + 'px',
|
||||||
})
|
height: (100 / iframeScale.value) + '%',
|
||||||
onUnmounted(() => {
|
transform: `scale(${iframeScale.value})`,
|
||||||
window.removeEventListener('journal-item-click', onJournalItemClick as EventListener)
|
transformOrigin: '0 0',
|
||||||
})
|
}))
|
||||||
|
|
||||||
const reset = () => {
|
let fallbackTimer: ReturnType<typeof setTimeout> | null = null
|
||||||
selectedItem.value = null
|
|
||||||
skeletonHidden.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
const onIframeLoad = () => {
|
const revealIframe = () => {
|
||||||
if (iframeRef.value) {
|
if (iframeRef.value) {
|
||||||
iframeRef.value.classList.remove('opacity-0')
|
iframeRef.value.classList.remove('opacity-0')
|
||||||
iframeRef.value.classList.add('opacity-100')
|
iframeRef.value.classList.add('opacity-100')
|
||||||
@@ -41,55 +33,40 @@ const onIframeLoad = () => {
|
|||||||
skeletonHidden.value = true
|
skeletonHidden.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const extractInstaShortcode = (url: string): string | null => {
|
onMounted(() => {
|
||||||
const m = url.match(/\/(p|reel)\/([^\/\?#]+)/)
|
if (wrapperRef.value && typeof ResizeObserver !== 'undefined') {
|
||||||
return m ? m[2] : null
|
updateScale()
|
||||||
}
|
resizeObs = new ResizeObserver(updateScale)
|
||||||
|
resizeObs.observe(wrapperRef.value)
|
||||||
const embedUrl = computed(() => {
|
|
||||||
if (!selectedItem.value) return null
|
|
||||||
const item = selectedItem.value
|
|
||||||
if (item.platform === 'substack') {
|
|
||||||
return item.url.includes('?') ? item.url + '&embed=1' : item.url + '?embed=1'
|
|
||||||
}
|
}
|
||||||
if (item.platform === 'instagram') {
|
// Fallback : si @load ne fire pas dans 2.5s (transform/scale peut bloquer l'event),
|
||||||
const sc = extractInstaShortcode(item.url)
|
// on revele quand meme l'iframe pour ne pas laisser le skeleton infini.
|
||||||
return sc ? `https://www.instagram.com/p/${sc}/embed/` : null
|
fallbackTimer = setTimeout(() => {
|
||||||
|
revealIframe()
|
||||||
|
}, 2500)
|
||||||
|
})
|
||||||
|
onUnmounted(() => {
|
||||||
|
resizeObs?.disconnect()
|
||||||
|
resizeObs = null
|
||||||
|
if (fallbackTimer) {
|
||||||
|
clearTimeout(fallbackTimer)
|
||||||
|
fallbackTimer = null
|
||||||
}
|
}
|
||||||
return null
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const platformLabel = (p: string) => {
|
const onIframeLoad = () => {
|
||||||
const labels: Record<string, string> = {
|
if (fallbackTimer) {
|
||||||
substack: 'Substack',
|
clearTimeout(fallbackTimer)
|
||||||
instagram: 'Instagram',
|
fallbackTimer = null
|
||||||
gitea: 'Gitea',
|
|
||||||
github: 'GitHub',
|
|
||||||
castopod: 'Podcast',
|
|
||||||
blog: 'Blog',
|
|
||||||
linkedin: 'LinkedIn',
|
|
||||||
}
|
|
||||||
return labels[p] || p
|
|
||||||
}
|
|
||||||
|
|
||||||
const formatDate = (iso: string) => {
|
|
||||||
try {
|
|
||||||
const d = new Date(iso)
|
|
||||||
return isNaN(d.getTime())
|
|
||||||
? ''
|
|
||||||
: `${String(d.getDate()).padStart(2, '0')}/${String(d.getMonth() + 1).padStart(2, '0')}`
|
|
||||||
} catch {
|
|
||||||
return ''
|
|
||||||
}
|
}
|
||||||
|
revealIframe()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="embed-dynamique h-full flex flex-col relative">
|
<div class="embed-dynamique h-full flex flex-col relative">
|
||||||
|
<div class="h-full">
|
||||||
<!-- DEFAULT : iframe AEP (aucun item selectionne) -->
|
<div ref="wrapperRef" class="relative h-full bg-neutral-100 overflow-hidden">
|
||||||
<div v-if="!selectedItem" class="h-full">
|
|
||||||
<div class="relative h-full bg-neutral-100">
|
|
||||||
<div
|
<div
|
||||||
v-if="!skeletonHidden"
|
v-if="!skeletonHidden"
|
||||||
id="embed-skeleton"
|
id="embed-skeleton"
|
||||||
@@ -100,82 +77,13 @@ const formatDate = (iso: string) => {
|
|||||||
<iframe
|
<iframe
|
||||||
src="https://aep.trans-former.fr/agences"
|
src="https://aep.trans-former.fr/agences"
|
||||||
title="Carte AEP"
|
title="Carte AEP"
|
||||||
class="w-full h-full border-0 opacity-0 transition-opacity duration-500"
|
class="absolute top-0 left-0 border-0 opacity-0 transition-opacity duration-500"
|
||||||
|
:style="iframeStyle"
|
||||||
sandbox="allow-scripts allow-same-origin allow-popups allow-forms"
|
sandbox="allow-scripts allow-same-origin allow-popups allow-forms"
|
||||||
@load="onIframeLoad"
|
@load="onIframeLoad"
|
||||||
ref="iframeRef"
|
ref="iframeRef"
|
||||||
></iframe>
|
></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- EMBED MODE : teaser + embed live ou carte incitative -->
|
|
||||||
<div v-else class="h-full flex flex-col overflow-y-auto">
|
|
||||||
|
|
||||||
<!-- Header : reset + hashtag -->
|
|
||||||
<div class="flex items-center justify-between px-4 py-2 border-b border-neutral-200 bg-white sticky top-0 z-10">
|
|
||||||
<button
|
|
||||||
class="text-xs text-neutral-500 hover:text-neutral-900 flex items-center gap-1"
|
|
||||||
@click="reset"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
- Retour a la carte
|
|
||||||
</button>
|
|
||||||
<span class="text-xs text-neutral-400" style="font-family: 'Courier New', Courier, monospace;">
|
|
||||||
{{ selectedItem.hashtag }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Teaser -->
|
|
||||||
<div class="px-4 py-3 border-b border-neutral-100 bg-neutral-50">
|
|
||||||
<p class="text-[11px] text-neutral-500 mb-1">{{ formatDate(selectedItem.date) }} - {{ selectedItem.platform }}</p>
|
|
||||||
<h3 class="text-sm font-semibold text-neutral-900 leading-snug mb-1">{{ selectedItem.titre }}</h3>
|
|
||||||
<p v-if="selectedItem.extrait" class="text-xs text-neutral-600 leading-relaxed line-clamp-3">
|
|
||||||
{{ selectedItem.extrait }}
|
|
||||||
</p>
|
|
||||||
<img
|
|
||||||
v-if="selectedItem.thumbnail"
|
|
||||||
:src="selectedItem.thumbnail"
|
|
||||||
:alt="selectedItem.titre"
|
|
||||||
class="mt-2 w-full max-h-28 object-cover rounded"
|
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Embed live (Substack ou Instagram) -->
|
|
||||||
<div v-if="embedUrl" class="flex-1 min-h-[200px] bg-white">
|
|
||||||
<iframe
|
|
||||||
:src="embedUrl"
|
|
||||||
class="w-full h-full border-0 min-h-[300px]"
|
|
||||||
:title="selectedItem.titre"
|
|
||||||
loading="lazy"
|
|
||||||
sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation"
|
|
||||||
></iframe>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Carte incitative (autres plateformes) -->
|
|
||||||
<div v-else class="flex-1 flex flex-col items-start justify-center px-4 py-6">
|
|
||||||
<p class="text-xs text-neutral-500 mb-3 italic">Embed non disponible pour cette plateforme.</p>
|
|
||||||
<a
|
|
||||||
:href="selectedItem.url"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="inline-block px-4 py-2 bg-neutral-900 text-white text-sm rounded-lg hover:bg-neutral-700 transition-colors"
|
|
||||||
>
|
|
||||||
Voir sur {{ platformLabel(selectedItem.platform) }} ->
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- CTA propagation universel -->
|
|
||||||
<div class="px-4 py-3 border-t border-neutral-100">
|
|
||||||
<a
|
|
||||||
:href="selectedItem.url"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="text-xs text-neutral-500 hover:text-neutral-900 underline"
|
|
||||||
>
|
|
||||||
Continuer sur {{ platformLabel(selectedItem.platform) }} - commenter, partager
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
152
src/components/vue/PreviewArticle.vue
Normal file
152
src/components/vue/PreviewArticle.vue
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
|
interface JournalItem {
|
||||||
|
id: string
|
||||||
|
platform: 'substack' | 'gitea' | 'github' | 'instagram' | 'castopod' | 'blog' | 'linkedin'
|
||||||
|
hashtag: string
|
||||||
|
date: string
|
||||||
|
titre: string
|
||||||
|
extrait: string
|
||||||
|
url: string
|
||||||
|
thumbnail: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedItem = ref<JournalItem | null>(null)
|
||||||
|
|
||||||
|
const onJournalItemClick = (e: Event) => {
|
||||||
|
const ce = e as CustomEvent
|
||||||
|
if (ce.detail?.item) selectedItem.value = ce.detail.item
|
||||||
|
}
|
||||||
|
|
||||||
|
const onPreviewCloseExternal = () => {
|
||||||
|
selectedItem.value = null
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
window.addEventListener('journal-item-click', onJournalItemClick as EventListener)
|
||||||
|
window.addEventListener('preview-close-request', onPreviewCloseExternal as EventListener)
|
||||||
|
})
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener('journal-item-click', onJournalItemClick as EventListener)
|
||||||
|
window.removeEventListener('preview-close-request', onPreviewCloseExternal as EventListener)
|
||||||
|
})
|
||||||
|
|
||||||
|
const close = () => {
|
||||||
|
selectedItem.value = null
|
||||||
|
window.dispatchEvent(new CustomEvent('preview-close'))
|
||||||
|
}
|
||||||
|
|
||||||
|
const extractInstaShortcode = (url: string): string | null => {
|
||||||
|
const m = url.match(/\/(p|reel)\/([^\/\?#]+)/)
|
||||||
|
return m ? m[2] : null
|
||||||
|
}
|
||||||
|
|
||||||
|
const embedUrl = computed(() => {
|
||||||
|
if (!selectedItem.value) return null
|
||||||
|
const item = selectedItem.value
|
||||||
|
if (item.platform === 'substack') {
|
||||||
|
return item.url.includes('?') ? item.url + '&embed=1' : item.url + '?embed=1'
|
||||||
|
}
|
||||||
|
if (item.platform === 'instagram') {
|
||||||
|
const sc = extractInstaShortcode(item.url)
|
||||||
|
return sc ? `https://www.instagram.com/p/${sc}/embed/` : null
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
})
|
||||||
|
|
||||||
|
const platformLabel = (p: string) => {
|
||||||
|
const labels: Record<string, string> = {
|
||||||
|
substack: 'Substack',
|
||||||
|
instagram: 'Instagram',
|
||||||
|
gitea: 'Gitea',
|
||||||
|
github: 'GitHub',
|
||||||
|
castopod: 'Podcast',
|
||||||
|
blog: 'Blog',
|
||||||
|
linkedin: 'LinkedIn',
|
||||||
|
}
|
||||||
|
return labels[p] || p
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatDate = (iso: string) => {
|
||||||
|
try {
|
||||||
|
const d = new Date(iso)
|
||||||
|
return isNaN(d.getTime())
|
||||||
|
? ''
|
||||||
|
: `${String(d.getDate()).padStart(2, '0')}/${String(d.getMonth() + 1).padStart(2, '0')}`
|
||||||
|
} catch {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="selectedItem" class="preview-article border border-neutral-200 rounded overflow-hidden bg-white flex flex-col">
|
||||||
|
|
||||||
|
<!-- Header : reset + hashtag -->
|
||||||
|
<div class="flex items-center justify-between px-4 py-2 border-b border-neutral-200 bg-white">
|
||||||
|
<button
|
||||||
|
class="text-xs text-neutral-500 hover:text-neutral-900 flex items-center gap-1"
|
||||||
|
@click="close"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
- Retour a la carte
|
||||||
|
</button>
|
||||||
|
<span class="text-xs text-neutral-400" style="font-family: 'Courier New', Courier, monospace;">
|
||||||
|
{{ selectedItem.hashtag }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Teaser -->
|
||||||
|
<div class="px-4 py-3 border-b border-neutral-100 bg-neutral-50">
|
||||||
|
<p class="text-[11px] text-neutral-500 mb-1">{{ formatDate(selectedItem.date) }} - {{ selectedItem.platform }}</p>
|
||||||
|
<h3 class="text-sm font-semibold text-neutral-900 leading-snug mb-1">{{ selectedItem.titre }}</h3>
|
||||||
|
<p v-if="selectedItem.extrait" class="text-xs text-neutral-600 leading-relaxed line-clamp-3">
|
||||||
|
{{ selectedItem.extrait }}
|
||||||
|
</p>
|
||||||
|
<img
|
||||||
|
v-if="selectedItem.thumbnail"
|
||||||
|
:src="selectedItem.thumbnail"
|
||||||
|
:alt="selectedItem.titre"
|
||||||
|
class="mt-2 w-full max-h-28 object-cover rounded"
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Embed live (Substack ou Instagram) -->
|
||||||
|
<div v-if="embedUrl" class="bg-white" style="height: 60vh; min-height: 400px;">
|
||||||
|
<iframe
|
||||||
|
:src="embedUrl"
|
||||||
|
class="w-full h-full border-0"
|
||||||
|
:title="selectedItem.titre"
|
||||||
|
loading="lazy"
|
||||||
|
sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation"
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Carte incitative (autres plateformes) -->
|
||||||
|
<div v-else class="flex flex-col items-start justify-center px-4 py-6">
|
||||||
|
<p class="text-xs text-neutral-500 mb-3 italic">Embed non disponible pour cette plateforme.</p>
|
||||||
|
<a
|
||||||
|
:href="selectedItem.url"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="inline-block px-4 py-2 bg-neutral-900 text-white text-sm rounded-lg hover:bg-neutral-700 transition-colors"
|
||||||
|
>
|
||||||
|
Voir sur {{ platformLabel(selectedItem.platform) }} ->
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- CTA propagation universel -->
|
||||||
|
<div class="px-4 py-3 border-t border-neutral-100">
|
||||||
|
<a
|
||||||
|
:href="selectedItem.url"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="text-xs text-neutral-500 hover:text-neutral-900 underline"
|
||||||
|
>
|
||||||
|
Continuer sur {{ platformLabel(selectedItem.platform) }} - commenter, partager
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user