@logora/debate 0.4.103 → 0.4.105
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/components/argument/argument/Argument.js +192 -164
- package/dist/components/data/data_provider/DataProvider.js +49 -49
- package/dist/components/input/argument_input/ArgumentInput.js +258 -214
- package/dist/components/input/text_editor/TextEditor.js +76 -74
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +50 -48
- package/dist/components/util/pending_reply/pendingReply.js +32 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function w(g) {
|
|
2
2
|
try {
|
|
3
3
|
const u = JSON.parse(localStorage.getItem(g));
|
|
4
4
|
return u && u.access_token ? { authorization: "Bearer " + u.access_token } : {};
|
|
@@ -6,83 +6,83 @@ function P(g) {
|
|
|
6
6
|
return {};
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
getOne: (s,
|
|
9
|
+
const d = (g, u, S = "", $ = "") => ({
|
|
10
|
+
getOne: (s, n, t = {}) => {
|
|
11
11
|
t.api_key = S;
|
|
12
|
-
const
|
|
12
|
+
const r = new URLSearchParams(t).toString(), c = `${u}/${s}/${n}?${r}`;
|
|
13
13
|
return new Promise((o, e) => {
|
|
14
|
-
g.get(
|
|
14
|
+
g.get(c).then((a) => {
|
|
15
15
|
o(a);
|
|
16
16
|
}).catch((a) => {
|
|
17
17
|
e(a);
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
},
|
|
21
|
-
getOneWithToken: (s,
|
|
22
|
-
const
|
|
23
|
-
headers:
|
|
21
|
+
getOneWithToken: (s, n, t = {}) => {
|
|
22
|
+
const r = new URLSearchParams(t).toString(), c = `${u}/${s}/${n}?${r}`, o = {
|
|
23
|
+
headers: w($)
|
|
24
24
|
};
|
|
25
25
|
return new Promise((e, a) => {
|
|
26
|
-
g.get(
|
|
26
|
+
g.get(c, o).then((i) => {
|
|
27
27
|
e(i);
|
|
28
28
|
}).catch((i) => {
|
|
29
29
|
a(i);
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
},
|
|
33
|
-
getList: (s,
|
|
34
|
-
|
|
35
|
-
const t = new URLSearchParams(
|
|
36
|
-
return new Promise((
|
|
37
|
-
g.get(
|
|
38
|
-
|
|
33
|
+
getList: (s, n = {}) => {
|
|
34
|
+
n.api_key = S;
|
|
35
|
+
const t = new URLSearchParams(n).toString(), r = `${u}/${s}?${t}`;
|
|
36
|
+
return new Promise((c, o) => {
|
|
37
|
+
g.get(r).then((e) => {
|
|
38
|
+
c(e);
|
|
39
39
|
}).catch((e) => {
|
|
40
40
|
o(e);
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
|
-
getListWithToken: (s,
|
|
44
|
+
getListWithToken: (s, n = {}) => {
|
|
45
45
|
const t = {
|
|
46
|
-
headers:
|
|
47
|
-
},
|
|
46
|
+
headers: w($)
|
|
47
|
+
}, r = new URLSearchParams(n).toString(), c = `${u}/${s}?${r}`;
|
|
48
48
|
return new Promise((o, e) => {
|
|
49
|
-
g.get(
|
|
49
|
+
g.get(c, t).then((a) => {
|
|
50
50
|
o(a);
|
|
51
51
|
}).catch((a) => {
|
|
52
52
|
e(a);
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
},
|
|
56
|
-
update: (s,
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
return new Promise((
|
|
61
|
-
g.patch(
|
|
62
|
-
|
|
63
|
-
}).catch((
|
|
64
|
-
|
|
56
|
+
update: (s, n, t, r = {}, c = !0, o = {}) => {
|
|
57
|
+
const e = { ...o };
|
|
58
|
+
c ? e.headers = w($) : r.api_key = S;
|
|
59
|
+
const a = new URLSearchParams(r).toString(), i = `${u}/${s}/${n}?${a}`;
|
|
60
|
+
return new Promise((h, P) => {
|
|
61
|
+
g.patch(i, t, e).then((m) => {
|
|
62
|
+
h(m);
|
|
63
|
+
}).catch((m) => {
|
|
64
|
+
P(m);
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
},
|
|
68
|
-
create: (s,
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
return new Promise((
|
|
73
|
-
g.post(
|
|
74
|
-
|
|
75
|
-
}).catch((
|
|
76
|
-
|
|
68
|
+
create: (s, n, t = {}, r = !0, c = {}) => {
|
|
69
|
+
const o = { ...c };
|
|
70
|
+
r ? o.headers = w($) : t.api_key = S;
|
|
71
|
+
const e = new URLSearchParams(t).toString(), a = `${u}/${s}?${e}`;
|
|
72
|
+
return new Promise((i, h) => {
|
|
73
|
+
g.post(a, n, o).then((P) => {
|
|
74
|
+
i(P);
|
|
75
|
+
}).catch((P) => {
|
|
76
|
+
h(P);
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
79
|
},
|
|
80
|
-
delete: (s,
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
const o = new URLSearchParams(t).toString(), e = `${u}/${s}/${
|
|
80
|
+
delete: (s, n, t = {}, r = !0) => {
|
|
81
|
+
const c = {};
|
|
82
|
+
r ? c.headers = w($) : t.api_key = S;
|
|
83
|
+
const o = new URLSearchParams(t).toString(), e = `${u}/${s}/${n}?${o}`;
|
|
84
84
|
return new Promise((a, i) => {
|
|
85
|
-
g.delete(e,
|
|
85
|
+
g.delete(e, c).then((h) => {
|
|
86
86
|
a(h);
|
|
87
87
|
}).catch((h) => {
|
|
88
88
|
i(h);
|
|
@@ -90,12 +90,12 @@ const m = (g, u, S = "", $ = "") => ({
|
|
|
90
90
|
});
|
|
91
91
|
},
|
|
92
92
|
getSettings: (s) => {
|
|
93
|
-
const
|
|
93
|
+
const n = {
|
|
94
94
|
shortname: s
|
|
95
|
-
}, t = new URLSearchParams(
|
|
96
|
-
return new Promise((
|
|
97
|
-
g.post(
|
|
98
|
-
|
|
95
|
+
}, t = new URLSearchParams(n).toString(), r = `${u}/settings?${t}`;
|
|
96
|
+
return new Promise((c, o) => {
|
|
97
|
+
g.post(r).then((e) => {
|
|
98
|
+
c(e);
|
|
99
99
|
}).catch((e) => {
|
|
100
100
|
o(e);
|
|
101
101
|
});
|
|
@@ -103,6 +103,6 @@ const m = (g, u, S = "", $ = "") => ({
|
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
d as dataProvider,
|
|
107
|
+
w as getAuthHeader
|
|
108
108
|
};
|