@logora/debate 0.3.93 → 0.3.95

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
+ ._listHeader_2wxq4_3{display:flex;justify-content:space-between;align-items:center;position:relative;flex-wrap:wrap;gap:var(--space-unit, 1em)}@container (max-width: 575.98px){._listHeader_2wxq4_3{flex-direction:column;align-items:flex-start}._listHeader_2wxq4_3._listHeaderOneItem_2wxq4_16{flex-direction:row;align-items:center;flex-wrap:nowrap!important}}._listTitle_2wxq4_23{font-size:var(--font-size-extra-large, 22px);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"))}._listSubtitle_2wxq4_30{color:var(--text-primary, #222222);font-weight:var(--font-weight-normal, 400);font-size:var(--font-size-normal, 16px);margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}._rightBar_2wxq4_37{display:flex;gap:var(--space-unit, 1em);flex-wrap:wrap}@container (max-width: 575.98px){._rightBar_2wxq4_37{width:100%;justify-content:space-between}._rightBar_2wxq4_37._rightBarOneItem_2wxq4_47{justify-content:flex-end}}._rightBar_2wxq4_37{flex:1 1 auto;justify-content:flex-end;align-items:center;flex-direction:row}._search_2wxq4_58{flex:1;max-width:35%}@container (max-width: 575.98px){._search_2wxq4_58{max-width:80%}}._tagList_2wxq4_68{display:flex;flex-direction:row;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75));padding-bottom:var(--spacer-md, calc(var(--space-unit, 1em) * .75))}@container (max-width: 575.98px){._tagList_2wxq4_68{gap:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}}._tagItem_2wxq4_83{display:flex!important;color:var(--text-secondary, #5F5F5F);cursor:pointer;white-space:nowrap}._select_2wxq4_90{max-width:300px}@container (max-width: 575.98px){._select_2wxq4_90{max-width:300px}}
@@ -14,20 +14,21 @@ import { QuoteNode as he } from "@lexical/rich-text";
14
14
  import b from "classnames";
15
15
  import { $getRoot as ge } from "lexical";
16
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";
17
+ import { useIntl as Pe } from "react-intl";
18
+ import Ce from "./EditorTheme.js";
19
19
  import i from "./TextEditor.module.scss.js";
20
20
  import { AutoSavePlugin as Te } from "./plugins/AutoSavePlugin.js";
21
- import { FocusPlugin as Ne } from "./plugins/FocusPlugin.js";
21
+ import { FocusPlugin as Ie } from "./plugins/FocusPlugin.js";
22
+ import { IOSInsertParagraphFallbackPlugin as Ne } from "./plugins/IOSInsertParagraphFallbackPlugin.js";
22
23
  import { MaxLengthPlugin as ve } from "./plugins/MaxLengthPlugin.js";
23
24
  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 = ({
25
+ import { SetContentPlugin as Re } from "./plugins/SetContentPlugin.js";
26
+ import { SetRichContentPlugin as be } from "./plugins/SetRichContentPlugin.js";
27
+ import { ToolbarPlugin as Me } from "./plugins/ToolbarPlugin.js";
28
+ import { useModal as ye } from "../../dialog/modal/useModal.js";
29
+ import { SourceModal as we } from "../../source/source_modal/SourceModal.js";
30
+ import { SourceListItem as Le } from "../../source/source_list_item/SourceListItem.js";
31
+ const y = (l) => l?.replace(/ /g, " "), lt = ({
31
32
  placeholder: l,
32
33
  initialContent: w,
33
34
  initialRichContent: L,
@@ -35,51 +36,51 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
35
36
  sources: p,
36
37
  hideSubmit: _ = !1,
37
38
  hideSourceAction: A = !1,
38
- onActivation: s,
39
- disabled: B = !1,
40
- handleChange: C,
39
+ onActivation: n,
40
+ disabled: O = !1,
41
+ handleChange: P,
41
42
  handleSourcesChange: h,
42
- shortBar: O = !1,
43
+ shortBar: k = !1,
43
44
  active: g = !1,
44
45
  maxLength: m,
45
- disableRichText: U = !1,
46
- editorRef: j,
47
- uid: P,
46
+ disableRichText: B = !1,
47
+ editorRef: U,
48
+ uid: C,
48
49
  allowedDomains: T = [],
49
- hideCharCount: k = !1,
50
+ hideCharCount: j = !1,
50
51
  disableAutoActivate: z = !1,
51
52
  autoFocus: a = !1,
52
- ...H
53
+ ...F
53
54
  }) => {
54
- const [n, J] = f(a || g), [Q, W] = f(""), [$, q] = f(""), [d, u] = f([]), { showModal: D } = Me(), N = Ce(), v = Se(), E = xe(!1);
55
+ const [s, H] = f(a || g), [J, Q] = f(""), [W, $] = f(""), [d, u] = f([]), { showModal: q } = ye(), I = Pe(), N = Se(), v = xe(!1);
55
56
  M(() => {
56
- a && !E.current && s && (E.current = !0, s());
57
- }, [a, s]), M(() => {
57
+ a && !v.current && n && (v.current = !0, n());
58
+ }, [a, n]), M(() => {
58
59
  p && u(p);
59
60
  }, [p]);
60
- const I = () => {
61
- n || (J(!0), s && s());
62
- }, F = {
63
- editable: !B,
64
- theme: Pe,
61
+ const E = () => {
62
+ s || (H(!0), n && n());
63
+ }, D = {
64
+ editable: !O,
65
+ theme: Ce,
65
66
  onError(t) {
66
67
  console.error("TextEditor error:", t);
67
68
  },
68
69
  nodes: [re, ie, he, ne]
69
70
  }, G = () => {
70
- I();
71
+ E();
71
72
  }, K = (t) => {
72
73
  t.read(() => {
73
74
  const o = ge().getTextContent(), r = y(o), c = JSON.stringify(t), R = y(c);
74
- W(r), q(R), C && C(r, R);
75
+ Q(r), $(R), P && P(r, R);
75
76
  });
76
77
  }, V = (t) => {
77
- const o = Q, r = $, c = d;
78
+ const o = J, r = W, c = d;
78
79
  x && (t.preventDefault(), x(o, r, c)), u([]), h?.([]);
79
80
  }, X = () => {
80
- D(
81
+ q(
81
82
  /* @__PURE__ */ e(
82
- ye,
83
+ we,
83
84
  {
84
85
  onAddSource: Y,
85
86
  allowedSources: T
@@ -99,7 +100,7 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
99
100
  return h?.(r), r;
100
101
  });
101
102
  }, ee = (t, o) => /* @__PURE__ */ e(
102
- we,
103
+ Le,
103
104
  {
104
105
  publisher: t.publisher,
105
106
  url: t.source_url,
@@ -110,11 +111,11 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
110
111
  o
111
112
  ), te = () => /* @__PURE__ */ e("div", { className: i.editorPlaceholder, children: l });
112
113
  return /* @__PURE__ */ S(oe, { children: [
113
- /* @__PURE__ */ e(ce, { initialConfig: F, children: /* @__PURE__ */ e("div", { className: i.editorContainer, onClick: G, children: /* @__PURE__ */ S(
114
+ /* @__PURE__ */ e(ce, { initialConfig: D, children: /* @__PURE__ */ e("div", { className: i.editorContainer, onClick: G, children: /* @__PURE__ */ S(
114
115
  "div",
115
116
  {
116
117
  className: b(i.editorInner, {
117
- [i.editorInnerInactive]: !n && !g
118
+ [i.editorInnerInactive]: !s && !g
118
119
  }),
119
120
  children: [
120
121
  /* @__PURE__ */ e(
@@ -124,9 +125,9 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
124
125
  le,
125
126
  {
126
127
  className: b(i.editorInput, {
127
- [i.editorInputInactive]: !n
128
+ [i.editorInputInactive]: !s
128
129
  }),
129
- ...H
130
+ ...F
130
131
  }
131
132
  ),
132
133
  placeholder: l && /* @__PURE__ */ e(te, {}),
@@ -134,25 +135,25 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
134
135
  }
135
136
  ),
136
137
  /* @__PURE__ */ e(
137
- be,
138
+ Me,
138
139
  {
139
140
  hideSourceAction: A,
140
141
  hideSubmit: _,
141
- disableRichText: U,
142
- shortBar: O,
142
+ disableRichText: B,
143
+ shortBar: k,
143
144
  onSubmit: V,
144
145
  onAddSource: X,
145
- isActive: n || g,
146
- sourceTooltip: T?.length > 0 && N.formatMessage({
146
+ isActive: s || g,
147
+ sourceTooltip: T?.length > 0 && I.formatMessage({
147
148
  id: "input.allowed_domains_tooltip",
148
149
  defaultMessage: "With the new source function, you can add links to your article."
149
150
  })
150
151
  }
151
152
  ),
152
- n && m && !k && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
153
+ s && m && !j && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
153
154
  /* @__PURE__ */ e(se, { maxLength: m }),
154
155
  " ",
155
- N.formatMessage({
156
+ I.formatMessage({
156
157
  id: "input.remaining_chars",
157
158
  defaultMessage: "remaining characters"
158
159
  })
@@ -164,16 +165,17 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
164
165
  Te,
165
166
  {
166
167
  onSetContent: z ? () => {
167
- } : I,
168
- storageUid: P || v
168
+ } : E,
169
+ storageUid: C || N
169
170
  }
170
171
  ),
171
- /* @__PURE__ */ e(Ie, { content: w }),
172
- /* @__PURE__ */ e(Re, { richContent: L }),
173
- /* @__PURE__ */ e(Ne, { autoFocus: a, isActive: n }),
172
+ /* @__PURE__ */ e(Re, { content: w }),
173
+ /* @__PURE__ */ e(be, { richContent: L }),
174
+ /* @__PURE__ */ e(Ie, { autoFocus: a }),
175
+ /* @__PURE__ */ e(Ne, {}),
174
176
  m && /* @__PURE__ */ e(ve, { maxLength: m }),
175
- /* @__PURE__ */ e(Ee, { storageUid: P || v }),
176
- /* @__PURE__ */ e(me, { editorRef: j })
177
+ /* @__PURE__ */ e(Ee, { storageUid: C || N }),
178
+ /* @__PURE__ */ e(me, { editorRef: U })
177
179
  ]
178
180
  }
179
181
  ) }) }),
@@ -181,5 +183,5 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
181
183
  ] });
182
184
  };
183
185
  export {
184
- st as TextEditor
186
+ lt as TextEditor
185
187
  };
@@ -1,20 +1,18 @@
1
- import { useLexicalComposerContext as l } from "@lexical/react/LexicalComposerContext";
2
- import { useRef as f, useEffect as r } from "react";
3
- import { useInput as m } from "../../input_provider/useInput.js";
4
- const d = ({ autoFocus: n = !1, isActive: t = !1 }) => {
5
- const [o] = l(), { focus: s } = m(), u = f(!1), c = f(t), e = () => {
6
- o.focus(() => {
7
- o.getRootElement()?.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
+ o.getRootElement().focus();
8
9
  });
9
- };
10
- return r(() => {
11
- s && e();
12
- }, [s, o]), r(() => {
13
- n && !u.current && (u.current = !0, e());
14
- }, [n, o]), r(() => {
15
- t && !c.current && e(), c.current = t;
10
+ }, [e, o]), s(() => {
11
+ t && !r.current && (r.current = !0, o.focus(() => {
12
+ o.getRootElement().focus();
13
+ }));
16
14
  }, [t, o]), null;
17
15
  };
18
16
  export {
19
- d as FocusPlugin
17
+ E as FocusPlugin
20
18
  };
@@ -0,0 +1,49 @@
1
+ import { useLexicalComposerContext as c } from "@lexical/react/LexicalComposerContext";
2
+ import { IS_IOS as f, KEY_ENTER_COMMAND as l, INSERT_PARAGRAPH_COMMAND as g, COMMAND_PRIORITY_LOW as h, $getRoot as d } from "lexical";
3
+ import { useRef as S, useEffect as E } from "react";
4
+ const I = (t) => t.inputType === "insertParagraph" || t.inputType === "insertLineBreak", a = (t) => {
5
+ let r = "";
6
+ return t.read(() => {
7
+ const n = d();
8
+ r = `${n.getChildrenSize()}:${n.getTextContent()}`;
9
+ }), r;
10
+ }, T = () => {
11
+ const [t] = c(), r = S(null);
12
+ return E(() => {
13
+ if (!f)
14
+ return;
15
+ const n = (e) => {
16
+ I(e) && (r.current = e.timeStamp);
17
+ }, s = t.registerRootListener(
18
+ (e, o) => {
19
+ o?.removeEventListener(
20
+ "beforeinput",
21
+ n,
22
+ !0
23
+ ), e?.addEventListener("beforeinput", n, !0);
24
+ }
25
+ ), i = t.registerCommand(
26
+ l,
27
+ (e) => {
28
+ if (!e || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey)
29
+ return !1;
30
+ const o = a(
31
+ t.getEditorState()
32
+ ), u = e.timeStamp;
33
+ return requestAnimationFrame(() => {
34
+ const p = r.current !== null && r.current >= u, m = a(
35
+ t.getEditorState()
36
+ );
37
+ !p && m === o && t.dispatchCommand(g, void 0);
38
+ }), !1;
39
+ },
40
+ h
41
+ );
42
+ return () => {
43
+ i(), s();
44
+ };
45
+ }, [t]), null;
46
+ };
47
+ export {
48
+ T as IOSInsertParagraphFallbackPlugin
49
+ };
@@ -1,25 +1,25 @@
1
- import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css';const t = "_listHeader_un1z2_3", e = "_listHeaderOneItem_un1z2_16", s = "_listTitle_un1z2_23", _ = "_listSubtitle_un1z2_30", i = "_rightBar_un1z2_37", n = "_rightBarOneItem_un1z2_47", a = "_search_un1z2_58", l = "_tagList_un1z2_68", r = "_tagItem_un1z2_83", c = "_select_un1z2_90", u = {
1
+ import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-CKkdHjXR.css';const t = "_listHeader_2wxq4_3", e = "_listHeaderOneItem_2wxq4_16", s = "_listTitle_2wxq4_23", _ = "_listSubtitle_2wxq4_30", i = "_rightBar_2wxq4_37", a = "_rightBarOneItem_2wxq4_47", l = "_search_2wxq4_58", r = "_tagList_2wxq4_68", c = "_tagItem_2wxq4_83", n = "_select_2wxq4_90", g = {
2
2
  listHeader: t,
3
3
  listHeaderOneItem: e,
4
4
  listTitle: s,
5
5
  listSubtitle: _,
6
6
  rightBar: i,
7
- rightBarOneItem: n,
8
- search: a,
9
- tagList: l,
10
- tagItem: r,
11
- select: c
7
+ rightBarOneItem: a,
8
+ search: l,
9
+ tagList: r,
10
+ tagItem: c,
11
+ select: n
12
12
  };
13
13
  export {
14
- u as default,
14
+ g as default,
15
15
  t as listHeader,
16
16
  e as listHeaderOneItem,
17
17
  _ as listSubtitle,
18
18
  s as listTitle,
19
19
  i as rightBar,
20
- n as rightBarOneItem,
21
- a as search,
22
- c as select,
23
- r as tagItem,
24
- l as tagList
20
+ a as rightBarOneItem,
21
+ l as search,
22
+ n as select,
23
+ c as tagItem,
24
+ r as tagList
25
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.93",
3
+ "version": "0.3.95",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -55,14 +55,14 @@
55
55
  },
56
56
  "homepage": "https://github.com/Logora/interface#readme",
57
57
  "dependencies": {
58
- "@lexical/headless": "^0.44.0",
59
- "@lexical/html": "^0.44.0",
60
- "@lexical/list": "^0.44.0",
61
- "@lexical/overflow": "^0.44.0",
62
- "@lexical/react": "^0.44.0",
63
- "@lexical/rich-text": "^0.44.0",
64
- "@lexical/selection": "^0.44.0",
65
- "@lexical/utils": "^0.44.0",
58
+ "@lexical/headless": "^0.45.0",
59
+ "@lexical/html": "^0.45.0",
60
+ "@lexical/list": "^0.45.0",
61
+ "@lexical/overflow": "^0.45.0",
62
+ "@lexical/react": "^0.45.0",
63
+ "@lexical/rich-text": "^0.45.0",
64
+ "@lexical/selection": "^0.45.0",
65
+ "@lexical/utils": "^0.45.0",
66
66
  "@rooks/use-localstorage-state": "^4.11.2",
67
67
  "@rooks/use-previous": "^4.11.2",
68
68
  "@rooks/use-sessionstorage-state": "^4.11.2",
@@ -72,7 +72,7 @@
72
72
  "classnames": "^2.5.1",
73
73
  "dompurify": "^3.3.3",
74
74
  "flat": "^5.0.2",
75
- "lexical": "^0.44.0",
75
+ "lexical": "^0.45.0",
76
76
  "path-to-regexp": "^6.3.0",
77
77
  "react-chartjs-2": "^5.3.1",
78
78
  "react-copy-to-clipboard": "^5.1.1",
@@ -1 +0,0 @@
1
- ._listHeader_un1z2_3{display:flex;justify-content:space-between;align-items:center;position:relative;flex-wrap:wrap;gap:var(--space-unit, 1em)}@container (max-width: 575.98px){._listHeader_un1z2_3{flex-direction:column;align-items:flex-start}._listHeader_un1z2_3._listHeaderOneItem_un1z2_16{flex-direction:row;align-items:center;flex-wrap:nowrap!important}}._listTitle_un1z2_23{font-size:var(--font-size-extra-large, 22px);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"))}._listSubtitle_un1z2_30{color:var(--text-secondary, #5F5F5F);font-weight:var(--font-weight-normal, 400);font-size:var(--font-size-normal, 16px);margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}._rightBar_un1z2_37{display:flex;gap:var(--space-unit, 1em);flex-wrap:wrap}@container (max-width: 575.98px){._rightBar_un1z2_37{width:100%;justify-content:space-between}._rightBar_un1z2_37._rightBarOneItem_un1z2_47{justify-content:flex-end}}._rightBar_un1z2_37{flex:1 1 auto;justify-content:flex-end;align-items:center;flex-direction:row}._search_un1z2_58{flex:1;max-width:35%}@container (max-width: 575.98px){._search_un1z2_58{max-width:80%}}._tagList_un1z2_68{display:flex;flex-direction:row;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75));padding-bottom:var(--spacer-md, calc(var(--space-unit, 1em) * .75))}@container (max-width: 575.98px){._tagList_un1z2_68{gap:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}}._tagItem_un1z2_83{display:flex!important;color:var(--text-secondary, #5F5F5F);cursor:pointer;white-space:nowrap}._select_un1z2_90{max-width:300px}@container (max-width: 575.98px){._select_un1z2_90{max-width:300px}}