@logora/debate 0.3.72 → 0.3.75
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/argument/argument/Argument.module-QZdPjj_i.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-D2an6OmR.css +1 -0
- package/dist/assets/components/input/text_editor/{TextEditor.module-DePSfOvG.css → TextEditor.module-CxuSL3l3.css} +1 -1
- package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
- package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-C9Q6gBw3.css +1 -0
- package/dist/components/argument/argument/Argument.js +112 -108
- package/dist/components/argument/argument/Argument.module.scss.js +31 -31
- package/dist/components/consultation/consultation_box/ConsultationBox.js +80 -111
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +23 -21
- package/dist/components/dialog/dropdown/Dropdown.js +35 -28
- package/dist/components/icons/spiegel_icons/Downvote.js +6 -0
- package/dist/components/icons/spiegel_icons/Upvote.js +6 -0
- package/dist/components/icons/spiegel_icons/index.js +46 -46
- package/dist/components/icons/stern_icons/index.js +100 -70
- package/dist/components/input/argument_input/ArgumentInput.js +142 -142
- package/dist/components/input/select/Select.js +19 -19
- package/dist/components/input/text_editor/TextEditor.js +135 -124
- package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
- package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
- package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
- package/dist/components/list/paginated_list/PaginatedList.js +112 -110
- package/dist/components/notification/notification_menu/NotificationMenu.js +23 -22
- package/dist/components/proposal/proposal_box/ProposalBox.js +8 -10
- package/dist/components/section/section_box/SectionBox.js +10 -10
- package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
- package/dist/components/source/context_source_list/ContextSourceList.js +8 -7
- package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +14 -12
- package/dist/components/source/source_list_item/SourceListItem.js +42 -28
- package/dist/components/source/source_list_item/SourceListItem.module.scss.js +8 -6
- package/dist/components/summary/summary/Summary.js +41 -63
- package/dist/components/summary/summary/Summary.module.scss.js +10 -6
- package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
- 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/dist/assets/components/argument/argument/Argument.module-gLfNRLks.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +0 -1
- package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +0 -1
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +0 -1
- package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useIntl as
|
|
1
|
+
import { jsxs as M, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import $e from "@rooks/use-sessionstorage-state";
|
|
3
|
+
import { useRef as qe, useState as c, useEffect as v, Suspense as De, lazy as We } from "react";
|
|
4
|
+
import { useIntl as Ye, FormattedMessage as me } from "react-intl";
|
|
5
5
|
import { useLocation as ke } from "react-router";
|
|
6
|
-
import
|
|
6
|
+
import I from "classnames";
|
|
7
7
|
import n from "./ArgumentInput.module.scss.js";
|
|
8
8
|
import { useDataProvider as Re } from "../../data/data_provider/useDataProvider.js";
|
|
9
9
|
import { useList as je } from "../../list/list_provider/useList.js";
|
|
@@ -20,144 +20,144 @@ import { Avatar as et } from "../../user/avatar/Avatar.js";
|
|
|
20
20
|
import { AuthorBox as tt } from "../../user/author_box/AuthorBox.js";
|
|
21
21
|
import { TextEditor as nt } from "../text_editor/TextEditor.js";
|
|
22
22
|
import { Icon as at } from "../../icons/icon/Icon.js";
|
|
23
|
-
const it =
|
|
24
|
-
argumentListId:
|
|
25
|
-
avatarSize:
|
|
26
|
-
disabled:
|
|
23
|
+
const it = We(() => import("../../modal/side_modal/index.js").then((S) => ({ default: S.SideModal }))), Nt = ({
|
|
24
|
+
argumentListId: S,
|
|
25
|
+
avatarSize: fe = 48,
|
|
26
|
+
disabled: z = !1,
|
|
27
27
|
positions: a = [],
|
|
28
|
-
disabledPositions:
|
|
29
|
-
groupId:
|
|
30
|
-
groupName:
|
|
31
|
-
groupType:
|
|
32
|
-
hideSourceAction:
|
|
28
|
+
disabledPositions: x = [],
|
|
29
|
+
groupId: b,
|
|
30
|
+
groupName: ge,
|
|
31
|
+
groupType: O,
|
|
32
|
+
hideSourceAction: he = !1,
|
|
33
33
|
isReply: r = !1,
|
|
34
|
-
onSubmit:
|
|
35
|
-
parentId:
|
|
36
|
-
placeholder:
|
|
37
|
-
positionId:
|
|
38
|
-
focusOnInit:
|
|
39
|
-
activeOnInit:
|
|
40
|
-
userGuideUrl:
|
|
41
|
-
hideUserGuideLink:
|
|
42
|
-
hideCharCount:
|
|
43
|
-
disableAutoActivate:
|
|
34
|
+
onSubmit: J,
|
|
35
|
+
parentId: F,
|
|
36
|
+
placeholder: pe,
|
|
37
|
+
positionId: A,
|
|
38
|
+
focusOnInit: _e = !1,
|
|
39
|
+
activeOnInit: P = !1,
|
|
40
|
+
userGuideUrl: K,
|
|
41
|
+
hideUserGuideLink: Me = !1,
|
|
42
|
+
hideCharCount: ve = !1,
|
|
43
|
+
disableAutoActivate: be = !1
|
|
44
44
|
}) => {
|
|
45
|
-
const
|
|
46
|
-
focus:
|
|
47
|
-
setFocus:
|
|
48
|
-
setReset:
|
|
49
|
-
inputContent:
|
|
50
|
-
setInputContent:
|
|
45
|
+
const o = Ye(), G = Re(), N = je(), h = ze(), {
|
|
46
|
+
focus: H,
|
|
47
|
+
setFocus: T,
|
|
48
|
+
setReset: Ae,
|
|
49
|
+
inputContent: B,
|
|
50
|
+
setInputContent: Q,
|
|
51
51
|
setInputRichContent: Ce
|
|
52
|
-
} = Oe(), { isLoggedIn:
|
|
52
|
+
} = Oe(), { isLoggedIn: C, currentUser: u } = Je(), { errors: E, validate: V } = Ke(), { isMobile: m } = Ge(), we = ke(), X = qe(null), [U, $] = c([]), [q, D] = c(""), [Z, W] = c(null), [d, p] = c(null), [ee, te] = c(null), [ne, ae] = c(!1), [w, ie] = c(!1), [_, se] = c({}), [f, Ie] = $e(
|
|
53
53
|
"userSide",
|
|
54
54
|
{}
|
|
55
55
|
), [g, Se] = c(
|
|
56
|
-
!
|
|
57
|
-
), Y = He(), { showModal: xe } = Qe(), { toast:
|
|
56
|
+
!C && h?.actions?.disableInputForVisitor
|
|
57
|
+
), Y = He(), { showModal: xe } = Qe(), { toast: k } = Xe() || {}, oe = new URLSearchParams(
|
|
58
58
|
typeof window < "u" ? window.location.search : we.search
|
|
59
59
|
);
|
|
60
|
-
|
|
60
|
+
v(() => {
|
|
61
61
|
Se(
|
|
62
|
-
!
|
|
62
|
+
!C && h?.actions?.disableInputForVisitor
|
|
63
63
|
);
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
66
|
-
|
|
64
|
+
}, [C, h]);
|
|
65
|
+
const R = u?.role === "editor" || u?.role === "moderator", re = u?.moderation_status === "banned";
|
|
66
|
+
v(() => {
|
|
67
67
|
let e = null;
|
|
68
|
-
typeof window < "u" && (e =
|
|
69
|
-
}, [
|
|
70
|
-
|
|
71
|
-
}, [
|
|
68
|
+
typeof window < "u" && (e = oe.get("positionId")), A && A != a[2]?.id && a?.find((t) => t.id === A) ? p(A) : e && e != a[2]?.id ? p(e) : f && f.groupId == b && f.positionId != a[2]?.id && p(f.positionId);
|
|
69
|
+
}, [A]), v(() => {
|
|
70
|
+
P && (j(), T(!0));
|
|
71
|
+
}, [P]), v(() => {
|
|
72
72
|
if (typeof window < "u") {
|
|
73
|
-
const e =
|
|
74
|
-
(e === !0 || e === "true") && (
|
|
73
|
+
const e = _e || oe.get("initArgument");
|
|
74
|
+
(e === !0 || e === "true") && (T(!0), Ee());
|
|
75
75
|
}
|
|
76
|
-
}, []),
|
|
77
|
-
|
|
78
|
-
}, [
|
|
79
|
-
|
|
80
|
-
}, [
|
|
76
|
+
}, []), v(() => {
|
|
77
|
+
H && (ue(), T(!1));
|
|
78
|
+
}, [H]), v(() => {
|
|
79
|
+
B?.id && (Ne(B), T(!0));
|
|
80
|
+
}, [B]);
|
|
81
81
|
const Ne = (e) => {
|
|
82
|
-
|
|
83
|
-
}, re = () => {
|
|
84
|
-
H.current.scrollIntoView(!1);
|
|
82
|
+
se(e), ie(!0), $(e.sources), D(e.content), W(e.rich_content), te(e.id), ue(), p(e.position?.id), JSON.parse(e.rich_content).hasOwnProperty("root") ? Ce(e.rich_content) : Q(e.content);
|
|
85
83
|
}, ue = () => {
|
|
86
|
-
|
|
84
|
+
X.current.scrollIntoView(!1);
|
|
85
|
+
}, de = () => {
|
|
86
|
+
D(""), W(null), se({}), te(null), $([]), Ae(!0), Q(null);
|
|
87
87
|
}, Te = (e) => {
|
|
88
|
-
p(e),
|
|
89
|
-
},
|
|
88
|
+
p(e), ce(e);
|
|
89
|
+
}, ye = () => {
|
|
90
90
|
xe(
|
|
91
|
-
/* @__PURE__ */ i(
|
|
91
|
+
/* @__PURE__ */ i(De, { fallback: null, children: /* @__PURE__ */ i(
|
|
92
92
|
it,
|
|
93
93
|
{
|
|
94
|
-
modalTitle:
|
|
94
|
+
modalTitle: o.formatMessage({
|
|
95
95
|
id: "modal.side_modal.modal_title",
|
|
96
96
|
defaultMessage: "Choose your side"
|
|
97
97
|
}),
|
|
98
98
|
onChooseSide: Te,
|
|
99
99
|
positions: a,
|
|
100
|
-
title:
|
|
101
|
-
disabledPositions: !r &&
|
|
102
|
-
isNeutral: f && f.groupId ==
|
|
100
|
+
title: ge,
|
|
101
|
+
disabledPositions: !r && x,
|
|
102
|
+
isNeutral: f && f.groupId == b && f.positionId === a[2]?.id
|
|
103
103
|
}
|
|
104
104
|
) })
|
|
105
105
|
);
|
|
106
|
-
},
|
|
107
|
-
|
|
106
|
+
}, Le = () => {
|
|
107
|
+
C ? ee ? Be() : !a || a?.length === 0 || !x?.find((e) => e?.id === d) && d || R && r ? ce(r && R && a[0]?.id) : ye() : Y({ loginAction: "argument" });
|
|
108
108
|
}, Fe = (e, t) => {
|
|
109
|
-
g ? Y({ loginAction: "argument" }) : (D(e), W(t),
|
|
109
|
+
g ? Y({ loginAction: "argument" }) : (D(e), W(t), V({ content: e }, [{ content: ["url", null] }]));
|
|
110
110
|
}, Pe = (e) => {
|
|
111
|
-
|
|
112
|
-
},
|
|
111
|
+
$(e);
|
|
112
|
+
}, le = [
|
|
113
113
|
{ content: ["length", 3] },
|
|
114
114
|
{ content: ["required", null] },
|
|
115
115
|
{ content: ["url", null] },
|
|
116
116
|
...!a || a?.length === 0 ? [] : [{ position_id: ["required", null] }]
|
|
117
|
-
],
|
|
117
|
+
], ce = (e) => {
|
|
118
118
|
const t = e || d, l = {
|
|
119
119
|
content: q,
|
|
120
|
-
rich_content:
|
|
121
|
-
group_id:
|
|
122
|
-
...
|
|
120
|
+
rich_content: Z,
|
|
121
|
+
group_id: b,
|
|
122
|
+
...O && { group_type: O },
|
|
123
123
|
...t && { position_id: t },
|
|
124
|
-
is_reply: !!
|
|
125
|
-
message_id:
|
|
126
|
-
source_ids:
|
|
124
|
+
is_reply: !!F,
|
|
125
|
+
message_id: F || null,
|
|
126
|
+
source_ids: U?.map((s) => s.id)
|
|
127
127
|
};
|
|
128
|
-
|
|
129
|
-
groupId:
|
|
128
|
+
V(l, le) && (t && a && a.map((s) => s.id).includes(t) && Ie({
|
|
129
|
+
groupId: b,
|
|
130
130
|
positionId: t
|
|
131
|
-
}),
|
|
132
|
-
if (
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
}), de(), G.create("messages", l).then((s) => {
|
|
132
|
+
if (s.data.success) {
|
|
133
|
+
if (F)
|
|
134
|
+
J(s.data.data.resource), k(
|
|
135
|
+
o.formatMessage({
|
|
136
136
|
id: "alert.argument_create",
|
|
137
137
|
defaultMessage: "Your contribution has been sent !"
|
|
138
138
|
}),
|
|
139
139
|
{
|
|
140
140
|
type: "success",
|
|
141
|
-
points:
|
|
141
|
+
points: o.formatMessage({
|
|
142
142
|
id: "alert.reply_gain",
|
|
143
143
|
defaultMessage: " "
|
|
144
144
|
})
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
147
|
else {
|
|
148
|
-
const
|
|
149
|
-
let L =
|
|
150
|
-
t && !m && (L = `argumentList${
|
|
148
|
+
const y = s.data.data.resource;
|
|
149
|
+
let L = S;
|
|
150
|
+
t && !m && (L = `argumentList${y.position.id}`), J?.(
|
|
151
151
|
q,
|
|
152
152
|
a.find((Ue) => Ue.id === t) || null
|
|
153
|
-
),
|
|
154
|
-
|
|
153
|
+
), N.add(L, [y]), k(
|
|
154
|
+
o.formatMessage({
|
|
155
155
|
id: "alert.argument_create",
|
|
156
156
|
defaultMessage: "Your contribution has been sent !"
|
|
157
157
|
}),
|
|
158
158
|
{
|
|
159
159
|
type: "success",
|
|
160
|
-
points:
|
|
160
|
+
points: o.formatMessage({
|
|
161
161
|
id: "alert.argument_create_gain",
|
|
162
162
|
defaultMessage: "Up to 10 eloquence points"
|
|
163
163
|
}),
|
|
@@ -169,7 +169,7 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
169
169
|
typeof window < "u" && window.dispatchEvent(
|
|
170
170
|
new CustomEvent("logora:user_content:created", {
|
|
171
171
|
detail: {
|
|
172
|
-
content:
|
|
172
|
+
content: s.data.data?.resource
|
|
173
173
|
}
|
|
174
174
|
})
|
|
175
175
|
);
|
|
@@ -178,40 +178,40 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
178
178
|
}, Be = () => {
|
|
179
179
|
const e = {
|
|
180
180
|
content: q,
|
|
181
|
-
rich_content:
|
|
182
|
-
source_ids:
|
|
181
|
+
rich_content: Z,
|
|
182
|
+
source_ids: U?.map((t) => t.id),
|
|
183
183
|
...d && { position_id: d }
|
|
184
184
|
};
|
|
185
|
-
|
|
185
|
+
V(e, le) && G.update("messages", ee, e).then((t) => {
|
|
186
186
|
if (t.data.success) {
|
|
187
187
|
const l = t.data.data.resource;
|
|
188
|
-
let
|
|
189
|
-
if (d && !m && (
|
|
190
|
-
const
|
|
191
|
-
|
|
188
|
+
let s = S;
|
|
189
|
+
if (_?.is_reply && _?.message_id ? s = `argument_${_.message_id}_reply_list` : d && !m && (s = `argumentList${l.position?.id}`), !_?.is_reply && _?.position?.id != l.position?.id && !m) {
|
|
190
|
+
const y = `argumentList${_.position.id}`, L = `argumentList${l.position.id}`;
|
|
191
|
+
N.remove(y, [l]), N.add(L, [l]);
|
|
192
192
|
} else
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
N.update(s, [l]);
|
|
194
|
+
k(o.formatMessage({ id: "alert.argument_modify" }), {
|
|
195
195
|
type: "success"
|
|
196
|
-
}),
|
|
196
|
+
}), de();
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
}, Ee = () => {
|
|
200
|
-
if (!
|
|
201
|
-
|
|
200
|
+
if (!ne) {
|
|
201
|
+
ae(!0);
|
|
202
202
|
const e = setTimeout(() => {
|
|
203
|
-
|
|
203
|
+
ae(!1);
|
|
204
204
|
}, 2e3);
|
|
205
205
|
return () => clearTimeout(e);
|
|
206
206
|
}
|
|
207
|
-
},
|
|
208
|
-
g ? Y({ loginAction: "argument" }) :
|
|
207
|
+
}, j = () => {
|
|
208
|
+
g ? Y({ loginAction: "argument" }) : ie(!0);
|
|
209
209
|
}, Ve = () => {
|
|
210
|
-
const e =
|
|
210
|
+
const e = x.find(
|
|
211
211
|
(t) => t.id === d
|
|
212
212
|
);
|
|
213
213
|
if (e)
|
|
214
|
-
return
|
|
214
|
+
return o.formatMessage(
|
|
215
215
|
{
|
|
216
216
|
id: "info.argument_side_limit",
|
|
217
217
|
defaultMessage: "You have reached the argument limit (10) for position {position}."
|
|
@@ -219,24 +219,24 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
219
219
|
{ position: e.name }
|
|
220
220
|
);
|
|
221
221
|
};
|
|
222
|
-
return /* @__PURE__ */
|
|
223
|
-
|
|
222
|
+
return /* @__PURE__ */ M("div", { className: n.inputContainer, children: [
|
|
223
|
+
z && /* @__PURE__ */ i("div", { className: n.disabledInputMask, children: re ? o.formatMessage({
|
|
224
224
|
id: "input.argument_input.user_banned",
|
|
225
225
|
defaultMessage: "You are banned from the debate space."
|
|
226
|
-
}) :
|
|
226
|
+
}) : o.formatMessage({
|
|
227
227
|
id: "info.debate_is_inactive",
|
|
228
228
|
defaultMessage: "Debate is closed"
|
|
229
229
|
}) }),
|
|
230
230
|
/* @__PURE__ */ i(
|
|
231
231
|
"div",
|
|
232
232
|
{
|
|
233
|
-
className:
|
|
234
|
-
[n.flash]:
|
|
233
|
+
className: I(n.argumentInput, {
|
|
234
|
+
[n.flash]: ne,
|
|
235
235
|
[n.replyInputContainer]: r
|
|
236
236
|
}),
|
|
237
|
-
children: /* @__PURE__ */ i("div", { "data-tid": "action_add_argument", ref:
|
|
238
|
-
a.length > 0 &&
|
|
239
|
-
/* @__PURE__ */ i("div", { children:
|
|
237
|
+
children: /* @__PURE__ */ i("div", { "data-tid": "action_add_argument", ref: X, children: /* @__PURE__ */ M("div", { className: n.argumentInputBox, children: [
|
|
238
|
+
a.length > 0 && C && (!r || !R) && /* @__PURE__ */ M("div", { className: n.userPosition, children: [
|
|
239
|
+
/* @__PURE__ */ i("div", { children: o.formatMessage({
|
|
240
240
|
id: "input.position",
|
|
241
241
|
defaultMessage: "Your position"
|
|
242
242
|
}) }),
|
|
@@ -250,10 +250,10 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
250
250
|
}
|
|
251
251
|
)
|
|
252
252
|
] }),
|
|
253
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ M(
|
|
254
254
|
"div",
|
|
255
255
|
{
|
|
256
|
-
className:
|
|
256
|
+
className: I(n.argumentTextInputBox, {
|
|
257
257
|
[n.argumentTextInputBoxisTablet]: !m,
|
|
258
258
|
[n.replyEditorRow]: r
|
|
259
259
|
}),
|
|
@@ -261,21 +261,21 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
261
261
|
/* @__PURE__ */ i(
|
|
262
262
|
"div",
|
|
263
263
|
{
|
|
264
|
-
className:
|
|
264
|
+
className: I(n.argumentAuthorContainer, {
|
|
265
265
|
[n.argumentAuthorContainerMobile]: m,
|
|
266
|
-
[n.argumentAuthorContainerActivated]: !m &&
|
|
266
|
+
[n.argumentAuthorContainerActivated]: !m && w || r
|
|
267
267
|
}),
|
|
268
|
-
children: !m &&
|
|
268
|
+
children: !m && w || r ? /* @__PURE__ */ i(
|
|
269
269
|
et,
|
|
270
270
|
{
|
|
271
271
|
avatarUrl: u.image_url,
|
|
272
272
|
userName: u.full_name,
|
|
273
|
-
size:
|
|
273
|
+
size: fe
|
|
274
274
|
}
|
|
275
275
|
) : /* @__PURE__ */ i(
|
|
276
276
|
tt,
|
|
277
277
|
{
|
|
278
|
-
fullName: u?.full_name ||
|
|
278
|
+
fullName: u?.full_name || o.formatMessage({ id: "default_author.full_name" }),
|
|
279
279
|
avatarUrl: u?.image_url,
|
|
280
280
|
points: u?.points || 0,
|
|
281
281
|
slug: u?.hash_id
|
|
@@ -283,12 +283,12 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
283
283
|
)
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ M(
|
|
287
287
|
"div",
|
|
288
288
|
{
|
|
289
|
-
onClick:
|
|
289
|
+
onClick: j,
|
|
290
290
|
"data-testid": "argument-input",
|
|
291
|
-
className:
|
|
291
|
+
className: I(n.textEditorBox, {
|
|
292
292
|
[n.replyTextEditorBox]: r
|
|
293
293
|
}),
|
|
294
294
|
children: [
|
|
@@ -301,35 +301,35 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
301
301
|
handleSourcesChange: (e) => {
|
|
302
302
|
Pe(e);
|
|
303
303
|
},
|
|
304
|
-
placeholder:
|
|
305
|
-
"aria-label":
|
|
304
|
+
placeholder: pe,
|
|
305
|
+
"aria-label": o.formatMessage({
|
|
306
306
|
id: "input.argument_input.aria_label",
|
|
307
307
|
defaultMessage: "Message input field"
|
|
308
308
|
}),
|
|
309
|
-
onSubmit:
|
|
310
|
-
sources:
|
|
311
|
-
hideSourceAction:
|
|
312
|
-
uid: `Argument${
|
|
313
|
-
onActivation:
|
|
314
|
-
showStylesControls:
|
|
315
|
-
disabled:
|
|
309
|
+
onSubmit: Le,
|
|
310
|
+
sources: U,
|
|
311
|
+
hideSourceAction: he || g,
|
|
312
|
+
uid: `Argument${b}`,
|
|
313
|
+
onActivation: j,
|
|
314
|
+
showStylesControls: w,
|
|
315
|
+
disabled: z || g || re,
|
|
316
316
|
maxLength: g ? !1 : h?.actions?.argumentMaxLength,
|
|
317
317
|
disableRichText: h?.actions?.disableRichText || g,
|
|
318
318
|
shortBar: r,
|
|
319
319
|
hideSubmit: g,
|
|
320
320
|
allowedDomains: h?.allowed_sources,
|
|
321
|
-
active:
|
|
322
|
-
hideCharCount:
|
|
323
|
-
disableAutoActivate:
|
|
321
|
+
active: P,
|
|
322
|
+
hideCharCount: ve,
|
|
323
|
+
disableAutoActivate: be
|
|
324
324
|
}
|
|
325
325
|
),
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
E?.content && /* @__PURE__ */ i("div", { className: n.argumentInputWarning, children: E && Object.values(E).map((e, t) => /* @__PURE__ */ i("div", { children: e }, t)) }),
|
|
327
|
+
w && x?.find(
|
|
328
328
|
(e) => e.id === d
|
|
329
|
-
) && /* @__PURE__ */
|
|
329
|
+
) && /* @__PURE__ */ M(
|
|
330
330
|
"div",
|
|
331
331
|
{
|
|
332
|
-
className:
|
|
332
|
+
className: I(
|
|
333
333
|
n.argumentInputWarning,
|
|
334
334
|
n.disabledPositionWarning
|
|
335
335
|
),
|
|
@@ -347,8 +347,8 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
347
347
|
]
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
w && K && !Me && /* @__PURE__ */ i("div", { className: n.guideMessage, children: /* @__PURE__ */ i(
|
|
351
|
+
me,
|
|
352
352
|
{
|
|
353
353
|
id: "alert.guide_message",
|
|
354
354
|
defaultMessage: "Contributions must comply with our {userCharter}.",
|
|
@@ -357,11 +357,11 @@ const it = Ye(() => import("../../modal/side_modal/index.js").then((I) => ({ def
|
|
|
357
357
|
"a",
|
|
358
358
|
{
|
|
359
359
|
className: n.guideMessage,
|
|
360
|
-
href:
|
|
360
|
+
href: K,
|
|
361
361
|
target: "_blank",
|
|
362
362
|
rel: "noreferrer",
|
|
363
363
|
children: /* @__PURE__ */ i(
|
|
364
|
-
|
|
364
|
+
me,
|
|
365
365
|
{
|
|
366
366
|
id: "alert.user_charter",
|
|
367
367
|
defaultMessage: "user charter"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
1
|
+
import { jsx as c, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import h from "classnames";
|
|
3
3
|
import { useState as b, useEffect as p } from "react";
|
|
4
|
-
import
|
|
4
|
+
import t from "./Select.module.scss.js";
|
|
5
5
|
import { Dropdown as k } from "../../dialog/dropdown/Dropdown.js";
|
|
6
6
|
import { Icon as y } from "../../icons/icon/Icon.js";
|
|
7
|
-
const
|
|
7
|
+
const N = ({
|
|
8
8
|
options: a,
|
|
9
9
|
defaultOption: n,
|
|
10
10
|
onChange: s,
|
|
@@ -13,7 +13,7 @@ const I = ({
|
|
|
13
13
|
className: m,
|
|
14
14
|
horizontalPosition: v = "left"
|
|
15
15
|
}) => {
|
|
16
|
-
const d = n ? a.filter((e) => e.name === n)[0] : a[0], [
|
|
16
|
+
const d = n ? a.filter((e) => e.name === n)[0] : a[0], [u, l] = b(d);
|
|
17
17
|
p(() => {
|
|
18
18
|
i === !0 && l(d);
|
|
19
19
|
}, [i]), p(() => {
|
|
@@ -22,29 +22,29 @@ const I = ({
|
|
|
22
22
|
const w = (e) => {
|
|
23
23
|
l(e), s && s(e);
|
|
24
24
|
}, x = (e) => {
|
|
25
|
-
const
|
|
25
|
+
const r = e.currentTarget;
|
|
26
26
|
switch (e.key) {
|
|
27
27
|
case "Enter":
|
|
28
28
|
case " ":
|
|
29
|
-
e.preventDefault(),
|
|
29
|
+
e.preventDefault(), r.click();
|
|
30
30
|
break;
|
|
31
31
|
case "ArrowDown":
|
|
32
|
-
e.preventDefault(),
|
|
32
|
+
e.preventDefault(), r.nextElementSibling?.focus();
|
|
33
33
|
break;
|
|
34
34
|
case "ArrowUp":
|
|
35
|
-
e.preventDefault(),
|
|
35
|
+
e.preventDefault(), r.previousElementSibling?.focus();
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
38
|
}, D = (e) => {
|
|
39
|
-
const
|
|
39
|
+
const r = u?.name === e.name;
|
|
40
40
|
return e.name !== "" && /* @__PURE__ */ c(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
43
|
role: "option",
|
|
44
|
-
"aria-selected":
|
|
44
|
+
"aria-selected": r,
|
|
45
45
|
tabIndex: 0,
|
|
46
|
-
className: h(
|
|
47
|
-
[
|
|
46
|
+
className: h(t.selectOption, {
|
|
47
|
+
[t.selectOptionActive]: r
|
|
48
48
|
}),
|
|
49
49
|
value: e.value,
|
|
50
50
|
"data-tid": e.dataTid,
|
|
@@ -55,22 +55,22 @@ const I = ({
|
|
|
55
55
|
e.value
|
|
56
56
|
);
|
|
57
57
|
};
|
|
58
|
-
return /* @__PURE__ */ c("div", { className:
|
|
59
|
-
/* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ c("div", { className: t.selectContainer, children: /* @__PURE__ */ f(k, { horizontalPosition: v, closeOnContentClick: !0, children: [
|
|
59
|
+
/* @__PURE__ */ f(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
|
-
className: h(
|
|
62
|
+
className: h(t.selectInput, {
|
|
63
63
|
[m]: m,
|
|
64
|
-
[
|
|
64
|
+
[t.disabled]: o
|
|
65
65
|
}),
|
|
66
66
|
children: [
|
|
67
|
-
/* @__PURE__ */ c("span", { className:
|
|
67
|
+
/* @__PURE__ */ c("span", { className: t.currentOptionText, children: u?.text }),
|
|
68
68
|
" ",
|
|
69
69
|
/* @__PURE__ */ c(
|
|
70
70
|
y,
|
|
71
71
|
{
|
|
72
72
|
name: "lightArrow",
|
|
73
|
-
className:
|
|
73
|
+
className: t.arrowDown,
|
|
74
74
|
height: 10,
|
|
75
75
|
width: 10
|
|
76
76
|
}
|
|
@@ -82,5 +82,5 @@ const I = ({
|
|
|
82
82
|
] }) });
|
|
83
83
|
};
|
|
84
84
|
export {
|
|
85
|
-
|
|
85
|
+
N as Select
|
|
86
86
|
};
|