@logora/debate 0.4.19 → 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,105 +1,101 @@
1
- import { jsxs as k, 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 x } from "@lexical/rich-text";
5
- import { $setBlocksType as I } 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 m, 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 d } from "../../../icons/icon/Icon.js";
13
- import { Button as Y } from "../../../action/button/Button.js";
14
- const he = (l) => {
15
- const c = W(), E = 1, [n] = U(), A = X(null), [b, M] = m("paragraph"), [Z, v] = m(null), [w, T] = m(!1), [D, _] = m(!1), [L, y] = m(!1), S = l.hideSubmit && l.hideSourceAction && l.disableRichText, h = z(() => {
16
- const t = p();
17
- if (N(t)) {
18
- const s = t.anchor.getNode(), r = s.getKey() === "root" ? s : s.getTopLevelElementOrThrow(), u = r.getKey();
19
- if (n.getElementByKey(u) !== null)
20
- if (v(u), $(r)) {
21
- const g = j(s, q), B = g ? g.getTag() : r.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 g = P(r) ? r.getTag() : r.getType();
25
- M(g);
24
+ const g = U(s) ? s.getTag() : s.getType();
25
+ N(g);
26
26
  }
27
- T(t.hasFormat("bold")), _(t.hasFormat("italic")), y(t.hasFormat("underline"));
27
+ A(t.hasFormat("bold")), L(t.hasFormat("italic")), O(t.hasFormat("underline"));
28
28
  }
29
- }, [n]);
30
- J(() => H(
31
- n.registerUpdateListener(({ editorState: t }) => {
29
+ }, [a]);
30
+ z(() => j(
31
+ a.registerUpdateListener(({ editorState: t }) => {
32
32
  t.read(() => {
33
- h();
33
+ b();
34
34
  });
35
35
  }),
36
- n.registerCommand(
37
- Q,
38
- () => (h(), !1),
39
- E
36
+ a.registerCommand(
37
+ H,
38
+ () => (b(), !1),
39
+ k
40
40
  )
41
- ), [n, h]);
42
- const i = (t) => {
43
- t.preventDefault();
44
- }, C = () => {
41
+ ), [a, b]);
42
+ const M = () => {
45
43
  setTimeout(() => {
46
- n.getEditorState().read(() => {
47
- h();
44
+ a.getEditorState().read(() => {
45
+ b();
48
46
  });
49
47
  }, 0);
50
48
  }, f = (t) => {
51
- n.dispatchCommand(G, t), t === "bold" && T((s) => !s), t === "italic" && _((s) => !s), t === "underline" && y((s) => !s);
52
- }, O = () => {
53
- b !== "ol" ? n.dispatchCommand(K) : n.dispatchCommand(F), C();
49
+ a.dispatchCommand(Q, t), a.focus();
54
50
  }, R = () => {
55
- b !== "quote" ? n.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 r = t.anchor.getNode().getTopLevelElementOrThrow(), u = x();
60
- r.insertAfter(u), u.selectEnd();
57
+ const s = t.anchor.getNode().getTopLevelElementOrThrow(), d = y();
58
+ s.insertAfter(d), d.selectEnd();
61
59
  } else
62
- I(t, () => x());
63
- }) : n.update(() => {
64
- const t = p();
65
- N(t) && I(t, () => V());
66
- }), C();
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 S ? null : /* @__PURE__ */ k(
66
+ return _ ? null : /* @__PURE__ */ T(
69
67
  "div",
70
68
  {
71
- className: a(e.toolbar, {
72
- [e.toolbarIsActive]: S ? !1 : l.isActive
69
+ className: i(e.toolbar, {
70
+ [e.toolbarIsActive]: _ ? !1 : l.isActive
73
71
  }),
74
- ref: A,
72
+ ref: x,
75
73
  children: [
76
- l.isActive ? !l.disableRichText && /* @__PURE__ */ k(
74
+ l.isActive ? !l.disableRichText && /* @__PURE__ */ T(
77
75
  "div",
78
76
  {
79
- className: a(e.iconToolbar, {
77
+ className: i(e.iconToolbar, {
80
78
  [e.shortBar]: l.shortBar
81
79
  }),
82
80
  children: [
83
81
  /* @__PURE__ */ o(
84
82
  "button",
85
83
  {
86
- onTouchStart: i,
87
- onMouseDown: i,
88
84
  onClick: () => f("bold"),
89
85
  type: "button",
90
- className: a(e.toolbarItem, { [e.active]: w }),
86
+ className: i(e.toolbarItem, { [e.active]: E }),
91
87
  "data-testid": "format-bold",
92
- "aria-label": c.formatMessage({
88
+ "aria-label": n.formatMessage({
93
89
  id: "input.text_editor.plugins.toolbar_plugin.bold.aria_label",
94
90
  defaultMessage: "Make text bold"
95
91
  }),
96
92
  children: /* @__PURE__ */ o(
97
- d,
93
+ r,
98
94
  {
99
95
  name: "bold",
100
96
  width: 24,
101
97
  height: 24,
102
- className: a(e.format, e.bold)
98
+ className: i(e.format, e.bold)
103
99
  }
104
100
  )
105
101
  }
@@ -107,24 +103,22 @@ const he = (l) => {
107
103
  /* @__PURE__ */ o(
108
104
  "button",
109
105
  {
110
- onTouchStart: i,
111
- onMouseDown: i,
112
106
  onClick: () => f("italic"),
113
107
  type: "button",
114
- className: a(e.toolbarItem, {
115
- [e.active]: D
108
+ className: i(e.toolbarItem, {
109
+ [e.active]: S
116
110
  }),
117
- "aria-label": c.formatMessage({
111
+ "aria-label": n.formatMessage({
118
112
  id: "input.text_editor.plugins.toolbar_plugin.italic.aria_label",
119
113
  defaultMessage: "Make text italic"
120
114
  }),
121
115
  children: /* @__PURE__ */ o(
122
- d,
116
+ r,
123
117
  {
124
118
  name: "italic",
125
119
  width: 24,
126
120
  height: 24,
127
- className: a(e.format, e.italic)
121
+ className: i(e.format, e.italic)
128
122
  }
129
123
  )
130
124
  }
@@ -132,24 +126,22 @@ const he = (l) => {
132
126
  /* @__PURE__ */ o(
133
127
  "button",
134
128
  {
135
- onTouchStart: i,
136
- onMouseDown: i,
137
129
  onClick: () => f("underline"),
138
130
  type: "button",
139
- className: a(e.toolbarItem, {
140
- [e.active]: L
131
+ className: i(e.toolbarItem, {
132
+ [e.active]: v
141
133
  }),
142
- "aria-label": c.formatMessage({
134
+ "aria-label": n.formatMessage({
143
135
  id: "input.text_editor.plugins.toolbar_plugin.underline.aria_label",
144
136
  defaultMessage: "Underline text"
145
137
  }),
146
138
  children: /* @__PURE__ */ o(
147
- d,
139
+ r,
148
140
  {
149
141
  name: "underline",
150
142
  width: 24,
151
143
  height: 24,
152
- className: a(e.format, e.underline)
144
+ className: i(e.format, e.underline)
153
145
  }
154
146
  )
155
147
  }
@@ -157,24 +149,22 @@ const he = (l) => {
157
149
  /* @__PURE__ */ o(
158
150
  "button",
159
151
  {
160
- onTouchStart: i,
161
- onMouseDown: i,
162
- onClick: () => R(),
152
+ onClick: () => w(),
163
153
  type: "button",
164
- className: a(e.toolbarItem, {
165
- [e.active]: b === "quote"
154
+ className: i(e.toolbarItem, {
155
+ [e.active]: u === "quote"
166
156
  }),
167
- "aria-label": c.formatMessage({
157
+ "aria-label": n.formatMessage({
168
158
  id: "input.text_editor.plugins.toolbar_plugin.blockquote.aria_label",
169
159
  defaultMessage: "Add a blockquote"
170
160
  }),
171
161
  children: /* @__PURE__ */ o(
172
- d,
162
+ r,
173
163
  {
174
164
  name: "blockquote",
175
165
  width: 24,
176
166
  height: 24,
177
- className: a(e.format, e.quote)
167
+ className: i(e.format, e.quote)
178
168
  }
179
169
  )
180
170
  }
@@ -182,24 +172,22 @@ const he = (l) => {
182
172
  /* @__PURE__ */ o(
183
173
  "button",
184
174
  {
185
- onTouchStart: i,
186
- onMouseDown: i,
187
- onClick: () => O(),
175
+ onClick: () => R(),
188
176
  type: "button",
189
- className: a(e.toolbarItem, {
190
- [e.active]: b === "ol"
177
+ className: i(e.toolbarItem, {
178
+ [e.active]: u === "ol"
191
179
  }),
192
- "aria-label": c.formatMessage({
180
+ "aria-label": n.formatMessage({
193
181
  id: "input.text_editor.plugins.toolbar_plugin.numbered_list.aria_label",
194
182
  defaultMessage: "Insert a numbered list"
195
183
  }),
196
184
  children: /* @__PURE__ */ o(
197
- d,
185
+ r,
198
186
  {
199
187
  name: "orderedList",
200
188
  width: 24,
201
189
  height: 24,
202
- className: a(e.format, e.numberedList)
190
+ className: i(e.format, e.numberedList)
203
191
  }
204
192
  )
205
193
  }
@@ -207,22 +195,20 @@ const he = (l) => {
207
195
  !l.hideSourceAction && /* @__PURE__ */ o(
208
196
  "button",
209
197
  {
210
- onTouchStart: i,
211
- onMouseDown: i,
212
198
  onClick: l.onAddSource,
213
199
  type: "button",
214
200
  className: e.toolbarItem,
215
- "aria-label": c.formatMessage({
201
+ "aria-label": n.formatMessage({
216
202
  id: "input.text_editor.plugins.toolbar_plugin.add_link.aria_label",
217
203
  defaultMessage: "Add hyperlink"
218
204
  }),
219
205
  children: /* @__PURE__ */ o(
220
- d,
206
+ r,
221
207
  {
222
208
  name: "link",
223
209
  width: 20,
224
210
  height: 20,
225
- className: a(e.format, e.link)
211
+ className: i(e.format, e.link)
226
212
  }
227
213
  )
228
214
  }
@@ -231,17 +217,17 @@ const he = (l) => {
231
217
  }
232
218
  ) : null,
233
219
  /* @__PURE__ */ o("div", { className: e.actionButton, children: l.hideSubmit ? null : /* @__PURE__ */ o(
234
- Y,
220
+ W,
235
221
  {
236
222
  type: "button",
237
223
  "data-testid": "submit-button",
238
224
  handleClick: l.onSubmit,
239
- className: a(e.inputSubmitActionButton, e.submitAction),
240
- "aria-label": c.formatMessage({
225
+ className: i(e.inputSubmitActionButton, e.submitAction),
226
+ "aria-label": n.formatMessage({
241
227
  id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
242
228
  defaultMessage: "Send message"
243
229
  }),
244
- children: /* @__PURE__ */ o(d, { name: "send", width: 20, height: 20 })
230
+ children: /* @__PURE__ */ o(r, { name: "send", width: 20, height: 20 })
245
231
  }
246
232
  ) })
247
233
  ]
@@ -249,5 +235,5 @@ const he = (l) => {
249
235
  );
250
236
  };
251
237
  export {
252
- he as ToolbarPlugin
238
+ be as ToolbarPlugin
253
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.19",
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}