@logora/debate 0.4.37 → 0.4.38

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.
@@ -1,7 +1,7 @@
1
1
  import { jsxs as r, jsx as t, Fragment as H } from "react/jsx-runtime";
2
2
  import { Suspense as J, lazy as O } from "react";
3
3
  import { useIntl as Q } from "react-intl";
4
- import b from "classnames";
4
+ import D from "classnames";
5
5
  import e from "./ContentFooter.module.scss.js";
6
6
  import { useConfig as V } from "../../data/config_provider/useConfig.js";
7
7
  import { useAuth as X } from "../../auth/use_auth/useAuth.js";
@@ -11,92 +11,92 @@ 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
13
  import { Link as ot } from "../../action/link/Link.js";
14
- import { Icon as l } from "../../icons/icon/Icon.js";
14
+ import { Icon as c } from "../../icons/icon/Icon.js";
15
15
  import { ShareButton as nt } from "../../share/share_button/ShareButton.js";
16
16
  import { Dropdown as at } from "../../dialog/dropdown/Dropdown.js";
17
17
  const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ default: o.ShareModal }))), Dt = ({
18
18
  resource: o,
19
- reportType: I,
20
- deleteType: k,
21
- deleteListId: N,
22
- softDelete: x = !1,
23
- disabled: m = !1,
19
+ reportType: b,
20
+ deleteType: I,
21
+ deleteListId: k,
22
+ softDelete: N = !1,
23
+ disabled: x = !1,
24
24
  children: C,
25
25
  enableReply: S,
26
26
  handleReplyTo: A,
27
27
  showActions: K = !0,
28
28
  showShareButton: E = !0,
29
29
  shareModal: R,
30
- shareUrl: p,
31
- shareTitle: u,
32
- shareText: f,
30
+ shareUrl: m,
31
+ shareTitle: p,
32
+ shareText: u,
33
33
  shareModalTitle: z,
34
- showShareCode: h,
35
- shareCode: _,
34
+ showShareCode: f,
35
+ shareCode: h,
36
36
  showShareText: P,
37
37
  enableEdition: T = !0,
38
38
  enableDeletion: j = !0,
39
39
  enableReport: F = !0,
40
40
  containerClassName: B,
41
41
  voteActionClassName: L,
42
- replyRedirectUrl: g
42
+ replyRedirectUrl: _
43
43
  }) => {
44
- const n = Q(), y = V(), { currentUser: d } = X(), { showModal: U } = Y(), { setInputContent: W } = Z() || {}, { reportContent: w } = $(I, o.id), { deleteContent: M } = tt(
44
+ const n = Q(), g = V(), { currentUser: d } = X(), { showModal: U } = Y(), { setInputContent: W } = Z() || {}, { reportContent: y } = $(b, o.id), { deleteContent: w } = tt(
45
45
  o,
46
+ I,
46
47
  k,
47
- N,
48
- x
49
- ), { elementWidth: c } = et(), q = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, v = () => {
48
+ N
49
+ ), { elementWidth: l } = et(), q = () => d?.id ? o.author?.id === d?.id || o.debate_suggestion?.author?.id === d?.id : !1, M = () => {
50
50
  W(o);
51
51
  }, G = () => {
52
- if (o.created_at && y.actions?.editionTime) {
52
+ if (o.created_at && g.actions?.editionTime) {
53
53
  const a = new Date(
54
54
  new Date(o.created_at).setSeconds(
55
- new Date(o.created_at).getSeconds() + y.actions?.editionTime
55
+ new Date(o.created_at).getSeconds() + g.actions?.editionTime
56
56
  )
57
57
  );
58
58
  return /* @__PURE__ */ new Date() < a;
59
59
  }
60
60
  return !0;
61
- }, D = () => {
61
+ }, v = () => {
62
62
  U(
63
63
  /* @__PURE__ */ t(J, { fallback: null, children: /* @__PURE__ */ t(
64
64
  rt,
65
65
  {
66
- shareUrl: p,
67
- shareTitle: u,
68
- shareText: f,
66
+ shareUrl: m,
67
+ shareTitle: p,
68
+ shareText: u,
69
69
  title: z,
70
- showShareCode: h,
71
- shareCode: _
70
+ showShareCode: f,
71
+ shareCode: h
72
72
  }
73
73
  ) })
74
74
  );
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, B), children: [
78
+ return /* @__PURE__ */ r("div", { className: D(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, L),
85
+ className: D(e.voteAction, L),
86
86
  "data-tid": "action_vote_argument",
87
87
  children: C
88
88
  }
89
89
  ),
90
- !m && S && /* @__PURE__ */ t("div", { "data-tid": "action_reply_argument", "data-testid": "reply-button", children: g ? /* @__PURE__ */ r(
90
+ !x && S && /* @__PURE__ */ t("div", { "data-tid": "action_reply_argument", "data-testid": "reply-button", children: _ ? /* @__PURE__ */ r(
91
91
  ot,
92
92
  {
93
- to: g,
93
+ to: _,
94
94
  className: e.replyAction,
95
95
  tabIndex: "0",
96
96
  "data-testid": "action-reply-button",
97
97
  children: [
98
98
  /* @__PURE__ */ t(
99
- l,
99
+ c,
100
100
  {
101
101
  name: "reply",
102
102
  "data-tid": "action_reply_argument",
@@ -104,7 +104,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
104
104
  width: 17
105
105
  }
106
106
  ),
107
- !(c < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
107
+ !(l < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
108
108
  id: "user_content.content_footer.reply",
109
109
  defaultMessage: "Reply"
110
110
  }) })
@@ -119,7 +119,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
119
119
  "data-testid": "action-reply-button",
120
120
  children: [
121
121
  /* @__PURE__ */ t(
122
- l,
122
+ c,
123
123
  {
124
124
  name: "reply",
125
125
  "data-tid": "action_reply_argument",
@@ -127,7 +127,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
127
127
  width: 17
128
128
  }
129
129
  ),
130
- !(c < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
130
+ !(l < 768) && /* @__PURE__ */ t("span", { className: e.replyText, children: n.formatMessage({
131
131
  id: "user_content.content_footer.reply",
132
132
  defaultMessage: "Reply"
133
133
  }) })
@@ -137,12 +137,12 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
137
137
  E && /* @__PURE__ */ t(
138
138
  nt,
139
139
  {
140
- shareUrl: p,
141
- shareTitle: u,
142
- shareText: f,
143
- showShareCode: h,
144
- shareCode: _,
145
- showText: !(c < 768) && P,
140
+ shareUrl: m,
141
+ shareTitle: p,
142
+ shareText: u,
143
+ showShareCode: f,
144
+ shareCode: h,
145
+ showText: !(l < 768) && P,
146
146
  iconSize: 17,
147
147
  popoverPosition: "top"
148
148
  }
@@ -163,7 +163,7 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
163
163
  verticalPosition: "top",
164
164
  children: [
165
165
  /* @__PURE__ */ t(
166
- l,
166
+ c,
167
167
  {
168
168
  name: "ellipsis",
169
169
  width: 17,
@@ -177,14 +177,14 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
177
177
  ),
178
178
  /* @__PURE__ */ r("div", { children: [
179
179
  q() && /* @__PURE__ */ r(H, { children: [
180
- !m && T && G() && /* @__PURE__ */ t(
180
+ T && G() && /* @__PURE__ */ t(
181
181
  "div",
182
182
  {
183
183
  "data-tid": "action_edit_argument",
184
184
  className: e.dropdownItem,
185
185
  tabIndex: "0",
186
- onClick: v,
187
- onKeyDown: i(v),
186
+ onClick: M,
187
+ onKeyDown: i(M),
188
188
  children: n.formatMessage({
189
189
  id: "user_content.content_footer.update",
190
190
  defaultMessage: "Update"
@@ -197,8 +197,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
197
197
  "data-tid": "action_delete_argument",
198
198
  className: e.dropdownItem,
199
199
  tabIndex: "0",
200
- onClick: M,
201
- onKeyDown: i(M),
200
+ onClick: w,
201
+ onKeyDown: i(w),
202
202
  children: n.formatMessage({
203
203
  id: "user_content.content_footer.delete",
204
204
  defaultMessage: "Delete"
@@ -212,9 +212,9 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
212
212
  "data-tid": "action_report_argument",
213
213
  className: e.dropdownItem,
214
214
  tabIndex: "0",
215
- onClick: w,
215
+ onClick: y,
216
216
  "data-testid": "report-content",
217
- onKeyDown: i(w),
217
+ onKeyDown: i(y),
218
218
  children: n.formatMessage({
219
219
  id: "user_content.content_footer.report",
220
220
  defaultMessage: "Report"
@@ -227,8 +227,8 @@ const rt = O(() => import("../../share/share_modal/index.js").then((o) => ({ def
227
227
  "data-tid": "action_share_argument",
228
228
  className: e.dropdownItem,
229
229
  tabIndex: "0",
230
- onClick: D,
231
- onKeyDown: i(D),
230
+ onClick: v,
231
+ onKeyDown: i(v),
232
232
  children: n.formatMessage({
233
233
  id: "user_content.content_footer.share",
234
234
  defaultMessage: "Share"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.37",
3
+ "version": "0.4.38",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",