@logora/debate 0.3.32 → 0.3.34

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
+ ._sectionBoxContainer_tcujo_3{background-color:var(--background-color-primary, white);box-shadow:var(--box-shadow-main-container, var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1)));border:var(--box-border-main-container, var(--box-border, 1px solid rgba(7, 42, 68, .1)));border-radius:var(--box-border-radius, 6px);color:var(--text-primary, #222222)}@container (min-width: 576px){._sectionBoxContainer_tcujo_3{padding:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important}}._sectionBoxContainer_tcujo_3._isMobile_tcujo_15{padding:var(--space-unit, 1em)!important}._header_tcujo_19{display:flex;justify-content:space-between;align-items:center;width:100%}._collapsible_tcujo_26{cursor:pointer}._iconLightArrow_tcujo_30{flex-shrink:0;margin-left:.75em;transition:transform .3s}._iconRotated_tcujo_36{transform:rotate(180deg)}._titleContainer_tcujo_40{display:flex;align-items:baseline;gap:.5em}._title_tcujo_40{font-size:var(--font-size-large, 20px);line-height:var(--line-height-tight, 1.08em);font-weight:var(--font-weight-bold, 700);font-family:var(--title-font-family, var(--font-family, "Montserrat"));color:var(--text-primary, #222222)}._subtitle_tcujo_54{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F)}._body_tcujo_59{padding-top:var(--space-unit, 1em)!important}
@@ -0,0 +1 @@
1
+ ._sectionBox_4pygt_3{padding:1em}._content_4pygt_7{padding-top:1em}._summaryContainer_4pygt_11{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;gap:1em}@container (max-width: 767.98px){._summaryContainer_4pygt_11{flex-direction:column}}._summaryContainer_4pygt_11>div{flex:1;display:flex;flex-direction:column}._description_4pygt_29{color:var(--text-secondary, #5F5F5F);font-size:var(--font-size-small, 16px);margin-bottom:1em}
@@ -6,20 +6,20 @@ import { useResponsive as N } from "../../hooks/use_responsive/useResponsive.js"
6
6
  import { Icon as g } from "../../icons/icon/Icon.js";
7
7
  const I = ({
8
8
  isCollapsible: t = !1,
9
- isCollapsedByDefault: a = !1,
10
- title: m,
9
+ isCollapsedByDefault: n = !1,
10
+ title: a,
11
11
  subtitle: r = "",
12
- className: n,
13
- titleClassName: d,
14
- children: l
12
+ className: m,
13
+ titleClassName: l,
14
+ children: d
15
15
  }) => {
16
- const [c, h] = x(a), { isMobile: f } = N(), p = () => {
16
+ const [c, h] = x(n), { isMobile: f } = N(), p = () => {
17
17
  t && h((v) => !v);
18
18
  };
19
19
  return /* @__PURE__ */ s(
20
20
  "div",
21
21
  {
22
- className: o(e.sectionBoxContainer, {
22
+ className: o(e.sectionBoxContainer, m, {
23
23
  [e.isMobile]: f
24
24
  }),
25
25
  children: [
@@ -30,8 +30,8 @@ const I = ({
30
30
  onClick: t ? p : null,
31
31
  children: [
32
32
  /* @__PURE__ */ s("div", { className: e.titleContainer, children: [
33
- /* @__PURE__ */ i("div", { className: o(d, e.title), children: m }),
34
- r && /* @__PURE__ */ i("div", { className: o(n, e.subtitle), children: r })
33
+ /* @__PURE__ */ i("div", { className: o(l, e.title), children: a }),
34
+ r && /* @__PURE__ */ i("div", { className: o(e.subtitle), children: r })
35
35
  ] }),
36
36
  t && /* @__PURE__ */ i(
37
37
  g,
@@ -47,7 +47,7 @@ const I = ({
47
47
  ]
48
48
  }
49
49
  ),
50
- (!c || !t) && /* @__PURE__ */ i("div", { className: o(e.body, n), children: l })
50
+ (!c || !t) && /* @__PURE__ */ i("div", { className: o(e.body), children: d })
51
51
  ]
52
52
  }
53
53
  );
@@ -1,25 +1,25 @@
1
- import '../../../assets/components/section/section_box/SectionBox.module-DUeUtdWr.css';const t = "_sectionBoxContainer_m9zal_3", o = "_isMobile_m9zal_15", e = "_header_m9zal_19", i = "_collapsible_m9zal_26", l = "_iconLightArrow_m9zal_30", n = "_iconRotated_m9zal_34", _ = "_titleContainer_m9zal_38", a = "_title_m9zal_38", s = "_subtitle_m9zal_52", c = "_body_m9zal_57", r = {
1
+ import '../../../assets/components/section/section_box/SectionBox.module-qQs4B6bf.css';const t = "_sectionBoxContainer_tcujo_3", o = "_isMobile_tcujo_15", e = "_header_tcujo_19", i = "_collapsible_tcujo_26", c = "_iconLightArrow_tcujo_30", n = "_iconRotated_tcujo_36", _ = "_titleContainer_tcujo_40", s = "_title_tcujo_40", l = "_subtitle_tcujo_54", a = "_body_tcujo_59", r = {
2
2
  sectionBoxContainer: t,
3
3
  isMobile: o,
4
4
  header: e,
5
5
  collapsible: i,
6
- iconLightArrow: l,
6
+ iconLightArrow: c,
7
7
  iconRotated: n,
8
8
  titleContainer: _,
9
- title: a,
10
- subtitle: s,
11
- body: c
9
+ title: s,
10
+ subtitle: l,
11
+ body: a
12
12
  };
13
13
  export {
14
- c as body,
14
+ a as body,
15
15
  i as collapsible,
16
16
  r as default,
17
17
  e as header,
18
- l as iconLightArrow,
18
+ c as iconLightArrow,
19
19
  n as iconRotated,
20
20
  o as isMobile,
21
21
  t as sectionBoxContainer,
22
- s as subtitle,
23
- a as title,
22
+ l as subtitle,
23
+ s as title,
24
24
  _ as titleContainer
25
25
  };
@@ -1,88 +1,66 @@
1
- import { jsxs as S, jsx as s } from "react/jsx-runtime";
2
- import { useState as w, useEffect as b } from "react";
3
- import { useIntl as j } from "react-intl";
4
- import l from "./Summary.module.scss.js";
5
- import { SectionBox as B } from "../../section/section_box/SectionBox.js";
6
- import { BoxSkeleton as f } from "../../skeleton/box_skeleton/BoxSkeleton.js";
7
- import { SummaryBox as h } from "../summary_box/SummaryBox.js";
8
- const k = ({
9
- apiUrl: d,
10
- summaryId: a,
11
- tags: t = [],
12
- tagClassNames: p = [],
13
- title: y,
14
- subtitle: g
1
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useIntl as h } from "react-intl";
4
+ import m from "./Summary.module.scss.js";
5
+ import { SectionBox as y } from "../../section/section_box/SectionBox.js";
6
+ import { SummaryBox as n } from "../summary_box/SummaryBox.js";
7
+ const M = ({
8
+ summary: t,
9
+ tags: i = [],
10
+ tagClassNames: l = [],
11
+ title: c,
12
+ subtitle: d
15
13
  }) => {
16
- const [n, x] = w({}), i = j(), u = async (e, r = "") => {
14
+ const a = h(), f = () => {
15
+ if (!t) return {};
16
+ if (typeof t == "object") return t;
17
17
  try {
18
- const o = `${d}/${e}${r ? `-${r}` : ""}`, m = await fetch(o);
19
- if (!m.ok)
20
- throw new Error(`HTTP error! Status: ${m.status}`);
21
- return (await m.json()).data?.content?.arguments || [];
22
- } catch (o) {
23
- console.error(o);
18
+ return JSON.parse(t);
19
+ } catch {
20
+ return { global: t };
24
21
  }
25
- };
26
- return b(() => {
27
- (async () => {
28
- try {
29
- const r = {};
30
- if (t.length === 0)
31
- r["no-position"] = await u(a);
32
- else {
33
- const o = await Promise.all(
34
- t.map((m) => u(a, m.id))
35
- );
36
- t.forEach((m, c) => {
37
- r[m.id] = o[c];
38
- });
39
- }
40
- x(r);
41
- } catch (r) {
42
- console.error(r);
43
- }
44
- })();
45
- }, [a, t]), /* @__PURE__ */ S(
46
- B,
22
+ }, u = (e) => e ? e.split(`
23
+ `).map((o) => o.trim()).filter(Boolean) : [], s = f();
24
+ return /* @__PURE__ */ r(
25
+ y,
47
26
  {
27
+ className: m.sectionBox,
48
28
  isCollapsible: !0,
49
29
  isCollapsedByDefault: !0,
50
- title: y,
51
- subtitle: g,
52
- children: [
53
- /* @__PURE__ */ s("div", { className: l.description, children: i.formatMessage({
30
+ title: c,
31
+ subtitle: d,
32
+ children: /* @__PURE__ */ p("div", { className: m.content, children: [
33
+ /* @__PURE__ */ r("div", { className: m.description, children: a.formatMessage({
54
34
  id: "summary.description.argument_summary",
55
35
  defaultMessage: "Our algorithm produces comprehensive, well-structured summaries of the most recurrent arguments. Each published argument influences the content of this summary. The better structured the argument, the more weight it carries."
56
36
  }) }),
57
- /* @__PURE__ */ s("div", { className: l.summaryContainer, children: Object.keys(n).length === 0 ? t.length === 0 ? /* @__PURE__ */ s(f, { onlyEdgeBox: !0, boxHeight: 120 }) : t.map((e) => /* @__PURE__ */ s(f, { onlyEdgeBox: !0, boxHeight: 120 }, e.id)) : t.length === 0 ? /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
58
- h,
37
+ /* @__PURE__ */ r("div", { className: m.summaryContainer, children: i.length > 0 ? i.map((e, o) => /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
38
+ n,
59
39
  {
60
- summaryItems: (n["no-position"] || []).map(
61
- (e) => e.argument
62
- ),
63
- emptySummaryText: i.formatMessage({
40
+ summaryItems: u(s[e.id]),
41
+ tag: e.name,
42
+ tagClassName: l[o],
43
+ emptySummaryText: a.formatMessage({
64
44
  id: "info.emptysummary",
65
45
  defaultMessage: "No resume found."
66
46
  })
67
47
  }
68
- ) }) : t.map((e, r) => /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
69
- h,
48
+ ) }, e.id)) : /* @__PURE__ */ r(
49
+ n,
70
50
  {
71
- summaryItems: (n[e.id] || []).map(
72
- (o) => o.argument
51
+ summaryItems: u(
52
+ s.global || s.untagged || Object.values(s)[0]
73
53
  ),
74
- tag: e.name,
75
- tagClassName: p[r],
76
- emptySummaryText: i.formatMessage({
54
+ emptySummaryText: a.formatMessage({
77
55
  id: "info.emptysummary",
78
56
  defaultMessage: "No resume found."
79
57
  })
80
58
  }
81
- ) }, e.id)) })
82
- ]
59
+ ) })
60
+ ] })
83
61
  }
84
62
  );
85
63
  };
86
64
  export {
87
- k as Summary
65
+ M as Summary
88
66
  };
@@ -1,9 +1,13 @@
1
- import '../../../assets/components/summary/summary/Summary.module-DjfmUlkW.css';const t = "_summaryContainer_1xdmt_3", n = "_description_1xdmt_21", s = {
2
- summaryContainer: t,
3
- description: n
1
+ import '../../../assets/components/summary/summary/Summary.module-CTK6cZnx.css';const t = "_sectionBox_4pygt_3", n = "_content_4pygt_7", o = "_summaryContainer_4pygt_11", s = "_description_4pygt_29", e = {
2
+ sectionBox: t,
3
+ content: n,
4
+ summaryContainer: o,
5
+ description: s
4
6
  };
5
7
  export {
6
- s as default,
7
- n as description,
8
- t as summaryContainer
8
+ n as content,
9
+ e as default,
10
+ s as description,
11
+ t as sectionBox,
12
+ o as summaryContainer
9
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.32",
3
+ "version": "0.3.34",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._sectionBoxContainer_m9zal_3{background-color:var(--background-color-primary, white);box-shadow:var(--box-shadow-main-container, var(--box-shadow, 0px 2px 5px rgba(7, 42, 68, .1)));border:var(--box-border-main-container, var(--box-border, 1px solid rgba(7, 42, 68, .1)));border-radius:var(--box-border-radius, 6px);color:var(--text-primary, #222222)}@container (min-width: 576px){._sectionBoxContainer_m9zal_3{padding:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))!important}}._sectionBoxContainer_m9zal_3._isMobile_m9zal_15{padding:var(--space-unit, 1em)!important}._header_m9zal_19{display:flex;justify-content:space-between;align-items:center;width:100%}._collapsible_m9zal_26{cursor:pointer}._iconLightArrow_m9zal_30{transition:transform .3s}._iconRotated_m9zal_34{transform:rotate(180deg)}._titleContainer_m9zal_38{display:flex;align-items:baseline;gap:.5em}._title_m9zal_38{font-size:var(--font-size-large, 20px);line-height:var(--line-height-tight, 1.08em);font-weight:var(--font-weight-bold, 700);font-family:var(--title-font-family, var(--font-family, "Montserrat"));color:var(--text-primary, #222222)}._subtitle_m9zal_52{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F)}._body_m9zal_57{padding-top:var(--space-unit, 1em)!important}
@@ -1 +0,0 @@
1
- ._summaryContainer_1xdmt_3{display:flex!important;flex-direction:row;flex-wrap:wrap;align-items:stretch!important;gap:1em}@container (max-width: 767.98px){._summaryContainer_1xdmt_3{flex-direction:column!important}}._summaryContainer_1xdmt_3>div{flex:1;display:flex;flex-direction:column}._description_1xdmt_21{color:var(--text-secondary, #5F5F5F);font-size:var(--font-size-small, 16px);margin-bottom:1em}