@logora/debate 0.3.31 → 0.3.33

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 +1 @@
1
- ._ltr_1m7ly_3{text-align:left}._editorContainer_1m7ly_7{color:var(--text-primary, #222222);line-height:var(--line-height-normal, 1.26em);font-weight:var(--font-weight-normal, 400);text-align:left}._editorInner_1m7ly_14{background:var(--background-color-primary, white);position:relative}._editorInner_1m7ly_14._editorInnerInactive_1m7ly_18{display:flex!important;justify-content:space-between!important}._editorPlaceholder_1m7ly_23{color:var(--text-primary, #222222);overflow:hidden;position:absolute;text-overflow:ellipsis;top:15px;font-size:var(--font-size-normal, 16px);-webkit-user-select:none;user-select:none;display:inline-block;pointer-events:none}._editorInput_1m7ly_35{min-height:25px;resize:none;font-size:var(--font-size-normal, 16px);position:relative;tab-size:1;outline:0;padding-top:var(--space-unit, 1em)!important;padding-bottom:var(--space-unit, 1em)!important;caret-color:var(--text-primary, #222222)}._editorInput_1m7ly_35._editorInputInactive_1m7ly_46{min-width:180px;width:100%}._editorTextBold_1m7ly_51{font-weight:var(--font-weight-bold, 700)}._editorTextItalic_1m7ly_55{font-style:italic}._editorTextUnderline_1m7ly_59{text-decoration:underline}._editorTextStrikethrough_1m7ly_63{text-decoration:line-through}._editorTextUnderlineStrikethrough_1m7ly_67{text-decoration:underline line-through}._editorParagraph_1m7ly_71{margin:0!important;margin-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;position:relative}._editorParagraph_1m7ly_71:last-child{margin-bottom:0!important}._editorQuote_1m7ly_81{margin:0!important;padding-left:var(--space-unit, 1em)!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F);border-left-color:#ced0d4;border-left-width:4px;border-left-style:solid}._editorListOl_1m7ly_91{margin:0!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;list-style-type:decimal!important}._editorListItem_1m7ly_98{margin-right:var(--space-unit, 1em)!important;margin-left:var(--space-unit, 1em)!important;margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;margin-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._editorNestedListItem_1m7ly_105{list-style-type:none}pre::-webkit-scrollbar{background:transparent;width:10px}pre::-webkit-scrollbar-thumb{background:var(--text-secondary, #5F5F5F)}._sourcesBox_1m7ly_118{display:flex!important;justify-content:flex-start!important;align-items:center!important;margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-right:0!important;padding-left:0!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._sourceList_1m7ly_129{display:flex!important;flex-direction:column!important;justify-content:flex-start!important;align-items:flex-start!important;padding:0!important}._charactersCount_1m7ly_140{align-self:center;font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);white-space:nowrap;margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}
1
+ ._ltr_1k7lj_3{text-align:left}._editorContainer_1k7lj_7{color:var(--text-primary, #222222);line-height:var(--line-height-normal, 1.26em);font-weight:var(--font-weight-normal, 400);text-align:left}._editorInner_1k7lj_14{background:var(--background-color-primary, white);position:relative}._editorInner_1k7lj_14._editorInnerInactive_1k7lj_18{display:flex!important;justify-content:space-between!important}._editorPlaceholder_1k7lj_23{color:var(--text-primary, #222222);overflow:hidden;position:absolute;text-overflow:ellipsis;top:15px;font-size:var(--font-size-normal, 16px);-webkit-user-select:none;user-select:none;display:inline-block;pointer-events:none}._editorInput_1k7lj_35{min-height:25px;resize:none;font-size:var(--font-size-normal, 16px);position:relative;tab-size:1;outline:0;padding-top:var(--space-unit, 1em)!important;padding-bottom:var(--space-unit, 1em)!important;caret-color:var(--text-primary, #222222)}._editorInput_1k7lj_35._editorInputInactive_1k7lj_46{min-width:180px;width:100%}._editorTextBold_1k7lj_51{font-weight:var(--font-weight-bold, 700)}._editorTextItalic_1k7lj_55{font-style:italic}._editorTextUnderline_1k7lj_59{text-decoration:underline}._editorTextStrikethrough_1k7lj_63{text-decoration:line-through}._editorTextUnderlineStrikethrough_1k7lj_67{text-decoration:underline line-through}._editorParagraph_1k7lj_71{margin:0!important;margin-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;position:relative}._editorParagraph_1k7lj_71:last-child{margin-bottom:0!important}._editorQuote_1k7lj_81{margin:0!important;padding-left:var(--space-unit, 1em)!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F);border-left-color:#ced0d4;border-left-width:4px;border-left-style:solid}._editorListOl_1k7lj_91{margin:0!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;list-style-type:decimal!important}._editorListItem_1k7lj_98{margin-right:var(--space-unit, 1em)!important;margin-left:var(--space-unit, 1em)!important;margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;margin-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._editorNestedListItem_1k7lj_105{list-style-type:none}pre::-webkit-scrollbar{background:transparent;width:10px}pre::-webkit-scrollbar-thumb{background:var(--text-secondary, #5F5F5F)}._sourcesBox_1k7lj_118{display:flex!important;justify-content:flex-start!important;align-items:center!important;margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-right:0!important;padding-left:0!important;padding-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;padding-bottom:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._sourceList_1k7lj_129{display:flex!important;flex-direction:column!important;justify-content:flex-start!important;align-items:flex-start!important;padding:0!important}._charactersCount_1k7lj_140{align-self:center;font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);white-space:nowrap;margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._editorInput_1k7lj_35 ol li::marker{content:normal!important}._editorInput_1k7lj_35 ul li::marker{content:normal!important}
@@ -1,4 +1,4 @@
1
- import '../../../assets/components/input/text_editor/TextEditor.module-DePSfOvG.css';const t = "_ltr_1m7ly_3", e = "_editorContainer_1m7ly_7", o = "_editorInner_1m7ly_14", r = "_editorInnerInactive_1m7ly_18", i = "_editorPlaceholder_1m7ly_23", n = "_editorInput_1m7ly_35", d = "_editorInputInactive_1m7ly_46", _ = "_editorTextBold_1m7ly_51", s = "_editorTextItalic_1m7ly_55", l = "_editorTextUnderline_1m7ly_59", c = "_editorTextStrikethrough_1m7ly_63", a = "_editorTextUnderlineStrikethrough_1m7ly_67", I = "_editorParagraph_1m7ly_71", m = "_editorQuote_1m7ly_81", u = "_editorListOl_1m7ly_91", h = "_editorListItem_1m7ly_98", y = "_editorNestedListItem_1m7ly_105", x = "_sourcesBox_1m7ly_118", T = "_sourceList_1m7ly_129", L = "_charactersCount_1m7ly_140", p = {
1
+ import '../../../assets/components/input/text_editor/TextEditor.module-CxuSL3l3.css';const t = "_ltr_1k7lj_3", e = "_editorContainer_1k7lj_7", o = "_editorInner_1k7lj_14", r = "_editorInnerInactive_1k7lj_18", i = "_editorPlaceholder_1k7lj_23", n = "_editorInput_1k7lj_35", d = "_editorInputInactive_1k7lj_46", _ = "_editorTextBold_1k7lj_51", s = "_editorTextItalic_1k7lj_55", l = "_editorTextUnderline_1k7lj_59", c = "_editorTextStrikethrough_1k7lj_63", a = "_editorTextUnderlineStrikethrough_1k7lj_67", I = "_editorParagraph_1k7lj_71", k = "_editorQuote_1k7lj_81", u = "_editorListOl_1k7lj_91", h = "_editorListItem_1k7lj_98", j = "_editorNestedListItem_1k7lj_105", x = "_sourcesBox_1k7lj_118", T = "_sourceList_1k7lj_129", L = "_charactersCount_1k7lj_140", p = {
2
2
  ltr: t,
3
3
  editorContainer: e,
4
4
  editorInner: o,
@@ -12,10 +12,10 @@ import '../../../assets/components/input/text_editor/TextEditor.module-DePSfOvG.
12
12
  editorTextStrikethrough: c,
13
13
  editorTextUnderlineStrikethrough: a,
14
14
  editorParagraph: I,
15
- editorQuote: m,
15
+ editorQuote: k,
16
16
  editorListOl: u,
17
17
  editorListItem: h,
18
- editorNestedListItem: y,
18
+ editorNestedListItem: j,
19
19
  sourcesBox: x,
20
20
  sourceList: T,
21
21
  charactersCount: L
@@ -30,10 +30,10 @@ export {
30
30
  d as editorInputInactive,
31
31
  h as editorListItem,
32
32
  u as editorListOl,
33
- y as editorNestedListItem,
33
+ j as editorNestedListItem,
34
34
  I as editorParagraph,
35
35
  i as editorPlaceholder,
36
- m as editorQuote,
36
+ k as editorQuote,
37
37
  _ as editorTextBold,
38
38
  s as editorTextItalic,
39
39
  c as editorTextStrikethrough,
@@ -1,88 +1,65 @@
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 { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useIntl as y } from "react-intl";
4
+ import u from "./Summary.module.scss.js";
5
+ import { SectionBox as h } from "../../section/section_box/SectionBox.js";
6
+ import { SummaryBox as n } from "../summary_box/SummaryBox.js";
7
+ const v = ({
8
+ summary: r,
9
+ tags: o = [],
10
+ tagClassNames: l = [],
11
+ title: c,
12
+ subtitle: d
15
13
  }) => {
16
- const [n, x] = w({}), i = j(), u = async (e, r = "") => {
14
+ const s = y(), f = () => {
15
+ if (!r) return {};
16
+ if (typeof r == "object") return r;
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(r);
19
+ } catch {
20
+ return { global: r };
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
+ }, i = (e) => e ? e.split(`
23
+ `).map((a) => a.trim()).filter(Boolean) : [], m = f();
24
+ return /* @__PURE__ */ p(
25
+ h,
47
26
  {
48
27
  isCollapsible: !0,
49
28
  isCollapsedByDefault: !0,
50
- title: y,
51
- subtitle: g,
29
+ title: c,
30
+ subtitle: d,
52
31
  children: [
53
- /* @__PURE__ */ s("div", { className: l.description, children: i.formatMessage({
32
+ /* @__PURE__ */ t("div", { className: u.description, children: s.formatMessage({
54
33
  id: "summary.description.argument_summary",
55
34
  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
35
  }) }),
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,
36
+ /* @__PURE__ */ t("div", { className: u.summaryContainer, children: o.length > 0 ? o.map((e, a) => /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
37
+ n,
59
38
  {
60
- summaryItems: (n["no-position"] || []).map(
61
- (e) => e.argument
62
- ),
63
- emptySummaryText: i.formatMessage({
39
+ summaryItems: i(m[e.id]),
40
+ tag: e.name,
41
+ tagClassName: l[a],
42
+ emptySummaryText: s.formatMessage({
64
43
  id: "info.emptysummary",
65
44
  defaultMessage: "No resume found."
66
45
  })
67
46
  }
68
- ) }) : t.map((e, r) => /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
69
- h,
47
+ ) }, e.id)) : /* @__PURE__ */ t(
48
+ n,
70
49
  {
71
- summaryItems: (n[e.id] || []).map(
72
- (o) => o.argument
50
+ summaryItems: i(
51
+ m.global || m.untagged || Object.values(m)[0]
73
52
  ),
74
- tag: e.name,
75
- tagClassName: p[r],
76
- emptySummaryText: i.formatMessage({
53
+ emptySummaryText: s.formatMessage({
77
54
  id: "info.emptysummary",
78
55
  defaultMessage: "No resume found."
79
56
  })
80
57
  }
81
- ) }, e.id)) })
58
+ ) })
82
59
  ]
83
60
  }
84
61
  );
85
62
  };
86
63
  export {
87
- k as Summary
64
+ v as Summary
88
65
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",