@logora/debate 0.3.118 → 0.3.119
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/dialog/dropdown/Dropdown.module-BmT3rAwz.css +1 -0
- package/dist/components/dialog/dropdown/Dropdown.js +19 -17
- package/dist/components/dialog/dropdown/Dropdown.module.scss.js +17 -13
- package/dist/components/user_content/content_footer/ContentFooter.js +15 -14
- package/package.json +1 -1
- package/dist/assets/components/dialog/dropdown/Dropdown.module-FG2Sqrqs.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._dropdownWrapper_7839n_3{position:relative;display:inline-block}._dropdownHeader_7839n_8{border:none;padding:0!important;cursor:pointer;background-color:var(--background-color-primary, white)}._dropdownHeader_7839n_8:focus:not(:focus-visible){outline:none;box-shadow:none}._dropdownList_7839n_19{position:absolute;z-index:3;background:var(--background-color-primary, white);box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));border-radius:var(--box-border-radius, 6px);overscroll-behavior-y:contain;width:max-content}._bottom_7839n_30{top:calc(100% + 2px)}._top_7839n_34{bottom:calc(100% + 2px)}._left_7839n_38{left:0!important}._right_7839n_42{right:0!important}._center_7839n_46{left:50%;transform:translate(-50%)}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import m from "classnames";
|
|
3
|
+
import { useState as x, useRef as b, useEffect as E } from "react";
|
|
4
4
|
import t from "./Dropdown.module.scss.js";
|
|
5
|
-
const
|
|
5
|
+
const y = ({
|
|
6
6
|
onClick: s,
|
|
7
|
-
horizontalPosition:
|
|
7
|
+
horizontalPosition: d = "left",
|
|
8
|
+
verticalPosition: c = "bottom",
|
|
8
9
|
disabled: l = !1,
|
|
9
|
-
closeOnContentClick:
|
|
10
|
-
className:
|
|
10
|
+
closeOnContentClick: p = !1,
|
|
11
|
+
className: f,
|
|
11
12
|
dropdownClassName: a,
|
|
12
|
-
children:
|
|
13
|
+
children: u
|
|
13
14
|
}) => {
|
|
14
|
-
const [r, o] =
|
|
15
|
+
const [r, o] = x(!1), n = b(null), w = () => {
|
|
15
16
|
l || (s && s(), o(!r));
|
|
16
17
|
};
|
|
17
18
|
return E(() => {
|
|
@@ -19,11 +20,11 @@ const k = ({
|
|
|
19
20
|
n.current && !n.current.contains(v.target) && o(!1);
|
|
20
21
|
};
|
|
21
22
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
22
|
-
}, []), /* @__PURE__ */
|
|
23
|
+
}, []), /* @__PURE__ */ g(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
26
|
ref: n,
|
|
26
|
-
className:
|
|
27
|
+
className: m(t.dropdownWrapper, { [f]: f }),
|
|
27
28
|
children: [
|
|
28
29
|
/* @__PURE__ */ i(
|
|
29
30
|
"button",
|
|
@@ -31,20 +32,21 @@ const k = ({
|
|
|
31
32
|
type: "button",
|
|
32
33
|
"aria-expanded": r,
|
|
33
34
|
className: t.dropdownHeader,
|
|
34
|
-
onClick:
|
|
35
|
-
children:
|
|
35
|
+
onClick: w,
|
|
36
|
+
children: u[0]
|
|
36
37
|
}
|
|
37
38
|
),
|
|
38
39
|
r && /* @__PURE__ */ i(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
|
-
className: a ||
|
|
42
|
+
className: a || m(t.dropdownList, {
|
|
43
|
+
[t[d]]: d,
|
|
42
44
|
[t[c]]: c
|
|
43
45
|
}),
|
|
44
46
|
onClick: (e) => {
|
|
45
|
-
(
|
|
47
|
+
(p || e.target === e.currentTarget) && o(!1);
|
|
46
48
|
},
|
|
47
|
-
children:
|
|
49
|
+
children: u[1]
|
|
48
50
|
}
|
|
49
51
|
)
|
|
50
52
|
]
|
|
@@ -52,5 +54,5 @@ const k = ({
|
|
|
52
54
|
);
|
|
53
55
|
};
|
|
54
56
|
export {
|
|
55
|
-
|
|
57
|
+
y as Dropdown
|
|
56
58
|
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import '../../../assets/components/dialog/dropdown/Dropdown.module-
|
|
2
|
-
dropdownWrapper:
|
|
3
|
-
dropdownHeader:
|
|
4
|
-
dropdownList:
|
|
5
|
-
|
|
1
|
+
import '../../../assets/components/dialog/dropdown/Dropdown.module-BmT3rAwz.css';const o = "_dropdownWrapper_7839n_3", t = "_dropdownHeader_7839n_8", n = "_dropdownList_7839n_19", r = "_bottom_7839n_30", _ = "_top_7839n_34", d = "_left_7839n_38", e = "_right_7839n_42", p = "_center_7839n_46", s = {
|
|
2
|
+
dropdownWrapper: o,
|
|
3
|
+
dropdownHeader: t,
|
|
4
|
+
dropdownList: n,
|
|
5
|
+
bottom: r,
|
|
6
|
+
top: _,
|
|
7
|
+
left: d,
|
|
6
8
|
right: e,
|
|
7
|
-
center:
|
|
9
|
+
center: p
|
|
8
10
|
};
|
|
9
11
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
r as bottom,
|
|
13
|
+
p as center,
|
|
14
|
+
s as default,
|
|
15
|
+
t as dropdownHeader,
|
|
16
|
+
n as dropdownList,
|
|
17
|
+
o as dropdownWrapper,
|
|
18
|
+
d as left,
|
|
19
|
+
e as right,
|
|
20
|
+
_ as top
|
|
17
21
|
};
|
|
@@ -14,7 +14,7 @@ import { Link as nt } from "../../action/link/Link.js";
|
|
|
14
14
|
import { Icon as l } from "../../icons/icon/Icon.js";
|
|
15
15
|
import { ShareButton as ot } from "../../share/share_button/ShareButton.js";
|
|
16
16
|
import { Dropdown as at } from "../../dialog/dropdown/Dropdown.js";
|
|
17
|
-
const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ default: n.ShareModal }))),
|
|
17
|
+
const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ default: n.ShareModal }))), Dt = ({
|
|
18
18
|
resource: n,
|
|
19
19
|
reportType: I,
|
|
20
20
|
deleteType: k,
|
|
@@ -36,9 +36,9 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
36
36
|
showShareText: T,
|
|
37
37
|
enableEdition: j = !0,
|
|
38
38
|
enableDeletion: F = !0,
|
|
39
|
-
enableReport:
|
|
40
|
-
containerClassName:
|
|
41
|
-
voteActionClassName:
|
|
39
|
+
enableReport: P = !0,
|
|
40
|
+
containerClassName: B,
|
|
41
|
+
voteActionClassName: L,
|
|
42
42
|
replyRedirectUrl: g
|
|
43
43
|
}) => {
|
|
44
44
|
const o = Q(), y = V(), { currentUser: d } = X(), { showModal: U } = Y(), { setInputContent: W } = Z() || {}, { reportContent: w } = $(I, n.id), { deleteContent: M } = tt(
|
|
@@ -46,7 +46,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
46
46
|
k,
|
|
47
47
|
N,
|
|
48
48
|
x
|
|
49
|
-
), { elementWidth: c } = et(), q = () => d?.id ? n.author?.id === d?.id || n.debate_suggestion?.author?.id === d?.id : !1,
|
|
49
|
+
), { elementWidth: c } = et(), q = () => d?.id ? n.author?.id === d?.id || n.debate_suggestion?.author?.id === d?.id : !1, v = () => {
|
|
50
50
|
W(n);
|
|
51
51
|
}, G = () => {
|
|
52
52
|
if (n.created_at && y.actions?.editionTime) {
|
|
@@ -58,7 +58,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
58
58
|
return /* @__PURE__ */ new Date() < a;
|
|
59
59
|
}
|
|
60
60
|
return !0;
|
|
61
|
-
},
|
|
61
|
+
}, D = () => {
|
|
62
62
|
U(
|
|
63
63
|
/* @__PURE__ */ t(J, { fallback: null, children: /* @__PURE__ */ t(
|
|
64
64
|
rt,
|
|
@@ -75,14 +75,14 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
75
75
|
}, i = (a) => (s) => {
|
|
76
76
|
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), a());
|
|
77
77
|
};
|
|
78
|
-
return /* @__PURE__ */ r("div", { className: b(e.container,
|
|
78
|
+
return /* @__PURE__ */ r("div", { className: b(e.container, B), children: [
|
|
79
79
|
/* @__PURE__ */ t(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
onKeyDown: (a) => {
|
|
83
83
|
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), onClick());
|
|
84
84
|
},
|
|
85
|
-
className: b(e.voteAction,
|
|
85
|
+
className: b(e.voteAction, L),
|
|
86
86
|
"data-tid": "action_vote_argument",
|
|
87
87
|
children: C
|
|
88
88
|
}
|
|
@@ -159,6 +159,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
159
159
|
{
|
|
160
160
|
className: e.moreActionDropdown,
|
|
161
161
|
horizontalPosition: "right",
|
|
162
|
+
verticalPosition: "top",
|
|
162
163
|
children: [
|
|
163
164
|
/* @__PURE__ */ t(
|
|
164
165
|
l,
|
|
@@ -181,8 +182,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
181
182
|
"data-tid": "action_edit_argument",
|
|
182
183
|
className: e.dropdownItem,
|
|
183
184
|
tabIndex: "0",
|
|
184
|
-
onClick:
|
|
185
|
-
onKeyDown: i(
|
|
185
|
+
onClick: v,
|
|
186
|
+
onKeyDown: i(v),
|
|
186
187
|
children: o.formatMessage({
|
|
187
188
|
id: "user_content.content_footer.update",
|
|
188
189
|
defaultMessage: "Update"
|
|
@@ -204,7 +205,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
204
205
|
}
|
|
205
206
|
)
|
|
206
207
|
] }),
|
|
207
|
-
|
|
208
|
+
P && /* @__PURE__ */ t(
|
|
208
209
|
"div",
|
|
209
210
|
{
|
|
210
211
|
"data-tid": "action_report_argument",
|
|
@@ -225,8 +226,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
225
226
|
"data-tid": "action_share_argument",
|
|
226
227
|
className: e.dropdownItem,
|
|
227
228
|
tabIndex: "0",
|
|
228
|
-
onClick:
|
|
229
|
-
onKeyDown: i(
|
|
229
|
+
onClick: D,
|
|
230
|
+
onKeyDown: i(D),
|
|
230
231
|
children: o.formatMessage({
|
|
231
232
|
id: "user_content.content_footer.share",
|
|
232
233
|
defaultMessage: "Share"
|
|
@@ -242,5 +243,5 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
242
243
|
] });
|
|
243
244
|
};
|
|
244
245
|
export {
|
|
245
|
-
|
|
246
|
+
Dt as ContentFooter
|
|
246
247
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._dropdownWrapper_zrxfa_3{position:relative;display:inline-block}._dropdownHeader_zrxfa_8{border:none;padding:0!important;cursor:pointer;background-color:var(--background-color-primary, white)}._dropdownHeader_zrxfa_8:focus:not(:focus-visible){outline:none;box-shadow:none}._dropdownList_zrxfa_19{position:absolute;top:calc(100% + 2px);z-index:3;background:var(--background-color-primary, white);box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));border:var(--box-border, 1px solid rgba(7, 42, 68, .1));border-radius:var(--box-border-radius, 6px);overscroll-behavior-y:contain;width:max-content}._left_zrxfa_31{left:0!important}._right_zrxfa_35{right:0!important}._center_zrxfa_39{left:50%;transform:translate(-50%)}
|