ep-lib-ts 0.1.38 → 0.1.40

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.
Files changed (95) hide show
  1. package/dist/{BgAudio-c72ab26e.js → BgAudio-842fb2ec.js} +1 -1
  2. package/dist/{DisplayBox-183c8fa3.js → DisplayBox-91cd3ce8.js} +1 -1
  3. package/dist/{EpAlert-dc58b9d0.js → EpAlert-528b8cca.js} +1 -1
  4. package/dist/{EpAudio-1ef1aecb.js → EpAudio-7cec685c.js} +1 -1
  5. package/dist/EpBadge-c1f78c68.js +6 -0
  6. package/dist/{EpBarChart-4a0b4379.js → EpBarChart-962af978.js} +1 -1
  7. package/dist/EpBtn-011702d8.js +6 -0
  8. package/dist/EpCard-304fa671.js +6 -0
  9. package/dist/EpChip-adc4452e.js +6 -0
  10. package/dist/EpContentSlider-9e7a31d1.js +6 -0
  11. package/dist/EpDivider-665c1f51.js +6 -0
  12. package/dist/{EpEdu-7ac81c48.js → EpEdu-21a7ee8a.js} +1 -1
  13. package/dist/EpFlex-dfa04304.js +6 -0
  14. package/dist/EpHeader-ad2402b1.js +6 -0
  15. package/dist/{EpIcon-f3d7d468.js → EpIcon-6c390e7f.js} +1 -1
  16. package/dist/EpIframe-c1ddc126.js +6 -0
  17. package/dist/EpImg-05cfa0ad.js +6 -0
  18. package/dist/{EpInput-457b39f8.js → EpInput-a01dd59b.js} +1 -1
  19. package/dist/EpLineChart-cbadbcde.js +6 -0
  20. package/dist/EpLink-652a9ccf.js +6 -0
  21. package/dist/EpLinkVersion-d6bd6af3.js +6 -0
  22. package/dist/{EpList-f4c21f26.js → EpList-8c5356af.js} +1 -1
  23. package/dist/EpModal-7311f070.js +6 -0
  24. package/dist/{EpNothing-b8e88547.js → EpNothing-2bc97780.js} +1 -1
  25. package/dist/EpPieChart-386930b8.js +6 -0
  26. package/dist/EpQuestion-0dcb3f65.js +6 -0
  27. package/dist/EpQuote-61ee0667.js +6 -0
  28. package/dist/EpRadio-4bc74a90.js +6 -0
  29. package/dist/EpReading-30eb7403.js +6 -0
  30. package/dist/EpResource-009c2731.js +6 -0
  31. package/dist/{EpScope-fb5a4efd.js → EpScope-a75e6829.js} +1 -1
  32. package/dist/EpSection-0e8728fc.js +6 -0
  33. package/dist/{EpSelect-cea4fd97.js → EpSelect-88ab32aa.js} +1 -1
  34. package/dist/EpSkeleton-0e7ae95d.js +6 -0
  35. package/dist/EpSoftware-16889441.js +6 -0
  36. package/dist/EpSpinner-86951588.js +6 -0
  37. package/dist/EpSvg-a3081cb5.js +6 -0
  38. package/dist/EpTable-50367f67.js +6 -0
  39. package/dist/EpTerm-7ea77431.js +6 -0
  40. package/dist/EpText-1b6866ea.js +6 -0
  41. package/dist/EpTimeLine-3e3bf959.js +6 -0
  42. package/dist/EpVideo-ff842a6d.js +6 -0
  43. package/dist/EpVideoPanopto-7e6b8755.js +6 -0
  44. package/dist/EpWordDef-3bd72c2e.js +6 -0
  45. package/dist/components/charts/EpBarChart.vue.d.ts +4 -0
  46. package/dist/components/charts/EpLineChart.vue.d.ts +4 -0
  47. package/dist/components/charts/EpPieChart.vue.d.ts +4 -0
  48. package/dist/components/medias/EpWordDef.vue.d.ts +29 -0
  49. package/dist/ep-lib-ts.js +23 -22
  50. package/dist/ep-lib-ts.umd.cjs +36 -36
  51. package/dist/{index-efcc4db9.js → index-430a8d16.js} +4677 -4556
  52. package/dist/index.d.ts +2 -1
  53. package/dist/types/GlossaryEntry.d.ts +10 -0
  54. package/package.json +1 -1
  55. package/src/components/basics/EpImg.vue +4 -3
  56. package/src/components/charts/EpBarChart.vue +5 -3
  57. package/src/components/charts/EpLineChart.vue +5 -3
  58. package/src/components/charts/EpPieChart.vue +6 -4
  59. package/src/components/educationals/EpResource.vue +0 -1
  60. package/src/components/interactions/EpContentSlider.vue +50 -30
  61. package/src/components/interactions/EpQuestion.vue +2 -2
  62. package/src/components/medias/EpVideo.vue +16 -3
  63. package/src/components/medias/EpWordDef.vue +116 -0
  64. package/src/components/signages/EpQuote.vue +10 -9
  65. package/dist/EpBadge-ac0af6da.js +0 -6
  66. package/dist/EpBtn-5aa83fe6.js +0 -6
  67. package/dist/EpCard-328ad09f.js +0 -6
  68. package/dist/EpChip-c52d3c21.js +0 -6
  69. package/dist/EpContentSlider-ea3ffb8d.js +0 -6
  70. package/dist/EpDivider-ac19c148.js +0 -6
  71. package/dist/EpFlex-e257d816.js +0 -6
  72. package/dist/EpHeader-90ba4918.js +0 -6
  73. package/dist/EpIframe-bc0a84ac.js +0 -6
  74. package/dist/EpImg-8a06246f.js +0 -6
  75. package/dist/EpLineChart-bb71e812.js +0 -6
  76. package/dist/EpLink-50d722ff.js +0 -6
  77. package/dist/EpLinkVersion-2c7b205f.js +0 -6
  78. package/dist/EpModal-9ac410ef.js +0 -6
  79. package/dist/EpPieChart-b45d9769.js +0 -6
  80. package/dist/EpQuestion-da7817e7.js +0 -6
  81. package/dist/EpQuote-9a0cca55.js +0 -6
  82. package/dist/EpRadio-087e5060.js +0 -6
  83. package/dist/EpReading-5c8a16ea.js +0 -6
  84. package/dist/EpResource-345ef0ae.js +0 -6
  85. package/dist/EpSection-682d2405.js +0 -6
  86. package/dist/EpSkeleton-6663cd6a.js +0 -6
  87. package/dist/EpSoftware-aadaffd5.js +0 -6
  88. package/dist/EpSpinner-b1cae366.js +0 -6
  89. package/dist/EpSvg-1ada51fc.js +0 -6
  90. package/dist/EpTable-078753c2.js +0 -6
  91. package/dist/EpTerm-ea4893ca.js +0 -6
  92. package/dist/EpText-413afc6b.js +0 -6
  93. package/dist/EpTimeLine-832b5522.js +0 -6
  94. package/dist/EpVideo-74beac1c.js +0 -6
  95. package/dist/EpVideoPanopto-faf1fd7a.js +0 -6
package/dist/index.d.ts CHANGED
@@ -34,8 +34,9 @@ import EpTerm from './components/medias/EpTerm.vue';
34
34
  import EpTimeLine from './components/medias/EpTimeLine.vue';
35
35
  import EpVideo from './components/medias/EpVideo.vue';
36
36
  import EpVideoPanopto from './components/medias/EpVideoPanopto.vue';
37
+ import EpWordDef from './components/medias/EpWordDef.vue';
37
38
  import EpAlert from './components/signages/EpAlert.vue';
38
39
  import EpHeader from './components/signages/EpHeader.vue';
39
40
  import EpQuote from './components/signages/EpQuote.vue';
40
41
  import EpSkeleton from './components/signages/EpSkeleton.vue';
41
- export { EpBadge, EpBtn, EpCard, EpChip, EpDivider, EpFlex, EpIcon, EpImg, EpSection, EpSpinner, EpTable, EpBarChart, EpLineChart, EpPieChart, EpText, EpEdu, EpReading, EpResource, EpScope, EpAccordeon, EpContentSlider, EpModal, EpQuestion, EpTabs, EpAudio, EpCarousel, EpIframe, EpKatex, EpLink, EpLinkVersion, EpSoftware, EpSvg, EpTerm, EpTimeLine, EpVideo, EpVideoPanopto, EpAlert, EpHeader, EpQuote, EpSkeleton };
42
+ export { EpBadge, EpBtn, EpCard, EpChip, EpDivider, EpFlex, EpIcon, EpImg, EpSection, EpSpinner, EpTable, EpBarChart, EpLineChart, EpPieChart, EpText, EpEdu, EpReading, EpResource, EpScope, EpAccordeon, EpContentSlider, EpModal, EpQuestion, EpTabs, EpAudio, EpCarousel, EpIframe, EpKatex, EpLink, EpLinkVersion, EpSoftware, EpSvg, EpTerm, EpTimeLine, EpVideo, EpVideoPanopto, EpAlert, EpHeader, EpQuote, EpSkeleton, EpWordDef };
@@ -0,0 +1,10 @@
1
+ export interface GlossaryEntry {
2
+ id: string;
3
+ term: string;
4
+ graminfo: string;
5
+ relation: string[];
6
+ domain: string | null;
7
+ definition: string;
8
+ variation: string[];
9
+ img?: string;
10
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep-lib-ts",
3
3
  "private": false,
4
- "version": "0.1.38",
4
+ "version": "0.1.40",
5
5
  "files": [
6
6
  "dist",
7
7
  "src/components/"
@@ -77,8 +77,8 @@ const { src, alt, title, caption, thumbnail, bib, noModal } = toRefs(props)
77
77
  </script>
78
78
 
79
79
  <template>
80
- <div>
81
- <div v-if="!thumbnail" class="flex">
80
+ <div :class="thumbnail?'inline-block':''">
81
+ <div v-if="!thumbnail" class="flex m-2">
82
82
  <div :class="`mx-auto bg-white rounded-md overflow-hidden shadow-md ${renderCols}`">
83
83
  <template v-if="isLoading">
84
84
  <span class="text-gray-200"><EpIcon :icon-path="mdiImage" size="250"></EpIcon></span>
@@ -107,12 +107,13 @@ const { src, alt, title, caption, thumbnail, bib, noModal } = toRefs(props)
107
107
  </div>
108
108
  </div>
109
109
  <EpModal v-model="showModal">
110
- <img class="object-cover object-center h-5/6 w-5/6 mx-auto" :src="src" :alt="alt" @click="toggleModal">
110
+ <img class="object-cover object-center h-5/6 w-5/6 mx-auto" :src="src" :alt="alt" @click="toggleModal"/>
111
111
  <div class="px-4 py-2" v-if="thumbnail">
112
112
  <h2 class="text-2xl font-bold">{{ title }}</h2>
113
113
  <p class="text-gray-500 text-sm mt-4">{{ caption }}</p>
114
114
  <div class="text-gray-700 mt-4" v-html="renderBib"></div>
115
115
  </div>
116
+ <!-- <div class="flex justify-end"><EpBtn @click="toggleModal" size="small" type="error" outlined>Fermer</EpBtn></div> -->
116
117
  </EpModal>
117
118
  <EpModal v-model="showBib" title="Référence bibliographique">
118
119
 
@@ -31,10 +31,12 @@ interface Props {
31
31
  type?: MediaVariants;
32
32
  mandateLevel?: string | null;
33
33
  source?:string;
34
+ width?:string
34
35
  }
35
36
 
36
37
  const props = withDefaults(defineProps<Props>(), {
37
- center: false,
38
+ center: true,
39
+ width:"500"
38
40
  });
39
41
 
40
42
  const renderText = computed(() => {
@@ -56,7 +58,7 @@ const globalOptions = computed(() => {
56
58
  }
57
59
  })
58
60
 
59
- const { center, series, source } = toRefs(props)
61
+ const { center, series, source, width } = toRefs(props)
60
62
 
61
63
  </script>
62
64
 
@@ -67,7 +69,7 @@ const { center, series, source } = toRefs(props)
67
69
  </template>
68
70
  <template #content>
69
71
  <div :class="`p-4 ${center ? 'flex justify-center' : ''}`" v-if="globalOptions && series">
70
- <apexchart width="500" type="bar" :options="globalOptions" :series="series"></apexchart>
72
+ <apexchart :width="width" type="bar" :options="globalOptions" :series="series"></apexchart>
71
73
  </div>
72
74
  <div v-else>
73
75
  <p>Data no disponible</p>
@@ -30,10 +30,12 @@ interface Props {
30
30
  type?: MediaVariants;
31
31
  mandateLevel?: string | null;
32
32
  source?: string;
33
+ width?:string
33
34
  }
34
35
 
35
36
  const props = withDefaults(defineProps<Props>(), {
36
- center: false,
37
+ center: true,
38
+ width:"500"
37
39
  });
38
40
 
39
41
  const renderText = computed(() => {
@@ -65,7 +67,7 @@ const globalOptions = computed(() => {
65
67
  }
66
68
  })
67
69
 
68
- const { center, series, source } = toRefs(props)
70
+ const { center, series, source, width} = toRefs(props)
69
71
 
70
72
  </script>
71
73
 
@@ -76,7 +78,7 @@ const { center, series, source } = toRefs(props)
76
78
  </template>
77
79
  <template #content>
78
80
  <div :class="`p-4 ${center ? 'flex justify-center' : ''}`" v-if="globalOptions && series">
79
- <apexchart width="500" type="line" :options="globalOptions" :series="series"></apexchart>
81
+ <apexchart :width="width" type="line" :options="globalOptions" :series="series"></apexchart>
80
82
  </div>
81
83
  <div v-else>
82
84
  <p>Data no disponible</p>
@@ -32,11 +32,13 @@ interface Props {
32
32
  type?: MediaVariants;
33
33
  mandateLevel?: string | null;
34
34
  source?: string;
35
+ width?:string
35
36
  }
36
37
 
37
38
  const props = withDefaults(defineProps<Props>(), {
38
- center: false,
39
- type:'base'
39
+ center: true,
40
+ type:'base',
41
+ width:"450"
40
42
  });
41
43
 
42
44
 
@@ -52,7 +54,7 @@ const renderText = computed(() => {
52
54
 
53
55
 
54
56
 
55
- const { center, series, source, options } = toRefs(props)
57
+ const { center, series, source, options, width } = toRefs(props)
56
58
 
57
59
  </script>
58
60
 
@@ -64,7 +66,7 @@ const { center, series, source, options } = toRefs(props)
64
66
  </template>
65
67
  <template #content>
66
68
  <div :class="`p-4 ${center ? 'flex justify-center' : ''}`" v-if="options && series">
67
- <apexchart width="350" type="pie" :options="options" :series="series"></apexchart>
69
+ <apexchart :width="width" type="pie" :options="options" :series="series"></apexchart>
68
70
  </div>
69
71
  <div v-else>
70
72
  <p>Data no disponible</p>
@@ -29,7 +29,6 @@ const resourceInfo = computed(()=>{
29
29
  if(typeRess === "website"){
30
30
  ress.href = ress.url
31
31
  ress.label = ress.title
32
- ress.title = null
33
32
  }
34
33
  if(typeRess === "book" && props.pages){
35
34
  ress.intentions = props.pages
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { ref, computed, defineAsyncComponent, toRefs } from "vue";
3
- import {SlidesType} from "../../types/Slides"
2
+ import { ref, computed, defineAsyncComponent, toRefs, Suspense } from "vue";
3
+ import { SlidesType } from "../../types/Slides"
4
4
  import { useComponent } from "../../composables/useComponent";
5
5
  import { useRenderText } from "../../composables/useRenderText";
6
6
  import { mdiArrowLeft } from "@mdi/js";
@@ -9,7 +9,7 @@ import EpIcon from "../basics/EpIcon.vue";
9
9
 
10
10
 
11
11
  interface Props {
12
- slides:SlidesType[];
12
+ slides: SlidesType[];
13
13
  }
14
14
 
15
15
  const props = withDefaults(defineProps<Props>(), {})
@@ -18,45 +18,49 @@ const props = withDefaults(defineProps<Props>(), {})
18
18
  const currentIndex = ref<number>(0)
19
19
 
20
20
  const currentSlide = computed(() => {
21
- if(!props.slides){
22
- return {title:'no data', img:'', uid:2, content:""}
21
+ if (!props.slides) {
22
+ return { title: 'no data', img: '', uid: 2, content: "" }
23
23
  }
24
- if(props.slides.length === 0) {
25
- return {title:'no data', img:'', uid:2, content:""}
24
+ if (props.slides.length === 0) {
25
+ return { title: 'no data', img: '', uid: 2, content: "" }
26
26
  }
27
27
  return props.slides[currentIndex.value]
28
28
  })
29
29
 
30
+ const hasTextContent = computed(() => {
31
+ return currentSlide.value.content.trim().length > 0
32
+ })
33
+
30
34
  const currentSlideMediaContent = computed(() => {
31
35
  if (currentSlide.value.img) {
32
36
  return defineAsyncComponent(() => import('../basics/EpImg.vue'))
33
37
  }
34
- if(currentSlide.value.component){
38
+ if (currentSlide.value.component) {
35
39
  const componentToLoad = useComponent(currentSlide.value.component?.type)
36
- return defineAsyncComponent(()=>import(`../${componentToLoad.path}/${componentToLoad.name}.vue`))
40
+ return defineAsyncComponent(() => import(`../${componentToLoad.path}/${componentToLoad.name}.vue`))
37
41
  }
38
42
  return null
39
43
  })
40
44
 
41
- const max = computed(()=> (currentIndex.value+1) < props.slides.length)
42
- const min = computed(()=> (currentIndex.value+1) > 1)
45
+ const max = computed(() => (currentIndex.value + 1) < props.slides.length)
46
+ const min = computed(() => (currentIndex.value + 1) > 1)
43
47
  const next = () => {
44
- if(max.value){
48
+ if (max.value) {
45
49
  currentIndex.value += 1
46
50
  }
47
51
  }
48
52
 
49
53
  const prev = () => {
50
- if(min.value){
54
+ if (min.value) {
51
55
  currentIndex.value -= 1
52
56
  }
53
57
  }
54
58
 
55
- const goTo = (index:number) =>{
59
+ const goTo = (index: number) => {
56
60
  currentIndex.value = index
57
61
  }
58
62
 
59
- const {slides} = toRefs(props)
63
+ const { slides } = toRefs(props)
60
64
 
61
65
  </script>
62
66
 
@@ -67,27 +71,42 @@ const {slides} = toRefs(props)
67
71
  {{ currentSlide.title }}
68
72
  </h5>
69
73
  <div class="md:flex items-end pb-1" v-if="slides">
70
- <template v-for="(slide,i) in slides.length" :key="`slide-index-${i}`">
71
- <span :class="`cursor-pointer h-4 w-4 ml-1 inline-block ${i === currentIndex?'bg-primary':'bg-gray-400'}`" @click="goTo(i)"></span>
74
+ <template v-for="(slide, i) in slides.length" :key="`slide-index-${i}`">
75
+ <span
76
+ :class="`cursor-pointer h-4 w-4 ml-1 inline-block ${i === currentIndex ? 'bg-primary' : 'bg-gray-400'}`"
77
+ @click="goTo(i)"></span>
72
78
  </template>
73
- <span class="ml-2 text-xs">({{(currentIndex+1)}}/{{ slides.length }})</span>
74
- <button :class="`px-2 ${min?'':'opacity-5'}`" @click="prev">
79
+ <span class="ml-2 text-xs">({{ (currentIndex + 1) }}/{{ slides.length }})</span>
80
+ <button :class="`px-2 ${min ? '' : 'opacity-5'}`" @click="prev">
75
81
  <EpIcon :icon-path="mdiArrowLeft" size="24"></EpIcon>
76
82
  </button>
77
- <button :class="`mx-2 ${max?'':'opacity-5'}`" @click="next">
83
+ <button :class="`mx-2 ${max ? '' : 'opacity-5'}`" @click="next">
78
84
  <EpIcon :icon-path="mdiArrowRight" size="24"></EpIcon>
79
85
  </button>
80
86
  </div>
81
87
  </div>
82
88
  <div class="">
83
89
  <Transition name="list" mode="out-in">
84
- <div class="md:flex p-8" :key="currentSlide.uid">
85
- <div class="w-full mr-5 flex items-center" v-if="currentSlideMediaContent">
86
- <component v-if="currentSlide.img" :is="currentSlideMediaContent" :src="currentSlide.img" cols="11"></component>
87
- <component v-else-if="currentSlide.component" :is="currentSlideMediaContent" v-bind="{...currentSlide.component.data}"></component>
90
+ <div class="md:flex p-4" :key="currentSlide.uid">
91
+ <div :class="`w-full ${hasTextContent ? 'mr-5' : ''}`" v-if="currentSlideMediaContent">
92
+ <div v-if="currentSlide.img" class="p-4">
93
+ <component :is="currentSlideMediaContent" :src="currentSlide.img" cols="11"></component>
94
+ </div>
95
+ <div v-else-if="currentSlide.component">
96
+ <Suspense>
97
+
98
+ <component :is="currentSlideMediaContent" v-bind="{ ...currentSlide.component.data }">
99
+ </component>
100
+ <template #fallback>
101
+ ...loading
102
+ </template>
103
+ </Suspense>
104
+
105
+ </div>
106
+
88
107
  </div>
89
- <div class="w-full">
90
- <div class="overflow-y-auto h-96 p-custom" v-html="useRenderText(currentSlide.content)"></div>
108
+ <div class="w-full pt-4" v-if="hasTextContent">
109
+ <div class="overflow-y-auto h-96 p-custom" v-html="useRenderText(currentSlide.content)"></div>
91
110
  </div>
92
111
  </div>
93
112
  </Transition>
@@ -105,12 +124,13 @@ const {slides} = toRefs(props)
105
124
  opacity: 0;
106
125
  transform: translateX(30px);
107
126
  }
108
- .h-custom {
109
- height: 30rem;
110
- }
127
+
128
+ .h-custom {
129
+ height: 30rem;
130
+ }
111
131
 
112
132
  .p-custom p {
113
- margin-bottom:1em;
133
+ margin-bottom: 1em;
114
134
  }
115
135
  </style>
116
136
 
@@ -152,12 +152,12 @@ const { title, intentions, hideIcon, question, src } = toRefs(props);
152
152
  </EpAlert>
153
153
  </div>
154
154
 
155
- <div v-if="answered">
155
+ <div v-if="answered" class="mb-2">
156
156
  <EpAlert :type="response.type" outlined>
157
157
  <div v-html="useRenderText(response.feedback)"></div>
158
158
  </EpAlert>
159
159
 
160
- <div v-if="response.component">
160
+ <div v-if="response.component" class="my-2">
161
161
  <component :is="getCompontent(response.component.type)" v-bind="{ ...response.component.data }"></component>
162
162
  </div>
163
163
  </div>
@@ -37,7 +37,7 @@ const isVideoFormat = computed(()=>{
37
37
  return false
38
38
  })
39
39
 
40
- const vimeoUrl = computed(()=> {
40
+ const videoURL = computed(()=> {
41
41
  const url = props.src
42
42
  if(!isVideoFormat.value && url.includes("https://vimeo.com/")){
43
43
  return url.replace("https://vimeo.com/", "https://player.vimeo.com/video/")
@@ -45,6 +45,13 @@ const vimeoUrl = computed(()=> {
45
45
  if(!isVideoFormat.value && url.includes('https://www.youtube.com/watch?')){
46
46
  return url.replace("https://www.youtube.com/watch?v=","https://www.youtube.com/embed/")
47
47
  }
48
+ //extra to short url youtube
49
+ if(!isVideoFormat.value && url.includes('https://youtu.be/')){
50
+ const id = getIdYoutube(url)
51
+ if(id){
52
+ return `https://www.youtube.com/embed/${id}`
53
+ }
54
+ }
48
55
  return url
49
56
  })
50
57
 
@@ -57,6 +64,12 @@ const renderText = computed(()=>{
57
64
  }
58
65
  return props.intentions
59
66
  })
67
+
68
+ const getIdYoutube = (url:string):string|null => {
69
+ const match = url.match(/\/([^\/]+)$/);
70
+ return match ? match[1]:null
71
+ }
72
+
60
73
  //controls
61
74
  //const controls = useMediaControls(video, {src:props.src})
62
75
  const {src, title, hideIcon, type} = toRefs(props)
@@ -71,8 +84,8 @@ const {src, title, hideIcon, type} = toRefs(props)
71
84
  <template #content>
72
85
  <div class="max-w-screen-sm mx-auto">
73
86
  <video v-if="isVideoFormat" ref="video" controls :src="src" width="640" controlsList="nodownload"></video>
74
- <iframe v-else :src="vimeoUrl" width="100%" height="360" frameborder="0" allowfullscreen></iframe>
75
- </div>
87
+ <iframe v-else :src="videoURL" width="100%" height="360" frameborder="0" allowfullscreen></iframe>
88
+ </div>
76
89
  </template>
77
90
  <!-- <template #actions>
78
91
  <EpBtn :color="type=='base'?'text-gray-700':'text-white'" :type="type">[Repair btn style... to change]</EpBtn>
@@ -0,0 +1,116 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue';
3
+ import { GlossaryEntry } from '../../types/GlossaryEntry';
4
+ import { useRenderText } from '../../composables/useRenderText';
5
+ import { useRouter } from "vue-router";
6
+
7
+ interface Term {
8
+ term: {
9
+ id: string
10
+ }
11
+ }
12
+
13
+ interface Props {
14
+ word: Term;
15
+ glossary: GlossaryEntry[]
16
+ }
17
+
18
+ const props = withDefaults(defineProps<Props>(), {});
19
+
20
+ const definition = computed(() => {
21
+ return props.glossary.find(item => item.id === props.word.term.id)
22
+ })
23
+
24
+ const sizeGramIngo = computed(() => {
25
+ if (definition.value) {
26
+ return definition.value.domain || definition.value.variation.length > 0 ? 'w-1/3' : 'w-full'
27
+ }
28
+ return ''
29
+ })
30
+
31
+ const sizeDomain = computed(() => {
32
+ if (definition.value) {
33
+ return definition.value.variation.length > 0 ? 'w-1/4' : 'w-3/4'
34
+ }
35
+ return ''
36
+ })
37
+
38
+ const sizeVariations = computed(() => {
39
+ if (definition.value) {
40
+ return definition.value.domain ? 'w-2/4' : 'w-3/4'
41
+ }
42
+ return ''
43
+ })
44
+
45
+ const findRelations = (relations: string[]): { id: number | string, term: string }[] => {
46
+ let _relations = props.glossary.filter((term) => {
47
+ return relations.some((x) => {
48
+ return term.id === x;
49
+ });
50
+ });
51
+ return _relations.map((x) => ({id:x.id, term:x.term}));
52
+ };
53
+
54
+ const router = useRouter()
55
+ const goto = (term:string) =>{
56
+ if(router.hasRoute('glossary')){
57
+ router.push({ path: "/glossary", query:{word:term} });
58
+ }
59
+ //console.log(router.hasRoute('signages'))
60
+ //
61
+ }
62
+
63
+ </script>
64
+
65
+ <template>
66
+ <div>
67
+ <div v-if="definition">
68
+ <div class="h-min border border-stone-300 rounded-lg divide-y">
69
+ <h2 class="text-xl font-semibold p-2">{{ definition.term }}</h2>
70
+ <div class="flex justify-between">
71
+ <div :class="sizeGramIngo">
72
+ <p class="text-sm font-medium bg-stone-100 p-2">
73
+ Information grammaticale
74
+ </p>
75
+ <div class="px-2 py-1">{{ definition.graminfo }}</div>
76
+ </div>
77
+ <div :class="sizeDomain" v-if="definition.domain">
78
+ <p class="text-sm font-medium bg-stone-100 p-2">Domaine</p>
79
+ <div class="px-2 py-1">{{ definition.domain }}</div>
80
+ </div>
81
+ <div :class="sizeVariations" v-if="definition.variation.length > 0">
82
+ <p class="text-sm font-medium bg-stone-100 p-2">Variation(s)</p>
83
+ <div class="px-2 py-1">
84
+ <span v-for="(variation, i) in definition.variation" :key="`v-${i}`">{{ variation }}{{
85
+ definition.variation.length > i + 1 ? ", " :
86
+ "." }}</span>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ <template v-if="!definition.img">
91
+ <div class="px-2 py-6" v-html="useRenderText(definition.definition)"></div>
92
+ </template>
93
+ <template v-else>
94
+ <div class="flex">
95
+ <div class="px-2 py-6" v-html="useRenderText(definition.definition)"></div>
96
+ <img class="h-60" :src="definition.img" :alt="`Image du terme ${definition.term}`" />
97
+ </div>
98
+ </template>
99
+
100
+ <div>
101
+ <div v-if="definition.relation.length > 0">
102
+ <p class="text-sm font-medium bg-stone-100 p-2">Relations</p>
103
+ <div class="p-2">
104
+ <template v-for="(relation, i) in findRelations(definition.relation)" :key="`relation-${i}`">
105
+ <button class="p-1 border rounded mr-1" @click="goto(relation.term)">
106
+ {{ relation.term }}
107
+ </button>
108
+ </template>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ </div>
114
+ <div v-else>La definition n'est pas disponible</div>
115
+ </div>
116
+ </template>
@@ -31,9 +31,9 @@ const styleTextAutor = computed(() => {
31
31
 
32
32
  const imageStyle = computed(() => {
33
33
  if (props.card) {
34
- return `rounded-lg`;
34
+ return `md:rounded-lg`;
35
35
  }
36
- return `rounded-l-md`;
36
+ return `md:rounded-l-md`;
37
37
  });
38
38
 
39
39
  const { author, img, card } = toRefs(props);
@@ -46,13 +46,14 @@ const { author, img, card } = toRefs(props);
46
46
  :outlined="!card ? true : false"
47
47
  :color="card ? 'primary':'bg-white'"
48
48
  >
49
- <div class="flex flex-wrap rounded-md">
50
- <img
51
- v-if="img"
52
- :class="`h-32 ${imageStyle}`"
53
- :src="img"
54
- alt="Image of quote"
55
- />
49
+ <div :class="`md:flex md:flex-wrap rounded-md `">
50
+ <div class="w-1/5" v-if="img">
51
+ <img
52
+ :class="`${imageStyle} md:w-full md:h-full md:object-cover md:rounded-l-md`"
53
+ :src="img"
54
+ alt="Image of quote"
55
+ />
56
+ </div>
56
57
  <div :class="`p-6 flex-1 ${colorText}`">
57
58
  <slot></slot>
58
59
  <template v-if="author">
@@ -1,6 +0,0 @@
1
- import { c as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { d as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { e as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { f as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { w as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { g as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { h as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { J as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { A as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { j as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { p as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { B as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { C as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { x as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };
@@ -1,6 +0,0 @@
1
- import { q as o } from "./index-efcc4db9.js";
2
- import "vue";
3
- import "vue-router";
4
- export {
5
- o as default
6
- };