ep-lib-ts 1.0.11 → 1.0.13
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.
- package/dist/BgAudio-7z3D2Xrz.js +4 -0
- package/dist/DisplayBox-BfVuWE6d.js +4 -0
- package/dist/EpAlert-tfP5ryYw.js +4 -0
- package/dist/EpAudio-BKK5LJTB.js +4 -0
- package/dist/EpBadge-C1DrhwzG.js +4 -0
- package/dist/EpBarChart-CYUAIbjS.js +4 -0
- package/dist/EpBtn-CgtiXdOp.js +4 -0
- package/dist/EpCard-Du5LhFwv.js +4 -0
- package/dist/EpChip-D0SWR-Y6.js +4 -0
- package/dist/EpContentSlider-BZl2jDkC.js +4 -0
- package/dist/{EpDarkmode-DJfhYRWy.js → EpDarkmode-k6GwEm62.js} +1 -1
- package/dist/EpDivider-BJ5C6WJ7.js +4 -0
- package/dist/EpEdu-olCU2BKM.js +4 -0
- package/dist/EpFlex--KY5t20R.js +4 -0
- package/dist/EpFunnelChart-DSQG5ZSB.js +4 -0
- package/dist/EpHeader-CkEEmu11.js +4 -0
- package/dist/{EpHover-Bk0pT5kL.js → EpHover-aGr2uExZ.js} +1 -1
- package/dist/EpIcon-BFBiMGk2.js +4 -0
- package/dist/EpIframe-CwcXQN00.js +4 -0
- package/dist/EpImg-CKTbWLSI.js +4 -0
- package/dist/{EpInput-DNqOOiKL.js → EpInput-ClZVKpkg.js} +1 -1
- package/dist/EpLineChart-kzbiG8ff.js +4 -0
- package/dist/EpLink-CmVw1taR.js +4 -0
- package/dist/EpLinkVersion-DJAIicgW.js +4 -0
- package/dist/{EpList-DWWNUyA9.js → EpList-CmL_eQ10.js} +1 -1
- package/dist/EpModal-nhd5JeyX.js +4 -0
- package/dist/{EpNothing-DDEr7md3.js → EpNothing-aDBiMyow.js} +1 -1
- package/dist/EpPieChart-LpqTUJV6.js +4 -0
- package/dist/EpQuestion-le3Hqg8k.js +4 -0
- package/dist/EpQuote-CrU_k7gO.js +4 -0
- package/dist/EpRadio-dB55Pyfp.js +4 -0
- package/dist/EpRadioSummative-C7pY3o7p.js +4 -0
- package/dist/EpReading-D9PgDWjU.js +4 -0
- package/dist/EpResource-3kOjlg9K.js +4 -0
- package/dist/EpScope-C2sETTw7.js +4 -0
- package/dist/EpSection-DeDPxaKC.js +4 -0
- package/dist/{EpSelect-BvHGkSc7.js → EpSelect-PBqzVRSz.js} +1 -1
- package/dist/EpSkeleton-CgOywOoi.js +4 -0
- package/dist/EpSoftware-eqKl9wSD.js +4 -0
- package/dist/EpSpinner-Dky9tDll.js +4 -0
- package/dist/EpSummativeTable-dC1BZbvS.js +4 -0
- package/dist/EpSvg-kzacE_o4.js +4 -0
- package/dist/EpTable-nIfYnCoF.js +4 -0
- package/dist/EpTerm-FbEfpR3_.js +4 -0
- package/dist/EpText-B90A2vYg.js +4 -0
- package/dist/EpTimeLine-DsV6mFif.js +4 -0
- package/dist/EpVideo-CZWNen4x.js +4 -0
- package/dist/EpVideoPanopto-s38_ww6z.js +4 -0
- package/dist/EpWordDef-CIzPsyfV.js +4 -0
- package/dist/components/educationals/EpEdu.vue.d.ts +0 -9
- package/dist/ep-lib-ts.js +1 -1
- package/dist/ep-lib-ts.umd.cjs +31 -31
- package/dist/{index-SGiX8oHR.js → index-DG0zkN1a.js} +546 -547
- package/package.json +1 -1
- package/src/components/educationals/EpEdu.vue +54 -41
- package/src/components/medias/EpVideo.vue +101 -75
- package/dist/BgAudio-SRpJZsKs.js +0 -4
- package/dist/DisplayBox-m3x7A_Lc.js +0 -4
- package/dist/EpAlert-CEh6nG7M.js +0 -4
- package/dist/EpAudio-B0BzGot9.js +0 -4
- package/dist/EpBadge-DcZHeED8.js +0 -4
- package/dist/EpBarChart-DXd6xCHk.js +0 -4
- package/dist/EpBtn-C1AGJ-yR.js +0 -4
- package/dist/EpCard-vZ-uw73Q.js +0 -4
- package/dist/EpChip-C8vDM3u4.js +0 -4
- package/dist/EpContentSlider-DHNcPL9C.js +0 -4
- package/dist/EpDivider-186LJI5h.js +0 -4
- package/dist/EpEdu-fheb_tTH.js +0 -4
- package/dist/EpFlex-BJw-H5dU.js +0 -4
- package/dist/EpFunnelChart-ip2pttgU.js +0 -4
- package/dist/EpHeader-Bi5Sf7zR.js +0 -4
- package/dist/EpIcon-CGER12MO.js +0 -4
- package/dist/EpIframe-bQcFLybh.js +0 -4
- package/dist/EpImg-BO5CR3ma.js +0 -4
- package/dist/EpLineChart-YESNjWO5.js +0 -4
- package/dist/EpLink-DdAAyH0l.js +0 -4
- package/dist/EpLinkVersion-BF3_oyRw.js +0 -4
- package/dist/EpModal-6yoWMThb.js +0 -4
- package/dist/EpPieChart-BtBpY7Ur.js +0 -4
- package/dist/EpQuestion-DNBjqXq4.js +0 -4
- package/dist/EpQuote-BcgbF8xr.js +0 -4
- package/dist/EpRadio-Dogz4F9n.js +0 -4
- package/dist/EpRadioSummative-VwkcjKJg.js +0 -4
- package/dist/EpReading-CJ6T41TD.js +0 -4
- package/dist/EpResource-DxGtO-TN.js +0 -4
- package/dist/EpScope-D_Zh2kOC.js +0 -4
- package/dist/EpSection-BtZdu6pI.js +0 -4
- package/dist/EpSkeleton-Cb_z9kwg.js +0 -4
- package/dist/EpSoftware-B1SbffFI.js +0 -4
- package/dist/EpSpinner-CyVszZ26.js +0 -4
- package/dist/EpSummativeTable-BPfbax-8.js +0 -4
- package/dist/EpSvg-CpF2O8rU.js +0 -4
- package/dist/EpTable-s0Idr6_o.js +0 -4
- package/dist/EpTerm-CWt3MuHx.js +0 -4
- package/dist/EpText-B-ISSKLK.js +0 -4
- package/dist/EpTimeLine-cYO1AORg.js +0 -4
- package/dist/EpVideo-BAq3Qjwa.js +0 -4
- package/dist/EpVideoPanopto-Bgm7AIjn.js +0 -4
- package/dist/EpWordDef-DVKhOvf4.js +0 -4
package/package.json
CHANGED
|
@@ -9,73 +9,76 @@ import EpChip from "../basics/EpChip.vue";
|
|
|
9
9
|
import EpScope from "./EpScope.vue";
|
|
10
10
|
import { mdiLeadPencil } from "@mdi/js";
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
interface Props {
|
|
14
13
|
title?: string | null;
|
|
15
14
|
subtitle?: string | null;
|
|
16
15
|
icon?: string;
|
|
17
|
-
mandateLevel?:string | MandateLevel | null;
|
|
16
|
+
mandateLevel?: string | MandateLevel | null;
|
|
18
17
|
synchrone?: boolean;
|
|
19
18
|
type?: MediaVariants;
|
|
20
19
|
intentions?: string;
|
|
21
|
-
hideIcon?:boolean;
|
|
22
|
-
flat?:boolean;
|
|
23
|
-
labels?:{
|
|
24
|
-
intentions?:string;
|
|
25
|
-
}
|
|
20
|
+
hideIcon?: boolean;
|
|
21
|
+
flat?: boolean;
|
|
22
|
+
labels?: {
|
|
23
|
+
intentions?: string;
|
|
24
|
+
};
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
const props = withDefaults(defineProps<Props>(), {
|
|
29
28
|
title: null,
|
|
30
29
|
type: "base",
|
|
31
|
-
hideIcon:false,
|
|
32
|
-
flat:false,
|
|
33
|
-
labels:()=>{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
hideIcon: false,
|
|
31
|
+
flat: false,
|
|
32
|
+
// labels:()=>{
|
|
33
|
+
// return {
|
|
34
|
+
// intentions:"[Intentions]"
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
38
37
|
});
|
|
39
38
|
|
|
40
39
|
//get slots
|
|
41
40
|
const slots = useSlots();
|
|
42
41
|
|
|
43
42
|
const hasIntentions = computed(() => {
|
|
44
|
-
return slots.intentions?true:false
|
|
43
|
+
return slots.intentions ? true : false;
|
|
45
44
|
});
|
|
46
45
|
|
|
47
46
|
const hasActions = computed(() => {
|
|
48
|
-
return slots.actions?true:false
|
|
47
|
+
return slots.actions ? true : false;
|
|
49
48
|
});
|
|
50
49
|
|
|
51
|
-
const renderIcon = computed(()=> {
|
|
52
|
-
|
|
53
|
-
return props.icon
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})
|
|
50
|
+
const renderIcon = computed(() => {
|
|
51
|
+
if (props.icon) {
|
|
52
|
+
return props.icon;
|
|
53
|
+
}
|
|
54
|
+
return mdiLeadPencil;
|
|
55
|
+
});
|
|
57
56
|
|
|
58
57
|
const topBarStyle = computed(() => {
|
|
59
|
-
return `${mediaVariants[props.type]} text-left px-5 py-2 ${
|
|
58
|
+
return `${mediaVariants[props.type]} text-left px-5 py-2 ${
|
|
59
|
+
props.flat ? "" : "rounded-t-md"
|
|
60
|
+
} flex justify-between items-center `;
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
const bottomBarStyle = computed(() => {
|
|
63
64
|
return `${mediaVariants[props.type]} text-right pr-5`;
|
|
64
65
|
});
|
|
65
66
|
|
|
66
|
-
const containerStyle = computed(()=>{
|
|
67
|
-
if(hasActions.value || hasIntentions.value || props.title){
|
|
68
|
-
return `rounded-lg overflow-hidden ${
|
|
67
|
+
const containerStyle = computed(() => {
|
|
68
|
+
if (hasActions.value || hasIntentions.value || props.title) {
|
|
69
|
+
return `rounded-lg overflow-hidden ${
|
|
70
|
+
props.flat ? "" : "shadow-md"
|
|
71
|
+
} flex flex-col justify-between h-full`;
|
|
69
72
|
}
|
|
70
|
-
return `flex flex-col justify-between
|
|
71
|
-
})
|
|
73
|
+
return `flex flex-col justify-between`;
|
|
74
|
+
});
|
|
72
75
|
|
|
73
|
-
const renderMandateLevel = computed(()=>{
|
|
74
|
-
if(typeof props.mandateLevel === "object"){
|
|
75
|
-
|
|
76
|
+
const renderMandateLevel = computed(() => {
|
|
77
|
+
if (typeof props.mandateLevel === "object") {
|
|
78
|
+
return props.mandateLevel?.title;
|
|
76
79
|
}
|
|
77
|
-
return props.mandateLevel
|
|
78
|
-
})
|
|
80
|
+
return props.mandateLevel;
|
|
81
|
+
});
|
|
79
82
|
|
|
80
83
|
// type, taxonomyLevel, courseCode, courseTitle, title, subtitle, height, src, color, synchrone
|
|
81
84
|
|
|
@@ -84,26 +87,36 @@ const { title, hideIcon } = toRefs(props);
|
|
|
84
87
|
|
|
85
88
|
<template>
|
|
86
89
|
<div :class="containerStyle">
|
|
87
|
-
<div
|
|
90
|
+
<div
|
|
91
|
+
:class="`${topBarStyle}`"
|
|
92
|
+
class="dark:base-dark"
|
|
93
|
+
v-if="title || mandateLevel"
|
|
94
|
+
>
|
|
88
95
|
<!-- <EpIcon :size="24" :icon-path="mdiBookOpenVariant"></EpIcon> -->
|
|
89
|
-
<h3
|
|
96
|
+
<h3>
|
|
97
|
+
<EpIcon v-if="!hideIcon" :iconPath="renderIcon" size="24"></EpIcon>
|
|
98
|
+
<span class="font-bold align-middle">{{ title }}</span>
|
|
99
|
+
</h3>
|
|
90
100
|
<EpScope v-if="mandateLevel" :title="renderMandateLevel"></EpScope>
|
|
91
101
|
</div>
|
|
92
102
|
<div class="px-5 dark:base-dark dark:text-white">
|
|
93
103
|
<div class="py-2" v-if="hasIntentions">
|
|
94
104
|
<!-- <EpIcon :size="24" :icon-path="mdiInformationOutline"></EpIcon> -->
|
|
95
|
-
<h4
|
|
96
|
-
|
|
97
|
-
|
|
105
|
+
<!-- <h4
|
|
106
|
+
v-if="labels && labels.intentions"
|
|
107
|
+
class="font-semibold mb-2 text-sm uppercase tracking-wide text-gray-500 dark:text-white"
|
|
108
|
+
>
|
|
109
|
+
{{ labels.intentions }}
|
|
110
|
+
</h4> -->
|
|
98
111
|
<slot name="intentions"></slot>
|
|
99
|
-
<EpDivider/>
|
|
112
|
+
<EpDivider />
|
|
100
113
|
</div>
|
|
101
114
|
<div class="py-2">
|
|
102
115
|
<slot name="content"></slot>
|
|
103
116
|
</div>
|
|
104
117
|
</div>
|
|
105
|
-
<div :class="bottomBarStyle"
|
|
118
|
+
<div :class="bottomBarStyle" class="dark:base-dark" v-if="hasActions">
|
|
106
119
|
<slot name="actions"></slot>
|
|
107
|
-
</div>
|
|
120
|
+
</div>
|
|
108
121
|
</div>
|
|
109
122
|
</template>
|
|
@@ -1,100 +1,126 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {ref, computed, toRefs} from
|
|
2
|
+
import { ref, computed, toRefs } from "vue";
|
|
3
3
|
//types with capital letter, object styles in lowercase
|
|
4
4
|
import { MediaVariants } from "../../types/Medias";
|
|
5
|
-
import { MandateLevel } from
|
|
6
|
-
import { isHtml } from
|
|
7
|
-
import {useMarkdown} from
|
|
5
|
+
import { MandateLevel } from "../../types/MandateLevel";
|
|
6
|
+
import { isHtml } from "../../composables/isHtml";
|
|
7
|
+
import { useMarkdown } from "../../composables/useMarkdown";
|
|
8
8
|
import { mdiVideo } from "@mdi/js";
|
|
9
9
|
|
|
10
10
|
//import { useMediaControls } from '@vueuse/core'
|
|
11
|
-
import EpEdu from
|
|
11
|
+
import EpEdu from "../educationals/EpEdu.vue";
|
|
12
12
|
|
|
13
|
-
interface Props{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
interface Props {
|
|
14
|
+
src: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
intentions?: string;
|
|
17
|
+
credits?: string;
|
|
18
|
+
mandateLevel?: string | MandateLevel | null;
|
|
19
|
+
type?: MediaVariants;
|
|
20
|
+
hideIcon?: boolean;
|
|
21
|
+
labels?: {
|
|
22
|
+
intentions?: string;
|
|
23
|
+
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const props = withDefaults(defineProps<Props>(),{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
26
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
27
|
+
type: "base",
|
|
28
|
+
hideIcon: false,
|
|
29
|
+
labels: () => {
|
|
30
|
+
return {
|
|
31
|
+
intentions: "Intentions d'écoute",
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
35
|
|
|
36
36
|
//only to make custum video player
|
|
37
|
-
const video = ref<HTMLVideoElement>()
|
|
37
|
+
const video = ref<HTMLVideoElement>();
|
|
38
38
|
|
|
39
|
-
const isVideoFormat = computed(()=>{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const isVideoFormat = computed(() => {
|
|
40
|
+
if (
|
|
41
|
+
props.src.endsWith(".mp4") ||
|
|
42
|
+
props.src.endsWith(".ogg") ||
|
|
43
|
+
props.src.endsWith(".webm")
|
|
44
|
+
) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
});
|
|
45
49
|
|
|
46
|
-
const videoURL = computed(()=> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
50
|
+
const videoURL = computed(() => {
|
|
51
|
+
const url = props.src;
|
|
52
|
+
if (!isVideoFormat.value && url.includes("https://vimeo.com/")) {
|
|
53
|
+
return url.replace("https://vimeo.com/", "https://player.vimeo.com/video/");
|
|
54
|
+
}
|
|
55
|
+
if (!isVideoFormat.value && url.includes("https://www.youtube.com/watch?")) {
|
|
56
|
+
return url.replace(
|
|
57
|
+
"https://www.youtube.com/watch?v=",
|
|
58
|
+
"https://www.youtube.com/embed/"
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
//extra to short url youtube
|
|
62
|
+
if (!isVideoFormat.value && url.includes("https://youtu.be/")) {
|
|
63
|
+
const id = getIdYoutube(url);
|
|
64
|
+
if (id) {
|
|
65
|
+
return `https://www.youtube.com/embed/${id}`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return url;
|
|
69
|
+
});
|
|
63
70
|
|
|
64
|
-
const renderText = computed(()=>{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})
|
|
71
|
+
const renderText = computed(() => {
|
|
72
|
+
if (!props.intentions) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
if (!isHtml(props.intentions)) {
|
|
76
|
+
return useMarkdown(props.intentions);
|
|
77
|
+
}
|
|
78
|
+
return props.intentions;
|
|
79
|
+
});
|
|
73
80
|
|
|
74
|
-
const getIdYoutube = (url:string):string|null => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
81
|
+
const getIdYoutube = (url: string): string | null => {
|
|
82
|
+
const match = url.match(/\/([^\/]+)$/);
|
|
83
|
+
return match ? match[1] : null;
|
|
84
|
+
};
|
|
78
85
|
|
|
79
86
|
//controls
|
|
80
87
|
//const controls = useMediaControls(video, {src:props.src})
|
|
81
|
-
const {src, title, hideIcon, type} = toRefs(props)
|
|
82
|
-
|
|
88
|
+
const { src, title, hideIcon, type } = toRefs(props);
|
|
83
89
|
</script>
|
|
84
90
|
|
|
85
91
|
<template>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
<EpEdu
|
|
93
|
+
:title="title"
|
|
94
|
+
:type="type"
|
|
95
|
+
:hideIcon="hideIcon"
|
|
96
|
+
:icon="mdiVideo"
|
|
97
|
+
:mandateLevel="mandateLevel"
|
|
98
|
+
>
|
|
99
|
+
<template #intentions v-if="renderText && renderText.length > 0">
|
|
100
|
+
<div v-html="renderText"></div>
|
|
101
|
+
</template>
|
|
102
|
+
<template #content>
|
|
91
103
|
<div class="max-w-screen-sm mx-auto">
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
<video
|
|
105
|
+
v-if="isVideoFormat"
|
|
106
|
+
ref="video"
|
|
107
|
+
controls
|
|
108
|
+
:src="src"
|
|
109
|
+
width="640"
|
|
110
|
+
controlsList="nodownload"
|
|
111
|
+
></video>
|
|
112
|
+
<iframe
|
|
113
|
+
v-else
|
|
114
|
+
:src="videoURL"
|
|
115
|
+
width="100%"
|
|
116
|
+
height="360"
|
|
117
|
+
frameborder="0"
|
|
118
|
+
allowfullscreen
|
|
119
|
+
></iframe>
|
|
120
|
+
</div>
|
|
121
|
+
</template>
|
|
122
|
+
<!-- <template #actions>
|
|
97
123
|
<EpBtn :color="type=='base'?'text-gray-700':'text-white'" :type="type">[Repair btn style... to change]</EpBtn>
|
|
98
124
|
</template> -->
|
|
99
|
-
|
|
125
|
+
</EpEdu>
|
|
100
126
|
</template>
|
package/dist/BgAudio-SRpJZsKs.js
DELETED
package/dist/EpAlert-CEh6nG7M.js
DELETED
package/dist/EpAudio-B0BzGot9.js
DELETED
package/dist/EpBadge-DcZHeED8.js
DELETED
package/dist/EpBtn-C1AGJ-yR.js
DELETED
package/dist/EpCard-vZ-uw73Q.js
DELETED
package/dist/EpChip-C8vDM3u4.js
DELETED
package/dist/EpEdu-fheb_tTH.js
DELETED
package/dist/EpFlex-BJw-H5dU.js
DELETED
package/dist/EpIcon-CGER12MO.js
DELETED
package/dist/EpImg-BO5CR3ma.js
DELETED
package/dist/EpLink-DdAAyH0l.js
DELETED
package/dist/EpModal-6yoWMThb.js
DELETED
package/dist/EpQuote-BcgbF8xr.js
DELETED
package/dist/EpRadio-Dogz4F9n.js
DELETED
package/dist/EpScope-D_Zh2kOC.js
DELETED
package/dist/EpSvg-CpF2O8rU.js
DELETED
package/dist/EpTable-s0Idr6_o.js
DELETED
package/dist/EpTerm-CWt3MuHx.js
DELETED
package/dist/EpText-B-ISSKLK.js
DELETED
package/dist/EpVideo-BAq3Qjwa.js
DELETED