@1024pix/epreuves-components 0.1.0 → 0.2.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.
@@ -3976,9 +3976,10 @@ export {
3976
3976
  ll as e,
3977
3977
  al as f,
3978
3978
  hl as g,
3979
- pl as h,
3980
- dl as i,
3981
- Po as j,
3979
+ bo as h,
3980
+ pl as i,
3981
+ dl as j,
3982
+ Po as k,
3982
3983
  yo as m,
3983
3984
  Ts as n,
3984
3985
  cl as o,
@@ -1,4 +1,4 @@
1
- import { d as i, 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-CG_vnhyz.js";
1
+ import { d as i, 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-DhEI-a9q.js";
2
2
  const v = { class: "card-inner" }, y = /* @__PURE__ */ i({
3
3
  __name: "CarteARetourner",
4
4
  props: {
@@ -0,0 +1,33 @@
1
+ import { d as r, c as o, o as s, n as m, a as n, h as p, t, F as d, e as l, f as _, _ as u, g as f } from "../_plugin-vue_export-helper-DhEI-a9q.js";
2
+ const h = { class: "message__sender" }, x = { class: "message__content" }, y = /* @__PURE__ */ r({
3
+ __name: "Message",
4
+ props: {
5
+ message: {}
6
+ },
7
+ setup(i) {
8
+ return (e, a) => (s(), o("article", {
9
+ class: m(["message", `message--${e.message.direction}`])
10
+ }, [
11
+ n("p", h, [
12
+ a[0] || (a[0] = n("span", { class: "sr-only" }, "Message de ", -1)),
13
+ p(t(e.message.userName), 1)
14
+ ]),
15
+ n("p", x, t(e.message.content), 1)
16
+ ], 2));
17
+ }
18
+ }), b = { part: "conversation" }, w = { class: "sr-only" }, k = /* @__PURE__ */ r({
19
+ __name: "MessageConversation.ce",
20
+ props: {
21
+ props: { type: Object }
22
+ },
23
+ setup(i) {
24
+ return (e, a) => (s(), o("figure", b, [
25
+ n("figcaption", w, t(e.props.title ?? "Conversation par messages"), 1),
26
+ (s(!0), o(d, null, l(e.props.messages, (g, c) => (s(), _(y, {
27
+ message: g,
28
+ key: c
29
+ }, null, 8, ["message"]))), 128))
30
+ ]));
31
+ }
32
+ }), v = "figure{background-color:#fff;border-radius:16px;display:flex;flex-direction:column;gap:8px;margin:0;padding:16px}.message{max-width:80%}.message--incoming{align-self:start}.message--incoming .message__sender{padding-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__content{background-color:#d1eaff}.message__sender{color:#444;font-size:.8rem;font-weight:700;margin:0}.message__content{border-radius:16px;margin:0;padding:10px 14px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", C = /* @__PURE__ */ u(k, [["styles", [v]]]);
33
+ window.customElements.define("message-conversation", f(C));
@@ -1,4 +1,4 @@
1
- import { d as b, r as _, w as y, c as h, o as r, h as g, i as p, n as v, a as k, m as q, t as w, j as m, s as $, F as P, e as B, f as N, _ as j, g as z } from "../_plugin-vue_export-helper-CG_vnhyz.js";
1
+ import { d as b, r as _, w as y, c as u, o as r, i as g, j as p, n as v, a as k, m as q, t as w, k as m, s as $, F as P, e as B, f as N, _ as j, g as z } from "../_plugin-vue_export-helper-DhEI-a9q.js";
2
2
  function L(o, n = E) {
3
3
  const i = [...o];
4
4
  for (let a = i.length - 1; a > 0; a--) {
@@ -28,7 +28,7 @@ const M = ["aria-checked", "tabindex"], Q = { key: 0 }, S = /* @__PURE__ */ b({
28
28
  n.checked && ((e = i.value) == null || e.focus());
29
29
  });
30
30
  const a = `qcu-image-choice-${(n.choice.response ?? n.choice.name).replace(/[^\w\-_:.]/g, "")}`;
31
- return (e, s) => (r(), h("li", {
31
+ return (e, s) => (r(), u("li", {
32
32
  ref_key: "el",
33
33
  ref: i,
34
34
  role: "radio",
@@ -43,7 +43,7 @@ const M = ["aria-checked", "tabindex"], Q = { key: 0 }, S = /* @__PURE__ */ b({
43
43
  s[3] || (s[3] = g(p((c) => e.$emit("checkNext"), ["stop", "prevent"]), ["down", "right"]))
44
44
  ]
45
45
  }, [
46
- e.choice.image ? (r(), h("figure", Q, [
46
+ e.choice.image ? (r(), u("figure", Q, [
47
47
  k("img", q(e.choice.image, {
48
48
  class: e.imageClass,
49
49
  alt: ""
@@ -52,7 +52,7 @@ const M = ["aria-checked", "tabindex"], Q = { key: 0 }, S = /* @__PURE__ */ b({
52
52
  class: v(e.nameClass),
53
53
  id: a
54
54
  }, w(e.choice.name), 3)
55
- ])) : (r(), h("span", {
55
+ ])) : (r(), u("span", {
56
56
  key: 1,
57
57
  id: a
58
58
  }, w(e.choice.name), 1))
@@ -69,22 +69,22 @@ const M = ["aria-checked", "tabindex"], Q = { key: 0 }, S = /* @__PURE__ */ b({
69
69
  function d(l) {
70
70
  l === -1 ? t.value = c.value[c.value.length - 1] : l === c.value.length ? t.value = c.value[0] : t.value = c.value[l], i("answer", t.value.response ?? t.value.name);
71
71
  }
72
- return (l, O) => (r(), h("ul", {
72
+ return (l, O) => (r(), u("ul", {
73
73
  role: "radiogroup",
74
74
  class: "qcu-image",
75
75
  "aria-label": l.props.name
76
76
  }, [
77
- (r(!0), h(P, null, B(c.value, (f, u) => (r(), N(S, {
77
+ (r(!0), u(P, null, B(c.value, (f, h) => (r(), N(S, {
78
78
  choice: f,
79
79
  "max-choices-per-line": a.value,
80
- key: u,
80
+ key: h,
81
81
  "name-class": e.value,
82
82
  "image-class": s.value,
83
83
  checked: f === t.value,
84
84
  focusable: f === C.value,
85
- onCheck: (x) => d(u),
86
- onCheckNext: (x) => d(u + 1),
87
- onCheckPrevious: (x) => d(u - 1)
85
+ onCheck: (x) => d(h),
86
+ onCheckNext: (x) => d(h + 1),
87
+ onCheckPrevious: (x) => d(h - 1)
88
88
  }, null, 8, ["choice", "max-choices-per-line", "name-class", "image-class", "checked", "focusable", "onCheck", "onCheckNext", "onCheckPrevious"]))), 128))
89
89
  ], 8, U));
90
90
  }
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ import "./components/message-conversation.js";
1
2
  import "./components/qcu-image.js";
2
3
  import "./components/cartes-a-retourner.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/epreuves-components",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "A collection of interactive components to be used in Pix challenges or modules",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",