@1024pix/epreuves-components 0.9.4 → 0.9.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,19 +1,19 @@
|
|
|
1
|
-
import { a as
|
|
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-CGraGJnO.js";
|
|
2
2
|
import "./llm-messages.ce.js.js";
|
|
3
|
-
const N = { class: "prompt-select" }, P = { class: "prompt-select__options" }, B = ["disabled", "onClick"], E = /* @__PURE__ */
|
|
3
|
+
const N = { class: "prompt-select" }, P = { class: "prompt-select__options" }, B = ["disabled", "onClick"], E = /* @__PURE__ */ v({
|
|
4
4
|
__name: "LLMPromptSelect.ce",
|
|
5
5
|
props: {
|
|
6
6
|
messages: { type: Array },
|
|
7
7
|
prompts: { type: Array },
|
|
8
8
|
speed: { type: Number }
|
|
9
9
|
},
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
10
|
+
setup(_, { expose: b }) {
|
|
11
|
+
const o = _, s = i(o.messages), m = i(o.prompts.map((e) => ({
|
|
12
12
|
...e,
|
|
13
13
|
disabled: !1
|
|
14
14
|
}))), r = i(!1);
|
|
15
15
|
function g() {
|
|
16
|
-
s.value =
|
|
16
|
+
s.value = o.messages, m.value = o.prompts.map((e) => ({
|
|
17
17
|
...e,
|
|
18
18
|
disabled: !1
|
|
19
19
|
})), r.value = !1;
|
|
@@ -21,8 +21,8 @@ const N = { class: "prompt-select" }, P = { class: "prompt-select__options" }, B
|
|
|
21
21
|
b({
|
|
22
22
|
reset: g
|
|
23
23
|
});
|
|
24
|
-
async function
|
|
25
|
-
const
|
|
24
|
+
async function x(e) {
|
|
25
|
+
const t = o.speed === 0 || window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
26
26
|
if (s.value = [
|
|
27
27
|
...s.value,
|
|
28
28
|
{
|
|
@@ -31,37 +31,37 @@ const N = { class: "prompt-select" }, P = { class: "prompt-select__options" }, B
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
direction: "inbound",
|
|
34
|
-
content:
|
|
34
|
+
content: t ? e.response : ""
|
|
35
35
|
}
|
|
36
|
-
], e.disabled = !0,
|
|
36
|
+
], e.disabled = !0, t) return;
|
|
37
37
|
const a = s.value.length - 1;
|
|
38
38
|
r.value = !0;
|
|
39
39
|
const n = e.response.split(/(\s+|<[^>]+>)/);
|
|
40
40
|
for (const p of n)
|
|
41
41
|
await new Promise((u) => {
|
|
42
|
-
setTimeout(u,
|
|
42
|
+
setTimeout(u, o.speed ?? 20);
|
|
43
43
|
}), s.value = [...s.value], s.value[a].content += p;
|
|
44
44
|
r.value = !1;
|
|
45
45
|
}
|
|
46
|
-
return (e,
|
|
47
|
-
const a =
|
|
48
|
-
return d(), c(
|
|
49
|
-
|
|
46
|
+
return (e, t) => {
|
|
47
|
+
const a = h("llm-messages");
|
|
48
|
+
return d(), c(f, null, [
|
|
49
|
+
y(a, { messages: s.value }, null, 8, ["messages"]),
|
|
50
50
|
l("div", N, [
|
|
51
|
-
|
|
51
|
+
t[0] || (t[0] = l("p", { class: "prompt-select__label" }, [
|
|
52
52
|
w(" Sélectionner un des prompts "),
|
|
53
53
|
l("span", { class: "sr-only" }, " une fois sélectionnés, les prompts ne sont plus disponibles. ")
|
|
54
54
|
], -1)),
|
|
55
55
|
l("div", P, [
|
|
56
|
-
(d(!0), c(
|
|
56
|
+
(d(!0), c(f, null, k(m.value, (n, p) => (d(), c("button", {
|
|
57
57
|
key: p,
|
|
58
58
|
disabled: n.disabled || r.value,
|
|
59
|
-
onClick: (u) =>
|
|
59
|
+
onClick: (u) => x(n)
|
|
60
60
|
}, S(n.prompt), 9, B))), 128))
|
|
61
61
|
])
|
|
62
62
|
])
|
|
63
63
|
], 64);
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
}), M = ".sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}llm-messages{display:block;height:400px}.prompt-select{border-top:solid 1px
|
|
66
|
+
}), M = ".sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);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(E, [["styles", [M]]]);
|
|
67
67
|
window.customElements.define("llm-prompt-select", L(V));
|