strapi-plugin-comments 3.0.7-beta.1 → 3.0.7
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/README.md +1 -1
- package/dist/_chunks/index-Bpnqk6JP.js +1 -0
- package/dist/_chunks/{index-D9B514y5.mjs → index-CF4vndXw.mjs} +3117 -3125
- package/dist/_chunks/{index-CTrpEEVW.js → index-CFIjHfkZ.js} +95 -95
- package/dist/_chunks/index-CHDv123w.js +44 -0
- package/dist/_chunks/{index-wsRcN626.mjs → index-CwHmRIcs.mjs} +91 -92
- package/dist/_chunks/{index-CVaM8WKt.mjs → index-DGKkpdmq.mjs} +1639 -1650
- package/dist/_chunks/{index-DbSxM8lO.js → index-YPqaQ-iX.js} +35 -35
- package/dist/_chunks/{index-BpDl_L4E.mjs → index-pLgOJz-6.mjs} +2097 -2094
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +5 -5
- package/dist/server/index.mjs +305 -310
- package/dist/server/src/controllers/index.d.ts +105 -0
- package/dist/server/src/index.d.ts +420 -0
- package/dist/server/src/services/admin/admin.service.d.ts +105 -0
- package/dist/server/src/services/client.service.d.ts +105 -0
- package/dist/server/src/services/index.d.ts +315 -0
- package/dist/server/src/validators/api/controllers/client.controller.validator.d.ts +105 -0
- package/package.json +8 -8
- package/dist/_chunks/index-BgJ65O-2.js +0 -44
- package/dist/_chunks/index-CYrQYscU.js +0 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import {
|
|
3
|
-
import { useTracking as
|
|
4
|
-
import { useMutation as A, useQuery as M, useQueryClient as
|
|
5
|
-
import { u as $, f as
|
|
6
|
-
import { useMemo as
|
|
7
|
-
import
|
|
1
|
+
import { jsx as e, Fragment as U, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { e as I, f as re, B as p, a1 as ae, F as q, T as m, Z as a, m as n, a2 as x, a3 as T, a4 as f, a5 as se, a6 as N, a7 as Q, a8 as le } from "./index-CF4vndXw.mjs";
|
|
3
|
+
import { useTracking as ce, useNotification as de, Page as W, Layouts as j, Form as ge } from "@strapi/strapi/admin";
|
|
4
|
+
import { useMutation as A, useQuery as M, useQueryClient as he, QueryClient as pe } from "@tanstack/react-query";
|
|
5
|
+
import { u as $, f as me, a as ue, g as t, l as D, e as be } from "./index-pLgOJz-6.mjs";
|
|
6
|
+
import { useMemo as fe, useRef as ye, useState as Se, useCallback as O } from "react";
|
|
7
|
+
import we from "styled-components";
|
|
8
8
|
const P = ({
|
|
9
|
-
children:
|
|
9
|
+
children: d,
|
|
10
10
|
condition: l
|
|
11
|
-
}) => l ? /* @__PURE__ */ e(
|
|
12
|
-
const l = $(),
|
|
11
|
+
}) => l ? /* @__PURE__ */ e(U, { children: d }) : null, Re = (d = {}) => {
|
|
12
|
+
const l = $(), y = A({
|
|
13
13
|
mutationFn: l.settings.update,
|
|
14
|
-
onSuccess:
|
|
15
|
-
onError:
|
|
16
|
-
}),
|
|
14
|
+
onSuccess: d.updateSettingsMutationSuccess,
|
|
15
|
+
onError: d.updateSettingsMutationError
|
|
16
|
+
}), S = A({
|
|
17
17
|
mutationFn: l.settings.restore,
|
|
18
|
-
onSuccess:
|
|
19
|
-
onError:
|
|
20
|
-
}),
|
|
18
|
+
onSuccess: d.restoreSettingsMutationSuccess,
|
|
19
|
+
onError: d.restoreSettingsMutationError
|
|
20
|
+
}), h = A({
|
|
21
21
|
mutationFn: l.settings.restart,
|
|
22
|
-
onSuccess:
|
|
23
|
-
onError:
|
|
24
|
-
}),
|
|
22
|
+
onSuccess: d.restartStrapiMutationSuccess,
|
|
23
|
+
onError: d.restartStrapiMutationError
|
|
24
|
+
}), w = M({
|
|
25
25
|
queryKey: l.config.getKey(),
|
|
26
26
|
queryFn: l.config.query
|
|
27
|
-
}),
|
|
27
|
+
}), u = M({
|
|
28
28
|
queryKey: l.contentTypeBuilder.all.getKey(),
|
|
29
29
|
queryFn: l.contentTypeBuilder.all.query
|
|
30
|
-
}),
|
|
30
|
+
}), b = M({
|
|
31
31
|
queryKey: l.roles.getKey(),
|
|
32
32
|
queryFn: l.roles.query
|
|
33
33
|
});
|
|
34
|
-
return
|
|
35
|
-
config:
|
|
36
|
-
collectionTypes:
|
|
37
|
-
roles:
|
|
38
|
-
restoreSettingsMutation:
|
|
39
|
-
updateSettingsMutation:
|
|
40
|
-
restartStrapiMutation:
|
|
34
|
+
return fe(() => ({
|
|
35
|
+
config: w,
|
|
36
|
+
collectionTypes: u,
|
|
37
|
+
roles: b,
|
|
38
|
+
restoreSettingsMutation: S,
|
|
39
|
+
updateSettingsMutation: y,
|
|
40
|
+
restartStrapiMutation: h
|
|
41
41
|
}), [
|
|
42
|
-
|
|
43
|
-
f,
|
|
42
|
+
w,
|
|
44
43
|
b,
|
|
45
|
-
|
|
44
|
+
u,
|
|
46
45
|
S,
|
|
47
|
-
|
|
46
|
+
y,
|
|
47
|
+
h
|
|
48
48
|
]);
|
|
49
49
|
}, C = {
|
|
50
50
|
background: "neutral0",
|
|
@@ -52,25 +52,24 @@ const P = ({
|
|
|
52
52
|
shadow: "filterShadow",
|
|
53
53
|
padding: 6,
|
|
54
54
|
width: "100%"
|
|
55
|
-
},
|
|
55
|
+
}, Ce = we(le)(() => ({
|
|
56
56
|
"[role]": {
|
|
57
57
|
flexDirection: "column"
|
|
58
58
|
}
|
|
59
|
-
})),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
collectionTypes: v,
|
|
59
|
+
})), Le = () => {
|
|
60
|
+
const { trackUsage: d } = ce(), l = ye(null), { toggleNotification: y } = de(), [S, h] = Se(!1), { isLoadingForPermissions: w, canSettingsChange: u } = ue(), b = he(), v = $(), {
|
|
61
|
+
config: c,
|
|
62
|
+
collectionTypes: k,
|
|
64
63
|
roles: L,
|
|
65
|
-
restoreSettingsMutation:
|
|
66
|
-
updateSettingsMutation:
|
|
67
|
-
restartStrapiMutation:
|
|
68
|
-
} =
|
|
64
|
+
restoreSettingsMutation: G,
|
|
65
|
+
updateSettingsMutation: E,
|
|
66
|
+
restartStrapiMutation: V
|
|
67
|
+
} = Re({
|
|
69
68
|
restoreSettingsMutationSuccess: () => {
|
|
70
69
|
b.invalidateQueries({
|
|
71
|
-
queryKey:
|
|
70
|
+
queryKey: v.config.getKey(),
|
|
72
71
|
exact: !1
|
|
73
|
-
}), h(!0),
|
|
72
|
+
}), h(!0), y({
|
|
74
73
|
message: t("page.settings.actions.restore.success"),
|
|
75
74
|
type: "success"
|
|
76
75
|
});
|
|
@@ -80,60 +79,60 @@ const P = ({
|
|
|
80
79
|
},
|
|
81
80
|
updateSettingsMutationSuccess: () => {
|
|
82
81
|
b.invalidateQueries({
|
|
83
|
-
queryKey:
|
|
82
|
+
queryKey: v.config.getKey(),
|
|
84
83
|
exact: !1
|
|
85
84
|
}), h(!0);
|
|
86
85
|
}
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
}, []),
|
|
90
|
-
|
|
86
|
+
}), Z = O(() => {
|
|
87
|
+
l.current?.requestSubmit();
|
|
88
|
+
}, []), z = O((r) => {
|
|
89
|
+
E.mutate({
|
|
91
90
|
...r,
|
|
92
91
|
blockedAuthorProps: r.blockedAuthorProps.split(",").map((s) => s.trim())
|
|
93
92
|
});
|
|
94
|
-
}, [
|
|
95
|
-
if (
|
|
93
|
+
}, [E]);
|
|
94
|
+
if (c.status !== "success" || k.status !== "success" || L.status !== "success" || w)
|
|
96
95
|
return t("page.settings.loading");
|
|
97
|
-
const F =
|
|
98
|
-
return /* @__PURE__ */ i(
|
|
99
|
-
/* @__PURE__ */ e(
|
|
100
|
-
/* @__PURE__ */ i(
|
|
96
|
+
const F = k.data.filter((r) => r.uid.includes("api::")), J = c.data.enabledCollections.filter((r) => F.some((s) => s.uid === r)), X = D.isNil(c.data.badWords) ? !0 : c.data?.badWords, Y = !!c.data.gql?.auth, _ = c.data.moderatorRoles.filter((r) => L.data.filter((s) => s.code === r)), ee = c.data.client?.url, te = c.data.client?.contactEmail, ne = c.data.blockedAuthorProps ?? [], ie = () => h(!1);
|
|
97
|
+
return /* @__PURE__ */ i(U, { children: [
|
|
98
|
+
/* @__PURE__ */ e(W.Title, { children: "Comments - settings" }),
|
|
99
|
+
/* @__PURE__ */ i(W.Main, { children: [
|
|
101
100
|
/* @__PURE__ */ e(
|
|
102
|
-
|
|
101
|
+
j.Header,
|
|
103
102
|
{
|
|
104
103
|
title: t("page.settings.header.title"),
|
|
105
104
|
subtitle: t("page.settings.header.description"),
|
|
106
105
|
as: "h2",
|
|
107
|
-
primaryAction: /* @__PURE__ */ e(P, { condition: u, children: /* @__PURE__ */ e(I, { type: "submit", startIcon: /* @__PURE__ */ e(re, {}), onClick:
|
|
106
|
+
primaryAction: /* @__PURE__ */ e(P, { condition: u, children: /* @__PURE__ */ e(I, { type: "submit", startIcon: /* @__PURE__ */ e(re, {}), onClick: Z, children: t("page.settings.actions.submit") }) })
|
|
108
107
|
}
|
|
109
108
|
),
|
|
110
|
-
/* @__PURE__ */ i(
|
|
109
|
+
/* @__PURE__ */ i(j.Content, { children: [
|
|
111
110
|
S && /* @__PURE__ */ e(p, { marginBottom: 4, children: /* @__PURE__ */ e(
|
|
112
|
-
|
|
111
|
+
Ce,
|
|
113
112
|
{
|
|
114
113
|
closeLabel: t("page.settings.actions.restart.alert.cancel"),
|
|
115
114
|
title: t("page.settings.actions.restart.alert.title"),
|
|
116
|
-
onClose:
|
|
117
|
-
action: /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(I, { onClick:
|
|
115
|
+
onClose: ie,
|
|
116
|
+
action: /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(I, { onClick: V.mutate, startIcon: /* @__PURE__ */ e(ae, {}), children: t("page.settings.actions.restart") }) }),
|
|
118
117
|
children: /* @__PURE__ */ e(p, { marginTop: 4, children: t("page.settings.actions.restart.alert.description") })
|
|
119
118
|
}
|
|
120
119
|
) }),
|
|
121
120
|
/* @__PURE__ */ e(
|
|
122
|
-
|
|
121
|
+
ge,
|
|
123
122
|
{
|
|
124
123
|
method: "POST",
|
|
125
|
-
ref:
|
|
126
|
-
onSubmit:
|
|
124
|
+
ref: l,
|
|
125
|
+
onSubmit: z,
|
|
127
126
|
initialValues: {
|
|
128
|
-
enabledCollections:
|
|
129
|
-
moderatorRoles:
|
|
130
|
-
badWords:
|
|
131
|
-
clientEmail:
|
|
132
|
-
clientUrl:
|
|
133
|
-
gqlAuthEnabled:
|
|
134
|
-
approvalFlow:
|
|
135
|
-
entryLabel:
|
|
136
|
-
blockedAuthorProps:
|
|
127
|
+
enabledCollections: J,
|
|
128
|
+
moderatorRoles: _,
|
|
129
|
+
badWords: X,
|
|
130
|
+
clientEmail: te,
|
|
131
|
+
clientUrl: ee,
|
|
132
|
+
gqlAuthEnabled: Y,
|
|
133
|
+
approvalFlow: c.data.approvalFlow,
|
|
134
|
+
entryLabel: c.data.entryLabel,
|
|
135
|
+
blockedAuthorProps: ne.join(", ")
|
|
137
136
|
},
|
|
138
137
|
children: ({ values: r, onChange: s }) => /* @__PURE__ */ i(q, { gap: 4, direction: "column", children: [
|
|
139
138
|
/* @__PURE__ */ i(p, { ...C, children: [
|
|
@@ -157,13 +156,13 @@ const P = ({
|
|
|
157
156
|
] }) }),
|
|
158
157
|
r.enabledCollections.length > 0 && /* @__PURE__ */ e(a.Item, { children: /* @__PURE__ */ i(a.Root, { gap: 4, width: "100%", children: [
|
|
159
158
|
/* @__PURE__ */ e(a.Item, { children: /* @__PURE__ */ e(m, { children: t("page.settings.form.contentTypesSettings.label") }) }),
|
|
160
|
-
/* @__PURE__ */ e(a.Item, { children: /* @__PURE__ */ e(
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
const { schema: { displayName: R, attributes:
|
|
164
|
-
return /* @__PURE__ */ i(
|
|
165
|
-
/* @__PURE__ */ e(
|
|
166
|
-
/* @__PURE__ */ e(
|
|
159
|
+
/* @__PURE__ */ e(a.Item, { children: /* @__PURE__ */ e(f.Root, { style: { width: "100%" }, children: D.orderBy(r.enabledCollections).map((o) => {
|
|
160
|
+
const H = F.find((R) => R.uid === o);
|
|
161
|
+
if (H) {
|
|
162
|
+
const { schema: { displayName: R, attributes: K } } = H, B = Object.keys(K).filter((g) => K[g].type === "string");
|
|
163
|
+
return /* @__PURE__ */ i(f.Item, { value: o, children: [
|
|
164
|
+
/* @__PURE__ */ e(f.Header, { children: /* @__PURE__ */ e(f.Trigger, { children: /* @__PURE__ */ e(m, { variant: "epsilon", as: "h3", children: R }) }) }),
|
|
165
|
+
/* @__PURE__ */ e(f.Content, { children: /* @__PURE__ */ i(a.Root, { padding: 6, gap: 4, children: [
|
|
167
166
|
/* @__PURE__ */ e(a.Item, { children: /* @__PURE__ */ i(
|
|
168
167
|
n.Root,
|
|
169
168
|
{
|
|
@@ -182,7 +181,7 @@ const P = ({
|
|
|
182
181
|
offLabel: t("components.toogle.disabled"),
|
|
183
182
|
checked: r.approvalFlow.includes(o),
|
|
184
183
|
onCheckedChange: (g) => {
|
|
185
|
-
s("approvalFlow", g ? [...r.approvalFlow, o] : r.approvalFlow.filter((
|
|
184
|
+
s("approvalFlow", g ? [...r.approvalFlow, o] : r.approvalFlow.filter((oe) => oe !== o));
|
|
186
185
|
}
|
|
187
186
|
}
|
|
188
187
|
),
|
|
@@ -190,7 +189,7 @@ const P = ({
|
|
|
190
189
|
]
|
|
191
190
|
}
|
|
192
191
|
) }),
|
|
193
|
-
/* @__PURE__ */ e(P, { condition:
|
|
192
|
+
/* @__PURE__ */ e(P, { condition: B.length > 0, children: /* @__PURE__ */ e(a.Item, { children: /* @__PURE__ */ i(
|
|
194
193
|
n.Root,
|
|
195
194
|
{
|
|
196
195
|
width: "100%",
|
|
@@ -207,7 +206,7 @@ const P = ({
|
|
|
207
206
|
onChange: (g) => {
|
|
208
207
|
s("entryLabel", { ...r.entryLabel, [o]: g });
|
|
209
208
|
},
|
|
210
|
-
children:
|
|
209
|
+
children: B.map((g) => /* @__PURE__ */ e(T, { value: g, children: g }, g))
|
|
211
210
|
}
|
|
212
211
|
),
|
|
213
212
|
/* @__PURE__ */ e(n.Hint, {})
|
|
@@ -228,7 +227,7 @@ const P = ({
|
|
|
228
227
|
/* @__PURE__ */ e(a.Item, { xs: 4, children: /* @__PURE__ */ i(n.Root, { width: "100%", hint: t("page.settings.form.enabledCollections.hint"), children: [
|
|
229
228
|
/* @__PURE__ */ e(n.Label, { htmlFor: "enabledCollections", children: t("page.settings.form.enabledCollections.label") }),
|
|
230
229
|
/* @__PURE__ */ e(
|
|
231
|
-
|
|
230
|
+
N,
|
|
232
231
|
{
|
|
233
232
|
name: "badWords",
|
|
234
233
|
checked: r.badWords,
|
|
@@ -248,7 +247,7 @@ const P = ({
|
|
|
248
247
|
/* @__PURE__ */ e(a.Item, { xs: 4, children: /* @__PURE__ */ i(n.Root, { width: "100%", hint: t("page.settings.form.gqlAuth.hint"), children: [
|
|
249
248
|
/* @__PURE__ */ e(n.Label, { children: t("page.settings.form.gqlAuth.label") }),
|
|
250
249
|
/* @__PURE__ */ e(
|
|
251
|
-
|
|
250
|
+
N,
|
|
252
251
|
{
|
|
253
252
|
name: "gqlAuthEnabled",
|
|
254
253
|
checked: r.gqlAuthEnabled,
|
|
@@ -307,21 +306,21 @@ const P = ({
|
|
|
307
306
|
/* @__PURE__ */ e(m, { variant: "pi", as: "h4", children: t("page.settings.section.restore.subtitle") })
|
|
308
307
|
] }),
|
|
309
308
|
/* @__PURE__ */ e(
|
|
310
|
-
|
|
309
|
+
be,
|
|
311
310
|
{
|
|
312
311
|
Trigger: ({ onClick: o }) => /* @__PURE__ */ e(
|
|
313
312
|
I,
|
|
314
313
|
{
|
|
315
314
|
variant: "danger-light",
|
|
316
|
-
startIcon: /* @__PURE__ */ e(
|
|
315
|
+
startIcon: /* @__PURE__ */ e(Q, {}),
|
|
317
316
|
onClick: o,
|
|
318
317
|
children: t("page.settings.actions.restore")
|
|
319
318
|
}
|
|
320
319
|
),
|
|
321
|
-
onConfirm:
|
|
320
|
+
onConfirm: G.mutate,
|
|
322
321
|
title: t("page.settings.actions.restore.confirmation.header"),
|
|
323
322
|
labelConfirm: t("page.settings.actions.restore.confirmation.button.confirm"),
|
|
324
|
-
iconConfirm: /* @__PURE__ */ e(
|
|
323
|
+
iconConfirm: /* @__PURE__ */ e(Q, {}),
|
|
325
324
|
children: t("page.settings.actions.restore.confirmation.description")
|
|
326
325
|
}
|
|
327
326
|
)
|
|
@@ -333,8 +332,8 @@ const P = ({
|
|
|
333
332
|
] })
|
|
334
333
|
] });
|
|
335
334
|
};
|
|
336
|
-
new
|
|
337
|
-
const
|
|
335
|
+
new pe();
|
|
336
|
+
const Pe = () => /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(Le, {}) });
|
|
338
337
|
export {
|
|
339
|
-
|
|
338
|
+
Pe as default
|
|
340
339
|
};
|