@logora/debate 0.4.2 → 0.4.3
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/share/share_button/{ShareButton.module-BS6STEUD.css → ShareButton.module-BnVEYTzr.css} +1 -1
- package/dist/components/share/share_button/ShareButton.js +26 -24
- package/dist/components/share/share_button/ShareButton.module.scss.js +5 -3
- package/dist/components/user_content/content_footer/ContentFooter.js +31 -30
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._shareButtonContainer_139ll_3{display:flex!important;align-content:center!important;justify-content:center!important;padding:0!important;cursor:pointer}._popoverWrapper_139ll_11{position:relative;display:flex!important;align-items:center!important;color:var(--text-primary, #222222)}._popoverWrapper_139ll_11._popoverActive_139ll_18 ._popoverContent_139ll_18{z-index:2;opacity:1;visibility:visible;transform:translate(-50%)}._popoverContent_139ll_18{opacity:0;visibility:hidden;position:absolute;left:25%;top:35px;padding:var(--space-unit, 1em);border:1px solid var(--text-secondary, #5F5F5F);border-radius:var(--box-border-radius, 6px);box-shadow:var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1));background:var(--background-color-primary, white);color:var(--text-primary, #222222);line-height:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5));width:auto}._popoverContent_139ll_18:before{position:absolute;z-index:-1;content:"";right:calc(50% - 10px);top:-10px;border-style:solid;border-width:0 10px 10px 10px;border-color:transparent transparent var(--text-secondary, #5F5F5F) transparent;transition-duration:.3s;transition-property:transform}._popoverContent_139ll_18:after{position:absolute;z-index:-1;content:"";right:calc(50% - 10px);top:-9px;border-style:solid;border-width:0 10px 10px 10px;border-color:transparent transparent var(--background-color-primary, white) transparent;transition-duration:.3s;transition-property:transform}._shareButtonText_139ll_65{padding-left:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._popoverContent_139ll_18._popoverTop_139ll_69{top:auto;bottom:35px}._popoverContent_139ll_18._popoverTop_139ll_69:before{top:auto;bottom:-10px;border-width:10px 10px 0 10px;border-color:var(--text-secondary, #5F5F5F) transparent transparent transparent}._popoverContent_139ll_18._popoverTop_139ll_69:after{top:auto;bottom:-9px;border-width:10px 10px 0 10px;border-color:var(--background-color-primary, white) transparent transparent transparent}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import n from "classnames";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
3
|
+
import { useRef as C, useState as S } from "react";
|
|
4
|
+
import { useIntl as B } from "react-intl";
|
|
5
|
+
import M from "use-onclickoutside";
|
|
6
6
|
import t from "./ShareButton.module.scss.js";
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { ShareBox as
|
|
9
|
-
const
|
|
7
|
+
import { Icon as _ } from "../../icons/icon/Icon.js";
|
|
8
|
+
import { ShareBox as N } from "../share_box/ShareBox.js";
|
|
9
|
+
const T = ({
|
|
10
10
|
showText: m,
|
|
11
11
|
shareUrl: u,
|
|
12
12
|
shareTitle: i,
|
|
@@ -15,48 +15,49 @@ const R = ({
|
|
|
15
15
|
showShareCode: s = !1,
|
|
16
16
|
iconSize: d = 22,
|
|
17
17
|
className: v,
|
|
18
|
-
tooltipPosition: x = "bottom"
|
|
18
|
+
tooltipPosition: x = "bottom",
|
|
19
|
+
popoverPosition: g = "bottom"
|
|
19
20
|
}) => {
|
|
20
|
-
const r =
|
|
21
|
+
const r = C(), l = B(), [c, p] = S(!1), h = (() => {
|
|
21
22
|
let e = u;
|
|
22
23
|
return typeof window < "u" && (e += "?redirect_url=" + window.location.protocol + "//" + window.location.hostname), e;
|
|
23
|
-
})(),
|
|
24
|
-
r && !r.current.contains(e.target) &&
|
|
25
|
-
},
|
|
24
|
+
})(), b = (e) => {
|
|
25
|
+
r && !r.current.contains(e.target) && p(!1);
|
|
26
|
+
}, f = () => {
|
|
26
27
|
if (typeof window < "u") {
|
|
27
28
|
const e = window.matchMedia("(max-width: 600px)");
|
|
28
|
-
typeof window < "u" && window.navigator.share && window.navigator.maxTouchPoints && window.navigator?.maxTouchPoints > 0 && e.matches ?
|
|
29
|
+
typeof window < "u" && window.navigator.share && window.navigator.maxTouchPoints && window.navigator?.maxTouchPoints > 0 && e.matches ? y() : p(!0);
|
|
29
30
|
}
|
|
30
|
-
},
|
|
31
|
+
}, y = () => {
|
|
31
32
|
typeof window < "u" && window.navigator.share({
|
|
32
33
|
text: a,
|
|
33
34
|
title: i,
|
|
34
|
-
url:
|
|
35
|
+
url: h
|
|
35
36
|
}).catch((e) => {
|
|
36
37
|
});
|
|
37
38
|
};
|
|
38
|
-
return
|
|
39
|
+
return M(r, b), /* @__PURE__ */ o(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
42
|
tabIndex: "0",
|
|
42
43
|
onKeyDown: (e) => {
|
|
43
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
44
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), f());
|
|
44
45
|
},
|
|
45
46
|
title: l.formatMessage({
|
|
46
47
|
id: "share.share_button.text",
|
|
47
48
|
defaultMessage: "Share"
|
|
48
49
|
}),
|
|
49
50
|
className: n(t.shareButtonContainer, v),
|
|
50
|
-
onClick:
|
|
51
|
+
onClick: f,
|
|
51
52
|
"data-tid": "action_share_button",
|
|
52
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ k(
|
|
53
54
|
"div",
|
|
54
55
|
{
|
|
55
56
|
className: n(t.popoverWrapper, {
|
|
56
57
|
[t.popoverActive]: c
|
|
57
58
|
}),
|
|
58
59
|
children: [
|
|
59
|
-
/* @__PURE__ */ o(
|
|
60
|
+
/* @__PURE__ */ o(_, { name: "share", height: d, width: d }),
|
|
60
61
|
m && /* @__PURE__ */ o("div", { className: t.shareButtonText, children: l.formatMessage({
|
|
61
62
|
id: "share.share_button.text",
|
|
62
63
|
defaultMessage: "Share"
|
|
@@ -66,12 +67,13 @@ const R = ({
|
|
|
66
67
|
{
|
|
67
68
|
ref: r,
|
|
68
69
|
className: n(t.popoverContent, {
|
|
69
|
-
[t.popoverContentWithCode]: s
|
|
70
|
+
[t.popoverContentWithCode]: s,
|
|
71
|
+
[t.popoverTop]: g === "top"
|
|
70
72
|
}),
|
|
71
73
|
children: c && /* @__PURE__ */ o(
|
|
72
|
-
|
|
74
|
+
N,
|
|
73
75
|
{
|
|
74
|
-
shareUrl:
|
|
76
|
+
shareUrl: h,
|
|
75
77
|
shareTitle: i,
|
|
76
78
|
shareText: a,
|
|
77
79
|
showShareCode: s,
|
|
@@ -88,5 +90,5 @@ const R = ({
|
|
|
88
90
|
);
|
|
89
91
|
};
|
|
90
92
|
export {
|
|
91
|
-
|
|
93
|
+
T as ShareButton
|
|
92
94
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import '../../../assets/components/share/share_button/ShareButton.module-
|
|
1
|
+
import '../../../assets/components/share/share_button/ShareButton.module-BnVEYTzr.css';const o = "_shareButtonContainer_139ll_3", t = "_popoverWrapper_139ll_11", e = "_popoverActive_139ll_18", p = "_popoverContent_139ll_18", r = "_shareButtonText_139ll_65", n = "_popoverTop_139ll_69", _ = {
|
|
2
2
|
shareButtonContainer: o,
|
|
3
3
|
popoverWrapper: t,
|
|
4
4
|
popoverActive: e,
|
|
5
5
|
popoverContent: p,
|
|
6
|
-
shareButtonText: r
|
|
6
|
+
shareButtonText: r,
|
|
7
|
+
popoverTop: n
|
|
7
8
|
};
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
_ as default,
|
|
10
11
|
e as popoverActive,
|
|
11
12
|
p as popoverContent,
|
|
13
|
+
n as popoverTop,
|
|
12
14
|
t as popoverWrapper,
|
|
13
15
|
o as shareButtonContainer,
|
|
14
16
|
r as shareButtonText
|
|
@@ -10,12 +10,12 @@ import { useInput as Z } from "../../input/input_provider/useInput.js";
|
|
|
10
10
|
import { useReportContent as $ } from "../use_report_content/useReportContent.js";
|
|
11
11
|
import { useDeleteContent as tt } from "../use_delete_content/useDeleteContent.js";
|
|
12
12
|
import { useResponsive as et } from "../../hooks/use_responsive/useResponsive.js";
|
|
13
|
-
import { Link as
|
|
13
|
+
import { Link as ot } from "../../action/link/Link.js";
|
|
14
14
|
import { Icon as l } from "../../icons/icon/Icon.js";
|
|
15
|
-
import { ShareButton as
|
|
15
|
+
import { ShareButton as nt } 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((
|
|
18
|
-
resource:
|
|
17
|
+
const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ default: o.ShareModal }))), Dt = ({
|
|
18
|
+
resource: o,
|
|
19
19
|
reportType: I,
|
|
20
20
|
deleteType: k,
|
|
21
21
|
deleteListId: N,
|
|
@@ -33,26 +33,26 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
33
33
|
shareModalTitle: z,
|
|
34
34
|
showShareCode: h,
|
|
35
35
|
shareCode: _,
|
|
36
|
-
showShareText:
|
|
37
|
-
enableEdition:
|
|
38
|
-
enableDeletion:
|
|
39
|
-
enableReport:
|
|
36
|
+
showShareText: P,
|
|
37
|
+
enableEdition: T = !0,
|
|
38
|
+
enableDeletion: j = !0,
|
|
39
|
+
enableReport: F = !0,
|
|
40
40
|
containerClassName: B,
|
|
41
41
|
voteActionClassName: L,
|
|
42
42
|
replyRedirectUrl: g
|
|
43
43
|
}) => {
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const n = Q(), y = V(), { currentUser: d } = X(), { showModal: U } = Y(), { setInputContent: W } = Z() || {}, { reportContent: w } = $(I, o.id), { deleteContent: M } = tt(
|
|
45
|
+
o,
|
|
46
46
|
k,
|
|
47
47
|
N,
|
|
48
48
|
x
|
|
49
|
-
), { elementWidth: c } = et(), q = () => d?.id ?
|
|
50
|
-
W(
|
|
49
|
+
), { elementWidth: c } = et(), q = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, v = () => {
|
|
50
|
+
W(o);
|
|
51
51
|
}, G = () => {
|
|
52
|
-
if (
|
|
52
|
+
if (o.created_at && y.actions?.editionTime) {
|
|
53
53
|
const a = new Date(
|
|
54
|
-
new Date(
|
|
55
|
-
new Date(
|
|
54
|
+
new Date(o.created_at).setSeconds(
|
|
55
|
+
new Date(o.created_at).getSeconds() + y.actions?.editionTime
|
|
56
56
|
)
|
|
57
57
|
);
|
|
58
58
|
return /* @__PURE__ */ new Date() < a;
|
|
@@ -88,7 +88,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
!m && S && /* @__PURE__ */ t("div", { "data-tid": "action_reply_argument", "data-testid": "reply-button", children: g ? /* @__PURE__ */ r(
|
|
91
|
-
|
|
91
|
+
ot,
|
|
92
92
|
{
|
|
93
93
|
to: g,
|
|
94
94
|
className: e.replyAction,
|
|
@@ -104,7 +104,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
104
104
|
width: 17
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
!(c < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children:
|
|
107
|
+
!(c < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
|
|
108
108
|
id: "user_content.content_footer.reply",
|
|
109
109
|
defaultMessage: "Reply"
|
|
110
110
|
}) })
|
|
@@ -127,7 +127,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
127
127
|
width: 17
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
|
-
!(c < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children:
|
|
130
|
+
!(c < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
|
|
131
131
|
id: "user_content.content_footer.reply",
|
|
132
132
|
defaultMessage: "Reply"
|
|
133
133
|
}) })
|
|
@@ -135,22 +135,23 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
135
135
|
}
|
|
136
136
|
) }),
|
|
137
137
|
E && /* @__PURE__ */ t(
|
|
138
|
-
|
|
138
|
+
nt,
|
|
139
139
|
{
|
|
140
140
|
shareUrl: p,
|
|
141
141
|
shareTitle: u,
|
|
142
142
|
shareText: f,
|
|
143
143
|
showShareCode: h,
|
|
144
144
|
shareCode: _,
|
|
145
|
-
showText: !(c < 768) &&
|
|
146
|
-
iconSize: 17
|
|
145
|
+
showText: !(c < 768) && P,
|
|
146
|
+
iconSize: 17,
|
|
147
|
+
popoverPosition: "top"
|
|
147
148
|
}
|
|
148
149
|
),
|
|
149
150
|
K && /* @__PURE__ */ t(
|
|
150
151
|
"div",
|
|
151
152
|
{
|
|
152
153
|
className: e.moreAction,
|
|
153
|
-
title:
|
|
154
|
+
title: n.formatMessage({
|
|
154
155
|
id: "user_content.content_footer.more",
|
|
155
156
|
defaultMessage: "More options"
|
|
156
157
|
}),
|
|
@@ -168,7 +169,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
168
169
|
width: 17,
|
|
169
170
|
height: 17,
|
|
170
171
|
"data-testid": "dropdown",
|
|
171
|
-
"aria-label":
|
|
172
|
+
"aria-label": n.formatMessage({
|
|
172
173
|
id: "user_content.content_footer.menu.aria_label",
|
|
173
174
|
defaultMessage: "opens menu"
|
|
174
175
|
})
|
|
@@ -176,7 +177,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
176
177
|
),
|
|
177
178
|
/* @__PURE__ */ r("div", { children: [
|
|
178
179
|
q() && /* @__PURE__ */ r(H, { children: [
|
|
179
|
-
!m &&
|
|
180
|
+
!m && T && G() && /* @__PURE__ */ t(
|
|
180
181
|
"div",
|
|
181
182
|
{
|
|
182
183
|
"data-tid": "action_edit_argument",
|
|
@@ -184,13 +185,13 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
184
185
|
tabIndex: "0",
|
|
185
186
|
onClick: v,
|
|
186
187
|
onKeyDown: i(v),
|
|
187
|
-
children:
|
|
188
|
+
children: n.formatMessage({
|
|
188
189
|
id: "user_content.content_footer.update",
|
|
189
190
|
defaultMessage: "Update"
|
|
190
191
|
})
|
|
191
192
|
}
|
|
192
193
|
),
|
|
193
|
-
|
|
194
|
+
j && /* @__PURE__ */ t(
|
|
194
195
|
"div",
|
|
195
196
|
{
|
|
196
197
|
"data-tid": "action_delete_argument",
|
|
@@ -198,14 +199,14 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
198
199
|
tabIndex: "0",
|
|
199
200
|
onClick: M,
|
|
200
201
|
onKeyDown: i(M),
|
|
201
|
-
children:
|
|
202
|
+
children: n.formatMessage({
|
|
202
203
|
id: "user_content.content_footer.delete",
|
|
203
204
|
defaultMessage: "Delete"
|
|
204
205
|
})
|
|
205
206
|
}
|
|
206
207
|
)
|
|
207
208
|
] }),
|
|
208
|
-
|
|
209
|
+
F && /* @__PURE__ */ t(
|
|
209
210
|
"div",
|
|
210
211
|
{
|
|
211
212
|
"data-tid": "action_report_argument",
|
|
@@ -214,7 +215,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
214
215
|
onClick: w,
|
|
215
216
|
"data-testid": "report-content",
|
|
216
217
|
onKeyDown: i(w),
|
|
217
|
-
children:
|
|
218
|
+
children: n.formatMessage({
|
|
218
219
|
id: "user_content.content_footer.report",
|
|
219
220
|
defaultMessage: "Report"
|
|
220
221
|
})
|
|
@@ -228,7 +229,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((n) => ({ def
|
|
|
228
229
|
tabIndex: "0",
|
|
229
230
|
onClick: D,
|
|
230
231
|
onKeyDown: i(D),
|
|
231
|
-
children:
|
|
232
|
+
children: n.formatMessage({
|
|
232
233
|
id: "user_content.content_footer.share",
|
|
233
234
|
defaultMessage: "Share"
|
|
234
235
|
})
|