@logora/debate 0.4.55 → 0.4.57

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_1shoq_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_1shoq_3{flex-direction:column;align-items:flex-start}._listHeader_1shoq_3._listHeaderOneItem_1shoq_16{flex-direction:row;align-items:center;flex-wrap:nowrap!important}}._listTitle_1shoq_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-variation-settings:var(--font-variation-bold, normal);font-family:var(--title-font-family, var(--font-family, "Montserrat"))}._listSubtitle_1shoq_31{color:var(--text-primary, #222222);font-weight:var(--font-weight-normal, 400);font-variation-settings:var(--font-variation-normal, normal);font-size:var(--font-size-normal, 16px);margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}._rightBar_1shoq_39{display:flex;gap:var(--space-unit, 1em);flex-wrap:wrap}@container (max-width: 575.98px){._rightBar_1shoq_39{width:100%;justify-content:space-between}._rightBar_1shoq_39._rightBarOneItem_1shoq_49{justify-content:flex-end}}._rightBar_1shoq_39{flex:1 1 auto;justify-content:flex-end;align-items:center;flex-direction:row}._search_1shoq_60{flex:1;max-width:35%}@container (max-width: 575.98px){._search_1shoq_60{max-width:80%}}._tagSection_1shoq_70{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._tagList_1shoq_78{display:flex;flex-direction:row;justify-content:flex-start;flex:1;overflow-x:auto;overflow-y:hidden;gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75));scrollbar-width:none}@container (max-width: 575.98px){._tagList_1shoq_78{gap:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}}._tagList_1shoq_78::-webkit-scrollbar{display:none}._arrow_1shoq_97{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;border:none;cursor:pointer;padding:0;transition:opacity .2s ease;outline:none;background:none;line-height:0}._arrow_1shoq_97 svg{display:block}._arrow_1shoq_97:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_1shoq_121{left:0;padding-left:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,#ffffff 40%,transparent)!important}._arrowLeft_1shoq_121 svg{transform:rotate(90deg)}._arrowRight_1shoq_130{right:0;padding-right:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,#ffffff 40%,transparent)!important}._arrowRight_1shoq_130 svg{transform:rotate(-90deg)}._arrowHidden_1shoq_139{opacity:0;pointer-events:none}._tagItem_1shoq_144{display:flex!important;color:var(--text-secondary, #5F5F5F);cursor:pointer;white-space:nowrap}._select_1shoq_151{max-width:300px}@container (max-width: 575.98px){._select_1shoq_151{max-width:300px}}
@@ -1,21 +1,23 @@
1
1
  import { useLexicalComposerContext as p } from "@lexical/react/LexicalComposerContext";
2
- import c from "@rooks/use-localstorage-state";
3
- import { $addUpdateTag as m, $getRoot as i, $createParagraphNode as d } from "lexical";
4
- import { useEffect as f } from "react";
2
+ import m from "@rooks/use-localstorage-state";
3
+ import { $addUpdateTag as i, $getRoot as l, $createParagraphNode as f } from "lexical";
4
+ import { useEffect as d } from "react";
5
5
  import { useInput as u } from "../../input_provider/useInput.js";
6
- const E = ({ storageUid: o }) => {
7
- const [r] = p(), { reset: t, setReset: n } = u(), [l, g, s] = c(
8
- `TextEditor:content_${o}`,
6
+ const L = ({ storageUid: s }) => {
7
+ const [n] = p(), { reset: t, setReset: a } = u(), [g, x, c] = m(
8
+ `TextEditor:content_${s}`,
9
9
  {}
10
10
  );
11
- return f(() => {
12
- t && r.update(() => {
13
- m("skip-dom-selection");
14
- const e = i(), a = d();
15
- e.clear(), e.append(a), s(), n(!1);
11
+ return d(() => {
12
+ t && n.update(() => {
13
+ i("skip-dom-selection");
14
+ const e = l(), o = f();
15
+ e.clear(), e.append(o);
16
+ const r = o.selectStart();
17
+ r.format = 0, r.style = "", c(), a(!1);
16
18
  });
17
19
  }, [t]), null;
18
20
  };
19
21
  export {
20
- E as ResetPlugin
22
+ L as ResetPlugin
21
23
  };
@@ -1,50 +1,51 @@
1
- import { jsxs as R, jsx as i } from "react/jsx-runtime";
2
- import { $isListNode as B, ListNode as Y, INSERT_ORDERED_LIST_COMMAND as Z, $isListItemNode as $, $createListNode as ee } from "@lexical/list";
1
+ import { jsxs as B, jsx as i } from "react/jsx-runtime";
2
+ import { $isListNode as $, ListNode as Y, INSERT_ORDERED_LIST_COMMAND as Z, $isListItemNode as q, $createListNode as ee } from "@lexical/list";
3
3
  import { useLexicalComposerContext as te } from "@lexical/react/LexicalComposerContext";
4
- import { $isHeadingNode as oe, $createQuoteNode as q } from "@lexical/rich-text";
5
- import { $setBlocksType as K } from "@lexical/selection";
4
+ import { $isHeadingNode as oe, $createQuoteNode as K } from "@lexical/rich-text";
5
+ import { $setBlocksType as F } from "@lexical/selection";
6
6
  import { $getNearestNodeOfType as ne, mergeRegister as ie } from "@lexical/utils";
7
7
  import l from "classnames";
8
- import { $getSelection as M, $isRangeSelection as I, SELECTION_CHANGE_COMMAND as le, FORMAT_TEXT_COMMAND as ae, $createParagraphNode as F } from "lexical";
9
- import { useRef as x, useState as N, useCallback as re, useEffect as U } from "react";
8
+ import { $getSelection as M, $isRangeSelection as I, SELECTION_CHANGE_COMMAND as le, FORMAT_TEXT_COMMAND as ae, $createParagraphNode as U } from "lexical";
9
+ import { useRef as D, useState as N, useCallback as re, useEffect as j } from "react";
10
10
  import { useIntl as se } from "react-intl";
11
11
  import t from "./ToolbarPlugin.module.scss.js";
12
12
  import { Icon as f } from "../../../icons/icon/Icon.js";
13
13
  import { Button as ce } from "../../../action/button/Button.js";
14
- const Ce = (a) => {
15
- const d = se(), j = 1, [r] = te(), H = x(null), [T, S] = N("paragraph"), [de, Q] = N(null), [V, L] = N(!1), [z, A] = N(!1), [G, D] = N(!1), v = a.hideSubmit && a.hideSourceAction && a.disableRichText, _ = re(() => {
14
+ const Ce = (r) => {
15
+ const d = se(), H = 1, [a] = te(), Q = D(null), [T, C] = N("paragraph"), [de, E] = N(null), [V, k] = N(!1), [z, w] = N(!1), [G, x] = N(!1), v = r.hideSubmit && r.hideSourceAction && r.disableRichText, _ = re(() => {
16
16
  const e = M();
17
17
  if (I(e)) {
18
- const n = e.anchor.getNode(), s = n.getKey() === "root" ? n : n.getTopLevelElementOrThrow(), u = s.getKey();
19
- if (r.getElementByKey(u) !== null)
20
- if (Q(u), B(s)) {
21
- const o = ne(n, Y), p = o ? o.getTag() : s.getTag();
22
- S(p);
18
+ const o = e.anchor.getNode(), s = o.getKey() === "root" ? o : o.getTopLevelElementOrThrow(), u = s.getKey();
19
+ if (a.getElementByKey(u) !== null)
20
+ if (E(u), $(s)) {
21
+ const n = ne(o, Y), p = n ? n.getTag() : s.getTag();
22
+ C(p);
23
23
  } else {
24
- const o = oe(s) ? s.getTag() : s.getType();
25
- S(o);
24
+ const n = oe(s) ? s.getTag() : s.getType();
25
+ C(n);
26
26
  }
27
- L(e.hasFormat("bold")), A(e.hasFormat("italic")), D(e.hasFormat("underline"));
28
- }
29
- }, [r]);
30
- U(() => ie(
31
- r.registerUpdateListener(({ editorState: e }) => {
27
+ k(e.hasFormat("bold")), w(e.hasFormat("italic")), x(e.hasFormat("underline"));
28
+ } else
29
+ E(null), C("paragraph"), k(!1), w(!1), x(!1);
30
+ }, [a]);
31
+ j(() => ie(
32
+ a.registerUpdateListener(({ editorState: e }) => {
32
33
  e.read(() => {
33
34
  _();
34
35
  });
35
36
  }),
36
- r.registerCommand(
37
+ a.registerCommand(
37
38
  le,
38
39
  () => (_(), !1),
39
- j
40
+ H
40
41
  )
41
- ), [r, _]);
42
- const y = x(!1), c = x(null);
43
- U(() => () => {
42
+ ), [a, _]);
43
+ const y = D(!1), c = D(null);
44
+ j(() => () => {
44
45
  c.current && clearTimeout(c.current);
45
46
  }, []);
46
- const g = (e, n) => {
47
- e.pointerType === "touch" || e.pointerType === "pen" ? (e.preventDefault(), y.current = !0, n(), c.current && clearTimeout(c.current), c.current = setTimeout(() => {
47
+ const g = (e, o) => {
48
+ e.pointerType === "touch" || e.pointerType === "pen" ? (e.preventDefault(), y.current = !0, o(), c.current && clearTimeout(c.current), c.current = setTimeout(() => {
48
49
  y.current = !1, c.current = null;
49
50
  }, 500)) : e.preventDefault();
50
51
  }, h = (e) => {
@@ -53,73 +54,76 @@ const Ce = (a) => {
53
54
  return;
54
55
  }
55
56
  e();
56
- }, C = () => {
57
+ }, S = () => {
57
58
  setTimeout(() => {
58
- r.getEditorState().read(() => {
59
+ a.getEditorState().read(() => {
59
60
  _();
60
61
  });
61
62
  }, 0);
62
63
  }, b = (e) => {
63
- r.dispatchCommand(ae, e), e === "bold" ? L((n) => !n) : e === "italic" ? A((n) => !n) : e === "underline" && D((n) => !n), C();
64
+ a.dispatchCommand(ae, e), e === "bold" ? k((o) => !o) : e === "italic" ? w((o) => !o) : e === "underline" && x((o) => !o), a.focus(() => {
65
+ const o = a.getRootElement();
66
+ o && o.focus();
67
+ }), S();
64
68
  }, X = () => {
65
- r.update(() => {
69
+ a.update(() => {
66
70
  const e = M();
67
71
  if (!I(e))
68
72
  return;
69
- const n = e.getNodes(), s = /* @__PURE__ */ new Set();
70
- for (const m of n) {
71
- let o = m;
72
- for (; o !== null && !$(o); )
73
- o = o.getParent();
74
- $(o) && s.add(o);
73
+ const o = e.getNodes(), s = /* @__PURE__ */ new Set();
74
+ for (const m of o) {
75
+ let n = m;
76
+ for (; n !== null && !q(n); )
77
+ n = n.getParent();
78
+ q(n) && s.add(n);
75
79
  }
76
80
  const u = Array.from(s).reverse();
77
81
  for (const m of u) {
78
- const o = m.getParent();
79
- if (!B(o))
82
+ const n = m.getParent();
83
+ if (!$(n))
80
84
  continue;
81
- const p = F(), J = m.getChildren();
82
- for (const w of J)
83
- p.append(w);
84
- const k = m.getNextSiblings();
85
- if (o.insertAfter(p), k.length > 0) {
86
- const w = k[0].getValue(), P = ee(o.getListType(), w);
87
- for (const W of k)
88
- P.append(W);
89
- p.insertAfter(P);
85
+ const p = U(), J = m.getChildren();
86
+ for (const A of J)
87
+ p.append(A);
88
+ const L = m.getNextSiblings();
89
+ if (n.insertAfter(p), L.length > 0) {
90
+ const A = L[0].getValue(), R = ee(n.getListType(), A);
91
+ for (const W of L)
92
+ R.append(W);
93
+ p.insertAfter(R);
90
94
  }
91
- m.remove(), o.getChildrenSize() === 0 && o.remove();
95
+ m.remove(), n.getChildrenSize() === 0 && n.remove();
92
96
  }
93
97
  });
94
- }, E = () => {
95
- T !== "ol" ? r.dispatchCommand(Z) : X(), C();
96
98
  }, O = () => {
97
- T !== "quote" ? r.update(() => {
99
+ T !== "ol" ? a.dispatchCommand(Z) : X(), S();
100
+ }, P = () => {
101
+ T !== "quote" ? a.update(() => {
98
102
  const e = M();
99
103
  if (I(e))
100
104
  if (e.isCollapsed()) {
101
- const s = e.anchor.getNode().getTopLevelElementOrThrow(), u = q();
105
+ const s = e.anchor.getNode().getTopLevelElementOrThrow(), u = K();
102
106
  s.insertAfter(u), u.selectEnd();
103
107
  } else
104
- K(e, () => q());
105
- }) : r.update(() => {
108
+ F(e, () => K());
109
+ }) : a.update(() => {
106
110
  const e = M();
107
- I(e) && K(e, () => F());
108
- }), C();
111
+ I(e) && F(e, () => U());
112
+ }), S();
109
113
  };
110
- return v ? null : /* @__PURE__ */ R(
114
+ return v ? null : /* @__PURE__ */ B(
111
115
  "div",
112
116
  {
113
117
  className: l(t.toolbar, {
114
- [t.toolbarIsActive]: v ? !1 : a.isActive
118
+ [t.toolbarIsActive]: v ? !1 : r.isActive
115
119
  }),
116
- ref: H,
120
+ ref: Q,
117
121
  children: [
118
- a.isActive ? !a.disableRichText && /* @__PURE__ */ R(
122
+ r.isActive ? !r.disableRichText && /* @__PURE__ */ B(
119
123
  "div",
120
124
  {
121
125
  className: l(t.iconToolbar, {
122
- [t.shortBar]: a.shortBar
126
+ [t.shortBar]: r.shortBar
123
127
  }),
124
128
  children: [
125
129
  /* @__PURE__ */ i(
@@ -196,8 +200,8 @@ const Ce = (a) => {
196
200
  /* @__PURE__ */ i(
197
201
  "button",
198
202
  {
199
- onPointerDown: (e) => g(e, () => O()),
200
- onClick: () => h(() => O()),
203
+ onPointerDown: (e) => g(e, () => P()),
204
+ onClick: () => h(() => P()),
201
205
  type: "button",
202
206
  className: l(t.toolbarItem, {
203
207
  [t.active]: T === "quote"
@@ -220,8 +224,8 @@ const Ce = (a) => {
220
224
  /* @__PURE__ */ i(
221
225
  "button",
222
226
  {
223
- onPointerDown: (e) => g(e, () => E()),
224
- onClick: () => h(() => E()),
227
+ onPointerDown: (e) => g(e, () => O()),
228
+ onClick: () => h(() => O()),
225
229
  type: "button",
226
230
  className: l(t.toolbarItem, {
227
231
  [t.active]: T === "ol"
@@ -241,10 +245,10 @@ const Ce = (a) => {
241
245
  )
242
246
  }
243
247
  ),
244
- !a.hideSourceAction && /* @__PURE__ */ i(
248
+ !r.hideSourceAction && /* @__PURE__ */ i(
245
249
  "button",
246
250
  {
247
- onClick: a.onAddSource,
251
+ onClick: r.onAddSource,
248
252
  type: "button",
249
253
  className: t.toolbarItem,
250
254
  "aria-label": d.formatMessage({
@@ -265,12 +269,12 @@ const Ce = (a) => {
265
269
  ]
266
270
  }
267
271
  ) : null,
268
- /* @__PURE__ */ i("div", { className: t.actionButton, children: a.hideSubmit ? null : /* @__PURE__ */ i(
272
+ /* @__PURE__ */ i("div", { className: t.actionButton, children: r.hideSubmit ? null : /* @__PURE__ */ i(
269
273
  ce,
270
274
  {
271
275
  type: "button",
272
276
  "data-testid": "submit-button",
273
- handleClick: a.onSubmit,
277
+ handleClick: r.onSubmit,
274
278
  className: l(t.inputSubmitActionButton, t.submitAction),
275
279
  "aria-label": d.formatMessage({
276
280
  id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
@@ -1,35 +1,35 @@
1
- import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-DP4kPR9x.css';const t = "_listHeader_10hfs_3", s = "_listHeaderOneItem_10hfs_16", e = "_listTitle_10hfs_23", r = "_listSubtitle_10hfs_31", _ = "_rightBar_10hfs_39", a = "_rightBarOneItem_10hfs_49", i = "_search_10hfs_60", o = "_tagSection_10hfs_70", n = "_tagList_10hfs_78", h = "_arrow_10hfs_98", c = "_arrowLeft_10hfs_122", l = "_arrowRight_10hfs_131", f = "_arrowHidden_10hfs_140", g = "_tagItem_10hfs_145", d = "_select_10hfs_152", w = {
1
+ import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-CN_P2Qad.css';const t = "_listHeader_1shoq_3", s = "_listHeaderOneItem_1shoq_16", e = "_listTitle_1shoq_23", o = "_listSubtitle_1shoq_31", r = "_rightBar_1shoq_39", _ = "_rightBarOneItem_1shoq_49", a = "_search_1shoq_60", i = "_tagSection_1shoq_70", n = "_tagList_1shoq_78", h = "_arrow_1shoq_97", c = "_arrowLeft_1shoq_121", l = "_arrowRight_1shoq_130", g = "_arrowHidden_1shoq_139", q = "_tagItem_1shoq_144", d = "_select_1shoq_151", w = {
2
2
  listHeader: t,
3
3
  listHeaderOneItem: s,
4
4
  listTitle: e,
5
- listSubtitle: r,
6
- rightBar: _,
7
- rightBarOneItem: a,
8
- search: i,
9
- tagSection: o,
5
+ listSubtitle: o,
6
+ rightBar: r,
7
+ rightBarOneItem: _,
8
+ search: a,
9
+ tagSection: i,
10
10
  tagList: n,
11
11
  arrow: h,
12
12
  arrowLeft: c,
13
13
  arrowRight: l,
14
- arrowHidden: f,
15
- tagItem: g,
14
+ arrowHidden: g,
15
+ tagItem: q,
16
16
  select: d
17
17
  };
18
18
  export {
19
19
  h as arrow,
20
- f as arrowHidden,
20
+ g as arrowHidden,
21
21
  c as arrowLeft,
22
22
  l as arrowRight,
23
23
  w as default,
24
24
  t as listHeader,
25
25
  s as listHeaderOneItem,
26
- r as listSubtitle,
26
+ o as listSubtitle,
27
27
  e as listTitle,
28
- _ as rightBar,
29
- a as rightBarOneItem,
30
- i as search,
28
+ r as rightBar,
29
+ _ as rightBarOneItem,
30
+ a as search,
31
31
  d as select,
32
- g as tagItem,
32
+ q as tagItem,
33
33
  n as tagList,
34
- o as tagSection
34
+ i as tagSection
35
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.55",
3
+ "version": "0.4.57",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._listHeader_10hfs_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_10hfs_3{flex-direction:column;align-items:flex-start}._listHeader_10hfs_3._listHeaderOneItem_10hfs_16{flex-direction:row;align-items:center;flex-wrap:nowrap!important}}._listTitle_10hfs_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-variation-settings:var(--font-variation-bold, normal);font-family:var(--title-font-family, var(--font-family, "Montserrat"))}._listSubtitle_10hfs_31{color:var(--text-primary, #222222);font-weight:var(--font-weight-normal, 400);font-variation-settings:var(--font-variation-normal, normal);font-size:var(--font-size-normal, 16px);margin-top:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}._rightBar_10hfs_39{display:flex;gap:var(--space-unit, 1em);flex-wrap:wrap}@container (max-width: 575.98px){._rightBar_10hfs_39{width:100%;justify-content:space-between}._rightBar_10hfs_39._rightBarOneItem_10hfs_49{justify-content:flex-end}}._rightBar_10hfs_39{flex:1 1 auto;justify-content:flex-end;align-items:center;flex-direction:row}._search_10hfs_60{flex:1;max-width:35%}@container (max-width: 575.98px){._search_10hfs_60{max-width:80%}}._tagSection_10hfs_70{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._tagList_10hfs_78{display:flex;flex-direction:row;justify-content:flex-start;flex:1;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));scrollbar-width:none}@container (max-width: 575.98px){._tagList_10hfs_78{gap:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))}}._tagList_10hfs_78::-webkit-scrollbar{display:none}._arrow_10hfs_98{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;border:none;cursor:pointer;padding:0;transition:opacity .2s ease;outline:none;background:none;line-height:0}._arrow_10hfs_98 svg{display:block}._arrow_10hfs_98:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_10hfs_122{left:0;padding-left:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to right,var(--background-color-container, white) 40%,transparent)}._arrowLeft_10hfs_122 svg{transform:rotate(90deg)}._arrowRight_10hfs_131{right:0;padding-right:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,var(--background-color-container, white) 40%,transparent)}._arrowRight_10hfs_131 svg{transform:rotate(-90deg)}._arrowHidden_10hfs_140{opacity:0;pointer-events:none}._tagItem_10hfs_145{display:flex!important;color:var(--text-secondary, #5F5F5F);cursor:pointer;white-space:nowrap}._select_10hfs_152{max-width:300px}@container (max-width: 575.98px){._select_10hfs_152{max-width:300px}}