@1024pix/epreuves-components 1.4.5 → 1.5.0
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/LLMMessage.ce-CcaSmq0J.js +96 -0
- package/dist/Loading.ce-kO02LfAR.js +14 -0
- package/dist/NavigationButton.ce-BUeEdL4x.js +98 -0
- package/dist/{_plugin-vue_export-helper-CwwQJ1m6.js → _plugin-vue_export-helper-BGEtPlxS.js} +1373 -1355
- package/dist/components/calcul-impact.ce.js.js +91 -85
- package/dist/components/capacity-calculation.ce.js.js +117 -111
- package/dist/components/clickable-image.ce.js.js +83 -59
- package/dist/components/complete-phrase.ce.js.js +57 -51
- package/dist/components/flip-cards.ce.js.js +43 -46
- package/dist/components/image-quiz.ce.js.js +6 -4
- package/dist/components/image-quizzes.ce.js.js +18 -14
- package/dist/components/llm-compare-messages.ce.js.js +17 -17
- package/dist/components/llm-messages.ce.js.js +17 -17
- package/dist/components/llm-prompt-select.ce.js.js +37 -32
- package/dist/components/message-conversation.ce.js.js +61 -52
- package/dist/components/pix-article.ce.js.js +26 -20
- package/dist/components/pix-carousel.ce.js.js +133 -121
- package/dist/components/pix-cursor.ce.js.js +62 -62
- package/dist/components/qcm-deepfake.ce.js.js +97 -91
- package/dist/{i18n-gncqQJ0G.js → i18n-D3E2CT0o.js} +44 -40
- package/dist/image-quiz.ce-Qe3SbGDF.js +141 -0
- package/dist/index.js +1 -1
- package/dist/normalize-props-AlmAfi_u.js +13 -0
- package/dist/schema.js +8 -8
- package/dist/{shadow-dom-MxYtPVXS.js → shadow-dom-Bqt3ZRMI.js} +1 -1
- package/package.json +1 -1
- package/dist/ImageQuiz.ce-BLOWdEiw.js +0 -123
- package/dist/LLMMessage.ce-DnZ8kE2i.js +0 -89
- package/dist/Loading.ce-FI776zdC.js +0 -14
- package/dist/NavigationButton.ce-gp04deGY.js +0 -98
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as y, r as c, z as h, c as d, o as m, y as w, f as a, A as k, F as _, a as L, t as S, _ as C, e as P } from "../_plugin-vue_export-helper-BGEtPlxS.js";
|
|
2
|
+
import { u as N } from "../normalize-props-AlmAfi_u.js";
|
|
2
3
|
import "./llm-messages.ce.js.js";
|
|
3
|
-
const
|
|
4
|
+
const M = { class: "prompt-select" }, z = { class: "prompt-select__options" }, A = ["disabled", "onClick"], B = /* @__PURE__ */ y({
|
|
4
5
|
__name: "LLMPromptSelect.ce",
|
|
5
6
|
props: {
|
|
6
7
|
messages: { type: Array },
|
|
7
8
|
prompts: { type: Array },
|
|
8
9
|
speed: { type: Number }
|
|
9
10
|
},
|
|
10
|
-
setup(
|
|
11
|
-
const o =
|
|
11
|
+
setup(r, { expose: g }) {
|
|
12
|
+
const o = r, s = c(o.messages), u = c(o.prompts.map((e) => ({
|
|
12
13
|
...e,
|
|
13
14
|
disabled: !1
|
|
14
|
-
}))),
|
|
15
|
-
function
|
|
16
|
-
s.value = o.messages,
|
|
15
|
+
}))), l = c(!1);
|
|
16
|
+
function x() {
|
|
17
|
+
s.value = o.messages, u.value = o.prompts.map((e) => ({
|
|
17
18
|
...e,
|
|
18
19
|
disabled: !1
|
|
19
|
-
})),
|
|
20
|
+
})), l.value = !1;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
reset:
|
|
22
|
+
g({
|
|
23
|
+
reset: x
|
|
23
24
|
});
|
|
24
|
-
async function
|
|
25
|
+
async function v(e) {
|
|
25
26
|
const t = o.speed === 0 || window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
26
27
|
if (s.value = [
|
|
27
28
|
...s.value,
|
|
@@ -34,34 +35,38 @@ const N = { class: "prompt-select" }, P = { class: "prompt-select__options" }, A
|
|
|
34
35
|
content: t ? e.response : ""
|
|
35
36
|
}
|
|
36
37
|
], e.disabled = !0, t) return;
|
|
37
|
-
const
|
|
38
|
-
|
|
38
|
+
const p = s.value.length - 1;
|
|
39
|
+
l.value = !0;
|
|
39
40
|
const n = e.response.split(/(\s+|<[^>]+>)/);
|
|
40
|
-
for (const
|
|
41
|
-
await new Promise((
|
|
42
|
-
setTimeout(
|
|
43
|
-
}), s.value = [...s.value], s.value[
|
|
44
|
-
|
|
41
|
+
for (const i of n)
|
|
42
|
+
await new Promise((f) => {
|
|
43
|
+
setTimeout(f, o.speed ?? 20);
|
|
44
|
+
}), s.value = [...s.value], s.value[p].content += i;
|
|
45
|
+
l.value = !1;
|
|
45
46
|
}
|
|
46
47
|
return (e, t) => {
|
|
47
|
-
const
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
t[0] || (t[0] =
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
const p = h("llm-messages");
|
|
49
|
+
return m(), d(_, null, [
|
|
50
|
+
w(p, { messages: s.value }, null, 8, ["messages"]),
|
|
51
|
+
a("div", M, [
|
|
52
|
+
t[0] || (t[0] = a("p", { class: "prompt-select__label" }, [
|
|
53
|
+
k(" Sélectionner un des prompts "),
|
|
54
|
+
a("span", { class: "sr-only" }, " une fois sélectionnés, les prompts ne sont plus disponibles. ")
|
|
54
55
|
], -1)),
|
|
55
|
-
|
|
56
|
-
(
|
|
57
|
-
key:
|
|
58
|
-
disabled: n.disabled ||
|
|
59
|
-
onClick: (
|
|
56
|
+
a("div", z, [
|
|
57
|
+
(m(!0), d(_, null, L(u.value, (n, i) => (m(), d("button", {
|
|
58
|
+
key: i,
|
|
59
|
+
disabled: n.disabled || l.value,
|
|
60
|
+
onClick: (f) => v(n)
|
|
60
61
|
}, S(n.prompt), 9, A))), 128))
|
|
61
62
|
])
|
|
62
63
|
])
|
|
63
64
|
], 64);
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
}), E = ".sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:
|
|
67
|
-
|
|
67
|
+
}), E = ".sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);border:0}llm-messages{display:block;height:400px}.prompt-select{font-family:Roboto,sans-serif;border-top:solid 1px #253858;padding:16px 24px 24px}.prompt-select__label{margin-top:0;font-weight:700;color:#253858}.prompt-select__options{display:flex;gap:1rem;justify-content:left;flex-wrap:wrap}.prompt-select__options>button{padding:1rem 1.5rem;border:none;background:#cec3f4;border-radius:16px;border:1px solid #ffffff;color:#130261;font-size:.875rem;box-shadow:0 4px 12px -4px #957ee833}.prompt-select__options>button:hover:not(:disabled){background:#9a8dc7;color:#fff;cursor:pointer}.prompt-select__options>button:disabled{cursor:not-allowed;color:#1010104d}", V = /* @__PURE__ */ C(B, [["styles", [E]]]), b = P(V);
|
|
68
|
+
b.prototype.normalizeProps = (r) => ({
|
|
69
|
+
...r,
|
|
70
|
+
speed: N(r.speed)
|
|
71
|
+
});
|
|
72
|
+
window.customElements.define("llm-prompt-select", b);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { L } from "../Loading.ce-
|
|
3
|
-
|
|
1
|
+
import { d as S, r as x, k as D, h as E, c as n, o as s, D as k, E as g, f as _, A as w, t as v, y as B, I as z, m as P, F as b, a as M, _ as N, g as T, b as V, e as F } from "../_plugin-vue_export-helper-BGEtPlxS.js";
|
|
2
|
+
import { L as I } from "../Loading.ce-kO02LfAR.js";
|
|
3
|
+
import { u as L, a as j } from "../normalize-props-AlmAfi_u.js";
|
|
4
|
+
const O = ["part"], R = {
|
|
4
5
|
key: 1,
|
|
5
6
|
class: "message__loader message__content",
|
|
6
7
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
8
|
+
}, q = ["part"], G = { key: 1 }, H = { key: 0 }, J = /* @__PURE__ */ S({
|
|
8
9
|
__name: "Message.ce",
|
|
9
10
|
props: {
|
|
10
11
|
displaySender: { type: Boolean, default: !0 },
|
|
@@ -13,90 +14,90 @@ const P = ["part"], I = {
|
|
|
13
14
|
animationDuration: { type: Number },
|
|
14
15
|
loadingDuration: { type: Number }
|
|
15
16
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const i =
|
|
17
|
+
setup(e, { expose: d }) {
|
|
18
|
+
const i = x("hidden"), l = x([]), p = D(() => e.message.content.split(`
|
|
18
19
|
`));
|
|
19
|
-
function
|
|
20
|
+
function m(t) {
|
|
20
21
|
return new Promise((a) => {
|
|
21
|
-
const o = setTimeout(a,
|
|
22
|
-
|
|
22
|
+
const o = setTimeout(a, t);
|
|
23
|
+
l.value.push(o);
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
async function
|
|
26
|
-
await
|
|
26
|
+
async function c() {
|
|
27
|
+
await m(e.startAnimation), i.value = "loading", await m(e.loadingDuration), i.value = "visible", await m(e.animationDuration);
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
E(c);
|
|
29
30
|
async function f() {
|
|
30
|
-
i.value = "hidden",
|
|
31
|
+
i.value = "hidden", l.value.forEach(clearTimeout), await c();
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return d({
|
|
33
34
|
reset: f
|
|
34
|
-
}), (
|
|
35
|
-
class:
|
|
35
|
+
}), (t, a) => (s(), n("div", {
|
|
36
|
+
class: k(["message", [
|
|
36
37
|
`message--${e.message.direction}`,
|
|
37
38
|
{ "hidden-state": i.value === "hidden" }
|
|
38
39
|
]])
|
|
39
40
|
}, [
|
|
40
|
-
e.displaySender ? (s(),
|
|
41
|
+
e.displaySender ? (s(), n("p", {
|
|
41
42
|
key: 0,
|
|
42
43
|
class: "message__sender",
|
|
43
44
|
part: `sender ${e.message.direction}`
|
|
44
45
|
}, [
|
|
45
|
-
a[0] || (a[0] =
|
|
46
|
-
|
|
47
|
-
], 8,
|
|
48
|
-
i.value === "loading" ? (s(),
|
|
49
|
-
|
|
50
|
-
])) :
|
|
51
|
-
|
|
52
|
-
class:
|
|
46
|
+
a[0] || (a[0] = _("span", { class: "sr-only" }, "Message de ", -1)),
|
|
47
|
+
w(v(e.message.userName), 1)
|
|
48
|
+
], 8, O)) : g("", !0),
|
|
49
|
+
i.value === "loading" ? (s(), n("div", R, [
|
|
50
|
+
B(I)
|
|
51
|
+
])) : g("", !0),
|
|
52
|
+
_("p", {
|
|
53
|
+
class: k(["message__content", { "hidden-state": i.value !== "visible" }]),
|
|
53
54
|
part: `message ${e.message.direction}`
|
|
54
55
|
}, [
|
|
55
|
-
e.message.image ? (s(),
|
|
56
|
-
e.message.image ? (s(),
|
|
57
|
-
(s(!0),
|
|
58
|
-
r > 0 ? (s(),
|
|
59
|
-
|
|
56
|
+
e.message.image ? (s(), n("img", z(P({ key: 0 }, e.message.image)), null, 16)) : g("", !0),
|
|
57
|
+
e.message.image ? (s(), n("br", G)) : g("", !0),
|
|
58
|
+
(s(!0), n(b, null, M(p.value, (o, r) => (s(), n(b, { key: r }, [
|
|
59
|
+
r > 0 ? (s(), n("br", H)) : g("", !0),
|
|
60
|
+
w(" " + v(o), 1)
|
|
60
61
|
], 64))), 128))
|
|
61
|
-
], 10,
|
|
62
|
+
], 10, q)
|
|
62
63
|
], 2));
|
|
63
64
|
}
|
|
64
|
-
}),
|
|
65
|
+
}), K = ".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}.message__content>img{max-width:100%}.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}}", Q = /* @__PURE__ */ N(J, [["styles", [K]]]), U = { part: "conversation" }, W = { class: "sr-only" }, X = /* @__PURE__ */ S({
|
|
65
66
|
__name: "MessageConversation.ce",
|
|
66
67
|
props: {
|
|
67
68
|
title: { default: "Conversation par messages", type: String },
|
|
68
69
|
messages: { type: Array },
|
|
69
70
|
animationSpeed: { default: 20, type: Number }
|
|
70
71
|
},
|
|
71
|
-
setup(
|
|
72
|
-
const i = 50 *
|
|
73
|
-
() =>
|
|
74
|
-
(
|
|
75
|
-
const r =
|
|
72
|
+
setup(e, { expose: d }) {
|
|
73
|
+
const i = 50 * e.animationSpeed, l = 50 * e.animationSpeed, p = D(
|
|
74
|
+
() => e.messages.reduce(
|
|
75
|
+
(t, a, o) => {
|
|
76
|
+
const r = c(a);
|
|
76
77
|
if (o === 0)
|
|
77
78
|
return [{ message: a, displaySender: !0, startAnimation: 0, animationDuration: r }];
|
|
78
79
|
const {
|
|
79
80
|
message: u,
|
|
80
81
|
startAnimation: y,
|
|
81
|
-
animationDuration:
|
|
82
|
-
} =
|
|
83
|
-
return [...
|
|
82
|
+
animationDuration: h
|
|
83
|
+
} = t.at(-1), C = a.direction !== u.direction || a.userName !== u.userName, $ = y + h + i;
|
|
84
|
+
return [...t, { message: a, displaySender: C, startAnimation: $, animationDuration: r }];
|
|
84
85
|
},
|
|
85
86
|
[]
|
|
86
87
|
)
|
|
87
|
-
),
|
|
88
|
-
function
|
|
89
|
-
let a =
|
|
90
|
-
return
|
|
88
|
+
), m = T("messages");
|
|
89
|
+
function c(t) {
|
|
90
|
+
let a = t.content.length * e.animationSpeed;
|
|
91
|
+
return t.image && (a += l), a;
|
|
91
92
|
}
|
|
92
93
|
function f() {
|
|
93
|
-
|
|
94
|
+
m.value.forEach((t) => t.reset());
|
|
94
95
|
}
|
|
95
|
-
return
|
|
96
|
+
return d({
|
|
96
97
|
reset: f
|
|
97
|
-
}), (
|
|
98
|
-
|
|
99
|
-
(s(!0),
|
|
98
|
+
}), (t, a) => (s(), n("figure", U, [
|
|
99
|
+
_("figcaption", W, v(e.title), 1),
|
|
100
|
+
(s(!0), n(b, null, M(p.value, ({ message: o, displaySender: r, startAnimation: u, animationDuration: y }, h) => (s(), V(Q, {
|
|
100
101
|
ref_for: !0,
|
|
101
102
|
ref: "messages",
|
|
102
103
|
message: o,
|
|
@@ -104,9 +105,17 @@ const P = ["part"], I = {
|
|
|
104
105
|
"animation-duration": y,
|
|
105
106
|
"loading-duration": i,
|
|
106
107
|
"display-sender": r,
|
|
107
|
-
key:
|
|
108
|
+
key: h
|
|
108
109
|
}, null, 8, ["message", "start-animation", "animation-duration", "display-sender"]))), 128))
|
|
109
110
|
]));
|
|
110
111
|
}
|
|
111
|
-
}),
|
|
112
|
-
|
|
112
|
+
}), Y = "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-path:inset(50%);white-space:nowrap;border:0}", Z = /* @__PURE__ */ N(X, [["styles", [Y]]]), A = F(Z);
|
|
113
|
+
A.prototype.normalizeProps = (e) => ({
|
|
114
|
+
...e,
|
|
115
|
+
animationSpeed: L(e.animationSpeed),
|
|
116
|
+
messages: e.messages.map((d) => ({
|
|
117
|
+
...d,
|
|
118
|
+
image: j(d.image)
|
|
119
|
+
}))
|
|
120
|
+
});
|
|
121
|
+
window.customElements.define("message-conversation", A);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
1
|
+
import { d as u, c as a, o as n, f as t, t as i, F as l, a as d, G as h, _ as m, e as f } from "../_plugin-vue_export-helper-BGEtPlxS.js";
|
|
2
|
+
import { a as p, i as o, b as v } from "../i18n-D3E2CT0o.js";
|
|
3
|
+
import { u as y } from "../normalize-props-AlmAfi_u.js";
|
|
4
|
+
const b = {}, x = {}, S = {}, L = {
|
|
4
5
|
"pix-article": { byAuthor: "Par {{author}}" }
|
|
5
|
-
},
|
|
6
|
+
}, j = {}, A = {}, P = ["titleLevel"], E = { class: "article__metadata" }, H = { class: "article__author" }, N = ["innerHTML"], k = /* @__PURE__ */ u({
|
|
6
7
|
__name: "PixArticle.ce",
|
|
7
8
|
props: {
|
|
8
9
|
titleLevel: { default: 2, type: Number },
|
|
@@ -17,26 +18,31 @@ const v = {}, y = {}, b = {
|
|
|
17
18
|
const s = e.paragraphs.join(`
|
|
18
19
|
`).replace("{{highlightedSentence}}", `<strong style="color: ${e.colorOfHighlightSentence};">${e.highlightedSentence}</strong>`).split(`
|
|
19
20
|
`);
|
|
20
|
-
return (
|
|
21
|
-
|
|
21
|
+
return (c, C) => (n(), a(l, null, [
|
|
22
|
+
t("div", {
|
|
22
23
|
class: "article__title",
|
|
23
24
|
role: "heading",
|
|
24
|
-
titleLevel:
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
titleLevel: e.titleLevel
|
|
26
|
+
}, i(e.title), 9, P),
|
|
27
|
+
t("p", E, [
|
|
28
|
+
t("span", H, i(c.$t("pix-article.byAuthor", { author: e.author })), 1),
|
|
29
|
+
t("time", null, i(e.date), 1)
|
|
29
30
|
]),
|
|
30
|
-
(
|
|
31
|
-
innerHTML:
|
|
32
|
-
key:
|
|
33
|
-
}, null, 8,
|
|
31
|
+
(n(!0), a(l, null, d(h(s), (_, g) => (n(), a("p", {
|
|
32
|
+
innerHTML: _,
|
|
33
|
+
key: g
|
|
34
|
+
}, null, 8, N))), 128))
|
|
34
35
|
], 64));
|
|
35
36
|
}
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
}), w = "[data-v-30ea36f1]{--pix-neutral-800: #253858;font-family:Nunito,Roboto,sans-serif;color:var(--pix-neutral-800)}.article__title[data-v-30ea36f1]{font-size:1.3rem;font-weight:700}.article__metadata[data-v-30ea36f1]{font-style:italic}.article__author[data-v-30ea36f1]{border-right:solid 1px var(--pix-neutral-800);padding-right:.7rem;margin-right:.5rem}", B = /* @__PURE__ */ m(k, [["styles", [w]], ["__scopeId", "data-v-30ea36f1"]]);
|
|
38
|
+
p(/* @__PURE__ */ Object.assign({ "./locales/en.json": b, "./locales/es-419.json": x, "./locales/es.json": S, "./locales/fr.json": L, "./locales/it.json": j, "./locales/nl.json": A })).catch((e) => console.error(e));
|
|
39
|
+
const r = f(B, {
|
|
39
40
|
configureApp(e) {
|
|
40
|
-
|
|
41
|
+
o.changeLanguage(document?.documentElement?.lang ?? navigator.language), e.use(v, { i18next: o });
|
|
41
42
|
}
|
|
42
|
-
})
|
|
43
|
+
});
|
|
44
|
+
r.prototype.normalizeProps = (e) => ({
|
|
45
|
+
...e,
|
|
46
|
+
titleLevel: y(e.titleLevel)
|
|
47
|
+
});
|
|
48
|
+
window.customElements.define("pix-article", r);
|