@logora/debate 0.4.63 → 0.4.65

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.
@@ -0,0 +1 @@
1
+ ._sectionBox_i352a_3{padding:1em}._content_i352a_7{padding-top:0}._summaryContainer_i352a_11{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;gap:1em}._summaryContainer_i352a_11>div{flex:1 1 calc(50% - .5em);max-width:calc(50% - .5em);display:flex;flex-direction:column}@container (max-width: 767.98px){._summaryContainer_i352a_11{flex-direction:column}._summaryContainer_i352a_11>div{flex:1 1 100%;max-width:100%;width:100%}}._description_i352a_35{color:var(--text-secondary, #5F5F5F);font-size:var(--font-size-small, 16px);margin-bottom:1em}
@@ -1,65 +1,65 @@
1
- import { jsx as l, jsxs as n } from "react/jsx-runtime";
2
- import d from "classnames";
1
+ import { jsx as l, jsxs as s } from "react/jsx-runtime";
2
+ import r from "classnames";
3
3
  import { useRef as g, useEffect as b } from "react";
4
- import { useIntl as w } from "react-intl";
5
- import o from "./Modal.module.scss.js";
6
- import { useModal as C } from "./useModal.js";
7
- import { Icon as M } from "../../icons/icon/Icon.js";
4
+ import { useIntl as C } from "react-intl";
5
+ import e from "./Modal.module.scss.js";
6
+ import { useModal as M } from "./useModal.js";
7
+ import { Icon as x } from "../../icons/icon/Icon.js";
8
8
  const D = ({
9
9
  title: t,
10
- showCloseButton: s = !1,
11
- fullScreen: i,
10
+ showCloseButton: i = !1,
11
+ fullScreen: c,
12
12
  children: m,
13
- disableClickOutside: c = !1,
14
- ...f
13
+ disableClickOutside: f = !1,
14
+ ...u
15
15
  }) => {
16
- const r = g(), u = w(), { hideModal: a } = C();
16
+ const a = g(), h = C(), { hideModal: d } = M();
17
17
  b(() => {
18
- const e = r.current;
19
- if (!e) return;
20
- const p = document.documentElement.style.overflow, y = document.body.style.overflow;
21
- return document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden", e.open || e.showModal(), e.focus(), () => {
22
- document.documentElement.style.overflow = p, document.body.style.overflow = y, e.open && e.close();
18
+ const o = a.current;
19
+ if (!o) return;
20
+ const n = window.scrollY, p = document.documentElement.style.overflow, y = document.body.style.overflow;
21
+ return document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden", o.open || o.showModal(), o.focus(), window.scrollTo(0, n), () => {
22
+ document.documentElement.style.overflow = p, document.body.style.overflow = y, o.open && o.close(), window.scrollTo(0, n);
23
23
  };
24
24
  }, []);
25
- const h = (e) => {
26
- c || e.currentTarget === e.target && a();
25
+ const w = (o) => {
26
+ f || o.currentTarget === o.target && d();
27
27
  }, v = () => {
28
- a();
28
+ d();
29
29
  };
30
30
  return /* @__PURE__ */ l(
31
31
  "dialog",
32
32
  {
33
- ref: r,
34
- className: d(o.modalDialog, {
35
- [o.modalDialogFullScreen]: i
33
+ ref: a,
34
+ className: r(e.modalDialog, {
35
+ [e.modalDialogFullScreen]: c
36
36
  }),
37
37
  "aria-labelledby": t ? "modal-title" : void 0,
38
- onClick: h,
38
+ onClick: w,
39
39
  onClose: v,
40
- ...f,
41
- children: /* @__PURE__ */ n("div", { className: d(o.modalContainer), children: [
42
- /* @__PURE__ */ n(
40
+ ...u,
41
+ children: /* @__PURE__ */ s("div", { className: r(e.modalContainer), children: [
42
+ /* @__PURE__ */ s(
43
43
  "div",
44
44
  {
45
- className: d(o.modalHeader, {
46
- [o.modalHeaderWithTitle]: t
45
+ className: r(e.modalHeader, {
46
+ [e.modalHeaderWithTitle]: t
47
47
  }),
48
48
  children: [
49
49
  t && /* @__PURE__ */ l("div", { id: "modal-title", children: t }),
50
- s && /* @__PURE__ */ l(
50
+ i && /* @__PURE__ */ l(
51
51
  "button",
52
52
  {
53
53
  type: "button",
54
- className: o.modalExitButton,
55
- onClick: a,
56
- "aria-label": u.formatMessage({
54
+ className: e.modalExitButton,
55
+ onClick: d,
56
+ "aria-label": h.formatMessage({
57
57
  id: "dialog.modal.aria_label",
58
58
  defaultMessage: "Close dialog"
59
59
  }),
60
60
  "data-testid": "close-button",
61
61
  children: /* @__PURE__ */ l(
62
- M,
62
+ x,
63
63
  {
64
64
  name: "close",
65
65
  height: 18,
@@ -73,7 +73,7 @@ const D = ({
73
73
  ]
74
74
  }
75
75
  ),
76
- /* @__PURE__ */ l("div", { className: o.modalContent, children: m })
76
+ /* @__PURE__ */ l("div", { className: e.modalContent, children: m })
77
77
  ] })
78
78
  }
79
79
  );
@@ -80,7 +80,7 @@ const C = ({ report: e, flash: i }) => {
80
80
  }
81
81
  ),
82
82
  o.formatMessage({
83
- id: "report.content_header.moderation_reason",
83
+ id: "report.content_header.moderation_reason_label",
84
84
  defaultMessage: "Report reason:"
85
85
  }),
86
86
  " ",
@@ -1,13 +1,13 @@
1
- import '../../../assets/components/summary/summary/Summary.module-2bnx3egy.css';const t = "_sectionBox_tui97_3", n = "_content_tui97_7", o = "_summaryContainer_tui97_11", s = "_description_tui97_35", i = {
2
- sectionBox: t,
3
- content: n,
1
+ import '../../../assets/components/summary/summary/Summary.module-C1E_L02_.css';const n = "_sectionBox_i352a_3", t = "_content_i352a_7", o = "_summaryContainer_i352a_11", s = "_description_i352a_35", i = {
2
+ sectionBox: n,
3
+ content: t,
4
4
  summaryContainer: o,
5
5
  description: s
6
6
  };
7
7
  export {
8
- n as content,
8
+ t as content,
9
9
  i as default,
10
10
  s as description,
11
- t as sectionBox,
11
+ n as sectionBox,
12
12
  o as summaryContainer
13
13
  };
@@ -1,10 +1,10 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
2
  import u from "classnames";
3
3
  import "react";
4
4
  import { useIntl as N } from "react-intl";
5
5
  import t from "./ContentHeader.module.scss.js";
6
- import { useRelativeTime as x } from "../../hooks/use_relative_time/useRelativeTime.js";
7
- import { useConfig as b } from "../../data/config_provider/useConfig.js";
6
+ import { useRelativeTime as b } from "../../hooks/use_relative_time/useRelativeTime.js";
7
+ import { useConfig as x } from "../../data/config_provider/useConfig.js";
8
8
  import { Icon as g } from "../../icons/icon/Icon.js";
9
9
  import { UserBoxSmall as H } from "../../user/user_box_small/UserBoxSmall.js";
10
10
  import { AuthorBox as w } from "../../user/author_box/AuthorBox.js";
@@ -22,11 +22,11 @@ const $ = ({
22
22
  moderationPolicyUrl: m,
23
23
  showModerationFeedback: v = !1
24
24
  }) => {
25
- const M = x(new Date(l).getTime()), a = N(), f = b();
25
+ const M = b(new Date(l).getTime()), n = N(), f = x();
26
26
  return /* @__PURE__ */ o("div", { className: t.contentHeaderContainer, children: [
27
27
  v && /* @__PURE__ */ o("div", { className: t.moderationInfo, children: [
28
28
  /* @__PURE__ */ o("div", { className: t.moderationReason, children: [
29
- /* @__PURE__ */ n(
29
+ /* @__PURE__ */ a(
30
30
  g,
31
31
  {
32
32
  name: "announcement",
@@ -35,17 +35,17 @@ const $ = ({
35
35
  className: t.warningIcon
36
36
  }
37
37
  ),
38
- a.formatMessage({
39
- id: "user_content.content_header.moderation_reason",
38
+ n.formatMessage({
39
+ id: "user_content.content_header.moderation_reason_label",
40
40
  defaultMessage: "Content rejected by moderation."
41
41
  }),
42
42
  " ",
43
- s && a.messages[`user_content.content_header.moderation_reason.${s.toLowerCase()}`] ? a.formatMessage({
43
+ s && n.messages[`user_content.content_header.moderation_reason.${s.toLowerCase()}`] ? n.formatMessage({
44
44
  id: `user_content.content_header.moderation_reason.${s.toLowerCase()}`,
45
45
  defaultMessage: ""
46
46
  }) : null
47
47
  ] }),
48
- c && /* @__PURE__ */ n("div", { children: a.formatMessage(
48
+ c && /* @__PURE__ */ a("div", { children: n.formatMessage(
49
49
  {
50
50
  id: "user_content.content_header.moderation_notes",
51
51
  defaultMessage: "Moderation Notes: {notes}"
@@ -53,19 +53,19 @@ const $ = ({
53
53
  { notes: c }
54
54
  ) }),
55
55
  m && /* @__PURE__ */ o("div", { children: [
56
- a.formatMessage({
56
+ n.formatMessage({
57
57
  id: "user_content.content_header.moderationPolicyUrl",
58
58
  defaultMessage: "Please keep contributions respectful. See rules:"
59
59
  }),
60
60
  " ",
61
- /* @__PURE__ */ n(
61
+ /* @__PURE__ */ a(
62
62
  "a",
63
63
  {
64
64
  href: m,
65
65
  target: "_blank",
66
66
  rel: "noopener noreferrer",
67
67
  className: t.moderationLink,
68
- children: a.formatMessage({
68
+ children: n.formatMessage({
69
69
  id: "user_content.content_header.moderation_policy_link",
70
70
  defaultMessage: "moderation policy"
71
71
  })
@@ -74,21 +74,21 @@ const $ = ({
74
74
  ] })
75
75
  ] }),
76
76
  p && !d && /* @__PURE__ */ o("div", { className: t.selectedContent, children: [
77
- /* @__PURE__ */ n(g, { name: "expertBadge", width: 18, height: 18 }),
78
- a.formatMessage({
77
+ /* @__PURE__ */ a(g, { name: "expertBadge", width: 18, height: 18 }),
78
+ n.formatMessage({
79
79
  id: "user_content.content_header.selected",
80
80
  defaultMessage: "Selected by editor"
81
81
  })
82
82
  ] }),
83
83
  /* @__PURE__ */ o("div", { className: t.contentHeader, children: [
84
- /* @__PURE__ */ n("div", { className: t.contentHeaderAuthorBox, children: i === !0 ? /* @__PURE__ */ n(
84
+ /* @__PURE__ */ a("div", { className: t.contentHeaderAuthorBox, children: i === !0 ? /* @__PURE__ */ a(
85
85
  H,
86
86
  {
87
87
  userName: e.full_name,
88
88
  avatarUrl: e.image_url,
89
89
  userSlug: e.hash_id
90
90
  }
91
- ) : /* @__PURE__ */ n(
91
+ ) : /* @__PURE__ */ a(
92
92
  w,
93
93
  {
94
94
  fullName: e.full_name,
@@ -106,13 +106,13 @@ const $ = ({
106
106
  }
107
107
  ) }),
108
108
  /* @__PURE__ */ o("div", { className: t.contentHeaderRight, children: [
109
- r && /* @__PURE__ */ n("div", { className: u(t.contentHeaderTagBox, _), children: /* @__PURE__ */ n("div", { className: t.contentHeaderTag, title: r, children: r }) }),
110
- !l || i ? null : /* @__PURE__ */ n(
109
+ r && /* @__PURE__ */ a("div", { className: u(t.contentHeaderTagBox, _), children: /* @__PURE__ */ a("div", { className: t.contentHeaderTag, title: r, children: r }) }),
110
+ !l || i ? null : /* @__PURE__ */ a(
111
111
  "div",
112
112
  {
113
113
  "data-testid": "content-header-date",
114
114
  className: u(t.contentHeaderDate),
115
- "aria-label": a.formatMessage({
115
+ "aria-label": n.formatMessage({
116
116
  id: "user_content.content_header.date",
117
117
  defaultMessage: "Publication date"
118
118
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.63",
3
+ "version": "0.4.65",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._sectionBox_tui97_3{padding:1em}._content_tui97_7{padding-top:1em}._summaryContainer_tui97_11{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;gap:1em}._summaryContainer_tui97_11>div{flex:1 1 calc(50% - .5em);max-width:calc(50% - .5em);display:flex;flex-direction:column}@container (max-width: 767.98px){._summaryContainer_tui97_11{flex-direction:column}._summaryContainer_tui97_11>div{flex:1 1 100%;max-width:100%;width:100%}}._description_tui97_35{color:var(--text-secondary, #5F5F5F);font-size:var(--font-size-small, 16px);margin-bottom:1em}