@1024pix/epreuves-components 1.4.4 → 1.4.5
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.
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { a as w, c as
|
|
2
|
-
import { a as M, i as f, b as
|
|
1
|
+
import { a as w, c as i, o as t, f as e, t as r, x as P, _ as x, r as b, y as g, F as v, b as h, D as B, e as C, d as A } from "../_plugin-vue_export-helper-CwwQJ1m6.js";
|
|
2
|
+
import { a as M, i as f, b as z } from "../i18n-gncqQJ0G.js";
|
|
3
3
|
import { L as y } from "../LLMMessage.ce-DnZ8kE2i.js";
|
|
4
|
-
const
|
|
5
|
-
"complete-phrase": { iaSuggestions: "🧠
|
|
6
|
-
},
|
|
4
|
+
const j = {}, N = {}, T = {
|
|
5
|
+
"complete-phrase": { iaSuggestions: "🧠 Probabilité du mot suivant", explanation: "La barre indique la probabilité de chaque mot. Plus elle est longue, plus le mot est probable dans ce contexte.", ariaLabelDescription: "Le mot {{name}} a une probabilité de {{percent}}%", clickHereButton: "Afficher le mot suivant choisi par l'IA", successfullyCompletedSentence: "👇 Répondez à la question ci-dessous" }
|
|
6
|
+
}, D = {}, E = {}, I = { class: "probability-bar" }, R = { "aria-hidden": "true" }, q = { class: "sr-only" }, F = /* @__PURE__ */ w({
|
|
7
7
|
__name: "ProbabilityBar.ce",
|
|
8
8
|
props: {
|
|
9
9
|
name: { type: String },
|
|
10
10
|
percent: { type: Number }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
return (o, s) => (t(),
|
|
14
|
-
e("p",
|
|
15
|
-
e("p",
|
|
12
|
+
setup(n) {
|
|
13
|
+
return (o, s) => (t(), i("div", I, [
|
|
14
|
+
e("p", R, r(o.name), 1),
|
|
15
|
+
e("p", q, r(o.$t("complete-phrase.ariaLabelDescription", { name: o.name, percent: o.percent })), 1),
|
|
16
16
|
e("div", {
|
|
17
|
-
style:
|
|
17
|
+
style: P(`width: ${o.percent}%`),
|
|
18
18
|
class: "probability-bar__percent",
|
|
19
19
|
"aria-hidden": "true"
|
|
20
20
|
}, null, 4),
|
|
@@ -24,7 +24,7 @@ const z = {}, N = {}, I = {
|
|
|
24
24
|
}, null, -1))
|
|
25
25
|
]));
|
|
26
26
|
}
|
|
27
|
-
}),
|
|
27
|
+
}), O = ".probability-bar[data-v-d89fc563]{position:relative;padding-bottom:10px;border-bottom:1px solid #cbcbcb}.probability-bar__percent[data-v-d89fc563]{position:absolute;left:0;z-index:2;height:5px;border-radius:5px;background-color:#235386}.probability-bar__background[data-v-d89fc563]{position:absolute;left:0;z-index:1;width:100%;height:5px;border-radius:5px;background-color:#92a1b2}.probability-bar p[data-v-d89fc563]{margin-bottom:0}.sr-only[data-v-d89fc563]{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", H = /* @__PURE__ */ x(F, [["styles", [O]], ["__scopeId", "data-v-d89fc563"]]), V = { class: "container" }, W = { class: "container__left-side" }, G = { class: "container__conversation" }, J = ["aria-describedby"], K = {
|
|
28
28
|
key: 1,
|
|
29
29
|
class: "container__successSentence"
|
|
30
30
|
}, Q = { class: "container__right-side" }, U = ["aria-level"], X = { "aria-hidden": "true" }, Y = { class: "probabilities" }, Z = ["id", "aria-hidden"], ee = /* @__PURE__ */ w({
|
|
@@ -36,19 +36,19 @@ const z = {}, N = {}, I = {
|
|
|
36
36
|
wordsToAdd: { type: Array },
|
|
37
37
|
titleLevel: { type: Number }
|
|
38
38
|
},
|
|
39
|
-
setup(
|
|
40
|
-
const s =
|
|
39
|
+
setup(n, { expose: o }) {
|
|
40
|
+
const s = n, d = b(0), p = b(s.llmMessage), u = b(!1), l = b(s.wordsToAdd);
|
|
41
41
|
function k() {
|
|
42
|
-
u.value = !1,
|
|
42
|
+
u.value = !1, p.value = s.llmMessage, l.value = s.wordsToAdd, d.value = 0;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
const [a, ..._] =
|
|
47
|
-
|
|
44
|
+
function $() {
|
|
45
|
+
l.value.length === 1 && (u.value = !0), d.value += 1;
|
|
46
|
+
const [a, ..._] = l.value;
|
|
47
|
+
l.value = _, p.value += `<span style="font-weight: bold;">${a} </span>`;
|
|
48
48
|
}
|
|
49
49
|
return o({
|
|
50
50
|
reset: k
|
|
51
|
-
}), (a, _) => (t(),
|
|
51
|
+
}), (a, _) => (t(), i("div", V, [
|
|
52
52
|
e("div", W, [
|
|
53
53
|
e("div", G, [
|
|
54
54
|
g(y, {
|
|
@@ -57,14 +57,14 @@ const z = {}, N = {}, I = {
|
|
|
57
57
|
}, null, 8, ["message"]),
|
|
58
58
|
g(y, {
|
|
59
59
|
class: "container__message",
|
|
60
|
-
message: { content:
|
|
60
|
+
message: { content: p.value, direction: "inbound" }
|
|
61
61
|
}, null, 8, ["message"])
|
|
62
62
|
]),
|
|
63
|
-
u.value ? (t(),
|
|
63
|
+
u.value ? (t(), i("p", K, r(a.$t("complete-phrase.successfullyCompletedSentence")), 1)) : (t(), i("button", {
|
|
64
64
|
key: 0,
|
|
65
|
-
onClick:
|
|
65
|
+
onClick: $,
|
|
66
66
|
class: "container__button",
|
|
67
|
-
"aria-describedby": `currentProbability${
|
|
67
|
+
"aria-describedby": `currentProbability${d.value}`
|
|
68
68
|
}, r(a.$t("complete-phrase.clickHereButton")), 9, J))
|
|
69
69
|
]),
|
|
70
70
|
e("div", Q, [
|
|
@@ -75,26 +75,26 @@ const z = {}, N = {}, I = {
|
|
|
75
75
|
}, r(a.$t("complete-phrase.iaSuggestions")), 9, U),
|
|
76
76
|
e("p", X, r(a.$t("complete-phrase.explanation")), 1),
|
|
77
77
|
e("div", Y, [
|
|
78
|
-
(t(!0),
|
|
79
|
-
class:
|
|
80
|
-
key:
|
|
81
|
-
id: `currentProbability${
|
|
82
|
-
"aria-hidden":
|
|
78
|
+
(t(!0), i(v, null, h(a.listOfProbabilityBarsLists, (L, c) => (t(), i("div", {
|
|
79
|
+
class: B(["probability", { hidden: c !== d.value }]),
|
|
80
|
+
key: c,
|
|
81
|
+
id: `currentProbability${c}`,
|
|
82
|
+
"aria-hidden": c !== d.value
|
|
83
83
|
}, [
|
|
84
|
-
(t(!0),
|
|
84
|
+
(t(!0), i(v, null, h(L, (m, S) => (t(), C(H, {
|
|
85
85
|
name: m.name,
|
|
86
86
|
percent: m.percent,
|
|
87
|
-
key:
|
|
87
|
+
key: S
|
|
88
88
|
}, null, 8, ["name", "percent"]))), 128))
|
|
89
89
|
], 10, Z))), 128))
|
|
90
90
|
])
|
|
91
91
|
])
|
|
92
92
|
]));
|
|
93
93
|
}
|
|
94
|
-
}), ae = "[data-v-
|
|
95
|
-
M(/* @__PURE__ */ Object.assign({ "./locales/en.json":
|
|
94
|
+
}), ae = "[data-v-db6bda33]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.container[data-v-db6bda33]{display:grid;grid-row:auto;gap:10px}.container__conversation[data-v-db6bda33]{display:flex;flex-direction:column;background:#fff;padding:1rem;border-radius:10px;margin-bottom:1rem;border:solid 1px lightgrey}.container__title[data-v-db6bda33]{font-size:1.2rem;font-weight:700}.container .probabilities[data-v-db6bda33]{display:grid}.container .probability[data-v-db6bda33]{grid-row:1;grid-column:1}.container__right-side[data-v-db6bda33]{grid-column:2;grid-row:1}.container__right-side h2[data-v-db6bda33]{margin-top:0}.container__right-side .hidden[data-v-db6bda33]{visibility:hidden;grid-row:1;grid-column:1}.container__left-side[data-v-db6bda33]{grid-column:1;grid-row:1}.container__message[data-v-db6bda33]{margin-bottom:20px}.container__successSentence[data-v-db6bda33]{width:90%;padding:.8rem .5rem;border-radius:10px}.container__button[data-v-db6bda33]{width:90%;border:none;padding:1.2rem 1rem;background:#355ac4;color:#fff;border-radius:10px;font-weight:700;font-size:1rem}.container__button[data-v-db6bda33]:hover{background:#2b3c77;cursor:pointer}@media (max-width: 600px){.container[data-v-db6bda33]{display:flex;flex-wrap:wrap}}", te = /* @__PURE__ */ x(ee, [["styles", [ae]], ["__scopeId", "data-v-db6bda33"]]);
|
|
95
|
+
M(/* @__PURE__ */ Object.assign({ "./locales/en.json": j, "./locales/es.json": N, "./locales/fr.json": T, "./locales/it.json": D, "./locales/nl.json": E })).catch((n) => console.error(n));
|
|
96
96
|
window.customElements.define("complete-phrase", A(te, {
|
|
97
|
-
configureApp(
|
|
98
|
-
f.changeLanguage(document?.documentElement?.lang || navigator.language),
|
|
97
|
+
configureApp(n) {
|
|
98
|
+
f.changeLanguage(document?.documentElement?.lang || navigator.language), n.use(z, { i18next: f });
|
|
99
99
|
}
|
|
100
100
|
}));
|