@logora/debate 0.3.80 → 0.3.81

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.
Files changed (54) hide show
  1. package/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +1 -0
  2. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +1 -0
  3. package/dist/assets/components/input/text_editor/{TextEditor.module-DePSfOvG.css → TextEditor.module-CxuSL3l3.css} +1 -1
  4. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-C9BaTFDH.css +1 -0
  5. package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
  6. package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
  7. package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
  8. package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +1 -0
  9. package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
  10. package/dist/assets/components/vote/vote_box/VoteBox.module-C9Q6gBw3.css +1 -0
  11. package/dist/components/argument/argument/Argument.js +111 -106
  12. package/dist/components/argument/argument/Argument.module.scss.js +31 -31
  13. package/dist/components/consultation/consultation_box/ConsultationBox.js +80 -111
  14. package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +31 -29
  15. package/dist/components/dialog/dropdown/Dropdown.js +35 -28
  16. package/dist/components/icons/spiegel_icons/Downvote.js +6 -0
  17. package/dist/components/icons/spiegel_icons/Upvote.js +6 -0
  18. package/dist/components/icons/spiegel_icons/index.js +46 -46
  19. package/dist/components/icons/stern_icons/index.js +100 -70
  20. package/dist/components/input/argument_input/ArgumentInput.js +201 -197
  21. package/dist/components/input/select/Select.js +19 -19
  22. package/dist/components/input/text_editor/TextEditor.js +143 -129
  23. package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
  24. package/dist/components/input/text_editor/plugins/FocusPlugin.js +12 -8
  25. package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
  26. package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
  27. package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +70 -72
  28. package/dist/components/list/paginated_list/PaginatedList.js +112 -110
  29. package/dist/components/notification/notification_menu/NotificationMenu.js +23 -22
  30. package/dist/components/proposal/proposal_box/ProposalBox.js +58 -49
  31. package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +14 -12
  32. package/dist/components/section/section_box/SectionBox.js +10 -10
  33. package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
  34. package/dist/components/source/context_source_box/ContextSourceBox.js +7 -7
  35. package/dist/components/source/context_source_list/ContextSourceList.js +10 -13
  36. package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +14 -12
  37. package/dist/components/source/source_list_item/SourceListItem.js +42 -28
  38. package/dist/components/source/source_list_item/SourceListItem.module.scss.js +8 -6
  39. package/dist/components/source/source_modal/SourceModal.js +15 -15
  40. package/dist/components/summary/summary/Summary.js +41 -63
  41. package/dist/components/summary/summary/Summary.module.scss.js +10 -6
  42. package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
  43. package/dist/components/vote/vote_box/VoteBox.js +123 -145
  44. package/dist/components/vote/vote_box/VoteBox.module.scss.js +50 -50
  45. package/package.json +1 -1
  46. package/dist/assets/components/argument/argument/Argument.module-gLfNRLks.css +0 -1
  47. package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +0 -1
  48. package/dist/assets/components/proposal/proposal_box/ProposalBox.module-T4ms_LQ7.css +0 -1
  49. package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +0 -1
  50. package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +0 -1
  51. package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +0 -1
  52. package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +0 -1
  53. package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +0 -1
  54. package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
@@ -1,10 +1,10 @@
1
- import { jsx as c, jsxs as u } from "react/jsx-runtime";
1
+ import { jsx as c, jsxs as f } from "react/jsx-runtime";
2
2
  import h from "classnames";
3
3
  import { useState as b, useEffect as p } from "react";
4
- import r from "./Select.module.scss.js";
4
+ import t from "./Select.module.scss.js";
5
5
  import { Dropdown as k } from "../../dialog/dropdown/Dropdown.js";
6
6
  import { Icon as y } from "../../icons/icon/Icon.js";
7
- const I = ({
7
+ const N = ({
8
8
  options: a,
9
9
  defaultOption: n,
10
10
  onChange: s,
@@ -13,7 +13,7 @@ const I = ({
13
13
  className: m,
14
14
  horizontalPosition: v = "left"
15
15
  }) => {
16
- const d = n ? a.filter((e) => e.name === n)[0] : a[0], [f, l] = b(d);
16
+ const d = n ? a.filter((e) => e.name === n)[0] : a[0], [u, l] = b(d);
17
17
  p(() => {
18
18
  i === !0 && l(d);
19
19
  }, [i]), p(() => {
@@ -22,29 +22,29 @@ const I = ({
22
22
  const w = (e) => {
23
23
  l(e), s && s(e);
24
24
  }, x = (e) => {
25
- const t = e.currentTarget;
25
+ const r = e.currentTarget;
26
26
  switch (e.key) {
27
27
  case "Enter":
28
28
  case " ":
29
- e.preventDefault(), t.click();
29
+ e.preventDefault(), r.click();
30
30
  break;
31
31
  case "ArrowDown":
32
- e.preventDefault(), t.nextElementSibling?.focus();
32
+ e.preventDefault(), r.nextElementSibling?.focus();
33
33
  break;
34
34
  case "ArrowUp":
35
- e.preventDefault(), t.previousElementSibling?.focus();
35
+ e.preventDefault(), r.previousElementSibling?.focus();
36
36
  break;
37
37
  }
38
38
  }, D = (e) => {
39
- const t = f?.name === e.name;
39
+ const r = u?.name === e.name;
40
40
  return e.name !== "" && /* @__PURE__ */ c(
41
41
  "div",
42
42
  {
43
43
  role: "option",
44
- "aria-selected": t,
44
+ "aria-selected": r,
45
45
  tabIndex: 0,
46
- className: h(r.selectOption, {
47
- [r.selectOptionActive]: t
46
+ className: h(t.selectOption, {
47
+ [t.selectOptionActive]: r
48
48
  }),
49
49
  value: e.value,
50
50
  "data-tid": e.dataTid,
@@ -55,22 +55,22 @@ const I = ({
55
55
  e.value
56
56
  );
57
57
  };
58
- return /* @__PURE__ */ c("div", { className: r.selectContainer, children: /* @__PURE__ */ u(k, { horizontalPosition: v, children: [
59
- /* @__PURE__ */ u(
58
+ return /* @__PURE__ */ c("div", { className: t.selectContainer, children: /* @__PURE__ */ f(k, { horizontalPosition: v, closeOnContentClick: !0, children: [
59
+ /* @__PURE__ */ f(
60
60
  "div",
61
61
  {
62
- className: h(r.selectInput, {
62
+ className: h(t.selectInput, {
63
63
  [m]: m,
64
- [r.disabled]: o
64
+ [t.disabled]: o
65
65
  }),
66
66
  children: [
67
- /* @__PURE__ */ c("span", { className: r.currentOptionText, children: f?.text }),
67
+ /* @__PURE__ */ c("span", { className: t.currentOptionText, children: u?.text }),
68
68
  " ",
69
69
  /* @__PURE__ */ c(
70
70
  y,
71
71
  {
72
72
  name: "lightArrow",
73
- className: r.arrowDown,
73
+ className: t.arrowDown,
74
74
  height: 10,
75
75
  width: 10
76
76
  }
@@ -82,5 +82,5 @@ const I = ({
82
82
  ] }) });
83
83
  };
84
84
  export {
85
- I as Select
85
+ N as Select
86
86
  };
@@ -1,171 +1,185 @@
1
- import { jsxs as u, Fragment as X, jsx as t } from "react/jsx-runtime";
2
- import { ListNode as Y, ListItemNode as Z } from "@lexical/list";
3
- import { OverflowNode as tt } from "@lexical/overflow";
4
- import { CharacterLimitPlugin as ot } from "@lexical/react/LexicalCharacterLimitPlugin";
5
- import { LexicalComposer as et } from "@lexical/react/LexicalComposer";
6
- import { ContentEditable as rt } from "@lexical/react/LexicalContentEditable";
7
- import { EditorRefPlugin as it } from "@lexical/react/LexicalEditorRefPlugin";
8
- import { LexicalErrorBoundary as nt } from "@lexical/react/LexicalErrorBoundary";
9
- import { HistoryPlugin as st } from "@lexical/react/LexicalHistoryPlugin";
10
- import { ListPlugin as lt } from "@lexical/react/LexicalListPlugin";
11
- import { OnChangePlugin as ct } from "@lexical/react/LexicalOnChangePlugin";
12
- import { RichTextPlugin as mt } from "@lexical/react/LexicalRichTextPlugin";
13
- import { QuoteNode as at } from "@lexical/rich-text";
14
- import I from "classnames";
15
- import { $getRoot as dt } from "lexical";
16
- import { useState as a, useId as ft, useEffect as b } from "react";
17
- import { useIntl as ut } from "react-intl";
18
- import pt from "./EditorTheme.js";
19
- import e from "./TextEditor.module.scss.js";
20
- import { AutoSavePlugin as ht } from "./plugins/AutoSavePlugin.js";
21
- import { FocusPlugin as gt } from "./plugins/FocusPlugin.js";
22
- import { MaxLengthPlugin as xt } from "./plugins/MaxLengthPlugin.js";
23
- import { ResetPlugin as St } from "./plugins/ResetPlugin.js";
24
- import { SetContentPlugin as Ct } from "./plugins/SetContentPlugin.js";
25
- import { SetRichContentPlugin as Pt } from "./plugins/SetRichContentPlugin.js";
26
- import { ToolbarPlugin as Tt } from "./plugins/ToolbarPlugin.js";
27
- import { useModal as vt } from "../../dialog/modal/useModal.js";
28
- import { SourceModal as Nt } from "../../source/source_modal/SourceModal.js";
29
- import { SourceListItem as Et } from "../../source/source_list_item/SourceListItem.js";
30
- const M = (l) => l?.replace(/ /g, " "), to = ({
1
+ import { jsxs as S, Fragment as oe, jsx as e } from "react/jsx-runtime";
2
+ import { ListNode as re, ListItemNode as ie } from "@lexical/list";
3
+ import { OverflowNode as ne } from "@lexical/overflow";
4
+ import { CharacterLimitPlugin as se } from "@lexical/react/LexicalCharacterLimitPlugin";
5
+ import { LexicalComposer as ce } from "@lexical/react/LexicalComposer";
6
+ import { ContentEditable as le } from "@lexical/react/LexicalContentEditable";
7
+ import { EditorRefPlugin as me } from "@lexical/react/LexicalEditorRefPlugin";
8
+ import { LexicalErrorBoundary as ae } from "@lexical/react/LexicalErrorBoundary";
9
+ import { HistoryPlugin as de } from "@lexical/react/LexicalHistoryPlugin";
10
+ import { ListPlugin as ue } from "@lexical/react/LexicalListPlugin";
11
+ import { OnChangePlugin as fe } from "@lexical/react/LexicalOnChangePlugin";
12
+ import { RichTextPlugin as pe } from "@lexical/react/LexicalRichTextPlugin";
13
+ import { QuoteNode as he } from "@lexical/rich-text";
14
+ import b from "classnames";
15
+ import { $getRoot as ge } from "lexical";
16
+ import { useState as f, useId as Se, useRef as xe, useEffect as M } from "react";
17
+ import { useIntl as Ce } from "react-intl";
18
+ import Pe from "./EditorTheme.js";
19
+ import i from "./TextEditor.module.scss.js";
20
+ import { AutoSavePlugin as Te } from "./plugins/AutoSavePlugin.js";
21
+ import { FocusPlugin as Ne } from "./plugins/FocusPlugin.js";
22
+ import { MaxLengthPlugin as ve } from "./plugins/MaxLengthPlugin.js";
23
+ import { ResetPlugin as Ee } from "./plugins/ResetPlugin.js";
24
+ import { SetContentPlugin as Ie } from "./plugins/SetContentPlugin.js";
25
+ import { SetRichContentPlugin as Re } from "./plugins/SetRichContentPlugin.js";
26
+ import { ToolbarPlugin as be } from "./plugins/ToolbarPlugin.js";
27
+ import { useModal as Me } from "../../dialog/modal/useModal.js";
28
+ import { SourceModal as ye } from "../../source/source_modal/SourceModal.js";
29
+ import { SourceListItem as we } from "../../source/source_list_item/SourceListItem.js";
30
+ const y = (l) => l?.replace(/ /g, " "), st = ({
31
31
  placeholder: l,
32
- onSubmit: p,
33
- sources: r,
34
- hideSubmit: y = !1,
35
- hideSourceAction: R = !1,
36
- onActivation: h,
37
- disabled: w = !1,
38
- handleChange: g,
39
- handleSourcesChange: x,
40
- shortBar: A = !1,
41
- active: S = !1,
42
- maxLength: c,
43
- disableRichText: L = !1,
44
- editorRef: _,
45
- uid: C,
46
- allowedDomains: P = [],
47
- hideCharCount: B = !1,
48
- disableAutoActivate: F = !1,
49
- ...O
32
+ initialContent: w,
33
+ initialRichContent: L,
34
+ onSubmit: x,
35
+ sources: p,
36
+ hideSubmit: _ = !1,
37
+ hideSourceAction: A = !1,
38
+ onActivation: n,
39
+ disabled: B = !1,
40
+ handleChange: C,
41
+ handleSourcesChange: h,
42
+ shortBar: O = !1,
43
+ active: g = !1,
44
+ maxLength: m,
45
+ disableRichText: U = !1,
46
+ editorRef: j,
47
+ uid: P,
48
+ allowedDomains: T = [],
49
+ hideCharCount: k = !1,
50
+ disableAutoActivate: z = !1,
51
+ autoFocus: a = !1,
52
+ ...H
50
53
  }) => {
51
- const [n, U] = a(!1), [j, k] = a(""), [z, H] = a(""), [s, d] = a([]), { showModal: J } = vt(), T = ut(), v = ft();
52
- b(() => {
53
- r && r.length > 0 && d(r);
54
- }, [r]), b(() => {
55
- x && s.length > 0 && x(s);
56
- }, [s]);
57
- const N = () => {
58
- n || (U(!0), h && h());
59
- }, Q = {
60
- editable: !w,
61
- theme: pt,
62
- onError(o) {
63
- console.error("TextEditor error:", o);
54
+ const [s, J] = f(a || g), [Q, W] = f(""), [$, q] = f(""), [d, u] = f([]), { showModal: D } = Me(), N = Ce(), v = Se(), E = xe(!1);
55
+ M(() => {
56
+ a && !E.current && n && (E.current = !0, n());
57
+ }, [a, n]), M(() => {
58
+ p && u(p);
59
+ }, [p]);
60
+ const I = () => {
61
+ s || (J(!0), n && n());
62
+ }, F = {
63
+ editable: !B,
64
+ theme: Pe,
65
+ onError(t) {
66
+ console.error("TextEditor error:", t);
64
67
  },
65
- nodes: [Y, Z, at, tt]
66
- }, W = () => {
67
- N();
68
- }, $ = (o) => {
69
- o.read(() => {
70
- const i = dt().getTextContent(), m = M(i), f = JSON.stringify(o), E = M(f);
71
- k(m), H(E), g && g(m, E);
68
+ nodes: [re, ie, he, ne]
69
+ }, G = () => {
70
+ I();
71
+ }, K = (t) => {
72
+ t.read(() => {
73
+ const o = ge().getTextContent(), r = y(o), c = JSON.stringify(t), R = y(c);
74
+ W(r), q(R), C && C(r, R);
72
75
  });
73
- }, q = (o) => {
74
- const i = j, m = z, f = s;
75
- p && (o.preventDefault(), p(i, m, f)), d([]);
76
- }, D = () => {
77
- J(
78
- /* @__PURE__ */ t(
79
- Nt,
76
+ }, V = (t) => {
77
+ const o = Q, r = $, c = d;
78
+ x && (t.preventDefault(), x(o, r, c)), u([]), h?.([]);
79
+ }, X = () => {
80
+ D(
81
+ /* @__PURE__ */ e(
82
+ ye,
80
83
  {
81
- onAddSource: G,
82
- allowedSources: P
84
+ onAddSource: Y,
85
+ allowedSources: T
83
86
  }
84
87
  )
85
88
  );
86
- }, G = (o) => {
87
- d([...s, o]);
88
- }, K = (o, i) => /* @__PURE__ */ t(
89
- Et,
89
+ }, Y = (t) => {
90
+ u((o) => {
91
+ const r = [...o, t];
92
+ return h?.(r), r;
93
+ });
94
+ }, Z = (t) => {
95
+ u((o) => {
96
+ const r = o.filter(
97
+ (c) => c.source_url !== t.source_url
98
+ );
99
+ return h?.(r), r;
100
+ });
101
+ }, ee = (t, o) => /* @__PURE__ */ e(
102
+ we,
90
103
  {
91
- publisher: o.publisher,
92
- url: o.source_url,
93
- title: o.title,
94
- index: i
104
+ publisher: t.publisher,
105
+ url: t.source_url,
106
+ title: t.title,
107
+ index: o,
108
+ onRemove: () => Z(t)
95
109
  },
96
- i
97
- ), V = () => /* @__PURE__ */ t("div", { className: e.editorPlaceholder, children: l });
98
- return /* @__PURE__ */ u(X, { children: [
99
- /* @__PURE__ */ t(et, { initialConfig: Q, children: /* @__PURE__ */ t("div", { className: e.editorContainer, onClick: W, children: /* @__PURE__ */ u(
110
+ o
111
+ ), te = () => /* @__PURE__ */ e("div", { className: i.editorPlaceholder, children: l });
112
+ return /* @__PURE__ */ S(oe, { children: [
113
+ /* @__PURE__ */ e(ce, { initialConfig: F, children: /* @__PURE__ */ e("div", { className: i.editorContainer, onClick: G, children: /* @__PURE__ */ S(
100
114
  "div",
101
115
  {
102
- className: I(e.editorInner, {
103
- [e.editorInnerInactive]: !n && !S
116
+ className: b(i.editorInner, {
117
+ [i.editorInnerInactive]: !s && !g
104
118
  }),
105
119
  children: [
106
- /* @__PURE__ */ t(
107
- mt,
120
+ /* @__PURE__ */ e(
121
+ pe,
108
122
  {
109
- contentEditable: /* @__PURE__ */ t(
110
- rt,
123
+ contentEditable: /* @__PURE__ */ e(
124
+ le,
111
125
  {
112
- className: I(e.editorInput, {
113
- [e.editorInputInactive]: !n
126
+ className: b(i.editorInput, {
127
+ [i.editorInputInactive]: !s
114
128
  }),
115
- ...O
129
+ ...H
116
130
  }
117
131
  ),
118
- placeholder: l && /* @__PURE__ */ t(V, {}),
119
- ErrorBoundary: nt
132
+ placeholder: l && /* @__PURE__ */ e(te, {}),
133
+ ErrorBoundary: ae
120
134
  }
121
135
  ),
122
- /* @__PURE__ */ t(
123
- Tt,
136
+ /* @__PURE__ */ e(
137
+ be,
124
138
  {
125
- hideSourceAction: R,
126
- hideSubmit: y,
127
- disableRichText: L,
128
- shortBar: A,
129
- onSubmit: q,
130
- onAddSource: D,
131
- isActive: n || S,
132
- sourceTooltip: P?.length > 0 && T.formatMessage({
139
+ hideSourceAction: A,
140
+ hideSubmit: _,
141
+ disableRichText: U,
142
+ shortBar: O,
143
+ onSubmit: V,
144
+ onAddSource: X,
145
+ isActive: s || g,
146
+ sourceTooltip: T?.length > 0 && N.formatMessage({
133
147
  id: "input.allowed_domains_tooltip",
134
148
  defaultMessage: "With the new source function, you can add links to your article."
135
149
  })
136
150
  }
137
151
  ),
138
- n && c && !B && /* @__PURE__ */ u("div", { className: e.charactersCount, children: [
139
- /* @__PURE__ */ t(ot, { maxLength: c }),
152
+ s && m && !k && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
153
+ /* @__PURE__ */ e(se, { maxLength: m }),
140
154
  " ",
141
- T.formatMessage({
155
+ N.formatMessage({
142
156
  id: "input.remaining_chars",
143
157
  defaultMessage: "remaining characters"
144
158
  })
145
159
  ] }),
146
- /* @__PURE__ */ t(lt, {}),
147
- /* @__PURE__ */ t(st, {}),
148
- /* @__PURE__ */ t(ct, { onChange: $, ignoreSelectionChange: !0 }),
149
- /* @__PURE__ */ t(
150
- ht,
160
+ /* @__PURE__ */ e(ue, {}),
161
+ /* @__PURE__ */ e(de, {}),
162
+ /* @__PURE__ */ e(fe, { onChange: K, ignoreSelectionChange: !0 }),
163
+ /* @__PURE__ */ e(
164
+ Te,
151
165
  {
152
- onSetContent: F ? () => {
153
- } : N,
154
- storageUid: C || v
166
+ onSetContent: z ? () => {
167
+ } : I,
168
+ storageUid: P || v
155
169
  }
156
170
  ),
157
- /* @__PURE__ */ t(Ct, {}),
158
- /* @__PURE__ */ t(Pt, {}),
159
- /* @__PURE__ */ t(gt, {}),
160
- c && /* @__PURE__ */ t(xt, { maxLength: c }),
161
- /* @__PURE__ */ t(St, { storageUid: C || v }),
162
- /* @__PURE__ */ t(it, { editorRef: _ })
171
+ /* @__PURE__ */ e(Ie, { content: w }),
172
+ /* @__PURE__ */ e(Re, { richContent: L }),
173
+ /* @__PURE__ */ e(Ne, { autoFocus: a }),
174
+ m && /* @__PURE__ */ e(ve, { maxLength: m }),
175
+ /* @__PURE__ */ e(Ee, { storageUid: P || v }),
176
+ /* @__PURE__ */ e(me, { editorRef: j })
163
177
  ]
164
178
  }
165
179
  ) }) }),
166
- r && r.length !== 0 ? /* @__PURE__ */ t("div", { className: e.sourcesBox, children: /* @__PURE__ */ t("div", { className: e.sourceList, children: r.map(K) }) }) : null
180
+ d && d.length !== 0 ? /* @__PURE__ */ e("div", { className: i.sourcesBox, children: /* @__PURE__ */ e("div", { className: i.sourceList, children: d.map(ee) }) }) : null
167
181
  ] });
168
182
  };
169
183
  export {
170
- to as TextEditor
184
+ st as TextEditor
171
185
  };
@@ -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,14 +1,18 @@
1
- import { useLexicalComposerContext as e } from "@lexical/react/LexicalComposerContext";
2
- import { useEffect as r } from "react";
3
- import { useInput as n } from "../../input_provider/useInput.js";
4
- const f = () => {
5
- const [o] = e(), { focus: t } = n();
6
- return r(() => {
7
- t && o.focus(() => {
1
+ import { useLexicalComposerContext as u } from "@lexical/react/LexicalComposerContext";
2
+ import { useRef as c, useEffect as s } from "react";
3
+ import { useInput as f } from "../../input_provider/useInput.js";
4
+ const E = ({ autoFocus: t = !1 }) => {
5
+ const [o] = u(), { focus: e } = f(), r = c(!1);
6
+ return s(() => {
7
+ e && o.focus(() => {
8
8
  o.getRootElement().focus();
9
9
  });
10
+ }, [e, o]), s(() => {
11
+ t && !r.current && (r.current = !0, o.focus(() => {
12
+ o.getRootElement().focus();
13
+ }));
10
14
  }, [t, o]), null;
11
15
  };
12
16
  export {
13
- f as FocusPlugin
17
+ E as FocusPlugin
14
18
  };
@@ -1,18 +1,18 @@
1
- import { useLexicalComposerContext as p } from "@lexical/react/LexicalComposerContext";
2
- import { $getRoot as u, $createParagraphNode as a, $createTextNode as c } from "lexical";
3
- import { useEffect as s } from "react";
4
- import { useInput as i } from "../../input_provider/useInput.js";
5
- const C = () => {
6
- const [n] = p(), { inputContent: t, setInputContent: r } = i();
7
- return s(() => {
8
- t && n.update(() => {
9
- const e = u();
10
- e.clear();
11
- const o = a();
12
- o.append(c(t)), e.append(o), r(null);
1
+ import { useLexicalComposerContext as s } from "@lexical/react/LexicalComposerContext";
2
+ import { $getRoot as a, $createParagraphNode as c, $createTextNode as u } from "lexical";
3
+ import { useEffect as f } from "react";
4
+ import { useInput as m } from "../../input_provider/useInput.js";
5
+ const x = ({ content: e }) => {
6
+ const [p] = s(), { inputContent: o, setInputContent: i } = m(), t = e || (typeof o == "string" ? o : void 0);
7
+ return f(() => {
8
+ typeof t == "string" && t && p.update(() => {
9
+ const n = a();
10
+ n.clear();
11
+ const r = c();
12
+ r.append(u(t)), n.append(r), !e && o && i(null);
13
13
  });
14
14
  }, [t]), null;
15
15
  };
16
16
  export {
17
- C as SetContentPlugin
17
+ x as SetContentPlugin
18
18
  };
@@ -1,14 +1,14 @@
1
- import { useLexicalComposerContext as r } from "@lexical/react/LexicalComposerContext";
2
- import { useEffect as i } from "react";
3
- import { useInput as s } from "../../input_provider/useInput.js";
4
- const m = () => {
5
- const [t] = r(), { inputRichContent: e, setInputRichContent: o } = s();
6
- return i(() => {
7
- e && t.update(() => {
8
- const n = t.parseEditorState(e);
9
- t.setEditorState(n), o(null);
1
+ import { useLexicalComposerContext as s } from "@lexical/react/LexicalComposerContext";
2
+ import { useEffect as u } from "react";
3
+ import { useInput as c } from "../../input_provider/useInput.js";
4
+ const m = ({ richContent: e }) => {
5
+ const [t] = s(), { inputRichContent: n, setInputRichContent: i } = c(), o = e || n;
6
+ return u(() => {
7
+ o && t.update(() => {
8
+ const r = t.parseEditorState(o);
9
+ t.setEditorState(r), !e && n && i(null);
10
10
  });
11
- }, [e]), null;
11
+ }, [o]), null;
12
12
  };
13
13
  export {
14
14
  m as SetRichContentPlugin