@logora/debate 0.4.93 → 0.4.95

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.
@@ -0,0 +1 @@
1
+ ._headerBox_p2vn2_3{display:flex!important;flex-direction:column!important;padding:0!important}._headerBoxLabel_p2vn2_9{display:flex!important;justify-content:flex-start!important;align-items:center!important;flex-wrap:wrap!important;gap:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}._headerBoxLabel_p2vn2_9>._titleRedirectUrl_p2vn2_16{background:var(--background-color-primary, white)!important}._headerBoxLabel_p2vn2_9>._titleRedirectUrl_p2vn2_16:hover{background:var(--background-color-primary, white)!important}._headerBoxLabel_p2vn2_9 a{text-decoration:none!important}._headerLiveStat_p2vn2_27{margin-left:auto!important;margin-right:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;color:var(--call-primary-color, #434343);font-size:var(--font-size-small, 16px);margin-left:30px}._headerLiveStat_p2vn2_27 span{margin-left:10px;margin-bottom:0!important}@media(prefers-color-scheme:dark){.logoraDarkMode ._headerLiveStat_p2vn2_27{color:#fff!important}.logoraDarkMode ._headerLiveNow_p2vn2_46{background-color:#fff!important}.logoraDarkMode ._headerLiveNow_p2vn2_46:before{background-color:#fff!important}}._headerLiveNow_p2vn2_46{min-width:8px;width:8px;height:8px;border-radius:50%;background-color:var(--call-primary-color, #434343);position:relative}._headerLiveNow_p2vn2_46:before{content:"";position:absolute;width:100%;height:100%;border-radius:50%;background-color:var(--call-primary-color, #434343);opacity:.4;animation-name:_livePin_p2vn2_1;animation-duration:1.6s;animation-iteration-count:infinite}@container (min-width: 576px){._headerLivePin_p2vn2_75{display:block!important}}._headerLivePin_p2vn2_75{display:none!important}@container (min-width: 576px){._headerLivePinMobile_p2vn2_84{display:none!important}}._headerLivePinMobile_p2vn2_84{display:block!important}@keyframes _livePin_p2vn2_1{0%{transform:scale(2.3)}50%{transform:scale(0)}to{transform:scale(2.3)}}._headerLabelText_p2vn2_103{background-color:var(--call-primary-color, #434343);color:var(--text-light, white);border-bottom:1px solid;border-color:var(--call-primary-color, #434343);border-radius:var(--box-border-radius, 6px) 0 var(--box-border-radius, 6px) 0;font-size:var(--font-size-normal, 16px);flex-wrap:nowrap;white-space:nowrap;padding-right:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._debateName_p2vn2_118{color:var(--text-primary, #222222);font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal);text-align:center;width:100%;display:flex!important;align-items:center!important;justify-content:center!important;padding-bottom:0!important;padding-top:var(--space-unit, 1em)!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important}@container (min-width: 576px){._debateName_p2vn2_118{padding-right:0!important}}@container (min-width: 576px){._debateName_p2vn2_118{padding-left:0!important}}._debateName_p2vn2_118 a._debateLink_p2vn2_142{color:var(--text-primary, #222222)!important}._debateLink_p2vn2_142{font-size:var(--font-size-large, 20px);line-height:var(--line-height-normal, 1.26em);background:var(--background-color-primary, white)!important;text-decoration:none!important;color:var(--text-primary, #222222);font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal)}._debateLink_p2vn2_142:hover{background:var(--background-color-primary, white)!important;text-decoration:underline!important}._left_p2vn2_160{justify-content:flex-start!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;padding-top:var(--space-unit, 1em)!important;padding-bottom:0!important;text-align:left}._headerLogo_p2vn2_169{width:100px!important;height:40px!important;object-fit:contain;object-position:left}._debateNameWithLogo_p2vn2_176{padding-right:0!important;padding-left:0!important}
@@ -1,42 +1,44 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import r from "classnames";
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import o from "classnames";
3
3
  import "react";
4
- import { FormattedMessage as n } from "react-intl";
4
+ import { FormattedMessage as r } from "react-intl";
5
5
  import e from "./EmbedHeader.module.scss.js";
6
- import { Link as o } from "../../action/link/Link.js";
7
- const x = ({
8
- title: m,
9
- titleRedirectUrl: s,
10
- headerLabel: l,
11
- onlineUsersCount: t,
12
- textLeft: c,
13
- className: h,
14
- logoUrl: d,
6
+ import { Link as m } from "../../action/link/Link.js";
7
+ const g = ({
8
+ title: c,
9
+ titleRedirectUrl: n,
10
+ headerLabel: t,
11
+ headerExtra: d,
12
+ onlineUsersCount: i,
13
+ textLeft: h,
14
+ className: u,
15
+ logoUrl: s,
15
16
  logoAlt: b
16
- }) => /* @__PURE__ */ i("div", { className: r(e.headerBox, h), children: [
17
- l && /* @__PURE__ */ i("div", { className: e.headerBoxLabel, children: [
18
- /* @__PURE__ */ a(
19
- o,
17
+ }) => /* @__PURE__ */ l("div", { className: o(e.headerBox, u), children: [
18
+ (t || d) && /* @__PURE__ */ l("div", { className: e.headerBoxLabel, children: [
19
+ t && /* @__PURE__ */ a(
20
+ m,
20
21
  {
21
- to: s,
22
+ to: n,
22
23
  target: "_top",
23
24
  external: !0,
24
25
  "data-tid": "link_debate_index_embed",
25
26
  rel: "nofollow",
26
- children: d ? /* @__PURE__ */ a(
27
+ children: s ? /* @__PURE__ */ a(
27
28
  "img",
28
29
  {
29
30
  loading: "lazy",
30
31
  className: e.headerLogo,
31
- src: d,
32
+ src: s,
32
33
  width: 100,
33
34
  height: 40,
34
35
  alt: b
35
36
  }
36
- ) : /* @__PURE__ */ a("div", { className: e.headerLabelText, children: l })
37
+ ) : /* @__PURE__ */ a("div", { className: e.headerLabelText, children: t })
37
38
  }
38
39
  ),
39
- t ? /* @__PURE__ */ i("div", { className: e.headerLiveStat, children: [
40
+ d && /* @__PURE__ */ a("div", { className: e.headerLabelText, children: d }),
41
+ t && i ? /* @__PURE__ */ l("div", { className: e.headerLiveStat, children: [
40
42
  /* @__PURE__ */ a("div", { className: e.headerLiveNow }),
41
43
  /* @__PURE__ */ a(
42
44
  "span",
@@ -44,10 +46,10 @@ const x = ({
44
46
  className: e.headerLivePin,
45
47
  "data-testid": "online-users-count",
46
48
  children: /* @__PURE__ */ a(
47
- n,
49
+ r,
48
50
  {
49
51
  id: "embed.embed_header.online_users",
50
- values: { count: t },
52
+ values: { count: i },
51
53
  defaultMessage: "{count} online users"
52
54
  }
53
55
  )
@@ -59,10 +61,10 @@ const x = ({
59
61
  className: e.headerLivePinMobile,
60
62
  "data-testid": "online-users-count-mobile",
61
63
  children: /* @__PURE__ */ a(
62
- n,
64
+ r,
63
65
  {
64
66
  id: "embed.embed_header.online",
65
- values: { count: t },
67
+ values: { count: i },
66
68
  defaultMessage: "{count} online"
67
69
  }
68
70
  )
@@ -73,26 +75,26 @@ const x = ({
73
75
  /* @__PURE__ */ a(
74
76
  "div",
75
77
  {
76
- className: r(e.debateName, {
77
- [e.left]: c,
78
- [e.debateNameWithLogo]: d
78
+ className: o(e.debateName, {
79
+ [e.left]: h,
80
+ [e.debateNameWithLogo]: s
79
81
  }),
80
82
  "data-testid": "debate-name",
81
83
  children: /* @__PURE__ */ a(
82
- o,
84
+ m,
83
85
  {
84
86
  className: e.debateLink,
85
- to: s,
87
+ to: n,
86
88
  target: "_top",
87
89
  external: !0,
88
90
  "data-tid": "link_debate_title_embed",
89
91
  rel: "nofollow",
90
- children: m
92
+ children: c
91
93
  }
92
94
  )
93
95
  }
94
96
  )
95
97
  ] });
96
98
  export {
97
- x as EmbedHeader
99
+ g as EmbedHeader
98
100
  };
@@ -1,29 +1,29 @@
1
- import '../../../assets/components/embed/embed_header/EmbedHeader.module-C8RPiVBp.css';const e = "_headerBox_czmub_3", a = "_headerBoxLabel_czmub_9", t = "_headerLiveStat_czmub_24", o = "_headerLiveNow_czmub_43", _ = "_headerLivePin_czmub_72", d = "_headerLivePinMobile_czmub_81", b = "_headerLabelText_czmub_100", h = "_debateName_czmub_115", i = "_debateLink_czmub_139", L = "_left_czmub_157", c = "_headerLogo_czmub_166", r = "_debateNameWithLogo_czmub_173", n = {
1
+ import '../../../assets/components/embed/embed_header/EmbedHeader.module-BiboXUr0.css';const e = "_headerBox_p2vn2_3", a = "_headerBoxLabel_p2vn2_9", t = "_headerLiveStat_p2vn2_27", o = "_headerLiveNow_p2vn2_46", _ = "_headerLivePin_p2vn2_75", d = "_headerLivePinMobile_p2vn2_84", n = "_headerLabelText_p2vn2_103", h = "_debateName_p2vn2_118", i = "_debateLink_p2vn2_142", L = "_left_p2vn2_160", r = "_headerLogo_p2vn2_169", v = "_debateNameWithLogo_p2vn2_176", b = {
2
2
  headerBox: e,
3
3
  headerBoxLabel: a,
4
4
  headerLiveStat: t,
5
5
  headerLiveNow: o,
6
6
  headerLivePin: _,
7
7
  headerLivePinMobile: d,
8
- headerLabelText: b,
8
+ headerLabelText: n,
9
9
  debateName: h,
10
10
  debateLink: i,
11
11
  left: L,
12
- headerLogo: c,
13
- debateNameWithLogo: r
12
+ headerLogo: r,
13
+ debateNameWithLogo: v
14
14
  };
15
15
  export {
16
16
  i as debateLink,
17
17
  h as debateName,
18
- r as debateNameWithLogo,
19
- n as default,
18
+ v as debateNameWithLogo,
19
+ b as default,
20
20
  e as headerBox,
21
21
  a as headerBoxLabel,
22
- b as headerLabelText,
22
+ n as headerLabelText,
23
23
  o as headerLiveNow,
24
24
  _ as headerLivePin,
25
25
  d as headerLivePinMobile,
26
26
  t as headerLiveStat,
27
- c as headerLogo,
27
+ r as headerLogo,
28
28
  L as left
29
29
  };
@@ -1,207 +1,210 @@
1
- import { jsx as s, Fragment as pe, jsxs as c } from "react/jsx-runtime";
2
- import d from "classnames";
3
- import { useState as N, useEffect as T } from "react";
4
- import { useIntl as _e, FormattedMessage as f } from "react-intl";
5
- import { useLocation as Ne } from "react-router";
1
+ import { jsx as s, Fragment as be, jsxs as d } from "react/jsx-runtime";
2
+ import u from "classnames";
3
+ import { useState as S, useEffect as y } from "react";
4
+ import { useIntl as Se, FormattedMessage as m } from "react-intl";
5
+ import { useLocation as we } from "react-router";
6
6
  import o from "./VoteBox.module.scss.js";
7
- import { useTranslatedContent as j } from "../../translation/translated_content/useTranslatedContent.js";
8
- import { useSessionStorageState as P } from "../../hooks/use_session_storage_state/useSessionStorageState.js";
9
- import { useToast as be } from "../../dialog/toast_provider/useToast.js";
10
- import { useAuthRequired as Se } from "../../hooks/use_auth_required/useAuthRequired.js";
11
- import { useDataProvider as we } from "../../data/data_provider/useDataProvider.js";
12
- import { useConfig as Be } from "../../data/config_provider/useConfig.js";
13
- import { useAuth as Ce } from "../../auth/use_auth/useAuth.js";
14
- import { Icon as F } from "../../icons/icon/Icon.js";
15
- import { ProgressBar as xe } from "../../progress/progress_bar/ProgressBar.js";
16
- import { Link as Ve } from "../../action/link/Link.js";
17
- import { Button as ye } from "../../action/button/Button.js";
18
- const We = ({
19
- numberVotes: b,
20
- votePositions: r,
21
- voteableType: v,
22
- voteableId: h,
23
- redirectUrl: S,
24
- displayColumn: O,
25
- textAlignLeft: ee,
26
- showTotal: te = !0,
27
- voteBoxClassName: E,
28
- buttonContainerClassName: I,
29
- buttonClassName: U,
30
- showResultClassName: H,
31
- onVote: w,
32
- disabled: A = !1,
33
- showVotesCommentsNumber: oe = !1,
34
- commentsCount: se,
35
- hideShowResultButton: $ = !1
7
+ import { useTranslatedContent as O } from "../../translation/translated_content/useTranslatedContent.js";
8
+ import { useSessionStorageState as te } from "../../hooks/use_session_storage_state/useSessionStorageState.js";
9
+ import { useToast as Be } from "../../dialog/toast_provider/useToast.js";
10
+ import { useAuthRequired as Ve } from "../../hooks/use_auth_required/useAuthRequired.js";
11
+ import { useDataProvider as Ce } from "../../data/data_provider/useDataProvider.js";
12
+ import { useConfig as xe } from "../../data/config_provider/useConfig.js";
13
+ import { useAuth as Ae } from "../../auth/use_auth/useAuth.js";
14
+ import { Icon as E } from "../../icons/icon/Icon.js";
15
+ import { ProgressBar as ye } from "../../progress/progress_bar/ProgressBar.js";
16
+ import { Link as Me } from "../../action/link/Link.js";
17
+ import { Button as Re } from "../../action/button/Button.js";
18
+ const Ke = ({
19
+ numberVotes: w,
20
+ votePositions: i,
21
+ voteableType: h,
22
+ voteableId: g,
23
+ redirectUrl: B,
24
+ displayColumn: I,
25
+ textAlignLeft: oe,
26
+ showTotal: se = !0,
27
+ voteBoxClassName: U,
28
+ buttonContainerClassName: H,
29
+ buttonClassName: $,
30
+ showResultClassName: q,
31
+ onVote: V,
32
+ onVoteCountsChange: ae,
33
+ disabled: M = !1,
34
+ showVotesCommentsNumber: ne = !1,
35
+ commentsCount: re,
36
+ hideShowResultButton: D = !1
36
37
  }) => {
37
- const [B, g] = N(!0), [l, M] = N(void 0), [p, m] = N(!1), [u, ae] = N(
38
- Number.parseFloat(b.total) || Object.values(b).reduce(
38
+ const [C, p] = S(!0), [l, R] = S(void 0), [N, v] = S(!1), [c, G] = S(
39
+ Number.parseFloat(w.total) || Object.values(w).reduce(
39
40
  (e, t) => e + Number.parseFloat(t),
40
41
  0
41
42
  ) || 0
42
- ), q = j(
43
- r[0]?.name,
44
- r[0]?.language,
43
+ ), W = O(
44
+ i[0]?.name,
45
+ i[0]?.language,
45
46
  "name",
46
- r[0]?.translation_entries
47
- ), Y = j(
48
- r[1]?.name,
49
- r[1]?.language,
47
+ i[0]?.translation_entries
48
+ ), Y = O(
49
+ i[1]?.name,
50
+ i[1]?.language,
50
51
  "name",
51
- r[1]?.translation_entries
52
- ), D = j(
53
- r[2]?.name,
54
- r[2]?.language,
52
+ i[1]?.translation_entries
53
+ ), z = O(
54
+ i[2]?.name,
55
+ i[2]?.language,
55
56
  "name",
56
- r[2]?.translation_entries
57
- ), [_, ne, G] = P(
57
+ i[2]?.translation_entries
58
+ ), [_, ie, J] = te(
58
59
  "storedUserVote",
59
60
  {}
60
- ), [Ae, re, ie] = P("userSide", {}), { toast: W } = be() || {}, le = () => {
61
+ ), [Le, le, ce] = te("userSide", {}), { toast: de } = Be() || {}, ue = () => {
61
62
  const e = {};
62
- return r?.forEach(
63
+ return i?.forEach(
63
64
  (t) => e[t.id] = {
64
- count: Number.parseFloat(b[t.id]) || 0,
65
- percentage: u === 0 ? 0 : Math.round(
66
- 100 * ((b[t.id] || 0) / u)
65
+ count: Number.parseFloat(w[t.id]) || 0,
66
+ percentage: c === 0 ? 0 : Math.round(
67
+ 100 * ((w[t.id] || 0) / c)
67
68
  )
68
69
  }
69
70
  ), e;
70
- }, [i, z] = N(le()), J = Se(), ce = Ne(), R = we(), L = Be(), C = _e(), { isLoggedIn: x, isLoggingIn: K } = Ce();
71
- T(() => {
72
- K === !1 && (x ? ue(h) : g(!1));
73
- }, [K, x]), T(() => {
74
- if (B === !1 && !S) {
75
- const [e, t] = de();
76
- e && (t ? X(t) : m(!0));
71
+ }, [n, L] = S(ue()), K = Ve(), fe = we(), k = Ce(), T = xe(), j = Se(), { isLoggedIn: x, isLoggingIn: Q } = Ae();
72
+ y(() => {
73
+ Q === !1 && (x ? ve(g) : p(!1));
74
+ }, [Q, x]), y(() => {
75
+ if (C === !1 && !B) {
76
+ const [e, t] = me();
77
+ e && (t ? P(t) : v(!0));
77
78
  }
78
- }, [B]), T(() => {
79
- w && w(l);
80
- }, [l]);
81
- const de = () => {
79
+ }, [C]), y(() => {
80
+ V && V(l);
81
+ }, [l]), y(() => {
82
+ ae?.({ total: c, counts: n });
83
+ }, [c, n]);
84
+ const me = () => {
82
85
  if (_ && Object.keys(_).length !== 0)
83
- return _.groupId === h && _.voteableType === v ? [!0, _.positionId] : (G(), [!1, !1]);
86
+ return _.groupId === g && _.voteableType === h ? [!0, _.positionId] : (J(), [!1, !1]);
84
87
  const e = new URLSearchParams(
85
- typeof window < "u" ? window.location.search : ce.search
88
+ typeof window < "u" ? window.location.search : fe.search
86
89
  ), t = !!e.get("initVote"), a = Number.parseInt(e.get("positionId")) || !1;
87
90
  return [t, a];
88
- }, ue = (e) => {
89
- g(!0), w && w(l), R.getOneWithToken("votes", `${v.toLowerCase()}/${e}`, {}).then((t) => {
90
- t.data.data.resource ? (M(t.data.data.resource), m(!0), g(!1)) : (g(!1), m(!1));
91
+ }, ve = (e) => {
92
+ p(!0), V && V(l), k.getOneWithToken("votes", `${h.toLowerCase()}/${e}`, {}).then((t) => {
93
+ t.data.data.resource ? (R(t.data.data.resource), v(!0), p(!1)) : (p(!1), v(!1));
91
94
  }).catch((t) => {
92
- g(!1);
95
+ p(!1);
93
96
  });
94
- }, V = (e, t) => t === 0 ? 0 : Math.round(100 * (e / t)), fe = (e) => {
97
+ }, A = (e, t) => t === 0 ? 0 : Math.round(100 * (e / t)), X = ({ counts: e, total: t, vote: a }) => {
98
+ L(e), G(t), R(a);
99
+ }, he = (e) => {
95
100
  const t = {
96
- voteable_id: h,
97
- voteable_type: v || "Group",
101
+ voteable_id: g,
102
+ voteable_type: h || "Group",
98
103
  position_id: e
99
104
  };
100
- re({
101
- groupId: h,
102
- voteableType: v,
105
+ le({
106
+ groupId: g,
107
+ voteableType: h,
103
108
  positionId: e
104
- }), l ? (ve(e, l.position_id), p === !1 && k(), e !== l.position_id && R.update("votes", l.id, t).then((n) => {
105
- n.data.success && (M(n.data.data.resource), W(
106
- C.formatMessage({
107
- id: "header.vote_confirm_modal",
108
- defaultMessage: "Your vote has been saved !"
109
- }),
110
- { type: "success" }
111
- ));
112
- })) : (me(e), k(), R.create("votes", t).then((n) => {
113
- n.data.success && (M(n.data.data.resource), W(
114
- C.formatMessage({
109
+ });
110
+ const r = {
111
+ counts: n,
112
+ total: c,
113
+ vote: l
114
+ }, f = (ee) => {
115
+ ee.data.success ? (R(ee.data.data.resource), de(
116
+ j.formatMessage({
115
117
  id: "header.vote_confirm_modal",
116
118
  defaultMessage: "Your vote has been saved !"
117
119
  }),
118
120
  { type: "success" }
119
- ));
120
- }));
121
- }, me = (e) => {
122
- const t = i[e].count + 1, a = u + 1, n = {};
123
- r.forEach((y) => {
124
- if (e === y.id)
125
- n[y.id] = {
121
+ )) : X(r);
122
+ }, b = () => X(r);
123
+ l ? (pe(e, l.position_id), N === !1 && F(), e !== l.position_id && k.update("votes", l.id, t).then(f, b)) : (ge(e), F(), k.create("votes", t).then(f, b));
124
+ }, ge = (e) => {
125
+ const t = n[e].count + 1, a = c + 1, r = {};
126
+ i.forEach((f) => {
127
+ if (e === f.id)
128
+ r[f.id] = {
126
129
  count: t,
127
- percentage: V(t, a)
130
+ percentage: A(t, a)
128
131
  };
129
132
  else {
130
- const Z = i[y.id].count;
131
- n[y.id] = {
132
- count: Z,
133
- percentage: V(Z, a)
133
+ const b = n[f.id].count;
134
+ r[f.id] = {
135
+ count: b,
136
+ percentage: A(b, a)
134
137
  };
135
138
  }
136
- }), z(n), ae(a);
137
- }, ve = (e, t) => {
139
+ }), L(r), G(a);
140
+ }, pe = (e, t) => {
138
141
  if (t !== e) {
139
142
  const a = {
140
- ...i,
143
+ ...n,
141
144
  [t]: {
142
- count: i[t].count - 1,
143
- percentage: V(
144
- i[t].count - 1,
145
- u
145
+ count: n[t].count - 1,
146
+ percentage: A(
147
+ n[t].count - 1,
148
+ c
146
149
  )
147
150
  },
148
151
  [e]: {
149
- count: i[e].count + 1,
150
- percentage: V(
151
- i[e].count + 1,
152
- u
152
+ count: n[e].count + 1,
153
+ percentage: A(
154
+ n[e].count + 1,
155
+ c
153
156
  )
154
157
  }
155
158
  };
156
- z(a);
159
+ L(a);
157
160
  }
158
- }, Q = (e) => {
161
+ }, Z = (e) => {
159
162
  const t = new URLSearchParams({
160
163
  initVote: "true",
161
164
  ...e && { positionId: e }
162
165
  });
163
- return S + `?${t.toString()}`;
164
- }, X = (e) => {
165
- B || (x ? Object.keys(i).includes(e.toString()) && (fe(e), G()) : (Object.keys(i).includes(e.toString()) && ne({
166
- groupId: h,
167
- voteableType: v,
166
+ return B + `?${t.toString()}`;
167
+ }, P = (e) => {
168
+ C || (x ? Object.keys(n).includes(e.toString()) && (he(e), J()) : (Object.keys(n).includes(e.toString()) && ie({
169
+ groupId: g,
170
+ voteableType: h,
168
171
  positionId: e
169
- }), J({ loginAction: "vote" })));
170
- }, k = () => {
171
- p && ie(), m(!p);
172
- }, he = (e, t) => {
172
+ }), K({ loginAction: "vote" })));
173
+ }, F = () => {
174
+ N && ce(), v(!N);
175
+ }, Ne = (e, t) => {
173
176
  let a;
174
- t === 0 ? a = q.translatedContent : t === 1 ? a = Y.translatedContent : t === 2 && (a = D.translatedContent);
175
- const n = typeof window < "u" && !S;
177
+ t === 0 ? a = W.translatedContent : t === 1 ? a = Y.translatedContent : t === 2 && (a = z.translatedContent);
178
+ const r = typeof window < "u" && !B;
176
179
  return /* @__PURE__ */ s(
177
180
  "div",
178
181
  {
179
- className: d(o.voteAction, {
182
+ className: u(o.voteAction, {
180
183
  [o.buttonAlignLeft]: o.buttonAlignLeft
181
184
  }),
182
185
  children: /* @__PURE__ */ s(
183
- ye,
186
+ Re,
184
187
  {
185
188
  "data-tid": "action_vote",
186
189
  type: "button",
187
190
  title: a,
188
- className: d(o.voteButton, {
189
- [o.textAlignLeft]: ee,
190
- [U]: U
191
+ className: u(o.voteButton, {
192
+ [o.textAlignLeft]: oe,
193
+ [$]: $
191
194
  }),
192
- onClick: n ? () => X(e.id) : null,
193
- disabled: A || n && B,
195
+ onClick: r ? () => P(e.id) : null,
196
+ disabled: M || r && C,
194
197
  "data-testid": "voteButton",
195
- to: n ? null : Q(e.id),
196
- target: n ? null : "_top",
197
- rel: n ? null : "nofollow",
198
- external: n ? null : !0,
198
+ to: r ? null : Z(e.id),
199
+ target: r ? null : "_top",
200
+ rel: r ? null : "nofollow",
201
+ external: r ? null : !0,
199
202
  children: /* @__PURE__ */ s(
200
203
  "div",
201
204
  {
202
205
  "data-tid": "action_vote",
203
- className: d(o.voteButtonThesis, {
204
- [o.voteButtonThesisSynthesisMobile]: !O
206
+ className: u(o.voteButtonThesis, {
207
+ [o.voteButtonThesisSynthesisMobile]: !I
205
208
  }),
206
209
  children: a
207
210
  }
@@ -211,21 +214,21 @@ const We = ({
211
214
  },
212
215
  t
213
216
  );
214
- }, ge = () => {
215
- x || L.actions?.unloggedVoteResults === !0 ? m(!0) : J({ loginAction: "vote" });
217
+ }, _e = () => {
218
+ x || T.actions?.unloggedVoteResults === !0 ? v(!0) : K({ loginAction: "vote" });
216
219
  };
217
220
  return /* @__PURE__ */ s(
218
221
  "div",
219
222
  {
220
- className: d(o.voteBox, { [E]: E }),
221
- children: /* @__PURE__ */ s(pe, { children: p || A ? /* @__PURE__ */ c("div", { className: o.voteResultsBox, "data-testid": "voteResultsBox", children: [
222
- /* @__PURE__ */ s("div", { className: o.voteResults, children: r.map((e, t) => {
223
+ className: u(o.voteBox, { [U]: U }),
224
+ children: /* @__PURE__ */ s(be, { children: N || M ? /* @__PURE__ */ d("div", { className: o.voteResultsBox, "data-testid": "voteResultsBox", children: [
225
+ /* @__PURE__ */ s("div", { className: o.voteResults, children: i.map((e, t) => {
223
226
  let a;
224
- return t === 0 ? a = q.translatedContent : t === 1 ? a = Y.translatedContent : t === 2 && (a = D.translatedContent), /* @__PURE__ */ c("div", { children: [
225
- /* @__PURE__ */ c(
227
+ return t === 0 ? a = W.translatedContent : t === 1 ? a = Y.translatedContent : t === 2 && (a = z.translatedContent), /* @__PURE__ */ d("div", { children: [
228
+ /* @__PURE__ */ d(
226
229
  "div",
227
230
  {
228
- className: t > 0 ? d(
231
+ className: t > 0 ? u(
229
232
  o.voteProgressHeader,
230
233
  o.voteProgressHeaderAgainst
231
234
  ) : o.voteProgressHeader,
@@ -235,64 +238,64 @@ const We = ({
235
238
  l && l.position_id === e.id ? /* @__PURE__ */ s(
236
239
  "span",
237
240
  {
238
- title: C.formatMessage({
241
+ title: j.formatMessage({
239
242
  id: "vote.vote_box.vote_side"
240
243
  }) + a,
241
244
  className: o.sideIcon,
242
245
  "aria-hidden": "true",
243
- children: /* @__PURE__ */ s(F, { name: "checkbox", width: 16, height: 16 })
246
+ children: /* @__PURE__ */ s(E, { name: "checkbox", width: 16, height: 16 })
244
247
  }
245
248
  ) : null
246
249
  ]
247
250
  }
248
251
  ),
249
- /* @__PURE__ */ c(
250
- xe,
252
+ /* @__PURE__ */ d(
253
+ ye,
251
254
  {
252
- progress: i[e.id].percentage / 100,
255
+ progress: n[e.id].percentage / 100,
253
256
  goal: 1,
254
257
  className: o.progress,
255
258
  innerClassName: o.progressBar,
256
259
  children: [
257
- i[e.id].percentage,
260
+ n[e.id].percentage,
258
261
  "%"
259
262
  ]
260
263
  }
261
264
  )
262
265
  ] }, t);
263
266
  }) }),
264
- /* @__PURE__ */ c("div", { className: o.voteBoxFooter, children: [
265
- te && /* @__PURE__ */ s("div", { className: o.voteResultsNumberVoters, children: /* @__PURE__ */ s(
266
- f,
267
+ /* @__PURE__ */ d("div", { className: o.voteBoxFooter, children: [
268
+ se && /* @__PURE__ */ s("div", { className: o.voteResultsNumberVoters, children: /* @__PURE__ */ s(
269
+ m,
267
270
  {
268
271
  id: "vote.vote_box.votes",
269
- values: { votesCount: u },
272
+ values: { votesCount: c },
270
273
  defaultMessage: "{votesCount} votes"
271
274
  }
272
275
  ) }),
273
- !A && /* @__PURE__ */ s("div", { children: l ? /* @__PURE__ */ s(
276
+ !M && /* @__PURE__ */ s("div", { children: l ? /* @__PURE__ */ s(
274
277
  "button",
275
278
  {
276
279
  "data-tid": "action_edit_vote",
277
280
  className: o.voteActionButton,
278
281
  type: "button",
279
- onClick: k,
282
+ onClick: F,
280
283
  children: /* @__PURE__ */ s(
281
- f,
284
+ m,
282
285
  {
283
286
  id: "vote.vote_box.update",
284
287
  defaultMessage: "Modify"
285
288
  }
286
289
  )
287
290
  }
288
- ) : !$ && /* @__PURE__ */ s(
291
+ ) : !D && /* @__PURE__ */ s(
289
292
  "button",
290
293
  {
291
294
  type: "button",
292
295
  className: o.voteActionButton,
293
- onClick: () => m(!1),
296
+ onClick: () => v(!1),
294
297
  children: /* @__PURE__ */ s(
295
- f,
298
+ m,
296
299
  {
297
300
  id: "vote.vote_box.back",
298
301
  defaultMessage: "Back to vote"
@@ -301,40 +304,40 @@ const We = ({
301
304
  }
302
305
  ) })
303
306
  ] })
304
- ] }) : /* @__PURE__ */ c("div", { className: o.voteBoxActions, children: [
307
+ ] }) : /* @__PURE__ */ d("div", { className: o.voteBoxActions, children: [
305
308
  /* @__PURE__ */ s(
306
309
  "div",
307
310
  {
308
- className: d(o.voteBoxActionsBody, {
309
- [o.voteBoxActionsBodyColumn]: O,
310
- [o.voteBoxActionsBodyOutlined]: L.layout?.outlinedVoteButtons,
311
- [o.voteBoxActionsBodyFilledNeutral]: L.layout?.filledNeutralVoteButton,
312
- [I]: I
311
+ className: u(o.voteBoxActionsBody, {
312
+ [o.voteBoxActionsBodyColumn]: I,
313
+ [o.voteBoxActionsBodyOutlined]: T.layout?.outlinedVoteButtons,
314
+ [o.voteBoxActionsBodyFilledNeutral]: T.layout?.filledNeutralVoteButton,
315
+ [H]: H
313
316
  }),
314
- children: r.map(
315
- (e, t) => he(e, t)
317
+ children: i.map(
318
+ (e, t) => Ne(e, t)
316
319
  )
317
320
  }
318
321
  ),
319
- oe && /* @__PURE__ */ c("div", { className: o.voteCommentCounts, children: [
320
- /* @__PURE__ */ c("div", { className: o.debateNumberItem, children: [
321
- /* @__PURE__ */ s(F, { name: "votebox", width: 20, height: 20 }),
322
+ ne && /* @__PURE__ */ d("div", { className: o.voteCommentCounts, children: [
323
+ /* @__PURE__ */ d("div", { className: o.debateNumberItem, children: [
324
+ /* @__PURE__ */ s(E, { name: "votebox", width: 20, height: 20 }),
322
325
  /* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
323
- f,
326
+ m,
324
327
  {
325
328
  id: "vote.vote_box.votes",
326
- values: { votesCount: u },
329
+ values: { votesCount: c },
327
330
  defaultMessage: "{votesCount} votes"
328
331
  }
329
332
  ) })
330
333
  ] }),
331
- /* @__PURE__ */ c("div", { className: o.debateNumberItem, children: [
332
- /* @__PURE__ */ s(F, { name: "chat", width: 20, height: 20 }),
334
+ /* @__PURE__ */ d("div", { className: o.debateNumberItem, children: [
335
+ /* @__PURE__ */ s(E, { name: "chat", width: 20, height: 20 }),
333
336
  /* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
334
- f,
337
+ m,
335
338
  {
336
339
  id: "vote.vote_box.comments",
337
- values: { count: se ?? 0 },
340
+ values: { count: re ?? 0 },
338
341
  defaultMessage: "{count} comments"
339
342
  }
340
343
  ) })
@@ -343,24 +346,24 @@ const We = ({
343
346
  /* @__PURE__ */ s(
344
347
  "div",
345
348
  {
346
- className: d(
349
+ className: u(
347
350
  o.voteBoxActions,
348
351
  o.voteBoxShowResultContainer,
349
- { [H]: H }
352
+ { [q]: q }
350
353
  ),
351
- children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children: $ ? !p && /* @__PURE__ */ s("div", { className: o.voteResultInfoText, children: C.formatMessage({
354
+ children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children: D ? !N && /* @__PURE__ */ s("div", { className: o.voteResultInfoText, children: j.formatMessage({
352
355
  id: "vote.vote_box.result_after_vote",
353
356
  defaultMessage: "Le résultat s'affichera après le vote."
354
- }) }) : typeof window < "u" && !S ? /* @__PURE__ */ s(
357
+ }) }) : typeof window < "u" && !B ? /* @__PURE__ */ s(
355
358
  "button",
356
359
  {
357
360
  type: "button",
358
- onClick: ge,
361
+ onClick: _e,
359
362
  "data-tid": "show_vote_result",
360
363
  "data-testid": "show-result",
361
364
  className: o.showResultButton,
362
- children: /* @__PURE__ */ s("span", { className: d(o.boldShowResult, o.outlined), children: /* @__PURE__ */ s(
363
- f,
365
+ children: /* @__PURE__ */ s("span", { className: u(o.boldShowResult, o.outlined), children: /* @__PURE__ */ s(
366
+ m,
364
367
  {
365
368
  id: "vote.vote_box.show_result",
366
369
  defaultMessage: "Show result"
@@ -368,16 +371,16 @@ const We = ({
368
371
  ) })
369
372
  }
370
373
  ) : /* @__PURE__ */ s(
371
- Ve,
374
+ Me,
372
375
  {
373
- to: Q(null),
376
+ to: Z(null),
374
377
  rel: "nofollow",
375
378
  "data-tid": "show_vote_result",
376
379
  target: "_top",
377
380
  external: !0,
378
381
  "data-testid": "show-result",
379
- children: /* @__PURE__ */ s("span", { className: d(o.boldShowResult, o.outlined), children: /* @__PURE__ */ s(
380
- f,
382
+ children: /* @__PURE__ */ s("span", { className: u(o.boldShowResult, o.outlined), children: /* @__PURE__ */ s(
383
+ m,
381
384
  {
382
385
  id: "vote.vote_box.show_result",
383
386
  defaultMessage: "Show result"
@@ -392,5 +395,5 @@ const We = ({
392
395
  );
393
396
  };
394
397
  export {
395
- We as VoteBox
398
+ Ke as VoteBox
396
399
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.93",
3
+ "version": "0.4.95",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._headerBox_czmub_3{display:flex!important;flex-direction:column!important;padding:0!important}._headerBoxLabel_czmub_9{display:flex!important;justify-content:flex-start!important}._headerBoxLabel_czmub_9>._titleRedirectUrl_czmub_13{background:var(--background-color-primary, white)!important}._headerBoxLabel_czmub_9>._titleRedirectUrl_czmub_13:hover{background:var(--background-color-primary, white)!important}._headerBoxLabel_czmub_9 a{text-decoration:none!important}._headerLiveStat_czmub_24{margin-left:auto!important;margin-right:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;color:var(--call-primary-color, #434343);font-size:var(--font-size-small, 16px);margin-left:30px}._headerLiveStat_czmub_24 span{margin-left:10px;margin-bottom:0!important}@media(prefers-color-scheme:dark){.logoraDarkMode ._headerLiveStat_czmub_24{color:#fff!important}.logoraDarkMode ._headerLiveNow_czmub_43{background-color:#fff!important}.logoraDarkMode ._headerLiveNow_czmub_43:before{background-color:#fff!important}}._headerLiveNow_czmub_43{min-width:8px;width:8px;height:8px;border-radius:50%;background-color:var(--call-primary-color, #434343);position:relative}._headerLiveNow_czmub_43:before{content:"";position:absolute;width:100%;height:100%;border-radius:50%;background-color:var(--call-primary-color, #434343);opacity:.4;animation-name:_livePin_czmub_1;animation-duration:1.6s;animation-iteration-count:infinite}@container (min-width: 576px){._headerLivePin_czmub_72{display:block!important}}._headerLivePin_czmub_72{display:none!important}@container (min-width: 576px){._headerLivePinMobile_czmub_81{display:none!important}}._headerLivePinMobile_czmub_81{display:block!important}@keyframes _livePin_czmub_1{0%{transform:scale(2.3)}50%{transform:scale(0)}to{transform:scale(2.3)}}._headerLabelText_czmub_100{background-color:var(--call-primary-color, #434343);color:var(--text-light, white);border-bottom:1px solid;border-color:var(--call-primary-color, #434343);border-radius:var(--box-border-radius, 6px) 0 var(--box-border-radius, 6px) 0;font-size:var(--font-size-normal, 16px);flex-wrap:nowrap;white-space:nowrap;padding-right:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._debateName_czmub_115{color:var(--text-primary, #222222);font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal);text-align:center;width:100%;display:flex!important;align-items:center!important;justify-content:center!important;padding-bottom:0!important;padding-top:var(--space-unit, 1em)!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important}@container (min-width: 576px){._debateName_czmub_115{padding-right:0!important}}@container (min-width: 576px){._debateName_czmub_115{padding-left:0!important}}._debateName_czmub_115 a._debateLink_czmub_139{color:var(--text-primary, #222222)!important}._debateLink_czmub_139{font-size:var(--font-size-large, 20px);line-height:var(--line-height-normal, 1.26em);background:var(--background-color-primary, white)!important;text-decoration:none!important;color:var(--text-primary, #222222);font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal)}._debateLink_czmub_139:hover{background:var(--background-color-primary, white)!important;text-decoration:underline!important}._left_czmub_157{justify-content:flex-start!important;padding-right:var(--space-unit, 1em)!important;padding-left:var(--space-unit, 1em)!important;padding-top:var(--space-unit, 1em)!important;padding-bottom:0!important;text-align:left}._headerLogo_czmub_166{width:100px!important;height:40px!important;object-fit:contain;object-position:left}._debateNameWithLogo_czmub_173{padding-right:0!important;padding-left:0!important}