@1024pix/epreuves-components 0.9.5 → 0.9.7
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/{NavigationButton.ce-qPk4D7sx.js → ButtonTooltip.ce-DJWPmZEW.js} +497 -551
- package/dist/{ImageQuiz.ce-CyuIHq11.js → ImageQuiz.ce-CoHr8kTK.js} +14 -14
- package/dist/LLMMessage.ce-DHyl5CcV.js +89 -0
- package/dist/Loading.ce-B_mSjXBH.js +14 -0
- package/dist/NavigationButton.ce-CObYL4XH.js +59 -0
- package/dist/_plugin-vue_export-helper-OrrhezDE.js +4178 -0
- package/dist/components/complete-phrase.ce.js.js +102 -0
- package/dist/components/image-quiz.ce.js.js +2 -2
- package/dist/components/image-quizzes.ce.js.js +2 -2
- package/dist/components/llm-compare-messages.ce.js.js +9 -8
- package/dist/components/llm-messages.ce.js.js +5 -4
- package/dist/components/llm-prompt-select.ce.js.js +1 -1
- package/dist/components/message-conversation.ce.js.js +52 -55
- package/dist/components/pix-carousel.ce.js.js +140 -139
- package/dist/components/pix-cursor.ce.js.js +90 -89
- package/dist/index.js +1 -0
- package/dist/metadata.js +11 -8
- package/dist/shadow-dom-Bfma-Uia.js +9 -0
- package/package.json +1 -1
- package/dist/LLMMessage.ce-CrEM5b3d.js +0 -3158
- package/dist/_plugin-vue_export-helper-CGraGJnO.js +0 -4184
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { a as x, c as r, o as t, f as e, t as i, I as L, _ as k, r as d, e as _, g as f, l as P, i as A, F as v, b as h, x as M, d as T } from "../_plugin-vue_export-helper-OrrhezDE.js";
|
|
2
|
+
import { B as I, a as N, i as y, b as z } from "../ButtonTooltip.ce-DJWPmZEW.js";
|
|
3
|
+
import { L as w } from "../LLMMessage.ce-DHyl5CcV.js";
|
|
4
|
+
const q = {
|
|
5
|
+
"complete-phrase": { iaSuggestions: "🧠 Suggestions de l'IA", explanation: "La barre indique la probabilité de chaque mot. Plus elle est longue, plus le mot est probable dans ce contexte.", ariaLabelDescription: "Le nom {{name}} a une probabilité de {{percent}}%", clickHereButton: "Cliquez ici pour voir ce que l'IA va compléter", successfullyCompletedSentence: "🎉 Phrase complétée avec succès !" }
|
|
6
|
+
}, E = { class: "probability-bar" }, D = ["aria-label"], F = /* @__PURE__ */ x({
|
|
7
|
+
__name: "ProbabilityBar.ce",
|
|
8
|
+
props: {
|
|
9
|
+
name: { type: String },
|
|
10
|
+
percent: { type: Number }
|
|
11
|
+
},
|
|
12
|
+
setup(s) {
|
|
13
|
+
return (o, n) => (t(), r("div", E, [
|
|
14
|
+
e("p", null, i(o.name), 1),
|
|
15
|
+
e("div", {
|
|
16
|
+
style: L(`width: ${o.percent}%`),
|
|
17
|
+
class: "probability-bar__percent",
|
|
18
|
+
"aria-label": o.$t("complete-phrase.ariaLabelDescription", { name: o.name, percent: o.percent })
|
|
19
|
+
}, null, 12, D),
|
|
20
|
+
n[0] || (n[0] = e("div", { class: "probability-bar__background" }, null, -1))
|
|
21
|
+
]));
|
|
22
|
+
}
|
|
23
|
+
}), H = ".probability-bar[data-v-609dbc19]{position:relative;padding-bottom:10px;border-bottom:1px solid #cbcbcb}.probability-bar__percent[data-v-609dbc19]{position:absolute;left:0;z-index:2;height:5px;border-radius:5px;background-color:#235386}.probability-bar__background[data-v-609dbc19]{position:absolute;left:0;z-index:1;width:100%;height:5px;border-radius:5px;background-color:#92a1b2}.probability-bar p[data-v-609dbc19]{margin-bottom:0}", O = /* @__PURE__ */ k(F, [["styles", [H]], ["__scopeId", "data-v-609dbc19"]]), R = { class: "container" }, V = { class: "container__left-side" }, j = {
|
|
24
|
+
key: 1,
|
|
25
|
+
class: "container__successSentence"
|
|
26
|
+
}, W = { class: "container__right-side" }, G = { class: "probabilities" }, J = ["aria-hidden"], K = /* @__PURE__ */ x({
|
|
27
|
+
__name: "CompletePhrase.ce",
|
|
28
|
+
props: {
|
|
29
|
+
listOfProbabilityBarsLists: { type: Array },
|
|
30
|
+
userMessage: { type: String },
|
|
31
|
+
llmMessage: { type: String },
|
|
32
|
+
wordsToAdd: { type: Array }
|
|
33
|
+
},
|
|
34
|
+
setup(s, { expose: o }) {
|
|
35
|
+
const n = s, l = d(0), p = d(n.llmMessage), b = d(!1), c = d(n.wordsToAdd);
|
|
36
|
+
function S() {
|
|
37
|
+
b.value = !1, p.value = n.llmMessage, c.value = n.wordsToAdd, l.value = 0;
|
|
38
|
+
}
|
|
39
|
+
function B() {
|
|
40
|
+
if (c.value.length <= 0) {
|
|
41
|
+
b.value = !0;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
l.value += 1;
|
|
45
|
+
const [a, ...m] = c.value;
|
|
46
|
+
c.value = m, p.value += `<span style="font-weight: bold;">${a} </span>`;
|
|
47
|
+
}
|
|
48
|
+
return o({
|
|
49
|
+
reset: S
|
|
50
|
+
}), (a, m) => (t(), r("div", R, [
|
|
51
|
+
e("div", V, [
|
|
52
|
+
e("div", null, [
|
|
53
|
+
f(w, {
|
|
54
|
+
class: "container__message",
|
|
55
|
+
message: { content: a.userMessage, direction: "outbound" }
|
|
56
|
+
}, null, 8, ["message"])
|
|
57
|
+
]),
|
|
58
|
+
e("div", null, [
|
|
59
|
+
f(w, {
|
|
60
|
+
class: "container__message",
|
|
61
|
+
message: { content: p.value, direction: "inbound" }
|
|
62
|
+
}, null, 8, ["message"])
|
|
63
|
+
]),
|
|
64
|
+
b.value ? (t(), r("p", j, i(a.$t("complete-phrase.successfullyCompletedSentence")), 1)) : (t(), _(I, {
|
|
65
|
+
key: 0,
|
|
66
|
+
onClick: B,
|
|
67
|
+
class: "container__button",
|
|
68
|
+
label: a.$t("complete-phrase.clickHereButton"),
|
|
69
|
+
"tooltip-position": "bottom"
|
|
70
|
+
}, {
|
|
71
|
+
default: P(() => [
|
|
72
|
+
A(i(a.$t("complete-phrase.clickHereButton")), 1)
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
}, 8, ["label"]))
|
|
76
|
+
]),
|
|
77
|
+
e("div", W, [
|
|
78
|
+
e("h2", null, i(a.$t("complete-phrase.iaSuggestions")), 1),
|
|
79
|
+
e("p", null, i(a.$t("complete-phrase.explanation")), 1),
|
|
80
|
+
e("div", G, [
|
|
81
|
+
(t(!0), r(v, null, h(a.listOfProbabilityBarsLists, (C, u) => (t(), r("div", {
|
|
82
|
+
class: M(["probability", { hidden: u !== l.value }]),
|
|
83
|
+
key: u,
|
|
84
|
+
"aria-hidden": u !== l.value
|
|
85
|
+
}, [
|
|
86
|
+
(t(!0), r(v, null, h(C, (g, $) => (t(), _(O, {
|
|
87
|
+
name: g.name,
|
|
88
|
+
percent: g.percent,
|
|
89
|
+
key: $
|
|
90
|
+
}, null, 8, ["name", "percent"]))), 128))
|
|
91
|
+
], 10, J))), 128))
|
|
92
|
+
])
|
|
93
|
+
])
|
|
94
|
+
]));
|
|
95
|
+
}
|
|
96
|
+
}), Q = "[data-v-7541b9af]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.container[data-v-7541b9af]{display:grid;grid-row:auto;gap:10px}.container .probabilities[data-v-7541b9af]{display:grid}.container .probability[data-v-7541b9af]{grid-row:1;grid-column:1}.container__right-side[data-v-7541b9af]{grid-column:2;grid-row:1}.container__right-side h2[data-v-7541b9af]{margin-top:0}.container__right-side .hidden[data-v-7541b9af]{visibility:hidden;grid-row:1;grid-column:1}.container__left-side[data-v-7541b9af]{grid-column:1;grid-row:1}.container__left-side>div[data-v-7541b9af]{display:flex;flex-direction:column}.container__message[data-v-7541b9af]{margin-bottom:20px}.container__successSentence[data-v-7541b9af]{width:90%;background-color:#cec3f4;padding:.8rem .5rem;border-radius:10px}[data-v-7541b9af] .container__button{width:90%;border:none;padding:1.2rem 1rem;background:#355ac4;color:#fff;border-radius:10px;font-weight:700}[data-v-7541b9af] .container__button:hover{background:#2b3c77}@media (max-width: 600px){.container[data-v-7541b9af]{display:flex;flex-wrap:wrap}}", U = /* @__PURE__ */ k(K, [["styles", [Q]], ["__scopeId", "data-v-7541b9af"]]);
|
|
97
|
+
N(/* @__PURE__ */ Object.assign({ "./locales/fr.json": q })).catch((s) => console.error(s));
|
|
98
|
+
window.customElements.define("complete-phrase", T(U, {
|
|
99
|
+
configureApp(s) {
|
|
100
|
+
y.changeLanguage(document?.documentElement?.lang || navigator.language), s.use(z, { i18next: y });
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as e } from "../_plugin-vue_export-helper-
|
|
2
|
-
import { I as m } from "../ImageQuiz.ce-
|
|
1
|
+
import { d as e } from "../_plugin-vue_export-helper-OrrhezDE.js";
|
|
2
|
+
import { I as m } from "../ImageQuiz.ce-CoHr8kTK.js";
|
|
3
3
|
window.customElements.define("image-quiz", e(m));
|
|
4
4
|
window.customElements.define("qcu-image", e(m));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as l, r as f, w, c as z, o as t, b as p, e as d, m as g, F as v, d as _ } from "../_plugin-vue_export-helper-
|
|
2
|
-
import { I as A } from "../ImageQuiz.ce-
|
|
1
|
+
import { a as l, r as f, w, c as z, o as t, b as p, e as d, m as g, F as v, d as _ } from "../_plugin-vue_export-helper-OrrhezDE.js";
|
|
2
|
+
import { I as A } from "../ImageQuiz.ce-CoHr8kTK.js";
|
|
3
3
|
const h = /* @__PURE__ */ l({
|
|
4
4
|
__name: "ImageQuizzes.ce",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as d, c as o, o as n, f as s, t, F as l, b as p, g as
|
|
2
|
-
import {
|
|
1
|
+
import { a as d, c as o, o as n, f as s, t, F as l, b as p, g as r, _ as c, d as f } from "../_plugin-vue_export-helper-OrrhezDE.js";
|
|
2
|
+
import { L as i } from "../LLMMessage.ce-DHyl5CcV.js";
|
|
3
|
+
import { p as u } from "../shadow-dom-Bfma-Uia.js";
|
|
3
4
|
const g = {
|
|
4
5
|
class: "header",
|
|
5
6
|
"aria-hidden": "true"
|
|
@@ -12,7 +13,7 @@ const g = {
|
|
|
12
13
|
messages: { type: Array }
|
|
13
14
|
},
|
|
14
15
|
setup(x) {
|
|
15
|
-
return
|
|
16
|
+
return u(), (e, L) => (n(), o(l, null, [
|
|
16
17
|
s("div", g, [
|
|
17
18
|
s("p", null, t(e.conversation1.title), 1),
|
|
18
19
|
s("p", null, t(e.conversation2.title), 1)
|
|
@@ -25,26 +26,26 @@ const g = {
|
|
|
25
26
|
}, [
|
|
26
27
|
Array.isArray(a) ? (n(), o(l, { key: 0 }, [
|
|
27
28
|
s("div", null, [
|
|
28
|
-
i
|
|
29
|
+
r(i, {
|
|
29
30
|
message: a[0],
|
|
30
31
|
name: e.conversation1.llmName
|
|
31
32
|
}, null, 8, ["message", "name"])
|
|
32
33
|
]),
|
|
33
34
|
s("div", null, [
|
|
34
|
-
i
|
|
35
|
+
r(i, {
|
|
35
36
|
message: a[1],
|
|
36
37
|
name: e.conversation2.llmName
|
|
37
38
|
}, null, 8, ["message", "name"])
|
|
38
39
|
])
|
|
39
40
|
], 64)) : (n(), o(l, { key: 1 }, [
|
|
40
41
|
s("div", null, [
|
|
41
|
-
i
|
|
42
|
+
r(i, {
|
|
42
43
|
message: a,
|
|
43
44
|
name: e.userName
|
|
44
45
|
}, null, 8, ["message", "name"])
|
|
45
46
|
]),
|
|
46
47
|
s("div", v, [
|
|
47
|
-
i
|
|
48
|
+
r(i, {
|
|
48
49
|
message: a,
|
|
49
50
|
name: e.userName
|
|
50
51
|
}, null, 8, ["message", "name"])
|
|
@@ -55,4 +56,4 @@ const g = {
|
|
|
55
56
|
], 64));
|
|
56
57
|
}
|
|
57
58
|
}), w = '*{box-sizing:border-box}:host{display:flex;flex-direction:column}.llm-compare-messages{display:flex;flex-direction:column;padding:24px 0;gap:24px;position:relative;height:100%;overflow:auto}.llm-compare-messages:after{content:"";position:absolute;height:100%;top:0;left:50%;border-left:dashed 1px grey}.llm-compare-messages__row{display:flex;flex-direction:row;justify-content:space-between}.llm-compare-messages__row>div{display:flex;flex-direction:column;width:calc(50% - 12px)}.header{display:flex}.header p{background:#e6eaf2;display:flex;width:50%;justify-content:center;align-items:center;padding:1rem;margin:0;font-size:1.2rem;font-weight:700}.header p:first-child{background:#fff7da}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}', b = /* @__PURE__ */ c(_, [["styles", [w]]]);
|
|
58
|
-
window.customElements.define("llm-compare-messages",
|
|
59
|
+
window.customElements.define("llm-compare-messages", f(b));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as m,
|
|
2
|
-
import {
|
|
1
|
+
import { a as m, j as i, k as p, c as o, o as e, F as d, b as g, e as u, _ as f, d as h } from "../_plugin-vue_export-helper-OrrhezDE.js";
|
|
2
|
+
import { L as _ } from "../LLMMessage.ce-DHyl5CcV.js";
|
|
3
|
+
import { p as x } from "../shadow-dom-Bfma-Uia.js";
|
|
3
4
|
const b = {
|
|
4
5
|
class: "llm-messages",
|
|
5
6
|
"aria-live": "polite"
|
|
@@ -10,7 +11,7 @@ const b = {
|
|
|
10
11
|
},
|
|
11
12
|
setup(t) {
|
|
12
13
|
const a = t;
|
|
13
|
-
|
|
14
|
+
x();
|
|
14
15
|
const s = i();
|
|
15
16
|
function r() {
|
|
16
17
|
s.scrollTop = s.scrollHeight;
|
|
@@ -18,7 +19,7 @@ const b = {
|
|
|
18
19
|
return p(async () => {
|
|
19
20
|
a.messages, r();
|
|
20
21
|
}), (l, w) => (e(), o("div", b, [
|
|
21
|
-
(e(!0), o(d, null,
|
|
22
|
+
(e(!0), o(d, null, g(l.messages, (n, c) => (e(), u(_, {
|
|
22
23
|
key: c,
|
|
23
24
|
message: n
|
|
24
25
|
}, null, 8, ["message"]))), 128))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as v, r as i, h, c, o as d, g as y, f as l, i as w, F as f, b as k, t as S, _ as C, d as L } from "../_plugin-vue_export-helper-
|
|
1
|
+
import { a as v, r as i, h, c, o as d, g as y, f as l, i as w, F as f, b as k, t as S, _ as C, d as L } from "../_plugin-vue_export-helper-OrrhezDE.js";
|
|
2
2
|
import "./llm-messages.ce.js.js";
|
|
3
3
|
const N = { class: "prompt-select" }, P = { class: "prompt-select__options" }, B = ["disabled", "onClick"], E = /* @__PURE__ */ v({
|
|
4
4
|
__name: "LLMPromptSelect.ce",
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return s(), o("div", F);
|
|
5
|
-
}
|
|
6
|
-
const L = /* @__PURE__ */ b(z, [["render", I], ["styles", [V]]]), j = ["part"], q = {
|
|
1
|
+
import { a as k, r as b, B as M, H as C, c as r, o as t, x, C as _, f as y, i as w, t as h, g as $, F as v, b as N, _ as D, G as B, e as E, d as T } from "../_plugin-vue_export-helper-OrrhezDE.js";
|
|
2
|
+
import { L as V } from "../Loading.ce-B_mSjXBH.js";
|
|
3
|
+
const F = ["part"], L = {
|
|
7
4
|
key: 1,
|
|
8
5
|
class: "message__loader message__content",
|
|
9
6
|
"aria-hidden": "true"
|
|
10
|
-
},
|
|
7
|
+
}, z = ["part"], I = { key: 0 }, j = /* @__PURE__ */ k({
|
|
11
8
|
__name: "Message.ce",
|
|
12
9
|
props: {
|
|
13
10
|
displaySender: { type: Boolean, default: !0 },
|
|
@@ -16,97 +13,97 @@ const L = /* @__PURE__ */ b(z, [["render", I], ["styles", [V]]]), j = ["part"],
|
|
|
16
13
|
animationDuration: { type: Number },
|
|
17
14
|
loadingDuration: { type: Number }
|
|
18
15
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
16
|
+
setup(n, { expose: c }) {
|
|
17
|
+
const s = b("hidden"), l = b([]), u = M(() => n.message.content.split(`
|
|
21
18
|
`));
|
|
22
|
-
function
|
|
19
|
+
function m(e) {
|
|
23
20
|
return new Promise((i) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
21
|
+
const o = setTimeout(i, e);
|
|
22
|
+
l.value.push(o);
|
|
26
23
|
});
|
|
27
24
|
}
|
|
28
|
-
async function
|
|
29
|
-
await
|
|
25
|
+
async function g() {
|
|
26
|
+
await m(n.startAnimation), s.value = "loading", await m(n.loadingDuration), s.value = "visible", await m(n.animationDuration);
|
|
30
27
|
}
|
|
31
|
-
|
|
28
|
+
C(g);
|
|
32
29
|
async function a() {
|
|
33
|
-
|
|
30
|
+
s.value = "hidden", l.value.forEach(clearTimeout), await g();
|
|
34
31
|
}
|
|
35
|
-
return
|
|
32
|
+
return c({
|
|
36
33
|
reset: a
|
|
37
|
-
}), (e, i) => (
|
|
38
|
-
class:
|
|
34
|
+
}), (e, i) => (t(), r("div", {
|
|
35
|
+
class: x(["message", [
|
|
39
36
|
`message--${e.message.direction}`,
|
|
40
|
-
{ "hidden-state":
|
|
37
|
+
{ "hidden-state": s.value === "hidden" }
|
|
41
38
|
]])
|
|
42
39
|
}, [
|
|
43
|
-
e.displaySender ? (
|
|
40
|
+
e.displaySender ? (t(), r("p", {
|
|
44
41
|
key: 0,
|
|
45
42
|
class: "message__sender",
|
|
46
43
|
part: `sender ${e.message.direction}`
|
|
47
44
|
}, [
|
|
48
45
|
i[0] || (i[0] = y("span", { class: "sr-only" }, "Message de ", -1)),
|
|
49
|
-
|
|
50
|
-
], 8,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
])) :
|
|
46
|
+
w(h(e.message.userName), 1)
|
|
47
|
+
], 8, F)) : _("", !0),
|
|
48
|
+
s.value === "loading" ? (t(), r("div", L, [
|
|
49
|
+
$(V)
|
|
50
|
+
])) : _("", !0),
|
|
54
51
|
y("p", {
|
|
55
|
-
class:
|
|
52
|
+
class: x(["message__content", { "hidden-state": s.value !== "visible" }]),
|
|
56
53
|
part: `message ${e.message.direction}`
|
|
57
54
|
}, [
|
|
58
|
-
(
|
|
59
|
-
d > 0 ? (
|
|
60
|
-
|
|
55
|
+
(t(!0), r(v, null, N(u.value, (o, d) => (t(), r(v, { key: d }, [
|
|
56
|
+
d > 0 ? (t(), r("br", I)) : _("", !0),
|
|
57
|
+
w(" " + h(o), 1)
|
|
61
58
|
], 64))), 128))
|
|
62
|
-
], 10,
|
|
59
|
+
], 10, z)
|
|
63
60
|
], 2));
|
|
64
61
|
}
|
|
65
|
-
}), G = ".message{max-width:80%;position:relative}.message--incoming{align-self:start}.message--incoming .message__sender{padding-left:10px}.message--incoming .message__loader{left:10px}.message--incoming .message__content{background-color:#e8e8e8}.message--outgoing{align-self:end}.message--outgoing .message__sender{padding-right:10px;text-align:right}.message--outgoing .message__loader{right:10px}.message--outgoing .message__content{background-color:#d1eaff}.message__sender{color:#444;font-size:.8rem;font-weight:700;margin:0}.message__loader{position:absolute;width:24px}.message__content{border-radius:16px;margin:0;padding:10px 14px}.message__content:not(.hidden-state){animation:fade .3s ease-in-out both}.hidden-state{visibility:hidden}@keyframes fade{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){.message__content:not(.hidden-state){animation:none}.message__loader{display:none}.hidden-state{visibility:visible}}", H = /* @__PURE__ */
|
|
62
|
+
}), G = ".message{max-width:80%;position:relative}.message--incoming{align-self:start}.message--incoming .message__sender{padding-left:10px}.message--incoming .message__loader{left:10px}.message--incoming .message__content{background-color:#e8e8e8}.message--outgoing{align-self:end}.message--outgoing .message__sender{padding-right:10px;text-align:right}.message--outgoing .message__loader{right:10px}.message--outgoing .message__content{background-color:#d1eaff}.message__sender{color:#444;font-size:.8rem;font-weight:700;margin:0}.message__loader{position:absolute;width:24px}.message__content{border-radius:16px;margin:0;padding:10px 14px}.message__content:not(.hidden-state){animation:fade .3s ease-in-out both}.hidden-state{visibility:hidden}@keyframes fade{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){.message__content:not(.hidden-state){animation:none}.message__loader{display:none}.hidden-state{visibility:visible}}", H = /* @__PURE__ */ D(j, [["styles", [G]]]), O = { part: "conversation" }, P = { class: "sr-only" }, R = /* @__PURE__ */ k({
|
|
66
63
|
__name: "MessageConversation.ce",
|
|
67
64
|
props: {
|
|
68
65
|
title: { default: "Conversation par messages", type: String },
|
|
69
66
|
messages: { type: Array },
|
|
70
67
|
animationSpeed: { default: 20, type: Number }
|
|
71
68
|
},
|
|
72
|
-
setup(
|
|
73
|
-
const
|
|
74
|
-
() =>
|
|
69
|
+
setup(n, { expose: c }) {
|
|
70
|
+
const s = 50 * n.animationSpeed, l = M(
|
|
71
|
+
() => n.messages.reduce(
|
|
75
72
|
(a, e, i) => {
|
|
76
|
-
const
|
|
73
|
+
const o = m(e);
|
|
77
74
|
if (i === 0)
|
|
78
|
-
return [{ message: e, displaySender: !0, startAnimation: 0, animationDuration:
|
|
75
|
+
return [{ message: e, displaySender: !0, startAnimation: 0, animationDuration: o }];
|
|
79
76
|
const {
|
|
80
77
|
message: d,
|
|
81
78
|
startAnimation: p,
|
|
82
|
-
animationDuration:
|
|
83
|
-
} = a.at(-1), S = e.direction !== d.direction || e.userName !== d.userName,
|
|
84
|
-
return [...a, { message: e, displaySender: S, startAnimation:
|
|
79
|
+
animationDuration: f
|
|
80
|
+
} = a.at(-1), S = e.direction !== d.direction || e.userName !== d.userName, A = p + f + s;
|
|
81
|
+
return [...a, { message: e, displaySender: S, startAnimation: A, animationDuration: o }];
|
|
85
82
|
},
|
|
86
83
|
[]
|
|
87
84
|
)
|
|
88
|
-
),
|
|
89
|
-
function
|
|
90
|
-
return a.content.length *
|
|
85
|
+
), u = B("messages");
|
|
86
|
+
function m(a) {
|
|
87
|
+
return a.content.length * n.animationSpeed;
|
|
91
88
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
89
|
+
function g() {
|
|
90
|
+
u.value.forEach((a) => a.reset());
|
|
94
91
|
}
|
|
95
|
-
return
|
|
96
|
-
reset:
|
|
97
|
-
}), (a, e) => (
|
|
98
|
-
y("figcaption",
|
|
99
|
-
(
|
|
92
|
+
return c({
|
|
93
|
+
reset: g
|
|
94
|
+
}), (a, e) => (t(), r("figure", O, [
|
|
95
|
+
y("figcaption", P, h(a.title), 1),
|
|
96
|
+
(t(!0), r(v, null, N(l.value, ({ message: i, displaySender: o, startAnimation: d, animationDuration: p }, f) => (t(), E(H, {
|
|
100
97
|
ref_for: !0,
|
|
101
98
|
ref: "messages",
|
|
102
99
|
message: i,
|
|
103
100
|
"start-animation": d,
|
|
104
101
|
"animation-duration": p,
|
|
105
|
-
"loading-duration":
|
|
106
|
-
"display-sender":
|
|
107
|
-
key:
|
|
102
|
+
"loading-duration": s,
|
|
103
|
+
"display-sender": o,
|
|
104
|
+
key: f
|
|
108
105
|
}, null, 8, ["message", "start-animation", "animation-duration", "display-sender"]))), 128))
|
|
109
106
|
]));
|
|
110
107
|
}
|
|
111
|
-
}),
|
|
112
|
-
window.customElements.define("message-conversation", T(
|
|
108
|
+
}), q = "figure{background-color:#fff;border-radius:16px;display:flex;flex-direction:column;gap:8px;margin:0;padding:16px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", J = /* @__PURE__ */ D(R, [["styles", [q]]]);
|
|
109
|
+
window.customElements.define("message-conversation", T(J));
|