ep-lib-ts 0.1.19 → 0.1.21
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-7658dbfa.js +5 -0
- package/dist/DisplayBox-91e0379e.js +5 -0
- package/dist/EpAlert-08bd894e.js +5 -0
- package/dist/EpAudio-f3bdfa56.js +5 -0
- package/dist/EpBadge-0f23df62.js +5 -0
- package/dist/EpBarChart-a8cc9021.js +5 -0
- package/dist/EpBtn-1b318d8b.js +5 -0
- package/dist/EpCard-f9d185f4.js +5 -0
- package/dist/EpChip-9dc924a1.js +5 -0
- package/dist/EpContentSlider-06e9ab9d.js +5 -0
- package/dist/{EpDivider-451f49c7.js → EpDivider-c8b50802.js} +1 -1
- package/dist/EpEdu-eedb5dd2.js +5 -0
- package/dist/EpFlex-a5e66290.js +5 -0
- package/dist/EpHeader-5a5301d1.js +5 -0
- package/dist/EpIcon-a22bca0e.js +5 -0
- package/dist/EpIframe-b13e2602.js +5 -0
- package/dist/{EpImg-58fe0075.js → EpImg-4b1c1eb0.js} +1 -1
- package/dist/{EpInput-40066436.js → EpInput-1abaeac9.js} +1 -1
- package/dist/EpLineChart-4294f586.js +5 -0
- package/dist/EpLink-8777a63f.js +5 -0
- package/dist/EpLinkVersion-5c082afe.js +5 -0
- package/dist/EpModal-47b3d6eb.js +5 -0
- package/dist/{EpNothing-60a0495b.js → EpNothing-4a436b63.js} +1 -1
- package/dist/EpPieChart-c1b6b0c6.js +5 -0
- package/dist/EpQuestion-22f494dc.js +5 -0
- package/dist/EpQuote-ebc9e1e9.js +5 -0
- package/dist/EpRadio-b8ddb3ca.js +5 -0
- package/dist/EpReading-f7962a86.js +5 -0
- package/dist/EpResource-04f931b8.js +5 -0
- package/dist/EpScope-0e3aec65.js +5 -0
- package/dist/EpSection-914a8f55.js +5 -0
- package/dist/{EpSelect-5eaaa06f.js → EpSelect-bbdf575d.js} +1 -1
- package/dist/EpSoftware-a7f455f3.js +5 -0
- package/dist/EpSpinner-8a65a879.js +5 -0
- package/dist/EpSvg-84333966.js +5 -0
- package/dist/EpTable-60100add.js +5 -0
- package/dist/EpTerm-5e901cc8.js +5 -0
- package/dist/EpText-8041a38c.js +5 -0
- package/dist/EpTimeLine-3ba111b3.js +5 -0
- package/dist/EpVideo-92d4440e.js +5 -0
- package/dist/EpVideoPanopto-ec445448.js +5 -0
- package/dist/ep-lib-ts.js +1 -1
- package/dist/ep-lib-ts.umd.cjs +16 -16
- package/dist/{index-6479cc61.js → index-e28f84f9.js} +3590 -3586
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/basics/EpText.vue +85 -84
- package/dist/BgAudio-e76b06bd.js +0 -5
- package/dist/DisplayBox-94d20004.js +0 -5
- package/dist/EpAlert-e5761fbe.js +0 -5
- package/dist/EpAudio-7fb55e21.js +0 -5
- package/dist/EpBadge-6e1e374b.js +0 -5
- package/dist/EpBarChart-940436ae.js +0 -5
- package/dist/EpBtn-d87b4bf9.js +0 -5
- package/dist/EpCard-2f0c3cf2.js +0 -5
- package/dist/EpChip-a1d7e511.js +0 -5
- package/dist/EpContentSlider-ea342e98.js +0 -5
- package/dist/EpEdu-150e12cd.js +0 -5
- package/dist/EpFlex-560db674.js +0 -5
- package/dist/EpHeader-532d0627.js +0 -5
- package/dist/EpIcon-47a3f19c.js +0 -5
- package/dist/EpIframe-8f71f906.js +0 -5
- package/dist/EpLineChart-0e5b5b2c.js +0 -5
- package/dist/EpLink-2d03f1e3.js +0 -5
- package/dist/EpLinkVersion-3bd4d934.js +0 -5
- package/dist/EpModal-b7d1789b.js +0 -5
- package/dist/EpPieChart-c8a803ad.js +0 -5
- package/dist/EpQuestion-1357ab62.js +0 -5
- package/dist/EpQuote-a7694dad.js +0 -5
- package/dist/EpRadio-c42aa3f5.js +0 -5
- package/dist/EpReading-cb2281dc.js +0 -5
- package/dist/EpResource-ed07a0f9.js +0 -5
- package/dist/EpScope-7a2308ab.js +0 -5
- package/dist/EpSection-6fbace66.js +0 -5
- package/dist/EpSoftware-03bf7edb.js +0 -5
- package/dist/EpSpinner-bbf4e53b.js +0 -5
- package/dist/EpSvg-fb389a78.js +0 -5
- package/dist/EpTable-90199b35.js +0 -5
- package/dist/EpTerm-7fc07a5f.js +0 -5
- package/dist/EpText-f5b15542.js +0 -5
- package/dist/EpTimeLine-64f3bcd6.js +0 -5
- package/dist/EpVideo-9c55fc1d.js +0 -5
- package/dist/EpVideoPanopto-2f5be5a0.js +0 -5
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.modal-mask{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;transition:opacity .3s ease}.modal-container{margin:auto;max-height:95%;transition:all .3s ease;z-index:9999}.modal-header h3{margin-top:0;color:#42b983}.modal-body{margin:20px 0}.modal-default-button{float:right}.modal-enter-from,.modal-leave-to{opacity:0}.modal-enter-from .modal-container,.modal-leave-to .modal-container{transform:scale(1.1)}.
|
|
1
|
+
.content[data-v-ab122c9c]{max-height:0;overflow:hidden}.modal-mask{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;transition:opacity .3s ease}.modal-container{margin:auto;max-height:95%;transition:all .3s ease;z-index:9999}.modal-header h3{margin-top:0;color:#42b983}.modal-body{margin:20px 0}.modal-default-button{float:right}.modal-enter-from,.modal-leave-to{opacity:0}.modal-enter-from .modal-container,.modal-leave-to .modal-container{transform:scale(1.1)}.custom_index{z-index:9999;position:absolute;right:12rem}.h-custom{height:30rem}.p-custom p{margin-bottom:1em}.v-enter-active[data-v-049ea2df],.v-leave-active[data-v-049ea2df]{transition:opacity .5s ease}.v-enter-from[data-v-049ea2df],.v-leave-to[data-v-049ea2df]{opacity:0}.katex[data-v-24ff8b28]{font-size:1.3em}.content[data-v-523dedc7]{max-height:0;overflow:hidden}.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}
|
package/package.json
CHANGED
|
@@ -1,102 +1,103 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed,
|
|
3
|
-
import { isHtml } from
|
|
4
|
-
import {useMarkdown} from
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { computed, toRefs, h } from "vue";
|
|
3
|
+
import { isHtml } from "../../composables/isHtml";
|
|
4
|
+
import { useMarkdown } from "../../composables/useMarkdown";
|
|
5
|
+
import EpAccordeon from "../interactions/EpAccordeon.vue";
|
|
6
|
+
import EpTerm from "../medias/EpTerm.vue";
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
glossary?: any[];
|
|
10
|
+
content: string;
|
|
11
|
+
title?: string | null;
|
|
12
|
+
compact?: boolean;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const props = withDefaults(defineProps<Props>(),{
|
|
16
|
-
compact:false,
|
|
17
|
-
})
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
compact: false,
|
|
17
|
+
});
|
|
18
18
|
|
|
19
|
-
const renderTitle = computed(()=>{
|
|
20
|
-
if(!props.title){
|
|
21
|
-
return "En savoir plus"
|
|
19
|
+
const renderTitle = computed(() => {
|
|
20
|
+
if (!props.title) {
|
|
21
|
+
return "En savoir plus";
|
|
22
22
|
}
|
|
23
|
-
return props.title
|
|
24
|
-
})
|
|
23
|
+
return props.title;
|
|
24
|
+
});
|
|
25
25
|
|
|
26
|
-
const renderText = computed(()=>{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
const term = _glossary.find(word => word.id === id)
|
|
57
|
-
//if was found
|
|
58
|
-
if(term){
|
|
59
|
-
///add the new values to the array
|
|
60
|
-
const word = item.outerHTML
|
|
61
|
-
//check if the term has relations
|
|
62
|
-
const foundedRelations = _glossary.filter((x) =>
|
|
63
|
-
x.relation.some((item:string) => {
|
|
64
|
-
return item == id;
|
|
65
|
-
})
|
|
66
|
-
);
|
|
67
|
-
//get relations id and term
|
|
68
|
-
const idsRelation = foundedRelations.map((x) => x.id);
|
|
69
|
-
const termsRelation = foundedRelations.map((x) => x.term);
|
|
70
|
-
const variation = term.variation
|
|
71
|
-
const hasImge = term.src ? term.src : ''
|
|
72
|
-
//const replaceWord = `<EpBtn :pts-data="{term:'${term.term}', definition:'${term.definition}', renderword:'${render_word}', graminfo:'${term.graminfo}', domain:'${term.domain}',variation:'${variation}', relations_names:'${termsRelation}', relations_ids:'${idsRelation}'}"></EpBtn>`
|
|
73
|
-
const replaceWord = ` <EpTerm term="${term.term}" word="${render_word}" variations="${variation}" graminfo="${term.graminfo}" src='${hasImge}' domain="${term.domain}" relations="${termsRelation}" idrelation="${idsRelation}"> ${term.definition} </EpTerm> `
|
|
74
|
-
//replace output string
|
|
75
|
-
newStr = newStr.replace(word, replaceWord)
|
|
76
|
-
}
|
|
77
|
-
})
|
|
26
|
+
const renderText = computed(() => {
|
|
27
|
+
if (!props.content) {
|
|
28
|
+
return `<div></div>`;
|
|
29
|
+
}
|
|
30
|
+
if (!isHtml(props.content)) {
|
|
31
|
+
return useMarkdown(props.content);
|
|
32
|
+
}
|
|
33
|
+
//return props.content
|
|
34
|
+
//create a div
|
|
35
|
+
const div = document.createElement("DIV");
|
|
36
|
+
///add the html input to the div
|
|
37
|
+
div.innerHTML = props.content.trim();
|
|
38
|
+
///get strign of html
|
|
39
|
+
let newStr = div.outerHTML;
|
|
40
|
+
//find all span.ep_glossary_item to know the glossary terms in the text
|
|
41
|
+
const glossaryTerms = div.querySelectorAll(".ep_glossary_item");
|
|
42
|
+
// console.log(glossaryTerms)
|
|
43
|
+
//if find glossary terms
|
|
44
|
+
if (glossaryTerms.length > 0) {
|
|
45
|
+
///check every term and replace it
|
|
46
|
+
glossaryTerms.forEach((item) => {
|
|
47
|
+
//get id
|
|
48
|
+
const id = item.getAttribute("data-id");
|
|
49
|
+
//get content text
|
|
50
|
+
const render_word = item.innerHTML;
|
|
51
|
+
//find in the glossary their equivalent
|
|
52
|
+
let _glossary = [];
|
|
53
|
+
if (props.glossary) {
|
|
54
|
+
_glossary = props.glossary;
|
|
78
55
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
56
|
+
const term = _glossary.find((word) => word.id === id);
|
|
57
|
+
//if was found
|
|
58
|
+
if (term) {
|
|
59
|
+
///add the new values to the array
|
|
60
|
+
const word = item.outerHTML;
|
|
61
|
+
//check if the term has relations
|
|
62
|
+
const foundedRelations = _glossary.filter((x) =>
|
|
63
|
+
x.relation.some((item: string) => {
|
|
64
|
+
return item == id;
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
//get relations id and term
|
|
68
|
+
const idsRelation = foundedRelations.map((x) => x.id);
|
|
69
|
+
const termsRelation = foundedRelations.map((x) => x.term);
|
|
70
|
+
const variation = term.variation;
|
|
71
|
+
const hasImge = term.src ? term.src : "";
|
|
72
|
+
//const replaceWord = `<EpBtn :pts-data="{term:'${term.term}', definition:'${term.definition}', renderword:'${render_word}', graminfo:'${term.graminfo}', domain:'${term.domain}',variation:'${variation}', relations_names:'${termsRelation}', relations_ids:'${idsRelation}'}"></EpBtn>`
|
|
73
|
+
const replaceWord = ` <EpTerm term="${term.term}" word="${render_word}" variations="${variation}" graminfo="${term.graminfo}" src='${hasImge}' domain="${term.domain}" relations="${termsRelation}" idrelation="${idsRelation}"> ${term.definition} </EpTerm> `;
|
|
74
|
+
//replace output string
|
|
75
|
+
newStr = newStr.replace(word, replaceWord);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
div.innerHTML = newStr;
|
|
80
|
+
// console.log(div.innerHTML)
|
|
81
|
+
return div.innerHTML;
|
|
82
|
+
});
|
|
84
83
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
const render = () => {
|
|
85
|
+
const r = {
|
|
86
|
+
components: {
|
|
87
|
+
epterm: EpTerm,
|
|
88
88
|
},
|
|
89
|
-
|
|
90
|
-
}
|
|
89
|
+
template: `<div>${renderText.value}</div>`,
|
|
90
|
+
};
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
return h(r);
|
|
93
|
+
};
|
|
93
94
|
|
|
95
|
+
const { compact } = toRefs(props);
|
|
94
96
|
</script>
|
|
95
97
|
|
|
96
98
|
<template>
|
|
97
|
-
<
|
|
99
|
+
<render v-if="!compact"></render>
|
|
98
100
|
<EpAccordeon outlined :title="renderTitle" v-else>
|
|
99
|
-
<
|
|
101
|
+
<render></render>
|
|
100
102
|
</EpAccordeon>
|
|
101
|
-
|
|
102
|
-
</template>
|
|
103
|
+
</template>
|
package/dist/BgAudio-e76b06bd.js
DELETED
package/dist/EpAlert-e5761fbe.js
DELETED
package/dist/EpAudio-7fb55e21.js
DELETED
package/dist/EpBadge-6e1e374b.js
DELETED
package/dist/EpBtn-d87b4bf9.js
DELETED
package/dist/EpCard-2f0c3cf2.js
DELETED
package/dist/EpChip-a1d7e511.js
DELETED
package/dist/EpEdu-150e12cd.js
DELETED
package/dist/EpFlex-560db674.js
DELETED
package/dist/EpIcon-47a3f19c.js
DELETED
package/dist/EpLink-2d03f1e3.js
DELETED
package/dist/EpModal-b7d1789b.js
DELETED
package/dist/EpQuote-a7694dad.js
DELETED
package/dist/EpRadio-c42aa3f5.js
DELETED
package/dist/EpScope-7a2308ab.js
DELETED
package/dist/EpSvg-fb389a78.js
DELETED
package/dist/EpTable-90199b35.js
DELETED
package/dist/EpTerm-7fc07a5f.js
DELETED
package/dist/EpText-f5b15542.js
DELETED
package/dist/EpVideo-9c55fc1d.js
DELETED