@logora/debate 0.3.94 → 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.
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-CKkdHjXR.css +1 -0
- package/dist/components/input/text_editor/TextEditor.js +49 -47
- package/dist/components/input/text_editor/plugins/IOSInsertParagraphFallbackPlugin.js +49 -0
- package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +12 -12
- package/package.json +10 -10
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +0 -1
|
@@ -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
|
|
18
|
-
import
|
|
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
|
|
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
|
|
25
|
-
import { SetRichContentPlugin as
|
|
26
|
-
import { ToolbarPlugin as
|
|
27
|
-
import { useModal as
|
|
28
|
-
import { SourceModal as
|
|
29
|
-
import { SourceListItem as
|
|
30
|
-
const y = (l) => l?.replace(/ /g, " "),
|
|
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,
|
|
@@ -36,50 +37,50 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
36
37
|
hideSubmit: _ = !1,
|
|
37
38
|
hideSourceAction: A = !1,
|
|
38
39
|
onActivation: n,
|
|
39
|
-
disabled:
|
|
40
|
-
handleChange:
|
|
40
|
+
disabled: O = !1,
|
|
41
|
+
handleChange: P,
|
|
41
42
|
handleSourcesChange: h,
|
|
42
|
-
shortBar:
|
|
43
|
+
shortBar: k = !1,
|
|
43
44
|
active: g = !1,
|
|
44
45
|
maxLength: m,
|
|
45
|
-
disableRichText:
|
|
46
|
-
editorRef:
|
|
47
|
-
uid:
|
|
46
|
+
disableRichText: B = !1,
|
|
47
|
+
editorRef: U,
|
|
48
|
+
uid: C,
|
|
48
49
|
allowedDomains: T = [],
|
|
49
|
-
hideCharCount:
|
|
50
|
+
hideCharCount: j = !1,
|
|
50
51
|
disableAutoActivate: z = !1,
|
|
51
52
|
autoFocus: a = !1,
|
|
52
|
-
...
|
|
53
|
+
...F
|
|
53
54
|
}) => {
|
|
54
|
-
const [s,
|
|
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 && !
|
|
57
|
+
a && !v.current && n && (v.current = !0, n());
|
|
57
58
|
}, [a, n]), M(() => {
|
|
58
59
|
p && u(p);
|
|
59
60
|
}, [p]);
|
|
60
|
-
const
|
|
61
|
-
s || (
|
|
62
|
-
},
|
|
63
|
-
editable: !
|
|
64
|
-
theme:
|
|
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
|
-
|
|
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
|
-
|
|
75
|
+
Q(r), $(R), P && P(r, R);
|
|
75
76
|
});
|
|
76
77
|
}, V = (t) => {
|
|
77
|
-
const o =
|
|
78
|
+
const o = J, r = W, c = d;
|
|
78
79
|
x && (t.preventDefault(), x(o, r, c)), u([]), h?.([]);
|
|
79
80
|
}, X = () => {
|
|
80
|
-
|
|
81
|
+
q(
|
|
81
82
|
/* @__PURE__ */ e(
|
|
82
|
-
|
|
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
|
-
|
|
103
|
+
Le,
|
|
103
104
|
{
|
|
104
105
|
publisher: t.publisher,
|
|
105
106
|
url: t.source_url,
|
|
@@ -110,7 +111,7 @@ 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:
|
|
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, {
|
|
@@ -126,7 +127,7 @@ const y = (l) => l?.replace(/ /g, " "), st = ({
|
|
|
126
127
|
className: b(i.editorInput, {
|
|
127
128
|
[i.editorInputInactive]: !s
|
|
128
129
|
}),
|
|
129
|
-
...
|
|
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
|
-
|
|
138
|
+
Me,
|
|
138
139
|
{
|
|
139
140
|
hideSourceAction: A,
|
|
140
141
|
hideSubmit: _,
|
|
141
|
-
disableRichText:
|
|
142
|
-
shortBar:
|
|
142
|
+
disableRichText: B,
|
|
143
|
+
shortBar: k,
|
|
143
144
|
onSubmit: V,
|
|
144
145
|
onAddSource: X,
|
|
145
146
|
isActive: s || g,
|
|
146
|
-
sourceTooltip: T?.length > 0 &&
|
|
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
|
-
s && m && !
|
|
153
|
+
s && m && !j && /* @__PURE__ */ S("div", { className: i.charactersCount, children: [
|
|
153
154
|
/* @__PURE__ */ e(se, { maxLength: m }),
|
|
154
155
|
" ",
|
|
155
|
-
|
|
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
|
-
} :
|
|
168
|
-
storageUid:
|
|
168
|
+
} : E,
|
|
169
|
+
storageUid: C || N
|
|
169
170
|
}
|
|
170
171
|
),
|
|
171
|
-
/* @__PURE__ */ e(
|
|
172
|
-
/* @__PURE__ */ e(
|
|
173
|
-
/* @__PURE__ */ e(
|
|
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:
|
|
176
|
-
/* @__PURE__ */ e(me, { editorRef:
|
|
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
|
-
|
|
186
|
+
lt as TextEditor
|
|
185
187
|
};
|
|
@@ -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-
|
|
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:
|
|
8
|
-
search:
|
|
9
|
-
tagList:
|
|
10
|
-
tagItem:
|
|
11
|
-
select:
|
|
7
|
+
rightBarOneItem: a,
|
|
8
|
+
search: l,
|
|
9
|
+
tagList: r,
|
|
10
|
+
tagItem: c,
|
|
11
|
+
select: n
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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.
|
|
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.
|
|
59
|
-
"@lexical/html": "^0.
|
|
60
|
-
"@lexical/list": "^0.
|
|
61
|
-
"@lexical/overflow": "^0.
|
|
62
|
-
"@lexical/react": "^0.
|
|
63
|
-
"@lexical/rich-text": "^0.
|
|
64
|
-
"@lexical/selection": "^0.
|
|
65
|
-
"@lexical/utils": "^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.
|
|
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}}
|