@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 n, o as t, f as e, t as r, x as C, _ as x, r as p, y as g, F as v, b as h, D as P, e as B, d as A } from "../_plugin-vue_export-helper-CwwQJ1m6.js";
2
- import { a as M, i as f, b as j } from "../i18n-gncqQJ0G.js";
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 z = {}, N = {}, I = {
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 mot {{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
- }, T = {}, q = {}, D = { class: "probability-bar" }, E = { "aria-hidden": "true" }, F = { class: "sr-only" }, O = /* @__PURE__ */ w({
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(i) {
13
- return (o, s) => (t(), n("div", D, [
14
- e("p", E, r(o.name), 1),
15
- e("p", F, r(o.$t("complete-phrase.ariaLabelDescription", { name: o.name, percent: o.percent })), 1),
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: C(`width: ${o.percent}%`),
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
- }), R = ".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(O, [["styles", [R]], ["__scopeId", "data-v-d89fc563"]]), V = { class: "container" }, W = { class: "container__left-side" }, G = { class: "container__conversation" }, J = ["aria-describedby"], K = {
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(i, { expose: o }) {
40
- const s = i, l = p(0), b = p(s.llmMessage), u = p(!1), c = p(s.wordsToAdd);
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, b.value = s.llmMessage, c.value = s.wordsToAdd, l.value = 0;
42
+ u.value = !1, p.value = s.llmMessage, l.value = s.wordsToAdd, d.value = 0;
43
43
  }
44
- function S() {
45
- c.value.length === 1 && (u.value = !0), l.value += 1;
46
- const [a, ..._] = c.value;
47
- c.value = _, b.value += `<span style="font-weight: bold;">${a} </span>`;
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(), n("div", V, [
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: b.value, direction: "inbound" }
60
+ message: { content: p.value, direction: "inbound" }
61
61
  }, null, 8, ["message"])
62
62
  ]),
63
- u.value ? (t(), n("p", K, r(a.$t("complete-phrase.successfullyCompletedSentence")), 1)) : (t(), n("button", {
63
+ u.value ? (t(), i("p", K, r(a.$t("complete-phrase.successfullyCompletedSentence")), 1)) : (t(), i("button", {
64
64
  key: 0,
65
- onClick: S,
65
+ onClick: $,
66
66
  class: "container__button",
67
- "aria-describedby": `currentProbability${l.value}`
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), n(v, null, h(a.listOfProbabilityBarsLists, ($, d) => (t(), n("div", {
79
- class: P(["probability", { hidden: d !== l.value }]),
80
- key: d,
81
- id: `currentProbability${d}`,
82
- "aria-hidden": d !== l.value
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), n(v, null, h($, (m, L) => (t(), B(H, {
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: L
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-12a26a0b]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.container[data-v-12a26a0b]{display:grid;grid-row:auto;gap:10px}.container__conversation[data-v-12a26a0b]{display:flex;flex-direction:column;background:#fff;padding:1rem;border-radius:10px;margin-bottom:1rem;border:solid 1px lightgrey}.container__title[data-v-12a26a0b]{font-size:1.2rem;font-weight:700}.container .probabilities[data-v-12a26a0b]{display:grid}.container .probability[data-v-12a26a0b]{grid-row:1;grid-column:1}.container__right-side[data-v-12a26a0b]{grid-column:2;grid-row:1}.container__right-side h2[data-v-12a26a0b]{margin-top:0}.container__right-side .hidden[data-v-12a26a0b]{visibility:hidden;grid-row:1;grid-column:1}.container__left-side[data-v-12a26a0b]{grid-column:1;grid-row:1}.container__message[data-v-12a26a0b]{margin-bottom:20px}.container__successSentence[data-v-12a26a0b]{width:90%;background-color:#cec3f4;padding:.8rem .5rem;border-radius:10px}.container__button[data-v-12a26a0b]{width:90%;border:none;padding:1.2rem 1rem;background:#355ac4;color:#fff;border-radius:10px;font-weight:700}.container__button[data-v-12a26a0b]:hover{background:#2b3c77;cursor:pointer}@media (max-width: 600px){.container[data-v-12a26a0b]{display:flex;flex-wrap:wrap}}", te = /* @__PURE__ */ x(ee, [["styles", [ae]], ["__scopeId", "data-v-12a26a0b"]]);
95
- M(/* @__PURE__ */ Object.assign({ "./locales/en.json": z, "./locales/es.json": N, "./locales/fr.json": I, "./locales/it.json": T, "./locales/nl.json": q })).catch((i) => console.error(i));
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(i) {
98
- f.changeLanguage(document?.documentElement?.lang || navigator.language), i.use(j, { i18next: f });
97
+ configureApp(n) {
98
+ f.changeLanguage(document?.documentElement?.lang || navigator.language), n.use(z, { i18next: f });
99
99
  }
100
100
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/epreuves-components",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "A collection of interactive components to be used in Pix challenges or modules",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",