ep-lib-ts 0.1.20 → 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.
Files changed (85) hide show
  1. package/dist/BgAudio-7658dbfa.js +5 -0
  2. package/dist/DisplayBox-91e0379e.js +5 -0
  3. package/dist/EpAlert-08bd894e.js +5 -0
  4. package/dist/EpAudio-f3bdfa56.js +5 -0
  5. package/dist/EpBadge-0f23df62.js +5 -0
  6. package/dist/EpBarChart-a8cc9021.js +5 -0
  7. package/dist/EpBtn-1b318d8b.js +5 -0
  8. package/dist/EpCard-f9d185f4.js +5 -0
  9. package/dist/EpChip-9dc924a1.js +5 -0
  10. package/dist/EpContentSlider-06e9ab9d.js +5 -0
  11. package/dist/{EpChip-fd468489.js → EpDivider-c8b50802.js} +1 -1
  12. package/dist/EpEdu-eedb5dd2.js +5 -0
  13. package/dist/EpFlex-a5e66290.js +5 -0
  14. package/dist/EpHeader-5a5301d1.js +5 -0
  15. package/dist/EpIcon-a22bca0e.js +5 -0
  16. package/dist/EpIframe-b13e2602.js +5 -0
  17. package/dist/{EpIcon-9dd2b039.js → EpImg-4b1c1eb0.js} +1 -1
  18. package/dist/{EpInput-556ab6fe.js → EpInput-1abaeac9.js} +36 -36
  19. package/dist/EpLineChart-4294f586.js +5 -0
  20. package/dist/EpLink-8777a63f.js +5 -0
  21. package/dist/EpLinkVersion-5c082afe.js +5 -0
  22. package/dist/EpModal-47b3d6eb.js +5 -0
  23. package/dist/{EpNothing-77b5a694.js → EpNothing-4a436b63.js} +2 -2
  24. package/dist/EpPieChart-c1b6b0c6.js +5 -0
  25. package/dist/EpQuestion-22f494dc.js +5 -0
  26. package/dist/EpQuote-ebc9e1e9.js +5 -0
  27. package/dist/EpRadio-b8ddb3ca.js +5 -0
  28. package/dist/EpReading-f7962a86.js +5 -0
  29. package/dist/EpResource-04f931b8.js +5 -0
  30. package/dist/EpScope-0e3aec65.js +5 -0
  31. package/dist/EpSection-914a8f55.js +5 -0
  32. package/dist/{EpSelect-1ffc465c.js → EpSelect-bbdf575d.js} +4 -4
  33. package/dist/EpSoftware-a7f455f3.js +5 -0
  34. package/dist/EpSpinner-8a65a879.js +5 -0
  35. package/dist/EpSvg-84333966.js +5 -0
  36. package/dist/EpTable-60100add.js +5 -0
  37. package/dist/EpTerm-5e901cc8.js +5 -0
  38. package/dist/EpText-8041a38c.js +5 -0
  39. package/dist/EpTimeLine-3ba111b3.js +5 -0
  40. package/dist/EpVideo-92d4440e.js +5 -0
  41. package/dist/EpVideoPanopto-ec445448.js +5 -0
  42. package/dist/ep-lib-ts.js +5 -5
  43. package/dist/ep-lib-ts.umd.cjs +31 -31
  44. package/dist/{index-5bd6e63c.js → index-e28f84f9.js} +3711 -3708
  45. package/package.json +1 -1
  46. package/src/components/basics/EpText.vue +87 -105
  47. package/dist/BgAudio-d9308f99.js +0 -5
  48. package/dist/DisplayBox-f17b28bc.js +0 -5
  49. package/dist/EpAlert-c5ccf377.js +0 -5
  50. package/dist/EpAudio-ee4175aa.js +0 -5
  51. package/dist/EpBadge-6fc0f5fc.js +0 -5
  52. package/dist/EpBarChart-d1bdc878.js +0 -5
  53. package/dist/EpBtn-010839a7.js +0 -5
  54. package/dist/EpCard-d67b77b2.js +0 -5
  55. package/dist/EpContentSlider-b1f27a7d.js +0 -5
  56. package/dist/EpDivider-ea7f1d1a.js +0 -5
  57. package/dist/EpEdu-74aed121.js +0 -5
  58. package/dist/EpFlex-232d7513.js +0 -5
  59. package/dist/EpHeader-1f6cca20.js +0 -5
  60. package/dist/EpIframe-a4082deb.js +0 -5
  61. package/dist/EpImg-7f4c35bd.js +0 -5
  62. package/dist/EpLineChart-822ceecf.js +0 -5
  63. package/dist/EpLink-c2a1a872.js +0 -5
  64. package/dist/EpLinkVersion-2bac33d5.js +0 -5
  65. package/dist/EpModal-1b4d1ff9.js +0 -5
  66. package/dist/EpPieChart-ad8576ca.js +0 -5
  67. package/dist/EpQuestion-94aa29de.js +0 -5
  68. package/dist/EpQuote-adfe2a2b.js +0 -5
  69. package/dist/EpRadio-53f60b1a.js +0 -5
  70. package/dist/EpReading-747f0ce9.js +0 -5
  71. package/dist/EpResource-c6662e5a.js +0 -5
  72. package/dist/EpScope-494ffdec.js +0 -5
  73. package/dist/EpSection-bdad41e4.js +0 -5
  74. package/dist/EpSoftware-2730a943.js +0 -5
  75. package/dist/EpSpinner-da2475b0.js +0 -5
  76. package/dist/EpSvg-a2ebcc93.js +0 -5
  77. package/dist/EpTable-0555285d.js +0 -5
  78. package/dist/EpTerm-87ed74e7.js +0 -5
  79. package/dist/EpText-7c29711c.js +0 -5
  80. package/dist/EpTimeLine-c85d470a.js +0 -5
  81. package/dist/EpVideo-fe865980.js +0 -5
  82. package/dist/EpVideoPanopto-f31cdb1e.js +0 -5
  83. package/dist/TextBloc-d81840e6.js +0 -13
  84. package/dist/components/tools/TextBloc.vue.d.ts +0 -9
  85. package/src/components/tools/TextBloc.vue +0 -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.20",
4
+ "version": "0.1.21",
5
5
  "files": [
6
6
  "dist",
7
7
  "src/components/"
@@ -1,121 +1,103 @@
1
1
  <script setup lang="ts">
2
- import { computed, defineComponent, defineAsyncComponent, toRefs,ref, h, createApp, defineCustomElement } from 'vue';
3
- import { isHtml } from '../../composables/isHtml';
4
- import {useMarkdown} from '../../composables/useMarkdown'
5
- import EpAccordeon from '../interactions/EpAccordeon.vue';
6
-
7
-
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";
8
7
 
9
8
  interface Props {
10
- glossary?:any[];
11
- content:string;
12
- title?:string|null;
13
- compact?:boolean;
9
+ glossary?: any[];
10
+ content: string;
11
+ title?: string | null;
12
+ compact?: boolean;
14
13
  }
15
14
 
16
- const props = withDefaults(defineProps<Props>(),{
17
- compact:false,
18
- })
15
+ const props = withDefaults(defineProps<Props>(), {
16
+ compact: false,
17
+ });
19
18
 
20
- const renderTitle = computed(()=>{
21
- if(!props.title){
22
- return "En savoir plus"
19
+ const renderTitle = computed(() => {
20
+ if (!props.title) {
21
+ return "En savoir plus";
23
22
  }
24
- return props.title
25
- })
23
+ return props.title;
24
+ });
26
25
 
27
- const renderText = computed(()=>{
28
- if(!props.content){
29
- return `<div></div>`
30
- }
31
- if(!isHtml(props.content)){
32
- return useMarkdown(props.content)
33
- }
34
- //return props.content
35
- //create a div
36
- const div = document.createElement('DIV')
37
- ///add the html input to the div
38
- div.innerHTML = props.content.trim()
39
- ///get strign of html
40
- let newStr = div.outerHTML
41
- //find all span.ep_glossary_item to know the glossary terms in the text
42
- const glossaryTerms = div.querySelectorAll('.ep_glossary_item')
43
- // console.log(glossaryTerms)
44
- //if find glossary terms
45
- if(glossaryTerms.length > 0){
46
- ///check every term and replace it
47
- glossaryTerms.forEach((item)=>{
48
- //get id
49
- const id = item.getAttribute("data-id")
50
- //get content text
51
- const render_word = item.innerHTML
52
- //find in the glossary their equivalent
53
- let _glossary = []
54
- if(props.glossary){
55
- _glossary = props.glossary
56
- }
57
- const term = _glossary.find(word => word.id === id)
58
- //if was found
59
- if(term){
60
- ///add the new values to the array
61
- const word = item.outerHTML
62
- //check if the term has relations
63
- const foundedRelations = _glossary.filter((x) =>
64
- x.relation.some((item:string) => {
65
- return item == id;
66
- })
67
- );
68
- //get relations id and term
69
- const idsRelation = foundedRelations.map((x) => x.id);
70
- const termsRelation = foundedRelations.map((x) => x.term);
71
- const variation = term.variation
72
- const hasImge = term.src ? term.src : ''
73
- //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>`
74
- 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> `
75
- //replace output string
76
- newStr = newStr.replace(word, replaceWord)
77
- }
78
- })
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;
79
55
  }
80
- div.innerHTML = newStr
81
- // console.log(div.innerHTML)
82
- return div.innerHTML;
83
- })
84
-
85
-
86
- const EpTerm = defineAsyncComponent(()=>import('../medias/EpTerm.vue'))
87
-
88
- const customRenderStringComponents = defineComponent({
89
- components:{
90
- 'epterm':EpTerm
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
+ });
83
+
84
+ const render = () => {
85
+ const r = {
86
+ components: {
87
+ epterm: EpTerm,
91
88
  },
92
- template:`<div>${renderText.value}</div>`
93
- })
94
- // const customRenderStringComponents = defineComponent({
95
- // components:{
96
- // 'epterm':EpTerm
97
- // },
98
- // template:`<div>${renderText.value}</div>`
99
- // })
100
-
101
- // const TextApp = createApp({
102
- // setup(){
103
- // return () => h(TextBlock, `<template>${renderText.value}</template>`)
104
- // }
105
- // })
106
-
89
+ template: `<div>${renderText.value}</div>`,
90
+ };
107
91
 
92
+ return h(r);
93
+ };
108
94
 
109
-
110
- const {compact} = toRefs(props)
111
-
95
+ const { compact } = toRefs(props);
112
96
  </script>
113
97
 
114
98
  <template>
115
-
116
- <component v-if="!compact" :is="customRenderStringComponents"></component>
99
+ <render v-if="!compact"></render>
117
100
  <EpAccordeon outlined :title="renderTitle" v-else>
118
- <component :is="customRenderStringComponents"></component>
119
- </EpAccordeon>
120
- <!-- <component v-else :is="renderText"></component> -->
121
- </template>
101
+ <render></render>
102
+ </EpAccordeon>
103
+ </template>
@@ -1,5 +0,0 @@
1
- import { L as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { M as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { I as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { z as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { c as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { o as a } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- a as default
5
- };
@@ -1,5 +0,0 @@
1
- import { d as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { e as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { w as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { g as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { r as a } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- a as default
5
- };
@@ -1,5 +0,0 @@
1
- import { h as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { J as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { A as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { j as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { p as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { B as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { C as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { x as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { q as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { y as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { K as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { v as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { b as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { s as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { t as a } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- a as default
5
- };
@@ -1,5 +0,0 @@
1
- import { k as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { D as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { l as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { E as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { m as a } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- a as default
5
- };
@@ -1,5 +0,0 @@
1
- import { _ as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { n as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { F as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { G as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,5 +0,0 @@
1
- import { H as m } from "./index-5bd6e63c.js";
2
- import "vue";
3
- export {
4
- m as default
5
- };
@@ -1,13 +0,0 @@
1
- import { defineComponent as t, openBlock as o, createElementBlock as n, createTextVNode as r, renderSlot as l } from "vue";
2
- const s = /* @__PURE__ */ t({
3
- __name: "TextBloc",
4
- setup(c) {
5
- return (e, a) => (o(), n("div", null, [
6
- r(" block "),
7
- l(e.$slots, "default")
8
- ]));
9
- }
10
- });
11
- export {
12
- s as default
13
- };
@@ -1,9 +0,0 @@
1
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
2
- default?(_: {}): any;
3
- }>;
4
- export default _default;
5
- type __VLS_WithTemplateSlots<T, S> = T & {
6
- new (): {
7
- $slots: S;
8
- };
9
- };
@@ -1,10 +0,0 @@
1
- <script setup lang="ts">
2
- import EpTerm from "../medias/EpTerm.vue";
3
- </script>
4
-
5
- <template>
6
- <div>
7
- block
8
- <slot> </slot>
9
- </div>
10
- </template>