@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.
- package/dist/assets/components/summary/summary/Summary.module-C21ANHKc.css +1 -0
- package/dist/components/input/text_editor/TextEditor.js +105 -103
- package/dist/components/source/source_list_item/SourceListItem.js +18 -16
- package/dist/components/summary/summary/Summary.module.scss.js +6 -6
- package/package.json +1 -1
- package/dist/assets/components/summary/summary/Summary.module-CTK6cZnx.css +0 -1
|
@@ -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
|
|
2
|
-
import { ListNode as
|
|
3
|
-
import { OverflowNode as
|
|
4
|
-
import { CharacterLimitPlugin as
|
|
5
|
-
import { LexicalComposer as
|
|
6
|
-
import { ContentEditable as
|
|
7
|
-
import { EditorRefPlugin as
|
|
8
|
-
import { LexicalErrorBoundary as
|
|
9
|
-
import { HistoryPlugin as
|
|
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
|
|
12
|
-
import { RichTextPlugin as
|
|
13
|
-
import { QuoteNode as
|
|
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
|
|
16
|
-
import { useState as d, useId as
|
|
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
|
|
20
|
-
import { AutoSavePlugin as
|
|
21
|
-
import { FocusPlugin as
|
|
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
|
|
24
|
-
import { SetContentPlugin as
|
|
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
|
|
31
|
-
placeholder:
|
|
32
|
-
onSubmit:
|
|
33
|
-
sources:
|
|
34
|
-
hideSubmit:
|
|
35
|
-
hideSourceAction:
|
|
36
|
-
onActivation:
|
|
37
|
-
disabled:
|
|
38
|
-
handleChange:
|
|
39
|
-
handleSourcesChange:
|
|
40
|
-
shortBar:
|
|
41
|
-
active:
|
|
42
|
-
maxLength:
|
|
43
|
-
disableRichText:
|
|
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:
|
|
47
|
-
hideCharCount:
|
|
48
|
-
disableAutoActivate:
|
|
49
|
-
...
|
|
46
|
+
allowedDomains: P = [],
|
|
47
|
+
hideCharCount: _ = !1,
|
|
48
|
+
disableAutoActivate: B = !1,
|
|
49
|
+
...F
|
|
50
50
|
}) => {
|
|
51
|
-
const [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, [
|
|
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
|
-
|
|
59
|
-
},
|
|
60
|
-
editable: !
|
|
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: [
|
|
66
|
-
},
|
|
63
|
+
nodes: [Y, Z, ao, oo]
|
|
64
|
+
}, Q = () => {
|
|
67
65
|
N();
|
|
68
|
-
},
|
|
66
|
+
}, W = (t) => {
|
|
69
67
|
t.read(() => {
|
|
70
|
-
const
|
|
71
|
-
|
|
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
|
-
},
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
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:
|
|
82
|
-
allowedSources:
|
|
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(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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:
|
|
101
|
-
onRemove: () =>
|
|
102
|
+
index: e,
|
|
103
|
+
onRemove: () => G(t)
|
|
102
104
|
},
|
|
103
|
-
|
|
104
|
-
),
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */ o(
|
|
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(
|
|
110
|
-
[
|
|
111
|
+
className: I(i.editorInner, {
|
|
112
|
+
[i.editorInnerInactive]: !n && !x
|
|
111
113
|
}),
|
|
112
114
|
children: [
|
|
113
115
|
/* @__PURE__ */ o(
|
|
114
|
-
|
|
116
|
+
mo,
|
|
115
117
|
{
|
|
116
118
|
contentEditable: /* @__PURE__ */ o(
|
|
117
|
-
|
|
119
|
+
ro,
|
|
118
120
|
{
|
|
119
|
-
className: I(
|
|
120
|
-
[
|
|
121
|
+
className: I(i.editorInput, {
|
|
122
|
+
[i.editorInputInactive]: !n
|
|
121
123
|
}),
|
|
122
|
-
...
|
|
124
|
+
...F
|
|
123
125
|
}
|
|
124
126
|
),
|
|
125
|
-
placeholder:
|
|
126
|
-
ErrorBoundary:
|
|
127
|
+
placeholder: c && /* @__PURE__ */ o(V, {}),
|
|
128
|
+
ErrorBoundary: no
|
|
127
129
|
}
|
|
128
130
|
),
|
|
129
131
|
/* @__PURE__ */ o(
|
|
130
132
|
No,
|
|
131
133
|
{
|
|
132
|
-
hideSourceAction:
|
|
133
|
-
hideSubmit:
|
|
134
|
-
disableRichText:
|
|
135
|
-
shortBar:
|
|
136
|
-
onSubmit:
|
|
137
|
-
onAddSource:
|
|
138
|
-
isActive:
|
|
139
|
-
sourceTooltip:
|
|
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
|
-
|
|
146
|
-
/* @__PURE__ */ o(
|
|
147
|
+
n && l && !_ && /* @__PURE__ */ p("div", { className: i.charactersCount, children: [
|
|
148
|
+
/* @__PURE__ */ o(to, { maxLength: l }),
|
|
147
149
|
" ",
|
|
148
|
-
|
|
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(
|
|
155
|
-
/* @__PURE__ */ o(
|
|
156
|
+
/* @__PURE__ */ o(so, {}),
|
|
157
|
+
/* @__PURE__ */ o(lo, { onChange: W, ignoreSelectionChange: !0 }),
|
|
156
158
|
/* @__PURE__ */ o(
|
|
157
|
-
|
|
159
|
+
So,
|
|
158
160
|
{
|
|
159
|
-
onSetContent:
|
|
161
|
+
onSetContent: B ? () => {
|
|
160
162
|
} : N,
|
|
161
163
|
storageUid: v || T
|
|
162
164
|
}
|
|
163
165
|
),
|
|
164
|
-
/* @__PURE__ */ o(
|
|
166
|
+
/* @__PURE__ */ o(Co, {}),
|
|
165
167
|
/* @__PURE__ */ o(To, {}),
|
|
166
|
-
/* @__PURE__ */ o(
|
|
167
|
-
|
|
168
|
-
/* @__PURE__ */ o(
|
|
169
|
-
/* @__PURE__ */ o(
|
|
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
|
-
|
|
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
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Icon as
|
|
6
|
-
const
|
|
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
|
-
|
|
8
|
+
m,
|
|
9
9
|
{
|
|
10
|
-
className:
|
|
11
|
-
to:
|
|
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__ */
|
|
18
|
-
/* @__PURE__ */ e("div", { className:
|
|
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
|
-
|
|
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__ */
|
|
33
|
+
i && /* @__PURE__ */ r(
|
|
34
34
|
"button",
|
|
35
35
|
{
|
|
36
36
|
type: "button",
|
|
37
|
-
className:
|
|
38
|
-
onClick:
|
|
37
|
+
className: t.removeSourceButton,
|
|
38
|
+
onClick: (n) => {
|
|
39
|
+
n.preventDefault(), n.stopPropagation(), i();
|
|
40
|
+
},
|
|
39
41
|
"aria-label": "Remove source",
|
|
40
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ r(s, { name: "close", width: 10, height: 10 })
|
|
41
43
|
}
|
|
42
44
|
)
|
|
43
45
|
] });
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
k as SourceListItem
|
|
46
48
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import '../../../assets/components/summary/summary/Summary.module-
|
|
2
|
-
sectionBox:
|
|
3
|
-
content:
|
|
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
|
-
|
|
9
|
-
|
|
8
|
+
t as content,
|
|
9
|
+
i as default,
|
|
10
10
|
s as description,
|
|
11
|
-
|
|
11
|
+
n as sectionBox,
|
|
12
12
|
o as summaryContainer
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -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}
|