@logora/debate 0.4.20 → 0.4.21

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
+ ._toolbar_awaxp_3{display:flex!important;justify-content:space-between!important;flex-wrap:wrap;background:var(--background-color-primary, white);padding-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;vertical-align:middle;align-items:flex-start;gap:var(--space-unit, 1em)}._toolbar_awaxp_3._toolbarIsActive_awaxp_13{border-top:1px solid var(--text-tertiary, #fafafa)}._iconToolbar_awaxp_17{display:flex!important;gap:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))}._iconToolbar_awaxp_17._shortBar_awaxp_21{gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75))}._toolbarItem_awaxp_25{border:0;background:none;padding:0!important;cursor:pointer;vertical-align:middle;touch-action:manipulation;display:flex;align-items:center;justify-content:center}@container (max-width: 575.98px){._toolbarItem_awaxp_25{min-width:44px;min-height:44px}}._toolbarItem_awaxp_25._disabled_awaxp_42{cursor:not-allowed}._toolbarItem_awaxp_25._active_awaxp_45{background-color:#bababa66;border-radius:50%}._toolbarItem_awaxp_25 ._format_awaxp_49{background-size:contain;display:inline-block;vertical-align:-.25em;display:flex!important}._actionButton_awaxp_56{display:flex!important;gap:var(--space-unit, 1em);margin-left:auto}._inputSubmitActionButton_awaxp_62{width:100%;height:35px;display:flex!important;justify-content:center!important;align-items:center!important;background-color:var(--call-primary-color, #434343)!important}._inputSubmitActionButton_awaxp_62._submitAction_awaxp_70 svg{fill:var(--text-light, white)!important}._inputSubmitActionButton_awaxp_62 ._inputSourceText_awaxp_73{display:none!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;font-size:var(--font-size-small, 16px)}@container (min-width: 576px){._inputSubmitActionButton_awaxp_62 ._inputSourceText_awaxp_73{display:block!important}}._tooltip_awaxp_84{width:230px!important;margin-left:-117px!important}
@@ -1,104 +1,101 @@
1
- import { jsxs as x, jsx as o } from "react/jsx-runtime";
2
- import { $isListNode as $, ListNode as q, INSERT_ORDERED_LIST_COMMAND as K, REMOVE_LIST_COMMAND as F } from "@lexical/list";
3
- import { useLexicalComposerContext as U } from "@lexical/react/LexicalComposerContext";
4
- import { $isHeadingNode as P, $createQuoteNode as I } from "@lexical/rich-text";
5
- import { $setBlocksType as E } from "@lexical/selection";
6
- import { $getNearestNodeOfType as j, mergeRegister as H } from "@lexical/utils";
7
- import a from "classnames";
8
- import { $getSelection as p, $isRangeSelection as N, SELECTION_CHANGE_COMMAND as Q, FORMAT_TEXT_COMMAND as G, $createParagraphNode as V } from "lexical";
9
- import { useRef as X, useState as u, useCallback as z, useEffect as J } from "react";
10
- import { useIntl as W } from "react-intl";
1
+ import { jsxs as T, jsx as o } from "react/jsx-runtime";
2
+ import { $isListNode as D, ListNode as $, INSERT_ORDERED_LIST_COMMAND as q, REMOVE_LIST_COMMAND as K } from "@lexical/list";
3
+ import { useLexicalComposerContext as F } from "@lexical/react/LexicalComposerContext";
4
+ import { $isHeadingNode as U, $createQuoteNode as y } from "@lexical/rich-text";
5
+ import { $setBlocksType as C } from "@lexical/selection";
6
+ import { $getNearestNodeOfType as P, mergeRegister as j } from "@lexical/utils";
7
+ import i from "classnames";
8
+ import { $getSelection as h, $isRangeSelection as p, SELECTION_CHANGE_COMMAND as H, FORMAT_TEXT_COMMAND as Q, $createParagraphNode as G } from "lexical";
9
+ import { useRef as V, useState as m, useCallback as X, useEffect as z } from "react";
10
+ import { useIntl as J } from "react-intl";
11
11
  import e from "./ToolbarPlugin.module.scss.js";
12
- import { Icon as c } from "../../../icons/icon/Icon.js";
13
- import { Button as Y } from "../../../action/button/Button.js";
14
- const ge = (i) => {
15
- const r = W(), S = 1, [l] = U(), A = X(null), [b, M] = u("paragraph"), [Z, v] = u(null), [w, _] = u(!1), [D, T] = u(!1), [L, y] = u(!1), C = i.hideSubmit && i.hideSourceAction && i.disableRichText, g = z(() => {
16
- const t = p();
17
- if (N(t)) {
18
- const n = t.anchor.getNode(), s = n.getKey() === "root" ? n : n.getTopLevelElementOrThrow(), m = s.getKey();
19
- if (l.getElementByKey(m) !== null)
20
- if (v(m), $(s)) {
21
- const f = j(n, q), B = f ? f.getTag() : s.getTag();
22
- M(B);
12
+ import { Icon as r } from "../../../icons/icon/Icon.js";
13
+ import { Button as W } from "../../../action/button/Button.js";
14
+ const be = (l) => {
15
+ const n = J(), k = 1, [a] = F(), x = V(null), [u, N] = m("paragraph"), [Y, I] = m(null), [E, A] = m(!1), [S, L] = m(!1), [v, O] = m(!1), _ = l.hideSubmit && l.hideSourceAction && l.disableRichText, b = X(() => {
16
+ const t = h();
17
+ if (p(t)) {
18
+ const c = t.anchor.getNode(), s = c.getKey() === "root" ? c : c.getTopLevelElementOrThrow(), d = s.getKey();
19
+ if (a.getElementByKey(d) !== null)
20
+ if (I(d), D(s)) {
21
+ const g = P(c, $), B = g ? g.getTag() : s.getTag();
22
+ N(B);
23
23
  } else {
24
- const f = P(s) ? s.getTag() : s.getType();
25
- M(f);
24
+ const g = U(s) ? s.getTag() : s.getType();
25
+ N(g);
26
26
  }
27
- _(t.hasFormat("bold")), T(t.hasFormat("italic")), y(t.hasFormat("underline"));
27
+ A(t.hasFormat("bold")), L(t.hasFormat("italic")), O(t.hasFormat("underline"));
28
28
  }
29
- }, [l]);
30
- J(() => H(
31
- l.registerUpdateListener(({ editorState: t }) => {
29
+ }, [a]);
30
+ z(() => j(
31
+ a.registerUpdateListener(({ editorState: t }) => {
32
32
  t.read(() => {
33
- g();
33
+ b();
34
34
  });
35
35
  }),
36
- l.registerCommand(
37
- Q,
38
- () => (g(), !1),
39
- S
36
+ a.registerCommand(
37
+ H,
38
+ () => (b(), !1),
39
+ k
40
40
  )
41
- ), [l, g]);
42
- const d = (t) => {
43
- t.preventDefault();
44
- }, k = () => {
41
+ ), [a, b]);
42
+ const M = () => {
45
43
  setTimeout(() => {
46
- l.getEditorState().read(() => {
47
- g();
44
+ a.getEditorState().read(() => {
45
+ b();
48
46
  });
49
47
  }, 0);
50
- }, h = (t) => {
51
- l.dispatchCommand(G, t), t === "bold" && _((n) => !n), t === "italic" && T((n) => !n), t === "underline" && y((n) => !n);
52
- }, O = () => {
53
- b !== "ol" ? l.dispatchCommand(K) : l.dispatchCommand(F), k();
48
+ }, f = (t) => {
49
+ a.dispatchCommand(Q, t), a.focus();
54
50
  }, R = () => {
55
- b !== "quote" ? l.update(() => {
56
- const t = p();
57
- if (N(t))
51
+ u !== "ol" ? a.dispatchCommand(q) : a.dispatchCommand(K), a.focus(), M();
52
+ }, w = () => {
53
+ u !== "quote" ? a.update(() => {
54
+ const t = h();
55
+ if (p(t))
58
56
  if (t.isCollapsed()) {
59
- const s = t.anchor.getNode().getTopLevelElementOrThrow(), m = I();
60
- s.insertAfter(m), m.selectEnd();
57
+ const s = t.anchor.getNode().getTopLevelElementOrThrow(), d = y();
58
+ s.insertAfter(d), d.selectEnd();
61
59
  } else
62
- E(t, () => I());
63
- }) : l.update(() => {
64
- const t = p();
65
- N(t) && E(t, () => V());
66
- }), k();
60
+ C(t, () => y());
61
+ }) : a.update(() => {
62
+ const t = h();
63
+ p(t) && C(t, () => G());
64
+ }), a.focus(), M();
67
65
  };
68
- return C ? null : /* @__PURE__ */ x(
66
+ return _ ? null : /* @__PURE__ */ T(
69
67
  "div",
70
68
  {
71
- className: a(e.toolbar, {
72
- [e.toolbarIsActive]: C ? !1 : i.isActive
69
+ className: i(e.toolbar, {
70
+ [e.toolbarIsActive]: _ ? !1 : l.isActive
73
71
  }),
74
- ref: A,
72
+ ref: x,
75
73
  children: [
76
- i.isActive ? !i.disableRichText && /* @__PURE__ */ x(
74
+ l.isActive ? !l.disableRichText && /* @__PURE__ */ T(
77
75
  "div",
78
76
  {
79
- className: a(e.iconToolbar, {
80
- [e.shortBar]: i.shortBar
77
+ className: i(e.iconToolbar, {
78
+ [e.shortBar]: l.shortBar
81
79
  }),
82
80
  children: [
83
81
  /* @__PURE__ */ o(
84
82
  "button",
85
83
  {
86
- onMouseDown: d,
87
- onClick: () => h("bold"),
84
+ onClick: () => f("bold"),
88
85
  type: "button",
89
- className: a(e.toolbarItem, { [e.active]: w }),
86
+ className: i(e.toolbarItem, { [e.active]: E }),
90
87
  "data-testid": "format-bold",
91
- "aria-label": r.formatMessage({
88
+ "aria-label": n.formatMessage({
92
89
  id: "input.text_editor.plugins.toolbar_plugin.bold.aria_label",
93
90
  defaultMessage: "Make text bold"
94
91
  }),
95
92
  children: /* @__PURE__ */ o(
96
- c,
93
+ r,
97
94
  {
98
95
  name: "bold",
99
96
  width: 24,
100
97
  height: 24,
101
- className: a(e.format, e.bold)
98
+ className: i(e.format, e.bold)
102
99
  }
103
100
  )
104
101
  }
@@ -106,23 +103,22 @@ const ge = (i) => {
106
103
  /* @__PURE__ */ o(
107
104
  "button",
108
105
  {
109
- onMouseDown: d,
110
- onClick: () => h("italic"),
106
+ onClick: () => f("italic"),
111
107
  type: "button",
112
- className: a(e.toolbarItem, {
113
- [e.active]: D
108
+ className: i(e.toolbarItem, {
109
+ [e.active]: S
114
110
  }),
115
- "aria-label": r.formatMessage({
111
+ "aria-label": n.formatMessage({
116
112
  id: "input.text_editor.plugins.toolbar_plugin.italic.aria_label",
117
113
  defaultMessage: "Make text italic"
118
114
  }),
119
115
  children: /* @__PURE__ */ o(
120
- c,
116
+ r,
121
117
  {
122
118
  name: "italic",
123
119
  width: 24,
124
120
  height: 24,
125
- className: a(e.format, e.italic)
121
+ className: i(e.format, e.italic)
126
122
  }
127
123
  )
128
124
  }
@@ -130,23 +126,22 @@ const ge = (i) => {
130
126
  /* @__PURE__ */ o(
131
127
  "button",
132
128
  {
133
- onMouseDown: d,
134
- onClick: () => h("underline"),
129
+ onClick: () => f("underline"),
135
130
  type: "button",
136
- className: a(e.toolbarItem, {
137
- [e.active]: L
131
+ className: i(e.toolbarItem, {
132
+ [e.active]: v
138
133
  }),
139
- "aria-label": r.formatMessage({
134
+ "aria-label": n.formatMessage({
140
135
  id: "input.text_editor.plugins.toolbar_plugin.underline.aria_label",
141
136
  defaultMessage: "Underline text"
142
137
  }),
143
138
  children: /* @__PURE__ */ o(
144
- c,
139
+ r,
145
140
  {
146
141
  name: "underline",
147
142
  width: 24,
148
143
  height: 24,
149
- className: a(e.format, e.underline)
144
+ className: i(e.format, e.underline)
150
145
  }
151
146
  )
152
147
  }
@@ -154,23 +149,22 @@ const ge = (i) => {
154
149
  /* @__PURE__ */ o(
155
150
  "button",
156
151
  {
157
- onMouseDown: d,
158
- onClick: () => R(),
152
+ onClick: () => w(),
159
153
  type: "button",
160
- className: a(e.toolbarItem, {
161
- [e.active]: b === "quote"
154
+ className: i(e.toolbarItem, {
155
+ [e.active]: u === "quote"
162
156
  }),
163
- "aria-label": r.formatMessage({
157
+ "aria-label": n.formatMessage({
164
158
  id: "input.text_editor.plugins.toolbar_plugin.blockquote.aria_label",
165
159
  defaultMessage: "Add a blockquote"
166
160
  }),
167
161
  children: /* @__PURE__ */ o(
168
- c,
162
+ r,
169
163
  {
170
164
  name: "blockquote",
171
165
  width: 24,
172
166
  height: 24,
173
- className: a(e.format, e.quote)
167
+ className: i(e.format, e.quote)
174
168
  }
175
169
  )
176
170
  }
@@ -178,45 +172,43 @@ const ge = (i) => {
178
172
  /* @__PURE__ */ o(
179
173
  "button",
180
174
  {
181
- onMouseDown: d,
182
- onClick: () => O(),
175
+ onClick: () => R(),
183
176
  type: "button",
184
- className: a(e.toolbarItem, {
185
- [e.active]: b === "ol"
177
+ className: i(e.toolbarItem, {
178
+ [e.active]: u === "ol"
186
179
  }),
187
- "aria-label": r.formatMessage({
180
+ "aria-label": n.formatMessage({
188
181
  id: "input.text_editor.plugins.toolbar_plugin.numbered_list.aria_label",
189
182
  defaultMessage: "Insert a numbered list"
190
183
  }),
191
184
  children: /* @__PURE__ */ o(
192
- c,
185
+ r,
193
186
  {
194
187
  name: "orderedList",
195
188
  width: 24,
196
189
  height: 24,
197
- className: a(e.format, e.numberedList)
190
+ className: i(e.format, e.numberedList)
198
191
  }
199
192
  )
200
193
  }
201
194
  ),
202
- !i.hideSourceAction && /* @__PURE__ */ o(
195
+ !l.hideSourceAction && /* @__PURE__ */ o(
203
196
  "button",
204
197
  {
205
- onMouseDown: d,
206
- onClick: i.onAddSource,
198
+ onClick: l.onAddSource,
207
199
  type: "button",
208
200
  className: e.toolbarItem,
209
- "aria-label": r.formatMessage({
201
+ "aria-label": n.formatMessage({
210
202
  id: "input.text_editor.plugins.toolbar_plugin.add_link.aria_label",
211
203
  defaultMessage: "Add hyperlink"
212
204
  }),
213
205
  children: /* @__PURE__ */ o(
214
- c,
206
+ r,
215
207
  {
216
208
  name: "link",
217
209
  width: 20,
218
210
  height: 20,
219
- className: a(e.format, e.link)
211
+ className: i(e.format, e.link)
220
212
  }
221
213
  )
222
214
  }
@@ -224,18 +216,18 @@ const ge = (i) => {
224
216
  ]
225
217
  }
226
218
  ) : null,
227
- /* @__PURE__ */ o("div", { className: e.actionButton, children: i.hideSubmit ? null : /* @__PURE__ */ o(
228
- Y,
219
+ /* @__PURE__ */ o("div", { className: e.actionButton, children: l.hideSubmit ? null : /* @__PURE__ */ o(
220
+ W,
229
221
  {
230
222
  type: "button",
231
223
  "data-testid": "submit-button",
232
- handleClick: i.onSubmit,
233
- className: a(e.inputSubmitActionButton, e.submitAction),
234
- "aria-label": r.formatMessage({
224
+ handleClick: l.onSubmit,
225
+ className: i(e.inputSubmitActionButton, e.submitAction),
226
+ "aria-label": n.formatMessage({
235
227
  id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
236
228
  defaultMessage: "Send message"
237
229
  }),
238
- children: /* @__PURE__ */ o(c, { name: "send", width: 20, height: 20 })
230
+ children: /* @__PURE__ */ o(r, { name: "send", width: 20, height: 20 })
239
231
  }
240
232
  ) })
241
233
  ]
@@ -243,5 +235,5 @@ const ge = (i) => {
243
235
  );
244
236
  };
245
237
  export {
246
- ge as ToolbarPlugin
238
+ be as ToolbarPlugin
247
239
  };
@@ -1,25 +1,25 @@
1
- import '../../../../assets/components/input/text_editor/plugins/ToolbarPlugin.module-CbPmMciY.css';const o = "_toolbar_qbyoz_3", t = "_toolbarIsActive_qbyoz_13", n = "_iconToolbar_qbyoz_17", _ = "_shortBar_qbyoz_21", c = "_toolbarItem_qbyoz_25", b = "_active_qbyoz_35", i = "_format_qbyoz_39", a = "_actionButton_qbyoz_46", s = "_inputSubmitActionButton_qbyoz_52", r = "_submitAction_qbyoz_60", u = {
2
- toolbar: o,
3
- toolbarIsActive: t,
4
- iconToolbar: n,
5
- shortBar: _,
6
- toolbarItem: c,
7
- active: b,
1
+ import '../../../../assets/components/input/text_editor/plugins/ToolbarPlugin.module-C3yG2biv.css';const t = "_toolbar_awaxp_3", o = "_toolbarIsActive_awaxp_13", a = "_iconToolbar_awaxp_17", n = "_shortBar_awaxp_21", _ = "_toolbarItem_awaxp_25", c = "_active_awaxp_45", i = "_format_awaxp_49", s = "_actionButton_awaxp_56", r = "_inputSubmitActionButton_awaxp_62", b = "_submitAction_awaxp_70", u = {
2
+ toolbar: t,
3
+ toolbarIsActive: o,
4
+ iconToolbar: a,
5
+ shortBar: n,
6
+ toolbarItem: _,
7
+ active: c,
8
8
  format: i,
9
- actionButton: a,
10
- inputSubmitActionButton: s,
11
- submitAction: r
9
+ actionButton: s,
10
+ inputSubmitActionButton: r,
11
+ submitAction: b
12
12
  };
13
13
  export {
14
- a as actionButton,
15
- b as active,
14
+ s as actionButton,
15
+ c as active,
16
16
  u as default,
17
17
  i as format,
18
- n as iconToolbar,
19
- s as inputSubmitActionButton,
20
- _ as shortBar,
21
- r as submitAction,
22
- o as toolbar,
23
- t as toolbarIsActive,
24
- c as toolbarItem
18
+ a as iconToolbar,
19
+ r as inputSubmitActionButton,
20
+ n as shortBar,
21
+ b as submitAction,
22
+ t as toolbar,
23
+ o as toolbarIsActive,
24
+ _ as toolbarItem
25
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.20",
3
+ "version": "0.4.21",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._toolbar_qbyoz_3{display:flex!important;justify-content:space-between!important;flex-wrap:wrap;background:var(--background-color-primary, white);padding-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important;vertical-align:middle;align-items:flex-start;gap:var(--space-unit, 1em)}._toolbar_qbyoz_3._toolbarIsActive_qbyoz_13{border-top:1px solid var(--text-tertiary, #fafafa)}._iconToolbar_qbyoz_17{display:flex!important;gap:var(--spacer-lg, calc(var(--space-unit, 1em) * 1.5))}._iconToolbar_qbyoz_17._shortBar_qbyoz_21{gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75))}._toolbarItem_qbyoz_25{border:0;background:none;padding:0!important;cursor:pointer;vertical-align:middle}._toolbarItem_qbyoz_25._disabled_qbyoz_32{cursor:not-allowed}._toolbarItem_qbyoz_25._active_qbyoz_35{background-color:#bababa66;border-radius:50%}._toolbarItem_qbyoz_25 ._format_qbyoz_39{background-size:contain;display:inline-block;vertical-align:-.25em;display:flex!important}._actionButton_qbyoz_46{display:flex!important;gap:var(--space-unit, 1em);margin-left:auto}._inputSubmitActionButton_qbyoz_52{width:100%;height:35px;display:flex!important;justify-content:center!important;align-items:center!important;background-color:var(--call-primary-color, #434343)!important}._inputSubmitActionButton_qbyoz_52._submitAction_qbyoz_60 svg{fill:var(--text-light, white)!important}._inputSubmitActionButton_qbyoz_52 ._inputSourceText_qbyoz_63{display:none!important;margin-left:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important;font-size:var(--font-size-small, 16px)}@container (min-width: 576px){._inputSubmitActionButton_qbyoz_52 ._inputSourceText_qbyoz_63{display:block!important}}._tooltip_qbyoz_74{width:230px!important;margin-left:-117px!important}