@logora/debate 0.3.37 → 0.3.39

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_1izm3_3{padding:1em}._content_1izm3_7{padding-top:1em}._summaryContainer_1izm3_11{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;gap:1em}@container (max-width: 767.98px){._summaryContainer_1izm3_11{flex-direction:column}}._summaryContainer_1izm3_11>div{flex:1 1 calc(50% - .5em);max-width:calc(50% - .5em);display:flex;flex-direction:column}._description_1izm3_30{color:var(--text-secondary, #5F5F5F);font-size:var(--font-size-small, 16px);margin-bottom:1em}
@@ -1,176 +1,178 @@
1
- import { jsxs as f, Fragment as Y, jsx as o } from "react/jsx-runtime";
2
- import { ListNode as Z, ListItemNode as oo } from "@lexical/list";
3
- import { OverflowNode as to } from "@lexical/overflow";
4
- import { CharacterLimitPlugin as eo } from "@lexical/react/LexicalCharacterLimitPlugin";
5
- import { LexicalComposer as ro } from "@lexical/react/LexicalComposer";
6
- import { ContentEditable as io } from "@lexical/react/LexicalContentEditable";
7
- import { EditorRefPlugin as no } from "@lexical/react/LexicalEditorRefPlugin";
8
- import { LexicalErrorBoundary as so } from "@lexical/react/LexicalErrorBoundary";
9
- import { HistoryPlugin as lo } from "@lexical/react/LexicalHistoryPlugin";
1
+ import { jsxs as p, Fragment as X, jsx as o } from "react/jsx-runtime";
2
+ import { ListNode as Y, ListItemNode as Z } from "@lexical/list";
3
+ import { OverflowNode as oo } from "@lexical/overflow";
4
+ import { CharacterLimitPlugin as to } from "@lexical/react/LexicalCharacterLimitPlugin";
5
+ import { LexicalComposer as eo } from "@lexical/react/LexicalComposer";
6
+ import { ContentEditable as ro } from "@lexical/react/LexicalContentEditable";
7
+ import { EditorRefPlugin as io } from "@lexical/react/LexicalEditorRefPlugin";
8
+ import { LexicalErrorBoundary as no } from "@lexical/react/LexicalErrorBoundary";
9
+ import { HistoryPlugin as so } from "@lexical/react/LexicalHistoryPlugin";
10
10
  import { ListPlugin as co } from "@lexical/react/LexicalListPlugin";
11
- import { OnChangePlugin as mo } from "@lexical/react/LexicalOnChangePlugin";
12
- import { RichTextPlugin as ao } from "@lexical/react/LexicalRichTextPlugin";
13
- import { QuoteNode as uo } from "@lexical/rich-text";
11
+ import { OnChangePlugin as lo } from "@lexical/react/LexicalOnChangePlugin";
12
+ import { RichTextPlugin as mo } from "@lexical/react/LexicalRichTextPlugin";
13
+ import { QuoteNode as ao } from "@lexical/rich-text";
14
14
  import I from "classnames";
15
- import { $getRoot as fo } from "lexical";
16
- import { useState as d, useId as po, useEffect as R } from "react";
15
+ import { $getRoot as uo } from "lexical";
16
+ import { useState as d, useId as fo, useEffect as po } from "react";
17
17
  import { useIntl as ho } from "react-intl";
18
18
  import go from "./EditorTheme.js";
19
- import e from "./TextEditor.module.scss.js";
20
- import { AutoSavePlugin as xo } from "./plugins/AutoSavePlugin.js";
21
- import { FocusPlugin as So } from "./plugins/FocusPlugin.js";
19
+ import i from "./TextEditor.module.scss.js";
20
+ import { AutoSavePlugin as So } from "./plugins/AutoSavePlugin.js";
21
+ import { FocusPlugin as xo } from "./plugins/FocusPlugin.js";
22
22
  import { MaxLengthPlugin as vo } from "./plugins/MaxLengthPlugin.js";
23
- import { ResetPlugin as Co } from "./plugins/ResetPlugin.js";
24
- import { SetContentPlugin as Po } from "./plugins/SetContentPlugin.js";
23
+ import { ResetPlugin as Po } from "./plugins/ResetPlugin.js";
24
+ import { SetContentPlugin as Co } from "./plugins/SetContentPlugin.js";
25
25
  import { SetRichContentPlugin as To } from "./plugins/SetRichContentPlugin.js";
26
26
  import { ToolbarPlugin as No } from "./plugins/ToolbarPlugin.js";
27
27
  import { useModal as Eo } from "../../dialog/modal/useModal.js";
28
28
  import { SourceModal as Io } from "../../source/source_modal/SourceModal.js";
29
29
  import { SourceListItem as Ro } from "../../source/source_list_item/SourceListItem.js";
30
- const b = (l) => l?.replace(/ /g, " "), et = ({
31
- placeholder: l,
32
- onSubmit: p,
33
- sources: c,
34
- hideSubmit: M = !1,
35
- hideSourceAction: y = !1,
36
- onActivation: h,
37
- disabled: w = !1,
38
- handleChange: g,
39
- handleSourcesChange: x,
40
- shortBar: A = !1,
41
- active: S = !1,
42
- maxLength: m,
43
- disableRichText: L = !1,
44
- editorRef: _,
30
+ const R = (c) => c?.replace(/ /g, " "), et = ({
31
+ placeholder: c,
32
+ onSubmit: h,
33
+ sources: u,
34
+ hideSubmit: b = !1,
35
+ hideSourceAction: M = !1,
36
+ onActivation: g,
37
+ disabled: y = !1,
38
+ handleChange: S,
39
+ handleSourcesChange: f,
40
+ shortBar: w = !1,
41
+ active: x = !1,
42
+ maxLength: l,
43
+ disableRichText: A = !1,
44
+ editorRef: L,
45
45
  uid: v,
46
- allowedDomains: C = [],
47
- hideCharCount: B = !1,
48
- disableAutoActivate: F = !1,
49
- ...O
46
+ allowedDomains: P = [],
47
+ hideCharCount: _ = !1,
48
+ disableAutoActivate: B = !1,
49
+ ...F
50
50
  }) => {
51
- const [s, U] = d(!1), [j, k] = d(""), [z, H] = d(""), [r, a] = d([]), { showModal: J } = Eo(), P = ho(), T = po();
52
- R(() => {
53
- c && c.length > 0 && a(c);
54
- }, [c]), R(() => {
55
- x && r.length > 0 && x(r);
56
- }, [r]);
51
+ const [n, O] = d(!1), [U, j] = d(""), [k, z] = d(""), [m, a] = d([]), { showModal: H } = Eo(), C = ho(), T = fo();
52
+ po(() => {
53
+ u && a(u);
54
+ }, [u]);
57
55
  const N = () => {
58
- s || (U(!0), h && h());
59
- }, Q = {
60
- editable: !w,
56
+ n || (O(!0), g && g());
57
+ }, J = {
58
+ editable: !y,
61
59
  theme: go,
62
60
  onError(t) {
63
61
  console.error("TextEditor error:", t);
64
62
  },
65
- nodes: [Z, oo, uo, to]
66
- }, W = () => {
63
+ nodes: [Y, Z, ao, oo]
64
+ }, Q = () => {
67
65
  N();
68
- }, $ = (t) => {
66
+ }, W = (t) => {
69
67
  t.read(() => {
70
- const i = fo().getTextContent(), n = b(i), u = JSON.stringify(t), E = b(u);
71
- k(n), H(E), g && g(n, E);
68
+ const e = uo().getTextContent(), r = R(e), s = JSON.stringify(t), E = R(s);
69
+ j(r), z(E), S && S(r, E);
72
70
  });
73
- }, q = (t) => {
74
- const i = j, n = z, u = r;
75
- p && (t.preventDefault(), p(i, n, u)), a([]);
76
- }, D = () => {
77
- J(
71
+ }, $ = (t) => {
72
+ const e = U, r = k, s = m;
73
+ h && (t.preventDefault(), h(e, r, s)), a([]), f?.([]);
74
+ }, q = () => {
75
+ H(
78
76
  /* @__PURE__ */ o(
79
77
  Io,
80
78
  {
81
- onAddSource: G,
82
- allowedSources: C
79
+ onAddSource: D,
80
+ allowedSources: P
83
81
  }
84
82
  )
85
83
  );
84
+ }, D = (t) => {
85
+ a((e) => {
86
+ const r = [...e, t];
87
+ return f?.(r), r;
88
+ });
86
89
  }, G = (t) => {
87
- a([...r, t]);
88
- }, K = (t) => {
89
- a(
90
- (i) => i.filter(
91
- (n) => n.source_url !== t.source_url
92
- )
93
- );
94
- }, V = (t, i) => /* @__PURE__ */ o(
90
+ a((e) => {
91
+ const r = e.filter(
92
+ (s) => s.source_url !== t.source_url
93
+ );
94
+ return f?.(r), r;
95
+ });
96
+ }, K = (t, e) => /* @__PURE__ */ o(
95
97
  Ro,
96
98
  {
97
99
  publisher: t.publisher,
98
100
  url: t.source_url,
99
101
  title: t.title,
100
- index: i,
101
- onRemove: () => K(t)
102
+ index: e,
103
+ onRemove: () => G(t)
102
104
  },
103
- i
104
- ), X = () => /* @__PURE__ */ o("div", { className: e.editorPlaceholder, children: l });
105
- return /* @__PURE__ */ f(Y, { children: [
106
- /* @__PURE__ */ o(ro, { initialConfig: Q, children: /* @__PURE__ */ o("div", { className: e.editorContainer, onClick: W, children: /* @__PURE__ */ f(
105
+ e
106
+ ), V = () => /* @__PURE__ */ o("div", { className: i.editorPlaceholder, children: c });
107
+ return /* @__PURE__ */ p(X, { children: [
108
+ /* @__PURE__ */ o(eo, { initialConfig: J, children: /* @__PURE__ */ o("div", { className: i.editorContainer, onClick: Q, children: /* @__PURE__ */ p(
107
109
  "div",
108
110
  {
109
- className: I(e.editorInner, {
110
- [e.editorInnerInactive]: !s && !S
111
+ className: I(i.editorInner, {
112
+ [i.editorInnerInactive]: !n && !x
111
113
  }),
112
114
  children: [
113
115
  /* @__PURE__ */ o(
114
- ao,
116
+ mo,
115
117
  {
116
118
  contentEditable: /* @__PURE__ */ o(
117
- io,
119
+ ro,
118
120
  {
119
- className: I(e.editorInput, {
120
- [e.editorInputInactive]: !s
121
+ className: I(i.editorInput, {
122
+ [i.editorInputInactive]: !n
121
123
  }),
122
- ...O
124
+ ...F
123
125
  }
124
126
  ),
125
- placeholder: l && /* @__PURE__ */ o(X, {}),
126
- ErrorBoundary: so
127
+ placeholder: c && /* @__PURE__ */ o(V, {}),
128
+ ErrorBoundary: no
127
129
  }
128
130
  ),
129
131
  /* @__PURE__ */ o(
130
132
  No,
131
133
  {
132
- hideSourceAction: y,
133
- hideSubmit: M,
134
- disableRichText: L,
135
- shortBar: A,
136
- onSubmit: q,
137
- onAddSource: D,
138
- isActive: s || S,
139
- sourceTooltip: C?.length > 0 && P.formatMessage({
134
+ hideSourceAction: M,
135
+ hideSubmit: b,
136
+ disableRichText: A,
137
+ shortBar: w,
138
+ onSubmit: $,
139
+ onAddSource: q,
140
+ isActive: n || x,
141
+ sourceTooltip: P?.length > 0 && C.formatMessage({
140
142
  id: "input.allowed_domains_tooltip",
141
143
  defaultMessage: "With the new source function, you can add links to your article."
142
144
  })
143
145
  }
144
146
  ),
145
- s && m && !B && /* @__PURE__ */ f("div", { className: e.charactersCount, children: [
146
- /* @__PURE__ */ o(eo, { maxLength: m }),
147
+ n && l && !_ && /* @__PURE__ */ p("div", { className: i.charactersCount, children: [
148
+ /* @__PURE__ */ o(to, { maxLength: l }),
147
149
  " ",
148
- P.formatMessage({
150
+ C.formatMessage({
149
151
  id: "input.remaining_chars",
150
152
  defaultMessage: "remaining characters"
151
153
  })
152
154
  ] }),
153
155
  /* @__PURE__ */ o(co, {}),
154
- /* @__PURE__ */ o(lo, {}),
155
- /* @__PURE__ */ o(mo, { onChange: $, ignoreSelectionChange: !0 }),
156
+ /* @__PURE__ */ o(so, {}),
157
+ /* @__PURE__ */ o(lo, { onChange: W, ignoreSelectionChange: !0 }),
156
158
  /* @__PURE__ */ o(
157
- xo,
159
+ So,
158
160
  {
159
- onSetContent: F ? () => {
161
+ onSetContent: B ? () => {
160
162
  } : N,
161
163
  storageUid: v || T
162
164
  }
163
165
  ),
164
- /* @__PURE__ */ o(Po, {}),
166
+ /* @__PURE__ */ o(Co, {}),
165
167
  /* @__PURE__ */ o(To, {}),
166
- /* @__PURE__ */ o(So, {}),
167
- m && /* @__PURE__ */ o(vo, { maxLength: m }),
168
- /* @__PURE__ */ o(Co, { storageUid: v || T }),
169
- /* @__PURE__ */ o(no, { editorRef: _ })
168
+ /* @__PURE__ */ o(xo, {}),
169
+ l && /* @__PURE__ */ o(vo, { maxLength: l }),
170
+ /* @__PURE__ */ o(Po, { storageUid: v || T }),
171
+ /* @__PURE__ */ o(io, { editorRef: L })
170
172
  ]
171
173
  }
172
174
  ) }) }),
173
- r && r.length !== 0 ? /* @__PURE__ */ o("div", { className: e.sourcesBox, children: /* @__PURE__ */ o("div", { className: e.sourceList, children: r.map(V) }) }) : null
175
+ m && m.length !== 0 ? /* @__PURE__ */ o("div", { className: i.sourcesBox, children: /* @__PURE__ */ o("div", { className: i.sourceList, children: m.map(K) }) }) : null
174
176
  ] });
175
177
  };
176
178
  export {
@@ -1,24 +1,24 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
2
  import "react";
3
- import r from "./SourceListItem.module.scss.js";
4
- import { Link as l } from "../../action/link/Link.js";
5
- import { Icon as n } from "../../icons/icon/Icon.js";
6
- const f = ({ index: s = 0, url: a, title: c, publisher: o, onRemove: i }) => /* @__PURE__ */ e("div", { className: r.sourceListItemContainer, children: [
3
+ import t from "./SourceListItem.module.scss.js";
4
+ import { Link as m } from "../../action/link/Link.js";
5
+ import { Icon as s } from "../../icons/icon/Icon.js";
6
+ const k = ({ index: a = 0, url: l, title: c, publisher: o, onRemove: i }) => /* @__PURE__ */ e("div", { className: t.sourceListItemContainer, children: [
7
7
  /* @__PURE__ */ e(
8
- l,
8
+ m,
9
9
  {
10
- className: r.sourceListItem,
11
- to: a,
10
+ className: t.sourceListItem,
11
+ to: l,
12
12
  external: !0,
13
13
  target: "_blank",
14
14
  rel: "nofollow noreferrer noopener",
15
15
  "data-tid": "link_view_source",
16
16
  children: [
17
- /* @__PURE__ */ t(n, { name: "link", width: 16, height: 16 }),
18
- /* @__PURE__ */ e("div", { className: r.sourceListItemLink, children: [
17
+ /* @__PURE__ */ r(s, { name: "link", width: 16, height: 16 }),
18
+ /* @__PURE__ */ e("div", { className: t.sourceListItemLink, children: [
19
19
  /* @__PURE__ */ e("span", { children: [
20
20
  "[ ",
21
- s + 1,
21
+ a + 1,
22
22
  " ] "
23
23
  ] }),
24
24
  /* @__PURE__ */ e("span", { children: [
@@ -30,17 +30,19 @@ const f = ({ index: s = 0, url: a, title: c, publisher: o, onRemove: i }) => /*
30
30
  ]
31
31
  }
32
32
  ),
33
- i && /* @__PURE__ */ t(
33
+ i && /* @__PURE__ */ r(
34
34
  "button",
35
35
  {
36
36
  type: "button",
37
- className: r.removeSourceButton,
38
- onClick: i,
37
+ className: t.removeSourceButton,
38
+ onClick: (n) => {
39
+ n.preventDefault(), n.stopPropagation(), i();
40
+ },
39
41
  "aria-label": "Remove source",
40
- children: /* @__PURE__ */ t(n, { name: "close", width: 10, height: 10 })
42
+ children: /* @__PURE__ */ r(s, { name: "close", width: 10, height: 10 })
41
43
  }
42
44
  )
43
45
  ] });
44
46
  export {
45
- f as SourceListItem
47
+ k as SourceListItem
46
48
  };
@@ -1,13 +1,13 @@
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,
1
+ import '../../../assets/components/summary/summary/Summary.module-C21ANHKc.css';const n = "_sectionBox_1izm3_3", t = "_content_1izm3_7", o = "_summaryContainer_1izm3_11", s = "_description_1izm3_30", i = {
2
+ sectionBox: n,
3
+ content: t,
4
4
  summaryContainer: o,
5
5
  description: s
6
6
  };
7
7
  export {
8
- n as content,
9
- e as default,
8
+ t as content,
9
+ i as default,
10
10
  s as description,
11
- t as sectionBox,
11
+ n as sectionBox,
12
12
  o as summaryContainer
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.37",
3
+ "version": "0.3.39",
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_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}