11import { RiDatabase2Line , RiLineChartLine , RiLink , RiListCheck2 , RiMarkdownLine , RiRobot2Line , RiWindow2Line } from '@remixicon/vue'
22import type { AccordionListBloc , DataservicesListBloc , DatasetsListBloc , HeroBloc , LinksListBloc , MarkdownBloc , ReusesListBloc } from '~/types/pages'
3+ import DatasetsListBlocComponent from '~/components/Pages/DatasetsListBloc.vue'
4+ import DataservicesListBlocComponent from '~/components/Pages/DataservicesListBloc.vue'
5+ import ReusesListBlocComponent from '~/components/Pages/ReusesListBloc.vue'
6+ import LinksListBlocComponent from '~/components/Pages/LinksListBloc.vue'
7+ import MarkdownBlocComponent from '~/components/Pages/MarkdownBloc.vue'
8+ import AccordionBlocEditorComponent from '~/components/Pages/AccordionBlocEditor.vue'
9+ import HeroBlocComponent from '~/components/Pages/HeroBloc.vue'
310
411export function useContentBlocsTypes ( ) {
512 const { t } = useTranslation ( )
@@ -9,26 +16,37 @@ export function useContentBlocsTypes() {
916 icon : RiDatabase2Line ,
1017 name : t ( 'Données à la une' ) ,
1118 description : t ( 'Mettre en avant jusqu\'à 4 jeux de données' ) ,
19+ component : DatasetsListBlocComponent ,
1220 default : ( ) : Omit < DatasetsListBloc , 'id' > => ( { class : 'DatasetsListBloc' , title : t ( 'Mes jeux de données' ) , subtitle : null , datasets : [ ] } ) ,
1321 } ,
1422 DataservicesListBloc : {
1523 icon : RiRobot2Line ,
1624 name : t ( 'APIs à la une' ) ,
1725 description : t ( 'Mettre en avant jusqu\'à 4 APIs' ) ,
26+ component : DataservicesListBlocComponent ,
1827 default : ( ) : Omit < DataservicesListBloc , 'id' > => ( { class : 'DataservicesListBloc' , title : t ( 'Mes APIs' ) , subtitle : null , dataservices : [ ] } ) ,
1928 } ,
2029 ReusesListBloc : {
2130 icon : RiLineChartLine ,
2231 name : t ( 'Réutilisations à la une' ) ,
2332 description : t ( 'Mettre en avant jusqu\'à 4 réutilisations' ) ,
33+ component : ReusesListBlocComponent ,
2434 default : ( ) : Omit < ReusesListBloc , 'id' > => ( { class : 'ReusesListBloc' , title : t ( 'Mes réutilisations' ) , subtitle : null , reuses : [ ] } ) ,
2535 } ,
2636 LinksListBloc : {
2737 icon : RiLink ,
2838 name : t ( 'Liens à la une' ) ,
2939 description : t ( 'Mettre en avant jusqu\'à 4 liens' ) ,
40+ component : LinksListBlocComponent ,
3041 default : ( ) : Omit < LinksListBloc , 'id' > => ( { class : 'LinksListBloc' , title : t ( 'Mes liens' ) , subtitle : null , paragraph : null , main_link_title : null , main_link_url : null , links : [ ] } ) ,
3142 } ,
43+ MarkdownBloc : {
44+ icon : RiMarkdownLine ,
45+ name : t ( 'Bloc Markdown' ) ,
46+ description : t ( 'Ajouter du contenu texte riche' ) ,
47+ component : MarkdownBlocComponent ,
48+ default : ( ) : Omit < MarkdownBloc , 'id' > => ( { class : 'MarkdownBloc' , title : 'Titre' , subtitle : null , content : '' } ) ,
49+ } ,
3250 }
3351}
3452
@@ -42,18 +60,15 @@ export function useBlocsTypes() {
4260 icon : RiListCheck2 ,
4361 name : t ( 'Accordéon' ) ,
4462 description : t ( 'Liste dépliable de contenus (FAQ, etc.)' ) ,
63+ component : AccordionBlocEditorComponent ,
4564 default : ( ) : Omit < AccordionListBloc , 'id' > => ( { class : 'AccordionListBloc' , title : t ( 'Mon accordéon' ) , description : null , items : [ ] } ) ,
4665 } ,
47- MarkdownBloc : {
48- icon : RiMarkdownLine ,
49- name : t ( 'Bloc Markdown' ) ,
50- description : t ( 'Ajouter du contenu texte riche' ) ,
51- default : ( ) : Omit < MarkdownBloc , 'id' > => ( { class : 'MarkdownBloc' , title : 'Titre' , subtitle : null , content : '' } ) ,
52- } ,
5366 HeroBloc : {
5467 icon : RiWindow2Line ,
5568 name : t ( 'Hero' ) ,
5669 description : t ( 'Bandeau d\'en-tête avec titre et description' ) ,
70+ component : HeroBlocComponent ,
71+ fullWidth : true ,
5772 default : ( ) : Omit < HeroBloc , 'id' > => ( { class : 'HeroBloc' , title : 'Titre' , description : null , color : 'primary' } ) ,
5873 } ,
5974 }
0 commit comments