@logora/debate 0.3.30 → 0.3.31
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/assets/components/vote/vote_box/VoteBox.module-C9Q6gBw3.css +1 -0
- package/dist/components/vote/vote_box/VoteBox.js +123 -145
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +50 -50
- package/package.json +1 -1
- package/src/components/styles/theme/_theme.scss +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._voteBox_e0cdc_3{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;width:100%}._voteResultsBox_e0cdc_11{display:flex!important;flex-direction:column!important;padding:0!important;width:100%}._voteResults_e0cdc_11{padding:0!important}._voteProgressHeader_e0cdc_22{margin-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;display:flex!important;align-items:center!important;font-size:var(--font-size-normal, 16px);display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}._voteProgressHeaderAgainst_e0cdc_35{margin-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important}._voteResultsNumberVoters_e0cdc_39{display:flex!important;align-items:center!important;padding:0!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F)}._voteBoxFooter_e0cdc_47{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;margin-top:var(--space-unit, 1em)!important;padding:0!important}._voteBoxActions_e0cdc_56{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center;gap:var(--space-unit, 1em);color:var(--text-secondary, #5F5F5F);width:100%}._voteBoxActionsBody_e0cdc_66{display:grid!important;grid-template-columns:repeat(2,1fr);gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75));padding:0!important;width:100%}._voteBoxActionsBodyColumn_e0cdc_74{grid-template-columns:1fr}._voteAction_e0cdc_78{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;padding:0!important;max-width:100%!important;width:100%!important;text-align:center}._voteAction_e0cdc_78._buttonAlignLeft_e0cdc_88{justify-content:flex-start!important}button._voteButton_e0cdc_92,a._voteButton_e0cdc_92{-webkit-appearance:initial!important;width:100%;-webkit-hyphens:auto;-ms-hyphens:auto;-moz-hyphens:auto;hyphens:auto;padding:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._textAlignLeft_e0cdc_103{justify-content:flex-start!important}._voteBoxShowResultContainer_e0cdc_107{display:flex!important;flex-direction:row!important;justify-content:center;flex-wrap:wrap!important;margin-top:.3em}._voteBoxShowResult_e0cdc_107{cursor:pointer}._voteBoxShowResult_e0cdc_107 a{color:inherit;text-decoration:none;background:none!important}._voteBoxShowResult_e0cdc_107 a:hover{text-decoration:none;background:none!important}._voteBoxShowResult_e0cdc_107 a:focus:not(:focus-visible){outline:none;box-shadow:none}._voteBoxShowResult_e0cdc_107 ._boldShowResult_e0cdc_131{font-weight:var(--font-weight-bold, 700);color:var(--text-primary, #222222)}._outlined_e0cdc_136{padding:7px 15px;border-radius:var(--box-border-radius, 6px);border:1px solid var(--text-primary, #222222)!important;white-space:nowrap}._voteButtonThesis_e0cdc_143{display:block;text-align:left;display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@container (max-width: 767.98px){._voteButtonThesisSynthesisMobile_e0cdc_155{text-align:center!important}}._voteBoxActionsBody_e0cdc_66 ._voteAction_e0cdc_78:first-child ._voteButton_e0cdc_92,._voteBoxActionsBody_e0cdc_66 ._voteAction_e0cdc_78:first-child ._voteButton_e0cdc_92:hover{background-color:var(--for-primary-color, #cc6a6d)!important;border-color:var(--for-primary-color, #cc6a6d)!important;border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteBoxActionsBody_e0cdc_66 ._voteAction_e0cdc_78:nth-child(2) ._voteButton_e0cdc_92{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_e0cdc_66 ._voteAction_e0cdc_78:nth-child(2) ._voteButton_e0cdc_92:hover{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_e0cdc_66 ._voteAction_e0cdc_78:nth-child(3) ._voteButton_e0cdc_92{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBody_e0cdc_66 ._voteAction_e0cdc_78:nth-child(3) ._voteButton_e0cdc_92:hover{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteActionButton_e0cdc_194{cursor:pointer;-webkit-appearance:initial!important;background:none;border:none;color:var(--text-secondary, #5F5F5F)!important;font-size:inherit;padding:0;font-weight:var(--font-weight-bold, 700)}._voteActionButton_e0cdc_194:focus:not(:focus-visible){outline:none;box-shadow:none}._sideIcon_e0cdc_209 svg{margin-left:5px;fill:var(--text-primary, #222222)}._progress_e0cdc_214{border-radius:10px;height:25px;color:var(--text-secondary, #5F5F5F)}._progressBar_e0cdc_220{border-radius:10px;height:25px}._voteResults_e0cdc_11>div:first-child ._progress_e0cdc_214 ._progressBar_e0cdc_220{background-color:var(--for-primary-color, #cc6a6d)!important}._voteResults_e0cdc_11>div:nth-child(2) ._progress_e0cdc_214 ._progressBar_e0cdc_220{background-color:var(--against-primary-color, #7980bb)!important}._voteResults_e0cdc_11 div:nth-child(3) ._progress_e0cdc_214 ._progressBar_e0cdc_220{background-color:var(--third-position-color-primary, #9b9b9b)!important}._voteCommentCounts_e0cdc_237{display:flex;align-items:center;gap:var(--space-unit, 1em);width:100%;margin-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._debateNumberItem_e0cdc_245{display:flex;align-items:center;gap:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25));font-size:var(--font-size-normal, 16px);color:var(--text-primary, #222222);white-space:nowrap}._debateNumberLabel_e0cdc_254{white-space:nowrap}._showResultButton_e0cdc_258{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}._showResultButton_e0cdc_258:focus:not(:focus-visible){outline:none;box-shadow:none}._voteResultInfoText_e0cdc_271{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);text-align:left;width:100%;align-self:flex-start}
|
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
import { jsx as s, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as s, Fragment as pe, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import Z from "@rooks/use-sessionstorage-state";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useLocation as
|
|
4
|
+
import { useState as b, useEffect as L } from "react";
|
|
5
|
+
import { useIntl as _e, FormattedMessage as m } from "react-intl";
|
|
6
|
+
import { useLocation as be } from "react-router";
|
|
7
7
|
import o from "./VoteBox.module.scss.js";
|
|
8
8
|
import { useTranslatedContent as k } from "../../translation/translated_content/useTranslatedContent.js";
|
|
9
|
-
import { useToast as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { useAuth as Ve } from "../../auth/use_auth/useAuth.js";
|
|
9
|
+
import { useToast as Ne } 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 Ce } from "../../data/config_provider/useConfig.js";
|
|
13
|
+
import { useAuth as Be } from "../../auth/use_auth/useAuth.js";
|
|
15
14
|
import { Icon as T } from "../../icons/icon/Icon.js";
|
|
16
|
-
import { ProgressBar as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
numberVotes: S,
|
|
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 Me } from "../../action/button/Button.js";
|
|
18
|
+
const We = ({
|
|
19
|
+
numberVotes: N,
|
|
22
20
|
votePositions: r,
|
|
23
|
-
voteableType:
|
|
24
|
-
voteableId:
|
|
25
|
-
redirectUrl:
|
|
21
|
+
voteableType: v,
|
|
22
|
+
voteableId: h,
|
|
23
|
+
redirectUrl: S,
|
|
26
24
|
displayColumn: j,
|
|
27
|
-
textAlignLeft:
|
|
28
|
-
showTotal:
|
|
25
|
+
textAlignLeft: P,
|
|
26
|
+
showTotal: ee = !0,
|
|
29
27
|
voteBoxClassName: F,
|
|
30
28
|
buttonContainerClassName: O,
|
|
31
29
|
buttonClassName: E,
|
|
32
30
|
showResultClassName: I,
|
|
33
|
-
onVote:
|
|
34
|
-
disabled:
|
|
35
|
-
showVotesCommentsNumber:
|
|
36
|
-
commentsCount:
|
|
31
|
+
onVote: w,
|
|
32
|
+
disabled: M = !1,
|
|
33
|
+
showVotesCommentsNumber: te = !1,
|
|
34
|
+
commentsCount: oe,
|
|
37
35
|
hideShowResultButton: U = !1
|
|
38
36
|
}) => {
|
|
39
|
-
const [H,
|
|
40
|
-
Number.parseFloat(
|
|
37
|
+
const [H, g] = b(!0), [c, A] = b(void 0), [p, f] = b(!1), [u, se] = b(
|
|
38
|
+
Number.parseFloat(N.total) || Object.values(N).reduce(
|
|
41
39
|
(e, t) => e + Number.parseFloat(t),
|
|
42
40
|
0
|
|
43
41
|
) || 0
|
|
@@ -56,125 +54,125 @@ const Xe = ({
|
|
|
56
54
|
r[2]?.language,
|
|
57
55
|
"name",
|
|
58
56
|
r[2]?.translation_entries
|
|
59
|
-
), [
|
|
57
|
+
), [_, ae, D] = Z(
|
|
60
58
|
"storedUserVote",
|
|
61
59
|
{}
|
|
62
|
-
), [
|
|
60
|
+
), [Ae, ne, re] = Z("userSide", {}), { toast: G } = Ne() || {}, ie = () => {
|
|
63
61
|
const e = {};
|
|
64
62
|
return r?.forEach(
|
|
65
63
|
(t) => e[t.id] = {
|
|
66
|
-
count: Number.parseFloat(
|
|
64
|
+
count: Number.parseFloat(N[t.id]) || 0,
|
|
67
65
|
percentage: u === 0 ? 0 : Math.round(
|
|
68
|
-
100 * ((
|
|
66
|
+
100 * ((N[t.id] || 0) / u)
|
|
69
67
|
)
|
|
70
68
|
}
|
|
71
69
|
), e;
|
|
72
|
-
}, [i,
|
|
70
|
+
}, [i, W] = b(ie()), z = Se(), ce = be(), R = we(), le = Ce(), C = _e(), { isLoggedIn: B, isLoggingIn: J } = Be();
|
|
73
71
|
L(() => {
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
if (H === !1 && !
|
|
77
|
-
const [e, t] =
|
|
78
|
-
e && (t ?
|
|
72
|
+
J === !1 && (B ? ue(h) : g(!1));
|
|
73
|
+
}, [J, B]), L(() => {
|
|
74
|
+
if (H === !1 && !S) {
|
|
75
|
+
const [e, t] = de();
|
|
76
|
+
e && (t ? Q(t) : f(!0));
|
|
79
77
|
}
|
|
80
78
|
}, [H]), L(() => {
|
|
81
|
-
|
|
79
|
+
w && w(c);
|
|
82
80
|
}, [c]);
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
return
|
|
81
|
+
const de = () => {
|
|
82
|
+
if (_ && Object.keys(_).length !== 0)
|
|
83
|
+
return _.groupId === h && _.voteableType === v ? [!0, _.positionId] : (D(), [!1, !1]);
|
|
86
84
|
const e = new URLSearchParams(
|
|
87
|
-
typeof window < "u" ? window.location.search :
|
|
85
|
+
typeof window < "u" ? window.location.search : ce.search
|
|
88
86
|
), t = !!e.get("initVote"), a = Number.parseInt(e.get("positionId")) || !1;
|
|
89
87
|
return [t, a];
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
t.data.data.resource ? (
|
|
88
|
+
}, ue = (e) => {
|
|
89
|
+
g(!0), w && w(c), R.getOneWithToken("votes", `${v.toLowerCase()}/${e}`, {}).then((t) => {
|
|
90
|
+
t.data.data.resource ? (A(t.data.data.resource), f(!0), g(!1)) : (g(!1), f(!1));
|
|
93
91
|
}).catch((t) => {
|
|
94
|
-
|
|
92
|
+
g(!1);
|
|
95
93
|
});
|
|
96
|
-
},
|
|
94
|
+
}, x = (e, t) => t === 0 ? 0 : Math.round(100 * (e / t)), me = (e) => {
|
|
97
95
|
const t = {
|
|
98
|
-
voteable_id:
|
|
99
|
-
voteable_type:
|
|
96
|
+
voteable_id: h,
|
|
97
|
+
voteable_type: v || "Group",
|
|
100
98
|
position_id: e
|
|
101
99
|
};
|
|
102
|
-
|
|
103
|
-
groupId:
|
|
104
|
-
voteableType:
|
|
100
|
+
ne({
|
|
101
|
+
groupId: h,
|
|
102
|
+
voteableType: v,
|
|
105
103
|
positionId: e
|
|
106
|
-
}), c ? (
|
|
107
|
-
n.data.success && (
|
|
108
|
-
|
|
104
|
+
}), c ? (ve(e, c.position_id), p === !1 && y(), e !== c.position_id && R.update("votes", c.id, t).then((n) => {
|
|
105
|
+
n.data.success && (A(n.data.data.resource), G(
|
|
106
|
+
C.formatMessage({
|
|
109
107
|
id: "header.vote_confirm_modal",
|
|
110
108
|
defaultMessage: "Your vote has been saved !"
|
|
111
109
|
}),
|
|
112
110
|
{ type: "success" }
|
|
113
111
|
));
|
|
114
|
-
})) : (
|
|
115
|
-
n.data.success && (
|
|
116
|
-
|
|
112
|
+
})) : (fe(e), y(), R.create("votes", t).then((n) => {
|
|
113
|
+
n.data.success && (A(n.data.data.resource), G(
|
|
114
|
+
C.formatMessage({
|
|
117
115
|
id: "header.vote_confirm_modal",
|
|
118
116
|
defaultMessage: "Your vote has been saved !"
|
|
119
117
|
}),
|
|
120
118
|
{ type: "success" }
|
|
121
119
|
));
|
|
122
120
|
}));
|
|
123
|
-
},
|
|
121
|
+
}, fe = (e) => {
|
|
124
122
|
const t = i[e].count + 1, a = u + 1, n = {};
|
|
125
|
-
r.forEach((
|
|
126
|
-
if (e ===
|
|
127
|
-
n[
|
|
123
|
+
r.forEach((V) => {
|
|
124
|
+
if (e === V.id)
|
|
125
|
+
n[V.id] = {
|
|
128
126
|
count: t,
|
|
129
|
-
percentage:
|
|
127
|
+
percentage: x(t, a)
|
|
130
128
|
};
|
|
131
129
|
else {
|
|
132
|
-
const
|
|
133
|
-
n[
|
|
134
|
-
count:
|
|
135
|
-
percentage:
|
|
130
|
+
const X = i[V.id].count;
|
|
131
|
+
n[V.id] = {
|
|
132
|
+
count: X,
|
|
133
|
+
percentage: x(X, a)
|
|
136
134
|
};
|
|
137
135
|
}
|
|
138
|
-
}),
|
|
139
|
-
},
|
|
136
|
+
}), W(n), se(a);
|
|
137
|
+
}, ve = (e, t) => {
|
|
140
138
|
if (t !== e) {
|
|
141
139
|
const a = {
|
|
142
140
|
...i,
|
|
143
141
|
[t]: {
|
|
144
142
|
count: i[t].count - 1,
|
|
145
|
-
percentage:
|
|
143
|
+
percentage: x(
|
|
146
144
|
i[t].count - 1,
|
|
147
145
|
u
|
|
148
146
|
)
|
|
149
147
|
},
|
|
150
148
|
[e]: {
|
|
151
149
|
count: i[e].count + 1,
|
|
152
|
-
percentage:
|
|
150
|
+
percentage: x(
|
|
153
151
|
i[e].count + 1,
|
|
154
152
|
u
|
|
155
153
|
)
|
|
156
154
|
}
|
|
157
155
|
};
|
|
158
|
-
|
|
156
|
+
W(a);
|
|
159
157
|
}
|
|
160
|
-
},
|
|
158
|
+
}, K = (e) => {
|
|
161
159
|
const t = new URLSearchParams({
|
|
162
160
|
initVote: "true",
|
|
163
161
|
...e && { positionId: e }
|
|
164
162
|
});
|
|
165
|
-
return
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
groupId:
|
|
169
|
-
voteableType:
|
|
163
|
+
return S + `?${t.toString()}`;
|
|
164
|
+
}, Q = (e) => {
|
|
165
|
+
B ? Object.keys(i).includes(e.toString()) && (me(e), D()) : (Object.keys(i).includes(e.toString()) && ae({
|
|
166
|
+
groupId: h,
|
|
167
|
+
voteableType: v,
|
|
170
168
|
positionId: e
|
|
171
|
-
}),
|
|
169
|
+
}), z({ loginAction: "vote" }));
|
|
172
170
|
}, y = () => {
|
|
173
|
-
|
|
174
|
-
},
|
|
171
|
+
p && re(), f(!p);
|
|
172
|
+
}, he = (e, t) => {
|
|
175
173
|
let a;
|
|
176
174
|
t === 0 ? a = $.translatedContent : t === 1 ? a = q.translatedContent : t === 2 && (a = Y.translatedContent);
|
|
177
|
-
const n = typeof window < "u" && !
|
|
175
|
+
const n = typeof window < "u" && !S;
|
|
178
176
|
return /* @__PURE__ */ s(
|
|
179
177
|
"div",
|
|
180
178
|
{
|
|
@@ -182,19 +180,19 @@ const Xe = ({
|
|
|
182
180
|
[o.buttonAlignLeft]: o.buttonAlignLeft
|
|
183
181
|
}),
|
|
184
182
|
children: /* @__PURE__ */ s(
|
|
185
|
-
|
|
183
|
+
Me,
|
|
186
184
|
{
|
|
187
185
|
"data-tid": "action_vote",
|
|
188
186
|
type: "button",
|
|
189
187
|
title: a,
|
|
190
188
|
className: d(o.voteButton, {
|
|
191
|
-
[o.textAlignLeft]:
|
|
189
|
+
[o.textAlignLeft]: P,
|
|
192
190
|
[E]: E
|
|
193
191
|
}),
|
|
194
|
-
onClick: n ? () =>
|
|
195
|
-
disabled:
|
|
192
|
+
onClick: n ? () => Q(e.id) : null,
|
|
193
|
+
disabled: M,
|
|
196
194
|
"data-testid": "voteButton",
|
|
197
|
-
to: n ? null :
|
|
195
|
+
to: n ? null : K(e.id),
|
|
198
196
|
target: n ? null : "_top",
|
|
199
197
|
rel: n ? null : "nofollow",
|
|
200
198
|
external: n ? null : !0,
|
|
@@ -213,14 +211,14 @@ const Xe = ({
|
|
|
213
211
|
},
|
|
214
212
|
t
|
|
215
213
|
);
|
|
216
|
-
},
|
|
217
|
-
|
|
214
|
+
}, ge = () => {
|
|
215
|
+
B || le.actions?.unloggedVoteResults === !0 ? f(!0) : z({ loginAction: "vote" });
|
|
218
216
|
};
|
|
219
217
|
return /* @__PURE__ */ s(
|
|
220
218
|
"div",
|
|
221
219
|
{
|
|
222
220
|
className: d(o.voteBox, { [F]: F }),
|
|
223
|
-
children: /* @__PURE__ */ s(
|
|
221
|
+
children: /* @__PURE__ */ s(pe, { children: p || M ? /* @__PURE__ */ l("div", { className: o.voteResultsBox, "data-testid": "voteResultsBox", children: [
|
|
224
222
|
/* @__PURE__ */ s("div", { className: o.voteResults, children: r.map((e, t) => {
|
|
225
223
|
let a;
|
|
226
224
|
return t === 0 ? a = $.translatedContent : t === 1 ? a = q.translatedContent : t === 2 && (a = Y.translatedContent), /* @__PURE__ */ l("div", { children: [
|
|
@@ -237,7 +235,7 @@ const Xe = ({
|
|
|
237
235
|
c && c.position_id === e.id ? /* @__PURE__ */ s(
|
|
238
236
|
"span",
|
|
239
237
|
{
|
|
240
|
-
title:
|
|
238
|
+
title: C.formatMessage({
|
|
241
239
|
id: "vote.vote_box.vote_side"
|
|
242
240
|
}) + a,
|
|
243
241
|
className: o.sideIcon,
|
|
@@ -249,7 +247,7 @@ const Xe = ({
|
|
|
249
247
|
}
|
|
250
248
|
),
|
|
251
249
|
/* @__PURE__ */ l(
|
|
252
|
-
|
|
250
|
+
xe,
|
|
253
251
|
{
|
|
254
252
|
progress: i[e.id].percentage / 100,
|
|
255
253
|
goal: 1,
|
|
@@ -264,7 +262,7 @@ const Xe = ({
|
|
|
264
262
|
] }, t);
|
|
265
263
|
}) }),
|
|
266
264
|
/* @__PURE__ */ l("div", { className: o.voteBoxFooter, children: [
|
|
267
|
-
|
|
265
|
+
ee && /* @__PURE__ */ s("div", { className: o.voteResultsNumberVoters, children: /* @__PURE__ */ s(
|
|
268
266
|
m,
|
|
269
267
|
{
|
|
270
268
|
id: "vote.vote_box.votes",
|
|
@@ -272,7 +270,7 @@ const Xe = ({
|
|
|
272
270
|
defaultMessage: "{votesCount} votes"
|
|
273
271
|
}
|
|
274
272
|
) }),
|
|
275
|
-
!
|
|
273
|
+
!M && /* @__PURE__ */ s("div", { children: c ? /* @__PURE__ */ s(
|
|
276
274
|
"button",
|
|
277
275
|
{
|
|
278
276
|
"data-tid": "action_edit_vote",
|
|
@@ -312,53 +310,33 @@ const Xe = ({
|
|
|
312
310
|
[O]: O
|
|
313
311
|
}),
|
|
314
312
|
children: r.map(
|
|
315
|
-
(e, t) =>
|
|
313
|
+
(e, t) => he(e, t)
|
|
316
314
|
)
|
|
317
315
|
}
|
|
318
316
|
),
|
|
319
|
-
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
322
|
-
{
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
id: "
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
ee,
|
|
343
|
-
{
|
|
344
|
-
position: W ? "right" : "bottom",
|
|
345
|
-
text: v.formatMessage({
|
|
346
|
-
id: "info.arguments_count",
|
|
347
|
-
defaultMessage: "Comments"
|
|
348
|
-
}),
|
|
349
|
-
children: /* @__PURE__ */ l("div", { className: o.debateNumberItem, children: [
|
|
350
|
-
/* @__PURE__ */ s(T, { name: "chat", width: 20, height: 20 }),
|
|
351
|
-
/* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
|
|
352
|
-
m,
|
|
353
|
-
{
|
|
354
|
-
id: "vote.vote_box.comments",
|
|
355
|
-
values: { count: ae ?? 0 },
|
|
356
|
-
defaultMessage: "{count} comments"
|
|
357
|
-
}
|
|
358
|
-
) })
|
|
359
|
-
] })
|
|
360
|
-
}
|
|
361
|
-
)
|
|
317
|
+
te && /* @__PURE__ */ l("div", { className: o.voteCommentCounts, children: [
|
|
318
|
+
/* @__PURE__ */ l("div", { className: o.debateNumberItem, children: [
|
|
319
|
+
/* @__PURE__ */ s(T, { name: "votebox", width: 20, height: 20 }),
|
|
320
|
+
/* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
|
|
321
|
+
m,
|
|
322
|
+
{
|
|
323
|
+
id: "vote.vote_box.votes",
|
|
324
|
+
values: { votesCount: u },
|
|
325
|
+
defaultMessage: "{votesCount} votes"
|
|
326
|
+
}
|
|
327
|
+
) })
|
|
328
|
+
] }),
|
|
329
|
+
/* @__PURE__ */ l("div", { className: o.debateNumberItem, children: [
|
|
330
|
+
/* @__PURE__ */ s(T, { name: "chat", width: 20, height: 20 }),
|
|
331
|
+
/* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
|
|
332
|
+
m,
|
|
333
|
+
{
|
|
334
|
+
id: "vote.vote_box.comments",
|
|
335
|
+
values: { count: oe ?? 0 },
|
|
336
|
+
defaultMessage: "{count} comments"
|
|
337
|
+
}
|
|
338
|
+
) })
|
|
339
|
+
] })
|
|
362
340
|
] }),
|
|
363
341
|
/* @__PURE__ */ s(
|
|
364
342
|
"div",
|
|
@@ -368,14 +346,14 @@ const Xe = ({
|
|
|
368
346
|
o.voteBoxShowResultContainer,
|
|
369
347
|
{ [I]: I }
|
|
370
348
|
),
|
|
371
|
-
children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children: U ? !
|
|
349
|
+
children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children: U ? !p && /* @__PURE__ */ s("div", { className: o.voteResultInfoText, children: C.formatMessage({
|
|
372
350
|
id: "vote.vote_box.result_after_vote",
|
|
373
351
|
defaultMessage: "Le résultat s'affichera après le vote."
|
|
374
|
-
}) }) : typeof window < "u" && !
|
|
352
|
+
}) }) : typeof window < "u" && !S ? /* @__PURE__ */ s(
|
|
375
353
|
"button",
|
|
376
354
|
{
|
|
377
355
|
type: "button",
|
|
378
|
-
onClick:
|
|
356
|
+
onClick: ge,
|
|
379
357
|
"data-tid": "show_vote_result",
|
|
380
358
|
"data-testid": "show-result",
|
|
381
359
|
className: o.showResultButton,
|
|
@@ -388,9 +366,9 @@ const Xe = ({
|
|
|
388
366
|
) })
|
|
389
367
|
}
|
|
390
368
|
) : /* @__PURE__ */ s(
|
|
391
|
-
|
|
369
|
+
Ve,
|
|
392
370
|
{
|
|
393
|
-
to:
|
|
371
|
+
to: K(null),
|
|
394
372
|
rel: "nofollow",
|
|
395
373
|
"data-tid": "show_vote_result",
|
|
396
374
|
target: "_top",
|
|
@@ -412,5 +390,5 @@ const Xe = ({
|
|
|
412
390
|
);
|
|
413
391
|
};
|
|
414
392
|
export {
|
|
415
|
-
|
|
393
|
+
We as VoteBox
|
|
416
394
|
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import '../../../assets/components/vote/vote_box/VoteBox.module-
|
|
1
|
+
import '../../../assets/components/vote/vote_box/VoteBox.module-C9Q6gBw3.css';const t = "_voteBox_e0cdc_3", o = "_voteResultsBox_e0cdc_11", e = "_voteResults_e0cdc_11", s = "_voteProgressHeader_e0cdc_22", c = "_voteProgressHeaderAgainst_e0cdc_35", n = "_voteResultsNumberVoters_e0cdc_39", _ = "_voteBoxFooter_e0cdc_47", u = "_voteBoxActions_e0cdc_56", d = "_voteBoxActionsBody_e0cdc_66", v = "_voteBoxActionsBodyColumn_e0cdc_74", r = "_voteAction_e0cdc_78", B = "_buttonAlignLeft_e0cdc_88", l = "_voteButton_e0cdc_92", i = "_textAlignLeft_e0cdc_103", x = "_voteBoxShowResultContainer_e0cdc_107", b = "_voteBoxShowResult_e0cdc_107", a = "_boldShowResult_e0cdc_131", A = "_outlined_e0cdc_136", R = "_voteButtonThesis_e0cdc_143", g = "_voteButtonThesisSynthesisMobile_e0cdc_155", h = "_voteActionButton_e0cdc_194", m = "_sideIcon_e0cdc_209", w = "_progress_e0cdc_214", C = "_progressBar_e0cdc_220", S = "_voteCommentCounts_e0cdc_237", f = "_debateNumberItem_e0cdc_245", y = "_debateNumberLabel_e0cdc_254", I = "_showResultButton_e0cdc_258", L = "_voteResultInfoText_e0cdc_271", N = {
|
|
2
2
|
voteBox: t,
|
|
3
3
|
voteResultsBox: o,
|
|
4
4
|
voteResults: e,
|
|
5
5
|
voteProgressHeader: s,
|
|
6
|
-
voteProgressHeaderAgainst:
|
|
7
|
-
voteResultsNumberVoters:
|
|
8
|
-
voteBoxFooter:
|
|
9
|
-
voteBoxActions:
|
|
10
|
-
voteBoxActionsBody:
|
|
11
|
-
voteBoxActionsBodyColumn:
|
|
12
|
-
voteAction:
|
|
13
|
-
buttonAlignLeft:
|
|
14
|
-
voteButton:
|
|
15
|
-
textAlignLeft:
|
|
6
|
+
voteProgressHeaderAgainst: c,
|
|
7
|
+
voteResultsNumberVoters: n,
|
|
8
|
+
voteBoxFooter: _,
|
|
9
|
+
voteBoxActions: u,
|
|
10
|
+
voteBoxActionsBody: d,
|
|
11
|
+
voteBoxActionsBodyColumn: v,
|
|
12
|
+
voteAction: r,
|
|
13
|
+
buttonAlignLeft: B,
|
|
14
|
+
voteButton: l,
|
|
15
|
+
textAlignLeft: i,
|
|
16
16
|
voteBoxShowResultContainer: x,
|
|
17
|
-
voteBoxShowResult:
|
|
18
|
-
boldShowResult:
|
|
19
|
-
outlined:
|
|
20
|
-
voteButtonThesis:
|
|
21
|
-
voteButtonThesisSynthesisMobile:
|
|
22
|
-
voteActionButton:
|
|
23
|
-
sideIcon:
|
|
24
|
-
progress:
|
|
25
|
-
progressBar:
|
|
26
|
-
voteCommentCounts:
|
|
27
|
-
debateNumberItem:
|
|
28
|
-
debateNumberLabel:
|
|
29
|
-
showResultButton:
|
|
30
|
-
voteResultInfoText:
|
|
17
|
+
voteBoxShowResult: b,
|
|
18
|
+
boldShowResult: a,
|
|
19
|
+
outlined: A,
|
|
20
|
+
voteButtonThesis: R,
|
|
21
|
+
voteButtonThesisSynthesisMobile: g,
|
|
22
|
+
voteActionButton: h,
|
|
23
|
+
sideIcon: m,
|
|
24
|
+
progress: w,
|
|
25
|
+
progressBar: C,
|
|
26
|
+
voteCommentCounts: S,
|
|
27
|
+
debateNumberItem: f,
|
|
28
|
+
debateNumberLabel: y,
|
|
29
|
+
showResultButton: I,
|
|
30
|
+
voteResultInfoText: L
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
a as boldShowResult,
|
|
34
|
+
B as buttonAlignLeft,
|
|
35
|
+
f as debateNumberItem,
|
|
36
|
+
y as debateNumberLabel,
|
|
37
|
+
N as default,
|
|
38
|
+
A as outlined,
|
|
39
|
+
w as progress,
|
|
40
|
+
C as progressBar,
|
|
41
|
+
I as showResultButton,
|
|
42
|
+
m as sideIcon,
|
|
43
|
+
i as textAlignLeft,
|
|
44
|
+
r as voteAction,
|
|
45
|
+
h as voteActionButton,
|
|
46
46
|
t as voteBox,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
u as voteBoxActions,
|
|
48
|
+
d as voteBoxActionsBody,
|
|
49
|
+
v as voteBoxActionsBodyColumn,
|
|
50
|
+
_ as voteBoxFooter,
|
|
51
|
+
b as voteBoxShowResult,
|
|
52
52
|
x as voteBoxShowResultContainer,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
l as voteButton,
|
|
54
|
+
R as voteButtonThesis,
|
|
55
|
+
g as voteButtonThesisSynthesisMobile,
|
|
56
|
+
S as voteCommentCounts,
|
|
57
57
|
s as voteProgressHeader,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
c as voteProgressHeaderAgainst,
|
|
59
|
+
L as voteResultInfoText,
|
|
60
60
|
e as voteResults,
|
|
61
61
|
o as voteResultsBox,
|
|
62
|
-
|
|
62
|
+
n as voteResultsNumberVoters
|
|
63
63
|
};
|
package/package.json
CHANGED
|
@@ -9,7 +9,6 @@ $connected-green: var(--connected-green, #80d764);
|
|
|
9
9
|
$announcement-primary: var(--announcement-primary, #cce5ff);
|
|
10
10
|
$announcement-text-primary: var(--announcement-text-primary, #004085);
|
|
11
11
|
$background-color-container: var(--background-color-container, white);
|
|
12
|
-
$background-color-container-dark: var(--background-color-container-dark, #000000);
|
|
13
12
|
$background-color-primary: var(--background-color-primary, white);
|
|
14
13
|
$background-color-secondary: var(--background-color-secondary ,#E8E8E8);
|
|
15
14
|
$box-shadow: var(--box-shadow, 0px 2px 5px rgba(7,42,68, 0.1));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._voteBox_29yqs_3{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;width:100%}._voteResultsBox_29yqs_11{display:flex!important;flex-direction:column!important;padding:0!important;width:100%}._voteResults_29yqs_11{padding:0!important}._voteProgressHeader_29yqs_22{margin-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;display:flex!important;align-items:center!important;font-size:var(--font-size-normal, 16px);display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}._voteProgressHeaderAgainst_29yqs_35{margin-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important}._voteResultsNumberVoters_29yqs_39{display:flex!important;align-items:center!important;padding:0!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F)}._voteBoxFooter_29yqs_47{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;margin-top:var(--space-unit, 1em)!important;padding:0!important}._voteBoxActions_29yqs_56{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center;gap:var(--space-unit, 1em);color:var(--text-secondary, #5F5F5F);width:100%}._voteBoxActionsBody_29yqs_66{display:grid!important;grid-template-columns:repeat(2,1fr);gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75));padding:0!important;width:100%}._voteBoxActionsBodyColumn_29yqs_74{grid-template-columns:1fr}._voteAction_29yqs_78{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;padding:0!important;max-width:100%!important;width:100%!important;text-align:center}._voteAction_29yqs_78._buttonAlignLeft_29yqs_88{justify-content:flex-start!important}button._voteButton_29yqs_92,a._voteButton_29yqs_92{-webkit-appearance:initial!important;width:100%;-webkit-hyphens:auto;-ms-hyphens:auto;-moz-hyphens:auto;hyphens:auto;padding:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._textAlignLeft_29yqs_103{justify-content:flex-start!important}._voteBoxShowResultContainer_29yqs_107{display:flex!important;flex-direction:row!important;justify-content:center;flex-wrap:wrap!important;margin-top:.3em}._voteBoxShowResult_29yqs_107{cursor:pointer}._voteBoxShowResult_29yqs_107 a{color:inherit;text-decoration:none;background:none!important}._voteBoxShowResult_29yqs_107 a:hover{text-decoration:none;background:none!important}._voteBoxShowResult_29yqs_107 a:focus:not(:focus-visible){outline:none;box-shadow:none}._voteBoxShowResult_29yqs_107 ._boldShowResult_29yqs_131{font-weight:var(--font-weight-bold, 700);color:var(--text-primary, #222222)}._outlined_29yqs_136{padding:7px 15px;border-radius:var(--box-border-radius, 6px);border:1px solid var(--text-primary, #222222)!important;white-space:nowrap}._voteButtonThesis_29yqs_143{display:block;text-align:left;display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@container (max-width: 767.98px){._voteButtonThesisSynthesisMobile_29yqs_155{text-align:center!important}}._voteBoxActionsBody_29yqs_66 ._voteAction_29yqs_78:first-child ._voteButton_29yqs_92,._voteBoxActionsBody_29yqs_66 ._voteAction_29yqs_78:first-child ._voteButton_29yqs_92:hover{background-color:var(--for-primary-color, #cc6a6d)!important;border-color:var(--for-primary-color, #cc6a6d)!important;border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteBoxActionsBody_29yqs_66 ._voteAction_29yqs_78:nth-child(2) ._voteButton_29yqs_92{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_29yqs_66 ._voteAction_29yqs_78:nth-child(2) ._voteButton_29yqs_92:hover{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_29yqs_66 ._voteAction_29yqs_78:nth-child(3) ._voteButton_29yqs_92{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBody_29yqs_66 ._voteAction_29yqs_78:nth-child(3) ._voteButton_29yqs_92:hover{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteActionButton_29yqs_194{cursor:pointer;-webkit-appearance:initial!important;background:none;border:none;color:var(--text-secondary, #5F5F5F)!important;font-size:inherit;padding:0;font-weight:var(--font-weight-bold, 700)}._voteActionButton_29yqs_194:focus:not(:focus-visible){outline:none;box-shadow:none}._sideIcon_29yqs_209 svg{margin-left:5px;fill:var(--text-primary, #222222)}._progress_29yqs_214{border-radius:10px;height:25px;color:var(--text-secondary, #5F5F5F)}._progressBar_29yqs_220{border-radius:10px;height:25px}._voteResults_29yqs_11>div:first-child ._progress_29yqs_214 ._progressBar_29yqs_220{background-color:var(--for-primary-color, #cc6a6d)!important}._voteResults_29yqs_11>div:nth-child(2) ._progress_29yqs_214 ._progressBar_29yqs_220{background-color:var(--against-primary-color, #7980bb)!important}._voteResults_29yqs_11 div:nth-child(3) ._progress_29yqs_214 ._progressBar_29yqs_220{background-color:var(--third-position-color-primary, #9b9b9b)!important}._voteCommentCounts_29yqs_237{display:flex;align-items:center;gap:var(--space-unit, 1em);width:100%;margin-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._debateNumberItem_29yqs_245{display:flex;align-items:center;gap:var(--spacer-sm, calc(var(--space-unit, 1em) * .5));font-size:var(--font-size-normal, 16px);color:var(--text-primary, #222222);white-space:nowrap}._debateNumberLabel_29yqs_254{white-space:nowrap}._showResultButton_29yqs_258{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}._showResultButton_29yqs_258:focus:not(:focus-visible){outline:none;box-shadow:none}._voteResultInfoText_29yqs_271{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);text-align:left;width:100%;align-self:flex-start}
|