@logora/debate 0.3.111 → 0.3.113

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
+ ._tabsWrapper_1ur7i_3{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._navTabs_1ur7i_11{display:flex;flex-wrap:nowrap;gap:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));white-space:nowrap;padding-left:0;margin-top:0;margin-bottom:0;border-bottom:none!important;list-style:none;flex:1}@container (max-width: 575.98px){._navTabs_1ur7i_11{font-size:var(--font-size-normal, 16px);gap:var(--space-unit, 1em)}}._navTabs_1ur7i_11{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none}._navTabs_1ur7i_11::-webkit-scrollbar{display:none}._arrow_1ur7i_39{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-color:#fff!important;line-height:0}._arrow_1ur7i_39 svg{display:block}._arrow_1ur7i_39:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_1ur7i_63{left:0;padding-left:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to right,#ffffff 40%,transparent)!important}._arrowLeft_1ur7i_63 svg{transform:rotate(90deg)}._arrowRight_1ur7i_72{right:0;padding-right:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));background:linear-gradient(to left,#ffffff 40%,transparent)!important}._arrowRight_1ur7i_72 svg{transform:rotate(-90deg)}._arrowHidden_1ur7i_81{opacity:0;pointer-events:none}._navItem_1ur7i_86{cursor:pointer}._navLink_1ur7i_90{display:block;position:relative;padding:var(--spacer-md, calc(var(--space-unit, 1em) * .75)) var(--spacer-md, calc(var(--space-unit, 1em) * .75));border:none!important;color:var(--text-primary, #222222);outline:0}._navLink_1ur7i_90:hover,._navLink_1ur7i_90:focus{text-decoration:none;color:var(--text-primary, #222222)!important;background:transparent}._navLink_1ur7i_90._disabled_1ur7i_103{color:var(--darkest-text-tertiary, #c7c7c7);pointer-events:none;cursor:default}._navLink_1ur7i_90:after{content:"";background-color:var(--text-primary, #222222);height:2px;position:absolute;width:100%;left:0;bottom:0;z-index:1;transition:transform .25s ease 0s;transform:scaleX(0)}._navLink_1ur7i_90._active_1ur7i_120{color:var(--text-primary, #222222)!important;background:transparent;font-weight:var(--font-weight-bold, 700)}._navLink_1ur7i_90._active_1ur7i_120:after{transform:scaleX(1)}
@@ -1,81 +1,84 @@
1
- import { jsxs as y, jsx as o } from "react/jsx-runtime";
2
- import { $isListNode as q, ListNode as $, 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 k } from "@lexical/rich-text";
5
- import { $setBlocksType as C } from "@lexical/selection";
1
+ import { jsxs as T, jsx as o } from "react/jsx-runtime";
2
+ import { $isListNode as q, ListNode as P, INSERT_ORDERED_LIST_COMMAND as $, REMOVE_LIST_COMMAND as K } from "@lexical/list";
3
+ import { useLexicalComposerContext as F } from "@lexical/react/LexicalComposerContext";
4
+ import { $isHeadingNode as U, $createQuoteNode as k } from "@lexical/rich-text";
5
+ import { $setBlocksType as w } from "@lexical/selection";
6
6
  import { $getNearestNodeOfType as j, mergeRegister as H } from "@lexical/utils";
7
7
  import a from "classnames";
8
- import { $getSelection as N, $isRangeSelection as M, 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";
8
+ import { $getSelection as h, $isRangeSelection as p, SELECTION_CHANGE_COMMAND as Q, $createParagraphNode as G } from "lexical";
9
+ import { useRef as V, useState as b, useCallback as z, useEffect as J } from "react";
10
10
  import { useIntl as W } from "react-intl";
11
11
  import e from "./ToolbarPlugin.module.scss.js";
12
- import { Icon as r } from "../../../icons/icon/Icon.js";
13
- import { Button as Y } from "../../../action/button/Button.js";
14
- const ge = (i) => {
15
- const s = W(), x = 1, [l] = U(), E = X(null), [b, _] = u("paragraph"), [Z, I] = u(null), [A, S] = u(!1), [v, w] = u(!1), [L, D] = u(!1), T = i.hideSubmit && i.hideSourceAction && i.disableRichText, g = z(() => {
16
- const t = N();
17
- if (M(t)) {
18
- const c = t.anchor.getNode(), n = c.getKey() === "root" ? c : c.getTopLevelElementOrThrow(), m = n.getKey();
19
- if (l.getElementByKey(m) !== null)
20
- if (I(m), q(n)) {
21
- const f = j(c, $), B = f ? f.getTag() : n.getTag();
22
- _(B);
12
+ import { Icon as d } from "../../../icons/icon/Icon.js";
13
+ import { Button as X } from "../../../action/button/Button.js";
14
+ const be = (i) => {
15
+ const c = W(), x = 1, [n] = F(), C = V(null), [g, _] = b("paragraph"), [Y, D] = b(null), [I, E] = b(!1), [S, v] = b(!1), [A, L] = b(!1), M = i.hideSubmit && i.hideSourceAction && i.disableRichText, m = z(() => {
16
+ const t = h();
17
+ if (p(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 (D(u), q(r)) {
21
+ const f = j(s, P), R = f ? f.getTag() : r.getTag();
22
+ _(R);
23
23
  } else {
24
- const f = P(n) ? n.getTag() : n.getType();
24
+ const f = U(r) ? r.getTag() : r.getType();
25
25
  _(f);
26
26
  }
27
- S(t.hasFormat("bold")), w(t.hasFormat("italic")), D(t.hasFormat("underline"));
27
+ E(t.hasFormat("bold")), v(t.hasFormat("italic")), L(t.hasFormat("underline"));
28
28
  }
29
- }, [l]);
29
+ }, [n]);
30
30
  J(() => H(
31
- l.registerUpdateListener(({ editorState: t }) => {
31
+ n.registerUpdateListener(({ editorState: t }) => {
32
32
  t.read(() => {
33
- g();
33
+ m();
34
34
  });
35
35
  }),
36
- l.registerCommand(
36
+ n.registerCommand(
37
37
  Q,
38
- (t, c) => (g(), !1),
38
+ (t, s) => (m(), !1),
39
39
  x
40
40
  )
41
- ), [l, g]);
42
- const d = (t) => {
41
+ ), [n, m]);
42
+ const l = (t) => {
43
43
  t.preventDefault();
44
- }, h = () => {
44
+ }, y = () => {
45
45
  queueMicrotask(() => {
46
46
  requestAnimationFrame(() => {
47
- l.getEditorState().read(() => {
48
- g();
47
+ n.getEditorState().read(() => {
48
+ m();
49
49
  });
50
50
  });
51
51
  });
52
- }, p = (t) => {
53
- l.dispatchCommand(G, t), h();
52
+ }, N = (t) => {
53
+ n.update(() => {
54
+ const s = h();
55
+ p(s) && (s.formatText(t), m());
56
+ });
54
57
  }, O = () => {
55
- b !== "ol" ? l.dispatchCommand(K) : l.dispatchCommand(F), h();
56
- }, R = () => {
57
- b !== "quote" ? l.update(() => {
58
- const t = N();
59
- if (M(t))
58
+ g !== "ol" ? n.dispatchCommand($) : n.dispatchCommand(K), y();
59
+ }, B = () => {
60
+ g !== "quote" ? n.update(() => {
61
+ const t = h();
62
+ if (p(t))
60
63
  if (t.isCollapsed()) {
61
- const n = t.anchor.getNode().getTopLevelElementOrThrow(), m = k();
62
- n.insertAfter(m), m.selectEnd();
64
+ const r = t.anchor.getNode().getTopLevelElementOrThrow(), u = k();
65
+ r.insertAfter(u), u.selectEnd();
63
66
  } else
64
- C(t, () => k());
65
- }) : l.update(() => {
66
- const t = N();
67
- M(t) && C(t, () => V());
68
- }), h();
67
+ w(t, () => k());
68
+ }) : n.update(() => {
69
+ const t = h();
70
+ p(t) && w(t, () => G());
71
+ }), y();
69
72
  };
70
- return T ? null : /* @__PURE__ */ y(
73
+ return M ? null : /* @__PURE__ */ T(
71
74
  "div",
72
75
  {
73
76
  className: a(e.toolbar, {
74
- [e.toolbarIsActive]: T ? !1 : i.isActive
77
+ [e.toolbarIsActive]: M ? !1 : i.isActive
75
78
  }),
76
- ref: E,
79
+ ref: C,
77
80
  children: [
78
- i.isActive ? !i.disableRichText && /* @__PURE__ */ y(
81
+ i.isActive ? !i.disableRichText && /* @__PURE__ */ T(
79
82
  "div",
80
83
  {
81
84
  className: a(e.iconToolbar, {
@@ -85,19 +88,20 @@ const ge = (i) => {
85
88
  /* @__PURE__ */ o(
86
89
  "button",
87
90
  {
88
- onMouseDown: d,
91
+ onPointerDown: l,
92
+ onMouseDown: l,
89
93
  onClick: () => {
90
- p("bold");
94
+ N("bold");
91
95
  },
92
96
  type: "button",
93
- className: a(e.toolbarItem, { [e.active]: A }),
97
+ className: a(e.toolbarItem, { [e.active]: I }),
94
98
  "data-testid": "format-bold",
95
- "aria-label": s.formatMessage({
99
+ "aria-label": c.formatMessage({
96
100
  id: "input.text_editor.plugins.toolbar_plugin.bold.aria_label",
97
101
  defaultMessage: "Make text bold"
98
102
  }),
99
103
  children: /* @__PURE__ */ o(
100
- r,
104
+ d,
101
105
  {
102
106
  name: "bold",
103
107
  width: 24,
@@ -110,20 +114,21 @@ const ge = (i) => {
110
114
  /* @__PURE__ */ o(
111
115
  "button",
112
116
  {
113
- onMouseDown: d,
117
+ onPointerDown: l,
118
+ onMouseDown: l,
114
119
  onClick: () => {
115
- p("italic");
120
+ N("italic");
116
121
  },
117
122
  type: "button",
118
123
  className: a(e.toolbarItem, {
119
- [e.active]: v
124
+ [e.active]: S
120
125
  }),
121
- "aria-label": s.formatMessage({
126
+ "aria-label": c.formatMessage({
122
127
  id: "input.text_editor.plugins.toolbar_plugin.italic.aria_label",
123
128
  defaultMessage: "Make text italic"
124
129
  }),
125
130
  children: /* @__PURE__ */ o(
126
- r,
131
+ d,
127
132
  {
128
133
  name: "italic",
129
134
  width: 24,
@@ -136,20 +141,21 @@ const ge = (i) => {
136
141
  /* @__PURE__ */ o(
137
142
  "button",
138
143
  {
139
- onMouseDown: d,
144
+ onPointerDown: l,
145
+ onMouseDown: l,
140
146
  onClick: () => {
141
- p("underline");
147
+ N("underline");
142
148
  },
143
149
  type: "button",
144
150
  className: a(e.toolbarItem, {
145
- [e.active]: L
151
+ [e.active]: A
146
152
  }),
147
- "aria-label": s.formatMessage({
153
+ "aria-label": c.formatMessage({
148
154
  id: "input.text_editor.plugins.toolbar_plugin.underline.aria_label",
149
155
  defaultMessage: "Underline text"
150
156
  }),
151
157
  children: /* @__PURE__ */ o(
152
- r,
158
+ d,
153
159
  {
154
160
  name: "underline",
155
161
  width: 24,
@@ -162,16 +168,17 @@ const ge = (i) => {
162
168
  /* @__PURE__ */ o(
163
169
  "button",
164
170
  {
165
- onMouseDown: d,
166
- onClick: () => R(),
171
+ onPointerDown: l,
172
+ onMouseDown: l,
173
+ onClick: () => B(),
167
174
  type: "button",
168
- className: a(e.toolbarItem, { [e.active]: b === "quote" }),
169
- "aria-label": s.formatMessage({
175
+ className: a(e.toolbarItem, { [e.active]: g === "quote" }),
176
+ "aria-label": c.formatMessage({
170
177
  id: "input.text_editor.plugins.toolbar_plugin.blockquote.aria_label",
171
178
  defaultMessage: "Add a blockquote"
172
179
  }),
173
180
  children: /* @__PURE__ */ o(
174
- r,
181
+ d,
175
182
  {
176
183
  name: "blockquote",
177
184
  width: 24,
@@ -184,16 +191,17 @@ const ge = (i) => {
184
191
  /* @__PURE__ */ o(
185
192
  "button",
186
193
  {
187
- onMouseDown: d,
194
+ onPointerDown: l,
195
+ onMouseDown: l,
188
196
  onClick: () => O(),
189
197
  type: "button",
190
- className: a(e.toolbarItem, { [e.active]: b === "ol" }),
191
- "aria-label": s.formatMessage({
198
+ className: a(e.toolbarItem, { [e.active]: g === "ol" }),
199
+ "aria-label": c.formatMessage({
192
200
  id: "input.text_editor.plugins.toolbar_plugin.numbered_list.aria_label",
193
201
  defaultMessage: "Insert a numbered list"
194
202
  }),
195
203
  children: /* @__PURE__ */ o(
196
- r,
204
+ d,
197
205
  {
198
206
  name: "orderedList",
199
207
  width: 24,
@@ -209,12 +217,12 @@ const ge = (i) => {
209
217
  onClick: i.onAddSource,
210
218
  type: "button",
211
219
  className: e.toolbarItem,
212
- "aria-label": s.formatMessage({
220
+ "aria-label": c.formatMessage({
213
221
  id: "input.text_editor.plugins.toolbar_plugin.add_link.aria_label",
214
222
  defaultMessage: "Add hyperlink"
215
223
  }),
216
224
  children: /* @__PURE__ */ o(
217
- r,
225
+ d,
218
226
  {
219
227
  name: "link",
220
228
  width: 20,
@@ -228,17 +236,17 @@ const ge = (i) => {
228
236
  }
229
237
  ) : null,
230
238
  /* @__PURE__ */ o("div", { className: e.actionButton, children: i.hideSubmit ? null : /* @__PURE__ */ o(
231
- Y,
239
+ X,
232
240
  {
233
241
  type: "button",
234
242
  "data-testid": "submit-button",
235
243
  handleClick: i.onSubmit,
236
244
  className: a(e.inputSubmitActionButton, e.submitAction),
237
- "aria-label": s.formatMessage({
245
+ "aria-label": c.formatMessage({
238
246
  id: "input.text_editor.plugins.toolbar_plugin.submit_button.aria_label",
239
247
  defaultMessage: "Send message"
240
248
  }),
241
- children: /* @__PURE__ */ o(r, { name: "send", width: 20, height: 20 })
249
+ children: /* @__PURE__ */ o(d, { name: "send", width: 20, height: 20 })
242
250
  }
243
251
  ) })
244
252
  ]
@@ -246,5 +254,5 @@ const ge = (i) => {
246
254
  );
247
255
  };
248
256
  export {
249
- ge as ToolbarPlugin
257
+ be as ToolbarPlugin
250
258
  };
@@ -1,23 +1,23 @@
1
- import '../../../assets/components/navigation/tabs/Tabs.module-DvCQQR63.css';const a = "_tabsWrapper_9pezl_3", r = "_navTabs_9pezl_11", t = "_arrow_9pezl_39", e = "_arrowLeft_9pezl_63", _ = "_arrowRight_9pezl_72", n = "_arrowHidden_9pezl_81", o = "_navItem_9pezl_86", s = "_navLink_9pezl_90", p = "_active_9pezl_120", c = {
2
- tabsWrapper: a,
3
- navTabs: r,
1
+ import '../../../assets/components/navigation/tabs/Tabs.module-B4sJ1pVW.css';const r = "_tabsWrapper_1ur7i_3", a = "_navTabs_1ur7i_11", t = "_arrow_1ur7i_39", _ = "_arrowLeft_1ur7i_63", n = "_arrowRight_1ur7i_72", o = "_arrowHidden_1ur7i_81", i = "_navItem_1ur7i_86", s = "_navLink_1ur7i_90", e = "_active_1ur7i_120", c = {
2
+ tabsWrapper: r,
3
+ navTabs: a,
4
4
  arrow: t,
5
- arrowLeft: e,
6
- arrowRight: _,
7
- arrowHidden: n,
8
- navItem: o,
5
+ arrowLeft: _,
6
+ arrowRight: n,
7
+ arrowHidden: o,
8
+ navItem: i,
9
9
  navLink: s,
10
- active: p
10
+ active: e
11
11
  };
12
12
  export {
13
- p as active,
13
+ e as active,
14
14
  t as arrow,
15
- n as arrowHidden,
16
- e as arrowLeft,
17
- _ as arrowRight,
15
+ o as arrowHidden,
16
+ _ as arrowLeft,
17
+ n as arrowRight,
18
18
  c as default,
19
- o as navItem,
19
+ i as navItem,
20
20
  s as navLink,
21
- r as navTabs,
22
- a as tabsWrapper
21
+ a as navTabs,
22
+ r as tabsWrapper
23
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.3.111",
3
+ "version": "0.3.113",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -1 +0,0 @@
1
- ._tabsWrapper_9pezl_3{position:relative;display:flex;align-items:stretch;width:100%;max-width:100%}._navTabs_9pezl_11{display:flex;flex-wrap:nowrap;gap:var(--spacer-xs, calc(var(--space-unit, 1em) * .325));white-space:nowrap;padding-left:0;margin-top:0;margin-bottom:0;border-bottom:none!important;list-style:none;flex:1}@container (max-width: 575.98px){._navTabs_9pezl_11{font-size:var(--font-size-normal, 16px);gap:var(--space-unit, 1em)}}._navTabs_9pezl_11{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none}._navTabs_9pezl_11::-webkit-scrollbar{display:none}._arrow_9pezl_39{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-color:var(--background-color-secondary, #E8E8E8)!important;line-height:0}._arrow_9pezl_39 svg{display:block}._arrow_9pezl_39:focus-visible{outline:2px solid var(--call-primary-color, #434343);outline-offset:-2px}._arrowLeft_9pezl_63{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_9pezl_63 svg{transform:rotate(90deg)}._arrowRight_9pezl_72{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_9pezl_72 svg{transform:rotate(-90deg)}._arrowHidden_9pezl_81{opacity:0;pointer-events:none}._navItem_9pezl_86{cursor:pointer}._navLink_9pezl_90{display:block;position:relative;padding:var(--spacer-md, calc(var(--space-unit, 1em) * .75)) var(--spacer-md, calc(var(--space-unit, 1em) * .75));border:none!important;color:var(--text-primary, #222222);outline:0}._navLink_9pezl_90:hover,._navLink_9pezl_90:focus{text-decoration:none;color:var(--text-primary, #222222)!important;background:transparent}._navLink_9pezl_90._disabled_9pezl_103{color:var(--darkest-text-tertiary, #c7c7c7);pointer-events:none;cursor:default}._navLink_9pezl_90:after{content:"";background-color:var(--text-primary, #222222);height:2px;position:absolute;width:100%;left:0;bottom:0;z-index:1;transition:transform .25s ease 0s;transform:scaleX(0)}._navLink_9pezl_90._active_9pezl_120{color:var(--text-primary, #222222)!important;background:transparent;font-weight:var(--font-weight-bold, 700)}._navLink_9pezl_90._active_9pezl_120:after{transform:scaleX(1)}