strapi-plugin-comments 3.1.4 → 3.2.0

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,119 @@
1
+ import "react";
2
+ import { Flex as u } from "@strapi/design-system";
3
+ import "@strapi/icons";
4
+ import { styled as g } from "styled-components";
5
+ import { jsx as o } from "react/jsx-runtime";
6
+ const a = (e, n = "") => Object.keys(e).reduce((i, r) => {
7
+ const c = n.length ? `${n}.` : "";
8
+ return typeof e[r] == "object" && e[r] !== null && !Array.isArray(e[r]) ? Object.assign(i, a(e[r], c + r)) : i[c + r] = e[r], i;
9
+ }, {}), m = (e, n) => {
10
+ if (!n)
11
+ throw new TypeError("pluginId can't be empty");
12
+ return Object.keys(e).reduce((i, r) => (i[`${n}.${r}`] = e[r], i), {});
13
+ };
14
+ g(u)`
15
+ &>* {
16
+ width: 100%;
17
+ }
18
+ `;
19
+ const f = "strapi-plugin-comments", $ = {
20
+ displayName: "Comments"
21
+ }, b = 576, h = ({ width: e = 24, height: n = 24 }) => /* @__PURE__ */ o("svg", { viewBox: `0 0 ${e} ${n}`, xmlns: "http://www.w3.org/2000/svg", height: `${n}px`, children: /* @__PURE__ */ o("g", { style: { transform: `scale(${e / b})` }, fill: "currentColor", children: /* @__PURE__ */ o("path", { d: "M416 192c0-88.4-93.1-160-208-160S0 103.6 0 192c0 34.3 14.1 65.9 38 92-13.4 30.2-35.5 54.2-35.8 54.5-2.2 2.3-2.8 5.7-1.5 8.7S4.8 352 8 352c36.6 0 66.9-12.3 88.7-25 32.2 15.7 70.3 25 111.3 25 114.9 0 208-71.6 208-160zm122 220c23.9-26 38-57.7 38-92 0-66.9-53.5-124.2-129.3-148.1.9 6.6 1.3 13.3 1.3 20.1 0 105.9-107.7 192-240 192-10.8 0-21.3-.8-31.7-1.9C207.8 439.6 281.8 480 368 480c41 0 79.1-9.2 111.3-25 21.8 12.7 52.1 25 88.7 25 3.2 0 6.1-1.9 7.3-4.8 1.3-2.9.7-6.3-1.5-8.7-.3-.3-22.4-24.2-35.8-54.5z" }) }) }), w = /* @__PURE__ */ o(h, {}), j = () => w, t = {
22
+ render: (e) => `plugin::comments.${e}`,
23
+ comments: {
24
+ read: "comments-read",
25
+ moderate: "comments-moderate"
26
+ },
27
+ reports: {
28
+ read: "reports-read",
29
+ review: "reports-review"
30
+ },
31
+ settings: {
32
+ read: "settings-read",
33
+ change: "settings-change"
34
+ }
35
+ }, l = {
36
+ access: [
37
+ { action: t.render(t.comments.read), subject: null },
38
+ { action: t.render(t.reports.read), subject: null },
39
+ // { action: 'plugin::comments.discover.read', subject: null },
40
+ { action: t.render(t.settings.read), subject: null }
41
+ ],
42
+ // discover: [{ action: 'plugin::comments.discover.read', subject: null }],
43
+ moderate: [
44
+ {
45
+ action: t.render(t.comments.moderate),
46
+ subject: null
47
+ }
48
+ ],
49
+ reports: [
50
+ { action: t.render(t.reports.read), subject: null }
51
+ ],
52
+ reportsReview: [
53
+ { action: t.render(t.reports.review), subject: null }
54
+ ],
55
+ settings: [
56
+ { action: t.render(t.settings.read), subject: null }
57
+ ],
58
+ settingsChange: [
59
+ { action: t.render(t.settings.change), subject: null }
60
+ ]
61
+ }, s = f.replace(/^strapi-plugin-/i, ""), p = {
62
+ en: () => import("./en-Y06L5Ws_.mjs"),
63
+ fr: () => import("./fr-Cv2agoba.mjs"),
64
+ "pt-BR": () => import("./pt-BR-DwEywOda.mjs"),
65
+ tr: () => import("./tr-Ca93Ai2h.mjs"),
66
+ ru: () => import("./ru-72L1_BWN.mjs"),
67
+ "zh-Hans": () => import("./zh-Hans-DXLzMysj.mjs"),
68
+ pl: () => import("./pl-a5516Yys.mjs")
69
+ }, { displayName: d } = $, M = {
70
+ register(e) {
71
+ e.addMenuLink({
72
+ to: `/plugins/${s}`,
73
+ badgeContent: 1,
74
+ icon: j,
75
+ intlLabel: {
76
+ id: `${s}.plugin.name`,
77
+ defaultMessage: d
78
+ },
79
+ Component: () => import("./index-rxGUTZN1.mjs"),
80
+ permissions: l.access
81
+ }), e.createSettingSection(
82
+ {
83
+ id: s,
84
+ intlLabel: {
85
+ id: `${s}.plugin.section`,
86
+ defaultMessage: `${d} plugin`
87
+ }
88
+ },
89
+ [
90
+ {
91
+ intlLabel: {
92
+ id: `${s}.plugin.section.item`,
93
+ defaultMessage: "Configuration"
94
+ },
95
+ id: "comments",
96
+ to: `/settings/${s}`,
97
+ Component: () => import("./index-Bu69cWq9.mjs"),
98
+ permissions: l.settings
99
+ }
100
+ ]
101
+ );
102
+ },
103
+ registerTrads: async function({ locales: e = [] }) {
104
+ return Promise.all(
105
+ e.map(async (n) => n in p ? p[n]().then(({ default: r }) => ({
106
+ data: m(a(r), s),
107
+ locale: n
108
+ })) : {
109
+ data: m(a({}), s),
110
+ locale: n
111
+ })
112
+ );
113
+ }
114
+ };
115
+ export {
116
+ l as a,
117
+ M as i,
118
+ s as p
119
+ };