@1024pix/epreuves-components 0.4.1 → 0.4.2
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/{_plugin-vue_export-helper-ne_y2ta8.js → _plugin-vue_export-helper-4Cw9-CIo.js} +12 -13
- package/dist/components/message-conversation.js +34 -34
- package/dist/components/qcu-image.js +47 -47
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/dist/components/cartes-a-retourner.js +0 -43
package/dist/{_plugin-vue_export-helper-ne_y2ta8.js → _plugin-vue_export-helper-4Cw9-CIo.js}
RENAMED
|
@@ -3988,23 +3988,22 @@ const _l = (e, t) => {
|
|
|
3988
3988
|
export {
|
|
3989
3989
|
Ae as F,
|
|
3990
3990
|
_l as _,
|
|
3991
|
-
|
|
3992
|
-
|
|
3991
|
+
gl as a,
|
|
3992
|
+
pl as b,
|
|
3993
3993
|
al as c,
|
|
3994
3994
|
Tr as d,
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
3995
|
+
Ti as e,
|
|
3996
|
+
Ro as f,
|
|
3997
|
+
cl as g,
|
|
3998
|
+
mo as h,
|
|
3999
|
+
dl as i,
|
|
4000
|
+
Rr as j,
|
|
4001
|
+
hl as k,
|
|
4002
|
+
xo as l,
|
|
4003
|
+
vo as m,
|
|
4004
4004
|
Ts as n,
|
|
4005
4005
|
go as o,
|
|
4006
|
-
|
|
4007
|
-
vo as q,
|
|
4006
|
+
Se as p,
|
|
4008
4007
|
ll as r,
|
|
4009
4008
|
fl as s,
|
|
4010
4009
|
Wi as t,
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
const C = {}, B = { class: "loader" };
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { _ as f, c as i, o as t, d as x, r as N, f as v, j as S, n as h, k as u, e as p, l as b, t as _, p as $, F as y, g as k, h as A, i as M } from "../_plugin-vue_export-helper-4Cw9-CIo.js";
|
|
2
|
+
const C = ".loader{width:8px;aspect-ratio:1;border-radius:50%;animation:l5 1s infinite linear alternate;transform:translate(100%)}@keyframes l5{0%{box-shadow:13px 0 #000,-13px 0 #0002;background:#000}33%{box-shadow:13px 0 #000,-13px 0 #0002;background:#0002}66%{box-shadow:13px 0 #0002,-13px 0 #000;background:#0002}to{box-shadow:13px 0 #0002,-13px 0 #000;background:#000}}@media (prefers-reduced-motion: reduce){.loader{display:none}}", B = {}, V = { class: "loader" };
|
|
3
|
+
function E(n, s) {
|
|
4
|
+
return t(), i("div", V);
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const F = /* @__PURE__ */ f(B, [["render", E], ["styles", [C]]]), j = ["part"], z = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "message__loader message__content",
|
|
9
9
|
"aria-hidden": "true"
|
|
10
|
-
}, L = ["part"], T = { key: 0 },
|
|
11
|
-
__name: "Message",
|
|
10
|
+
}, L = ["part"], T = { key: 0 }, O = /* @__PURE__ */ x({
|
|
11
|
+
__name: "Message.ce",
|
|
12
12
|
props: {
|
|
13
13
|
displaySender: { type: Boolean, default: !0 },
|
|
14
|
-
message: {},
|
|
15
|
-
startAnimation: {},
|
|
16
|
-
animationDuration: {},
|
|
17
|
-
loadingDuration: {}
|
|
14
|
+
message: { type: Object },
|
|
15
|
+
startAnimation: { type: Number },
|
|
16
|
+
animationDuration: { type: Number },
|
|
17
|
+
loadingDuration: { type: Number }
|
|
18
18
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const s =
|
|
19
|
+
setup(n) {
|
|
20
|
+
const s = N("hidden"), m = v(() => n.message.content.split(`
|
|
21
21
|
`));
|
|
22
22
|
function r(e) {
|
|
23
23
|
return new Promise((a) => setTimeout(a, e));
|
|
24
24
|
}
|
|
25
|
-
return
|
|
26
|
-
await r(
|
|
27
|
-
}), (e, a) => (
|
|
25
|
+
return S(async () => {
|
|
26
|
+
await r(n.startAnimation), s.value = "loading", await r(n.loadingDuration), s.value = "visible", await r(n.animationDuration);
|
|
27
|
+
}), (e, a) => (t(), i("div", {
|
|
28
28
|
class: h(["message", [
|
|
29
29
|
`message--${e.message.direction}`,
|
|
30
30
|
{ "hidden-state": s.value === "hidden" }
|
|
31
31
|
]])
|
|
32
32
|
}, [
|
|
33
|
-
e.displaySender ? (
|
|
33
|
+
e.displaySender ? (t(), i("p", {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "message__sender",
|
|
36
36
|
part: `sender ${e.message.direction}`
|
|
37
37
|
}, [
|
|
38
38
|
a[0] || (a[0] = p("span", { class: "sr-only" }, "Message de ", -1)),
|
|
39
|
-
|
|
40
|
-
], 8,
|
|
41
|
-
s.value === "loading" ? (
|
|
42
|
-
|
|
39
|
+
b(_(e.message.userName), 1)
|
|
40
|
+
], 8, j)) : u("", !0),
|
|
41
|
+
s.value === "loading" ? (t(), i("div", z, [
|
|
42
|
+
$(F)
|
|
43
43
|
])) : u("", !0),
|
|
44
44
|
p("p", {
|
|
45
45
|
class: h(["message__content", { "hidden-state": s.value !== "visible" }]),
|
|
46
46
|
part: `message ${e.message.direction}`
|
|
47
47
|
}, [
|
|
48
|
-
(
|
|
49
|
-
o > 0 ? (
|
|
50
|
-
|
|
48
|
+
(t(!0), i(y, null, k(m.value, (d, o) => (t(), i(y, { key: o }, [
|
|
49
|
+
o > 0 ? (t(), i("br", T)) : u("", !0),
|
|
50
|
+
b(" " + _(d), 1)
|
|
51
51
|
], 64))), 128))
|
|
52
52
|
], 10, L)
|
|
53
53
|
], 2));
|
|
54
54
|
}
|
|
55
|
-
}), P = { part: "conversation" },
|
|
55
|
+
}), P = ".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}}", q = /* @__PURE__ */ f(O, [["styles", [P]]]), G = { part: "conversation" }, H = { class: "sr-only" }, I = /* @__PURE__ */ x({
|
|
56
56
|
__name: "MessageConversation.ce",
|
|
57
57
|
props: {
|
|
58
58
|
title: { default: "Conversation par messages", type: String },
|
|
59
59
|
messages: { type: Array },
|
|
60
60
|
animationSpeed: { default: 20, type: Number }
|
|
61
61
|
},
|
|
62
|
-
setup(
|
|
63
|
-
const s = 50 *
|
|
64
|
-
() =>
|
|
62
|
+
setup(n) {
|
|
63
|
+
const s = 50 * n.animationSpeed, m = v(
|
|
64
|
+
() => n.messages.reduce(
|
|
65
65
|
(e, a, d) => {
|
|
66
66
|
const o = r(a);
|
|
67
67
|
if (d === 0)
|
|
@@ -77,11 +77,11 @@ const E = /* @__PURE__ */ x(C, [["render", V]]), F = ["part"], z = {
|
|
|
77
77
|
)
|
|
78
78
|
);
|
|
79
79
|
function r(e) {
|
|
80
|
-
return e.content.length *
|
|
80
|
+
return e.content.length * n.animationSpeed;
|
|
81
81
|
}
|
|
82
|
-
return (e, a) => (
|
|
83
|
-
p("figcaption",
|
|
84
|
-
(
|
|
82
|
+
return (e, a) => (t(), i("figure", G, [
|
|
83
|
+
p("figcaption", H, _(e.title), 1),
|
|
84
|
+
(t(!0), i(y, null, k(m.value, ({ message: d, displaySender: o, startAnimation: l, animationDuration: c }, g) => (t(), A(q, {
|
|
85
85
|
message: d,
|
|
86
86
|
"start-animation": l,
|
|
87
87
|
"animation-duration": c,
|
|
@@ -91,5 +91,5 @@ const E = /* @__PURE__ */ x(C, [["render", V]]), F = ["part"], z = {
|
|
|
91
91
|
}, null, 8, ["message", "start-animation", "animation-duration", "display-sender"]))), 128))
|
|
92
92
|
]));
|
|
93
93
|
}
|
|
94
|
-
}),
|
|
95
|
-
window.customElements.define("message-conversation", M(
|
|
94
|
+
}), J = "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}", K = /* @__PURE__ */ f(I, [["styles", [J]]]);
|
|
95
|
+
window.customElements.define("message-conversation", M(K));
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
function
|
|
3
|
-
const a = [...
|
|
4
|
-
for (let
|
|
5
|
-
const e =
|
|
6
|
-
[a[
|
|
1
|
+
import { d as y, r as w, w as C, c as l, o as n, a as g, b as h, n as x, e as k, m as $, t as v, _ as b, f as p, s as N, F as P, g as B, h as S, i as z } from "../_plugin-vue_export-helper-4Cw9-CIo.js";
|
|
2
|
+
function L(c, t = j) {
|
|
3
|
+
const a = [...c];
|
|
4
|
+
for (let o = a.length - 1; o > 0; o--) {
|
|
5
|
+
const e = t() % (o + 1);
|
|
6
|
+
[a[o], a[e]] = [a[e], a[o]];
|
|
7
7
|
}
|
|
8
8
|
return a;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function j() {
|
|
11
11
|
return Math.floor(Math.random() * 2 ** 32);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
__name: "
|
|
13
|
+
const E = ["aria-checked", "tabindex"], I = { key: 0 }, q = /* @__PURE__ */ y({
|
|
14
|
+
__name: "ImageChoice.ce",
|
|
15
15
|
props: {
|
|
16
|
-
choice: {},
|
|
17
|
-
maxChoicesPerLine: {},
|
|
18
|
-
imageClass: {},
|
|
19
|
-
nameClass: {},
|
|
16
|
+
choice: { type: Object },
|
|
17
|
+
maxChoicesPerLine: { type: Number },
|
|
18
|
+
imageClass: { type: String },
|
|
19
|
+
nameClass: { type: String },
|
|
20
20
|
checked: { type: Boolean },
|
|
21
21
|
focusable: { type: Boolean }
|
|
22
22
|
},
|
|
23
23
|
emits: ["check", "checkNext", "checkPrevious"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
setup(c) {
|
|
25
|
+
const t = c, a = w();
|
|
26
|
+
C(() => {
|
|
27
27
|
var e;
|
|
28
|
-
|
|
28
|
+
t.checked && ((e = a.value) == null || e.focus());
|
|
29
29
|
});
|
|
30
|
-
const
|
|
31
|
-
return (e, i) => (
|
|
30
|
+
const o = `image-choice-${(t.choice.response ?? t.choice.name).replace(/[^\w\-_:.]/g, "")}`;
|
|
31
|
+
return (e, i) => (n(), l("li", {
|
|
32
32
|
ref_key: "el",
|
|
33
33
|
ref: a,
|
|
34
34
|
role: "radio",
|
|
35
|
-
class: x(["
|
|
36
|
-
"aria-labelledby":
|
|
35
|
+
class: x(["image-choice", `image-choice--max${t.maxChoicesPerLine}`]),
|
|
36
|
+
"aria-labelledby": o,
|
|
37
37
|
"aria-checked": e.checked,
|
|
38
38
|
tabindex: e.focusable ? 0 : -1,
|
|
39
39
|
onClick: i[0] || (i[0] = h((r) => e.$emit("check"), ["stop"])),
|
|
40
40
|
onKeydown: [
|
|
41
|
-
i[1] || (i[1] =
|
|
42
|
-
i[2] || (i[2] =
|
|
43
|
-
i[3] || (i[3] =
|
|
41
|
+
i[1] || (i[1] = g(h((r) => e.$emit("check"), ["stop", "prevent"]), ["enter", "space"])),
|
|
42
|
+
i[2] || (i[2] = g(h((r) => e.$emit("checkPrevious"), ["stop", "prevent"]), ["up", "left"])),
|
|
43
|
+
i[3] || (i[3] = g(h((r) => e.$emit("checkNext"), ["stop", "prevent"]), ["down", "right"]))
|
|
44
44
|
]
|
|
45
45
|
}, [
|
|
46
|
-
e.choice.image ? (
|
|
47
|
-
k("img",
|
|
46
|
+
e.choice.image ? (n(), l("figure", I, [
|
|
47
|
+
k("img", $(e.choice.image, {
|
|
48
48
|
class: e.imageClass,
|
|
49
49
|
alt: ""
|
|
50
50
|
}), null, 16),
|
|
51
51
|
k("figcaption", {
|
|
52
52
|
class: x(e.nameClass),
|
|
53
|
-
id:
|
|
53
|
+
id: o
|
|
54
54
|
}, v(e.choice.name), 3)
|
|
55
|
-
])) : (
|
|
55
|
+
])) : (n(), l("span", {
|
|
56
56
|
key: 1,
|
|
57
|
-
id:
|
|
57
|
+
id: o
|
|
58
58
|
}, v(e.choice.name), 1))
|
|
59
|
-
], 42,
|
|
59
|
+
], 42, E));
|
|
60
60
|
}
|
|
61
|
-
}), M = ["aria-label"],
|
|
61
|
+
}), M = 'ul,li{padding:0;margin:0}li{list-style:none}.image-choice{display:flex;position:relative;flex-direction:column;align-items:center;justify-content:center;margin:1em;border:solid 2px #c1c7d0;border-radius:10px;background:#fff;width:calc(20% - 2em);min-width:120px}.image-choice--max4{width:calc(25% - 2em);min-width:175px}.image-choice--max3{width:calc(33% - 2em)}.image-choice--max2{width:calc(50% - 2em);min-width:300px}.image-choice--max1{width:calc(100% - 4em);min-width:300px}.image-choice:hover{cursor:pointer;box-shadow:0 3px 10px #0000001a;transform:scale(1.04);transition:transform ease-in .1s}.image-choice:focus{outline:none;box-shadow:5px 5px #ffbe00,-5px 5px #ffbe00,5px -5px #ffbe00,-5px -5px #ffbe00}.image-choice[aria-checked=true]{border-color:#3d68ff}.image-choice[aria-checked=true]:after{content:"";position:absolute;width:100%;height:100%;background:#3d68ff4d;border-radius:10px;z-index:3}.image-choice figure{width:100%;padding:0 10px;margin:3px;text-align:center}.image-choice figure img{max-width:100%;height:auto}.image-choice figure img.icon{max-height:100px;width:auto}.image-choice figure img.medium{max-width:50%;height:auto}.image-choice figure figcaption{margin:1ex}', A = /* @__PURE__ */ b(q, [["styles", [M]]]), F = ["aria-label"], K = /* @__PURE__ */ y({
|
|
62
62
|
__name: "QCUImage.ce",
|
|
63
63
|
props: {
|
|
64
64
|
choices: { type: Array },
|
|
@@ -69,29 +69,29 @@ const L = ["aria-checked", "tabindex"], E = { key: 0 }, j = /* @__PURE__ */ w({
|
|
|
69
69
|
imageChoicesSize: { default: "icon", type: String }
|
|
70
70
|
},
|
|
71
71
|
emits: ["answer"],
|
|
72
|
-
setup(
|
|
73
|
-
const a =
|
|
74
|
-
function u(
|
|
75
|
-
|
|
72
|
+
setup(c, { emit: t }) {
|
|
73
|
+
const a = t, o = p(() => c.hideChoicesName ? "sr-only" : ""), e = p(() => c.orderChoices ? c.choices : L(c.choices)), i = N(), r = p(() => i.value ?? e.value[0]);
|
|
74
|
+
function u(s) {
|
|
75
|
+
s === -1 ? i.value = e.value[e.value.length - 1] : s === e.value.length ? i.value = e.value[0] : i.value = e.value[s], a("answer", i.value.response ?? i.value.name);
|
|
76
76
|
}
|
|
77
|
-
return (
|
|
77
|
+
return (s, R) => (n(), l("ul", {
|
|
78
78
|
role: "radiogroup",
|
|
79
79
|
class: "qcu-image",
|
|
80
|
-
"aria-label":
|
|
80
|
+
"aria-label": s.name
|
|
81
81
|
}, [
|
|
82
|
-
(
|
|
82
|
+
(n(!0), l(P, null, B(e.value, (d, m) => (n(), S(A, {
|
|
83
83
|
choice: d,
|
|
84
|
-
"max-choices-per-line":
|
|
84
|
+
"max-choices-per-line": s.maxChoicesPerLine,
|
|
85
85
|
key: m,
|
|
86
|
-
"name-class":
|
|
87
|
-
"image-class":
|
|
86
|
+
"name-class": o.value,
|
|
87
|
+
"image-class": c.imageChoicesSize,
|
|
88
88
|
checked: d === i.value,
|
|
89
89
|
focusable: d === r.value,
|
|
90
|
-
onCheck: (
|
|
91
|
-
onCheckNext: (
|
|
92
|
-
onCheckPrevious: (
|
|
90
|
+
onCheck: (f) => u(m),
|
|
91
|
+
onCheckNext: (f) => u(m + 1),
|
|
92
|
+
onCheckPrevious: (f) => u(m - 1)
|
|
93
93
|
}, null, 8, ["choice", "max-choices-per-line", "name-class", "image-class", "checked", "focusable", "onCheck", "onCheckNext", "onCheckPrevious"]))), 128))
|
|
94
|
-
], 8,
|
|
94
|
+
], 8, F));
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
97
|
-
window.customElements.define("qcu-image",
|
|
96
|
+
}), O = "*{box-sizing:border-box}.qcu-image{display:flex;width:100%;flex-wrap:wrap;justify-content:space-around;font-size:110%;font-family:Open Sans,Arial,sans-serif}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}", Q = /* @__PURE__ */ b(K, [["styles", [O]]]);
|
|
97
|
+
window.customElements.define("qcu-image", z(Q));
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { d as o, r as l, c as n, o as a, n as p, a as t, b as c, F as u, e as f, f as m, _ as g, g as _ } from "../_plugin-vue_export-helper-ne_y2ta8.js";
|
|
2
|
-
const y = { class: "card-inner" }, v = /* @__PURE__ */ o({
|
|
3
|
-
__name: "CarteARetourner",
|
|
4
|
-
props: {
|
|
5
|
-
card: {}
|
|
6
|
-
},
|
|
7
|
-
setup(d) {
|
|
8
|
-
const e = l(!1);
|
|
9
|
-
return (s, r) => (a(), n("div", {
|
|
10
|
-
class: p(["card", { flipped: e.value }]),
|
|
11
|
-
onClick: r[0] || (r[0] = (i) => e.value = !e.value)
|
|
12
|
-
}, [
|
|
13
|
-
t("div", y, [
|
|
14
|
-
t("div", {
|
|
15
|
-
class: "card-face card-front",
|
|
16
|
-
style: c({ backgroundImage: `url('${s.card.frontImageUrl}')` })
|
|
17
|
-
}, null, 4),
|
|
18
|
-
t("div", {
|
|
19
|
-
class: "card-face card-back",
|
|
20
|
-
style: c({ backgroundImage: `url('${s.card.backImageUrl}')` })
|
|
21
|
-
}, null, 4)
|
|
22
|
-
])
|
|
23
|
-
], 2));
|
|
24
|
-
}
|
|
25
|
-
}), b = /* @__PURE__ */ o({
|
|
26
|
-
__name: "CartesARetourner.ce",
|
|
27
|
-
props: {
|
|
28
|
-
cards: { type: Array },
|
|
29
|
-
cardsPerLine: { type: Number }
|
|
30
|
-
},
|
|
31
|
-
setup(d) {
|
|
32
|
-
return (e, s) => (a(), n("div", {
|
|
33
|
-
class: "container",
|
|
34
|
-
style: c({ "--cards-per-line": e.cardsPerLine })
|
|
35
|
-
}, [
|
|
36
|
-
(a(!0), n(u, null, f(e.cards, (r, i) => (a(), m(v, {
|
|
37
|
-
key: i,
|
|
38
|
-
card: r
|
|
39
|
-
}, null, 8, ["card"]))), 128))
|
|
40
|
-
], 4));
|
|
41
|
-
}
|
|
42
|
-
}), k = ".container{display:grid;grid-template-columns:repeat(var(--cards-per-line),1fr);gap:20px;justify-items:center}.card{width:150px;height:150px;perspective:1000px;cursor:pointer}.card-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .6s}.card.flipped .card-inner{transform:rotateY(180deg)}.card-face{width:100%;height:100%;position:absolute;backface-visibility:hidden;display:flex;justify-content:center;align-items:center;font-size:24px;border-radius:10px;background-size:cover}.card-back{transform:rotateY(180deg)}", h = /* @__PURE__ */ g(b, [["styles", [k]]]);
|
|
43
|
-
window.customElements.define("cartes-a-retourner", _(h));
|