strapi-plugin-comments 3.0.1 → 3.0.2
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/_chunks/{index-Ccb93U47.js → index-7Geqfcar.js} +3 -2
- package/dist/_chunks/{index-R1krliyC.js → index-BoLOt7pX.js} +2 -2
- package/dist/_chunks/{index-_exHAK6u.mjs → index-CIBI9Is6.mjs} +1 -1
- package/dist/_chunks/{index-BC5Odn17.mjs → index-ChxSaqbf.mjs} +2 -2
- package/dist/_chunks/{index-COoWcAcA.js → index-CiJKS9C3.js} +1 -1
- package/dist/_chunks/{index-BIorFYba.mjs → index-Ct7A5TFY.mjs} +27 -26
- package/dist/_chunks/{index-k7z0V0lj.js → index-Czdnz9Ci.js} +55 -16
- package/dist/_chunks/{index-D1DAMkhj.mjs → index-JWxk4wBa.mjs} +55 -16
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/server/index.js +20 -21
- package/dist/server/index.mjs +20 -21
- package/dist/server/src/controllers/index.d.ts +1 -1
- package/dist/server/src/index.d.ts +3 -3
- package/dist/server/src/services/index.d.ts +2 -2
- package/dist/server/src/validators/api/controllers/client.controller.validator.d.ts +2 -2
- package/dist/server/src/validators/utils.d.ts +4 -4
- package/package.json +1 -1
|
@@ -51206,7 +51206,7 @@ const index = {
|
|
|
51206
51206
|
id: `${pluginId}.plugin.name`,
|
|
51207
51207
|
defaultMessage: displayName
|
|
51208
51208
|
},
|
|
51209
|
-
Component: () => Promise.resolve().then(() => require("./index-
|
|
51209
|
+
Component: () => Promise.resolve().then(() => require("./index-Czdnz9Ci.js")),
|
|
51210
51210
|
permissions: pluginPermissions.access
|
|
51211
51211
|
});
|
|
51212
51212
|
app.createSettingSection(
|
|
@@ -51225,7 +51225,7 @@ const index = {
|
|
|
51225
51225
|
},
|
|
51226
51226
|
id: "comments",
|
|
51227
51227
|
to: `/settings/${pluginId}`,
|
|
51228
|
-
Component: () => Promise.resolve().then(() => require("./index-
|
|
51228
|
+
Component: () => Promise.resolve().then(() => require("./index-BoLOt7pX.js")),
|
|
51229
51229
|
permissions: pluginPermissions.settings
|
|
51230
51230
|
}
|
|
51231
51231
|
]
|
|
@@ -51313,6 +51313,7 @@ exports.Td = Td;
|
|
|
51313
51313
|
exports.Th = Th;
|
|
51314
51314
|
exports.Thead = Thead;
|
|
51315
51315
|
exports.Toggle = Toggle;
|
|
51316
|
+
exports.TooltipImpl = TooltipImpl;
|
|
51316
51317
|
exports.Tr = Tr;
|
|
51317
51318
|
exports.Typography = Typography;
|
|
51318
51319
|
exports.__rest = __rest;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const index$2 = require("./index-
|
|
4
|
+
const index$2 = require("./index-7Geqfcar.js");
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
6
|
const reactQuery = require("@tanstack/react-query");
|
|
7
|
-
const index$1 = require("./index-
|
|
7
|
+
const index$1 = require("./index-CiJKS9C3.js");
|
|
8
8
|
const React = require("react");
|
|
9
9
|
const styled = require("styled-components");
|
|
10
10
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { a9 as darkTheme, aa as lightTheme, ab as DesignSystemProvider, ac as pluginPermissions, ad as __assign, ae as __rest, p as pluginId, af as Dialog, F as Flex, ag as ForwardRef$3, T as Typography, e as Button } from "./index-Ct7A5TFY.mjs";
|
|
3
3
|
import { useQuery, QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { useMemo, createContext, useState } from "react";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { a1 as Alert, e as Button, f as ForwardRef$4x, B as Box, a2 as ForwardRef$1f, F as Flex, T as Typography, Z as Grid, m as Field, a3 as MultiSelect, a4 as MultiSelectOption, a5 as Accordion, a6 as SwitchImpl, a7 as Toggle, a8 as ForwardRef$59 } from "./index-Ct7A5TFY.mjs";
|
|
3
3
|
import { useTracking, useNotification, Page, Layouts, Form } from "@strapi/strapi/admin";
|
|
4
4
|
import { useMutation, useQuery, useQueryClient, QueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { u as useAPI, f as CommonProviders, a as usePermissions, g as getMessage, l as lodashExports, e as ConfirmationDialog } from "./index-
|
|
5
|
+
import { u as useAPI, f as CommonProviders, a as usePermissions, g as getMessage, l as lodashExports, e as ConfirmationDialog } from "./index-CIBI9Is6.mjs";
|
|
6
6
|
import { useMemo, useRef, useState, useCallback } from "react";
|
|
7
7
|
import styled from "styled-components";
|
|
8
8
|
const RenderIf = ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-7Geqfcar.js");
|
|
4
4
|
const reactQuery = require("@tanstack/react-query");
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
@@ -51188,7 +51188,7 @@ const index = {
|
|
|
51188
51188
|
id: `${pluginId}.plugin.name`,
|
|
51189
51189
|
defaultMessage: displayName
|
|
51190
51190
|
},
|
|
51191
|
-
Component: () => import("./index-
|
|
51191
|
+
Component: () => import("./index-JWxk4wBa.mjs"),
|
|
51192
51192
|
permissions: pluginPermissions.access
|
|
51193
51193
|
});
|
|
51194
51194
|
app.createSettingSection(
|
|
@@ -51207,7 +51207,7 @@ const index = {
|
|
|
51207
51207
|
},
|
|
51208
51208
|
id: "comments",
|
|
51209
51209
|
to: `/settings/${pluginId}`,
|
|
51210
|
-
Component: () => import("./index-
|
|
51210
|
+
Component: () => import("./index-ChxSaqbf.mjs"),
|
|
51211
51211
|
permissions: pluginPermissions.settings
|
|
51212
51212
|
}
|
|
51213
51213
|
]
|
|
@@ -51234,7 +51234,7 @@ const index = {
|
|
|
51234
51234
|
}
|
|
51235
51235
|
};
|
|
51236
51236
|
export {
|
|
51237
|
-
|
|
51237
|
+
SimpleMenu as $,
|
|
51238
51238
|
ForwardRef$11 as A,
|
|
51239
51239
|
Box as B,
|
|
51240
51240
|
CheckboxImpl as C,
|
|
@@ -51256,30 +51256,31 @@ export {
|
|
|
51256
51256
|
SubNav as S,
|
|
51257
51257
|
Typography as T,
|
|
51258
51258
|
Avatar as U,
|
|
51259
|
-
|
|
51260
|
-
|
|
51261
|
-
|
|
51262
|
-
|
|
51263
|
-
|
|
51264
|
-
|
|
51259
|
+
TooltipImpl as V,
|
|
51260
|
+
Loader as W,
|
|
51261
|
+
Link as X,
|
|
51262
|
+
ForwardRef$51 as Y,
|
|
51263
|
+
Grid as Z,
|
|
51264
|
+
Td as _,
|
|
51265
51265
|
SubNavHeader as a,
|
|
51266
|
-
|
|
51267
|
-
|
|
51268
|
-
|
|
51269
|
-
|
|
51270
|
-
|
|
51271
|
-
|
|
51272
|
-
|
|
51273
|
-
|
|
51274
|
-
|
|
51275
|
-
|
|
51276
|
-
|
|
51277
|
-
|
|
51278
|
-
|
|
51279
|
-
|
|
51280
|
-
|
|
51281
|
-
|
|
51282
|
-
|
|
51266
|
+
MenuItem as a0,
|
|
51267
|
+
Alert as a1,
|
|
51268
|
+
ForwardRef$1f as a2,
|
|
51269
|
+
MultiSelect as a3,
|
|
51270
|
+
MultiSelectOption as a4,
|
|
51271
|
+
Accordion as a5,
|
|
51272
|
+
SwitchImpl as a6,
|
|
51273
|
+
Toggle as a7,
|
|
51274
|
+
ForwardRef$59 as a8,
|
|
51275
|
+
darkTheme as a9,
|
|
51276
|
+
lightTheme as aa,
|
|
51277
|
+
DesignSystemProvider as ab,
|
|
51278
|
+
pluginPermissions as ac,
|
|
51279
|
+
__assign as ad,
|
|
51280
|
+
__rest as ae,
|
|
51281
|
+
Dialog as af,
|
|
51282
|
+
ForwardRef$3 as ag,
|
|
51283
|
+
index as ah,
|
|
51283
51284
|
SubNavSections as b,
|
|
51284
51285
|
SubNavSection as c,
|
|
51285
51286
|
SubNavLink as d,
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const admin = require("@strapi/strapi/admin");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-7Geqfcar.js");
|
|
7
7
|
const reactQuery = require("@tanstack/react-query");
|
|
8
|
-
const index$1 = require("./index-
|
|
8
|
+
const index$1 = require("./index-CiJKS9C3.js");
|
|
9
9
|
const react = require("zustand/react");
|
|
10
10
|
const React = require("react");
|
|
11
11
|
const styled = require("styled-components");
|
|
@@ -452,9 +452,12 @@ const CommentStatusBadge = ({ item, canAccessReports, hasReports }) => {
|
|
|
452
452
|
};
|
|
453
453
|
const IconButtonGroup = styled__default.default(index.IconButtonGroup)(({ isSingle, withMargin }) => {
|
|
454
454
|
const isSingleStyle = {
|
|
455
|
-
|
|
456
|
-
"&:first-child
|
|
457
|
-
borderRadius: "4px"
|
|
455
|
+
button: {
|
|
456
|
+
"&:first-child": {
|
|
457
|
+
borderRadius: "4px !important"
|
|
458
|
+
},
|
|
459
|
+
"&:last-child": {
|
|
460
|
+
borderRadius: "4px !important"
|
|
458
461
|
}
|
|
459
462
|
}
|
|
460
463
|
};
|
|
@@ -50351,7 +50354,7 @@ const ModeratorResponseModal = ({ id: id2, content, title, Icon }) => {
|
|
|
50351
50354
|
setIsModalVisible((prev) => !prev);
|
|
50352
50355
|
}, []);
|
|
50353
50356
|
return /* @__PURE__ */ jsxRuntime.jsxs(index.Modal.Root, { open: isModalVisible, onOpenChange: onToggleModal, children: [
|
|
50354
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Modal.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(index.IconButton, { children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) }) }),
|
|
50357
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Modal.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(index.IconButton, { label: index$1.getMessage("page.details.actions.thread.modal.start.thread"), children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) }) }),
|
|
50355
50358
|
/* @__PURE__ */ jsxRuntime.jsxs(index.Modal.Content, { children: [
|
|
50356
50359
|
/* @__PURE__ */ jsxRuntime.jsx(index.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(index.Modal.Title, { children: title }) }),
|
|
50357
50360
|
/* @__PURE__ */ jsxRuntime.jsx(index.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -50819,6 +50822,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50819
50822
|
{
|
|
50820
50823
|
onClick,
|
|
50821
50824
|
loading: commentMutation.block.isPending,
|
|
50825
|
+
label: index$1.getMessage("page.details.actions.comment.block"),
|
|
50822
50826
|
children: /* @__PURE__ */ jsxRuntime.jsx(LockIcon, {})
|
|
50823
50827
|
}
|
|
50824
50828
|
),
|
|
@@ -50832,6 +50836,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50832
50836
|
{
|
|
50833
50837
|
onClick: handleUnblockClick,
|
|
50834
50838
|
loading: commentMutation.block.isPending,
|
|
50839
|
+
label: index$1.getMessage("page.details.actions.comment.unblock"),
|
|
50835
50840
|
children: /* @__PURE__ */ jsxRuntime.jsx(UnlockIcon, {})
|
|
50836
50841
|
}
|
|
50837
50842
|
)
|
|
@@ -50860,6 +50865,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50860
50865
|
{
|
|
50861
50866
|
onClick: handleDeleteClick,
|
|
50862
50867
|
loading: commentMutation.delete.isPending,
|
|
50868
|
+
label: index$1.getMessage("page.details.actions.comment.delete"),
|
|
50863
50869
|
children: /* @__PURE__ */ jsxRuntime.jsx(index.ForwardRef$j, {})
|
|
50864
50870
|
}
|
|
50865
50871
|
),
|
|
@@ -50874,6 +50880,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50874
50880
|
index.IconButton,
|
|
50875
50881
|
{
|
|
50876
50882
|
onClick: handleDrillDownClick,
|
|
50883
|
+
label: index$1.getMessage("page.details.panel.discussion.nav.drilldown"),
|
|
50877
50884
|
style: blocked && !blockedThread ? { marginTop: "1px", marginRight: ".5rem" } : {},
|
|
50878
50885
|
children: /* @__PURE__ */ jsxRuntime.jsx(index.ForwardRef$3x, {})
|
|
50879
50886
|
}
|
|
@@ -50894,10 +50901,11 @@ const AdminAvatar = ({ children }) => /* @__PURE__ */ jsxRuntime.jsxs(index.Box,
|
|
|
50894
50901
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
50895
50902
|
index.Flex,
|
|
50896
50903
|
{
|
|
50904
|
+
padding: "2px",
|
|
50897
50905
|
alignItems: "middle",
|
|
50898
50906
|
position: "absolute",
|
|
50899
|
-
right: "-
|
|
50900
|
-
top: "-
|
|
50907
|
+
right: "-30%",
|
|
50908
|
+
top: "-30%",
|
|
50901
50909
|
borderRadius: "50%",
|
|
50902
50910
|
border: "2px #ffffff solid",
|
|
50903
50911
|
background: "#ffffff",
|
|
@@ -50929,10 +50937,21 @@ const DiscussionThreadItemFooter = ({ item, children }) => {
|
|
|
50929
50937
|
dateStyle: "medium",
|
|
50930
50938
|
timeStyle: "short"
|
|
50931
50939
|
});
|
|
50932
|
-
const { name, avatar } = item.author || {};
|
|
50940
|
+
const { name, avatar, email: email2 } = item.author || {};
|
|
50933
50941
|
return /* @__PURE__ */ jsxRuntime.jsx(index.Flex, { direction: "row", paddingTop: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(DiscussionThreadItemFooterMeta, { children: [
|
|
50934
|
-
|
|
50935
|
-
|
|
50942
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
50943
|
+
index.TooltipImpl,
|
|
50944
|
+
{
|
|
50945
|
+
open: item.isAdminComment ? false : void 0,
|
|
50946
|
+
label: !item.isAdminComment ? email2 : void 0,
|
|
50947
|
+
align: "start",
|
|
50948
|
+
side: "left",
|
|
50949
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(index.Flex, { style: { cursor: item.isAdminComment ? "default" : "help" }, children: [
|
|
50950
|
+
item.author && /* @__PURE__ */ jsxRuntime.jsx(UserAvatar, { avatar, name, isAdminComment: item.isAdminComment }),
|
|
50951
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: name || index$1.getMessage("components.author.unknown") })
|
|
50952
|
+
] })
|
|
50953
|
+
}
|
|
50954
|
+
),
|
|
50936
50955
|
/* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "pi", textColor: "neutral600", children: dateTime }),
|
|
50937
50956
|
children
|
|
50938
50957
|
] }) });
|
|
@@ -51241,10 +51260,30 @@ const CommentRow = ({ item }) => {
|
|
|
51241
51260
|
const localeParam = related.locale ? `?plugins[i18n][locale]=${related.locale}` : "";
|
|
51242
51261
|
return /* @__PURE__ */ jsxRuntime.jsx(index.Link, { href: `/admin/content-manager/collection-types/${related.uid}/${related.documentId}${localeParam}`, children: related.title });
|
|
51243
51262
|
}, [item.related]);
|
|
51263
|
+
const { name, email: email2, avatar } = item.author || {};
|
|
51244
51264
|
return /* @__PURE__ */ jsxRuntime.jsxs(index.Tr, { children: [
|
|
51245
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: item.id }),
|
|
51246
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children:
|
|
51247
|
-
|
|
51265
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(index.Typography, { children: item.id }) }),
|
|
51266
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
51267
|
+
index.TooltipImpl,
|
|
51268
|
+
{
|
|
51269
|
+
open: item.isAdminComment ? false : void 0,
|
|
51270
|
+
label: !item.isAdminComment ? email2 : void 0,
|
|
51271
|
+
align: "start",
|
|
51272
|
+
side: "left",
|
|
51273
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(index.Flex, { gap: 2, style: { cursor: item.isAdminComment ? "default" : "help" }, children: [
|
|
51274
|
+
item.author && /* @__PURE__ */ jsxRuntime.jsx(
|
|
51275
|
+
UserAvatar,
|
|
51276
|
+
{
|
|
51277
|
+
name,
|
|
51278
|
+
avatar,
|
|
51279
|
+
isAdminComment: item.isAdminComment
|
|
51280
|
+
}
|
|
51281
|
+
),
|
|
51282
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Typography, { children: name || index$1.getMessage("components.author.unknown") })
|
|
51283
|
+
] })
|
|
51284
|
+
}
|
|
51285
|
+
) }),
|
|
51286
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(index.Typography, { ellipsis: true, children: item.content }) }),
|
|
51248
51287
|
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: item.threadOf ? /* @__PURE__ */ jsxRuntime.jsx(index.Link, { href: `discover/${item.threadOf.id}`, onClick: onClickDetails(item.threadOf.id), children: index$1.getMessage(
|
|
51249
51288
|
{
|
|
51250
51289
|
id: "page.discover.table.cell.thread",
|
|
@@ -51253,10 +51292,10 @@ const CommentRow = ({ item }) => {
|
|
|
51253
51292
|
"#" + item.threadOf.id
|
|
51254
51293
|
) }) : "-" }),
|
|
51255
51294
|
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: contentTypeLink }),
|
|
51256
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: formatDate(item.updatedAt || item.createdAt, {
|
|
51295
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(index.Typography, { children: formatDate(item.updatedAt || item.createdAt, {
|
|
51257
51296
|
dateStyle: "long",
|
|
51258
51297
|
timeStyle: "short"
|
|
51259
|
-
}) }),
|
|
51298
|
+
}) }) }),
|
|
51260
51299
|
/* @__PURE__ */ jsxRuntime.jsx(index.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
51261
51300
|
CommentStatusBadge,
|
|
51262
51301
|
{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useNotification, Form, Page, Layouts, useTracking, useQueryParams, SearchInput, Pagination } from "@strapi/strapi/admin";
|
|
3
3
|
import { useNavigate, useParams, Routes, Route, Navigate } from "react-router-dom";
|
|
4
|
-
import { S as SubNav, a as SubNavHeader, b as SubNavSections, c as SubNavSection, d as SubNavLink, p as pluginId, B as Box, T as Typography, D as Divider, F as Flex, C as CheckboxImpl, e as Button, I as IconButton, f as ForwardRef$4x, g as ForwardRef$3$, h as Badge, i as IconButtonGroup$1, P as Portal$1, j as FocusTrap, k as ForwardRef$45, l as ForwardRef$3B, m as Field, n as SingleSelect, o as SingleSelectOption, q as ForwardRef$4X, r as ForwardRef$2v, s as ForwardRef$f, t as ForwardRef$1R, u as Popover, v as ForwardRef$v, w as ForwardRef$4R, x as ForwardRef$1L, y as ForwardRef$4d, z as ForwardRef$2l, A as ForwardRef$11, M as Modal, E as Table, G as Thead, H as Tr, J as Th, K as Tbody, L as ForwardRef$1r, N as ForwardRef$j, O as ForwardRef$3x, Q as ForwardRef$1d, R as ForwardRef$R, U as Avatar, V as
|
|
4
|
+
import { S as SubNav, a as SubNavHeader, b as SubNavSections, c as SubNavSection, d as SubNavLink, p as pluginId, B as Box, T as Typography, D as Divider, F as Flex, C as CheckboxImpl, e as Button, I as IconButton, f as ForwardRef$4x, g as ForwardRef$3$, h as Badge, i as IconButtonGroup$1, P as Portal$1, j as FocusTrap, k as ForwardRef$45, l as ForwardRef$3B, m as Field, n as SingleSelect, o as SingleSelectOption, q as ForwardRef$4X, r as ForwardRef$2v, s as ForwardRef$f, t as ForwardRef$1R, u as Popover, v as ForwardRef$v, w as ForwardRef$4R, x as ForwardRef$1L, y as ForwardRef$4d, z as ForwardRef$2l, A as ForwardRef$11, M as Modal, E as Table, G as Thead, H as Tr, J as Th, K as Tbody, L as ForwardRef$1r, N as ForwardRef$j, O as ForwardRef$3x, Q as ForwardRef$1d, R as ForwardRef$R, U as Avatar, V as TooltipImpl, W as Loader, X as Link, Y as ForwardRef$51, Z as Grid, _ as Td, $ as SimpleMenu, a0 as MenuItem } from "./index-Ct7A5TFY.mjs";
|
|
5
5
|
import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { u as useAPI, l as lodashExports, C as COMMENT_STATUS, R as REPORT_STATUS, g as getMessage, a as usePermissions, U as UserContext, b as getDefaultExportFromCjs, c as useIntl, d as REPORT_REASON, e as ConfirmationDialog, f as CommonProviders } from "./index-
|
|
6
|
+
import { u as useAPI, l as lodashExports, C as COMMENT_STATUS, R as REPORT_STATUS, g as getMessage, a as usePermissions, U as UserContext, b as getDefaultExportFromCjs, c as useIntl, d as REPORT_REASON, e as ConfirmationDialog, f as CommonProviders } from "./index-CIBI9Is6.mjs";
|
|
7
7
|
import { create } from "zustand/react";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { useCallback, useMemo, useContext, useState, useRef, Fragment as Fragment$1 } from "react";
|
|
@@ -428,9 +428,12 @@ const CommentStatusBadge = ({ item, canAccessReports, hasReports }) => {
|
|
|
428
428
|
};
|
|
429
429
|
const IconButtonGroup = styled(IconButtonGroup$1)(({ isSingle, withMargin }) => {
|
|
430
430
|
const isSingleStyle = {
|
|
431
|
-
|
|
432
|
-
"&:first-child
|
|
433
|
-
borderRadius: "4px"
|
|
431
|
+
button: {
|
|
432
|
+
"&:first-child": {
|
|
433
|
+
borderRadius: "4px !important"
|
|
434
|
+
},
|
|
435
|
+
"&:last-child": {
|
|
436
|
+
borderRadius: "4px !important"
|
|
434
437
|
}
|
|
435
438
|
}
|
|
436
439
|
};
|
|
@@ -50327,7 +50330,7 @@ const ModeratorResponseModal = ({ id: id2, content, title, Icon }) => {
|
|
|
50327
50330
|
setIsModalVisible((prev) => !prev);
|
|
50328
50331
|
}, []);
|
|
50329
50332
|
return /* @__PURE__ */ jsxs(Modal.Root, { open: isModalVisible, onOpenChange: onToggleModal, children: [
|
|
50330
|
-
/* @__PURE__ */ jsx(Modal.Trigger, { children: /* @__PURE__ */ jsx(IconButton, { children: /* @__PURE__ */ jsx(Icon, {}) }) }),
|
|
50333
|
+
/* @__PURE__ */ jsx(Modal.Trigger, { children: /* @__PURE__ */ jsx(IconButton, { label: getMessage("page.details.actions.thread.modal.start.thread"), children: /* @__PURE__ */ jsx(Icon, {}) }) }),
|
|
50331
50334
|
/* @__PURE__ */ jsxs(Modal.Content, { children: [
|
|
50332
50335
|
/* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsx(Modal.Title, { children: title }) }),
|
|
50333
50336
|
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(
|
|
@@ -50795,6 +50798,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50795
50798
|
{
|
|
50796
50799
|
onClick,
|
|
50797
50800
|
loading: commentMutation.block.isPending,
|
|
50801
|
+
label: getMessage("page.details.actions.comment.block"),
|
|
50798
50802
|
children: /* @__PURE__ */ jsx(LockIcon, {})
|
|
50799
50803
|
}
|
|
50800
50804
|
),
|
|
@@ -50808,6 +50812,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50808
50812
|
{
|
|
50809
50813
|
onClick: handleUnblockClick,
|
|
50810
50814
|
loading: commentMutation.block.isPending,
|
|
50815
|
+
label: getMessage("page.details.actions.comment.unblock"),
|
|
50811
50816
|
children: /* @__PURE__ */ jsx(UnlockIcon, {})
|
|
50812
50817
|
}
|
|
50813
50818
|
)
|
|
@@ -50836,6 +50841,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50836
50841
|
{
|
|
50837
50842
|
onClick: handleDeleteClick,
|
|
50838
50843
|
loading: commentMutation.delete.isPending,
|
|
50844
|
+
label: getMessage("page.details.actions.comment.delete"),
|
|
50839
50845
|
children: /* @__PURE__ */ jsx(ForwardRef$j, {})
|
|
50840
50846
|
}
|
|
50841
50847
|
),
|
|
@@ -50850,6 +50856,7 @@ const DiscussionThreadItemActions = ({ item, pinned, preview }) => {
|
|
|
50850
50856
|
IconButton,
|
|
50851
50857
|
{
|
|
50852
50858
|
onClick: handleDrillDownClick,
|
|
50859
|
+
label: getMessage("page.details.panel.discussion.nav.drilldown"),
|
|
50853
50860
|
style: blocked && !blockedThread ? { marginTop: "1px", marginRight: ".5rem" } : {},
|
|
50854
50861
|
children: /* @__PURE__ */ jsx(ForwardRef$3x, {})
|
|
50855
50862
|
}
|
|
@@ -50870,10 +50877,11 @@ const AdminAvatar = ({ children }) => /* @__PURE__ */ jsxs(Box, { position: "rel
|
|
|
50870
50877
|
/* @__PURE__ */ jsx(
|
|
50871
50878
|
Flex,
|
|
50872
50879
|
{
|
|
50880
|
+
padding: "2px",
|
|
50873
50881
|
alignItems: "middle",
|
|
50874
50882
|
position: "absolute",
|
|
50875
|
-
right: "-
|
|
50876
|
-
top: "-
|
|
50883
|
+
right: "-30%",
|
|
50884
|
+
top: "-30%",
|
|
50877
50885
|
borderRadius: "50%",
|
|
50878
50886
|
border: "2px #ffffff solid",
|
|
50879
50887
|
background: "#ffffff",
|
|
@@ -50905,10 +50913,21 @@ const DiscussionThreadItemFooter = ({ item, children }) => {
|
|
|
50905
50913
|
dateStyle: "medium",
|
|
50906
50914
|
timeStyle: "short"
|
|
50907
50915
|
});
|
|
50908
|
-
const { name, avatar } = item.author || {};
|
|
50916
|
+
const { name, avatar, email: email2 } = item.author || {};
|
|
50909
50917
|
return /* @__PURE__ */ jsx(Flex, { direction: "row", paddingTop: 2, children: /* @__PURE__ */ jsxs(DiscussionThreadItemFooterMeta, { children: [
|
|
50910
|
-
|
|
50911
|
-
|
|
50918
|
+
/* @__PURE__ */ jsx(
|
|
50919
|
+
TooltipImpl,
|
|
50920
|
+
{
|
|
50921
|
+
open: item.isAdminComment ? false : void 0,
|
|
50922
|
+
label: !item.isAdminComment ? email2 : void 0,
|
|
50923
|
+
align: "start",
|
|
50924
|
+
side: "left",
|
|
50925
|
+
children: /* @__PURE__ */ jsxs(Flex, { style: { cursor: item.isAdminComment ? "default" : "help" }, children: [
|
|
50926
|
+
item.author && /* @__PURE__ */ jsx(UserAvatar, { avatar, name, isAdminComment: item.isAdminComment }),
|
|
50927
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: name || getMessage("components.author.unknown") })
|
|
50928
|
+
] })
|
|
50929
|
+
}
|
|
50930
|
+
),
|
|
50912
50931
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: dateTime }),
|
|
50913
50932
|
children
|
|
50914
50933
|
] }) });
|
|
@@ -51217,10 +51236,30 @@ const CommentRow = ({ item }) => {
|
|
|
51217
51236
|
const localeParam = related.locale ? `?plugins[i18n][locale]=${related.locale}` : "";
|
|
51218
51237
|
return /* @__PURE__ */ jsx(Link, { href: `/admin/content-manager/collection-types/${related.uid}/${related.documentId}${localeParam}`, children: related.title });
|
|
51219
51238
|
}, [item.related]);
|
|
51239
|
+
const { name, email: email2, avatar } = item.author || {};
|
|
51220
51240
|
return /* @__PURE__ */ jsxs(Tr, { children: [
|
|
51221
|
-
/* @__PURE__ */ jsx(Td, { children: item.id }),
|
|
51222
|
-
/* @__PURE__ */ jsx(Td, { children:
|
|
51223
|
-
|
|
51241
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { children: item.id }) }),
|
|
51242
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(
|
|
51243
|
+
TooltipImpl,
|
|
51244
|
+
{
|
|
51245
|
+
open: item.isAdminComment ? false : void 0,
|
|
51246
|
+
label: !item.isAdminComment ? email2 : void 0,
|
|
51247
|
+
align: "start",
|
|
51248
|
+
side: "left",
|
|
51249
|
+
children: /* @__PURE__ */ jsxs(Flex, { gap: 2, style: { cursor: item.isAdminComment ? "default" : "help" }, children: [
|
|
51250
|
+
item.author && /* @__PURE__ */ jsx(
|
|
51251
|
+
UserAvatar,
|
|
51252
|
+
{
|
|
51253
|
+
name,
|
|
51254
|
+
avatar,
|
|
51255
|
+
isAdminComment: item.isAdminComment
|
|
51256
|
+
}
|
|
51257
|
+
),
|
|
51258
|
+
/* @__PURE__ */ jsx(Typography, { children: name || getMessage("components.author.unknown") })
|
|
51259
|
+
] })
|
|
51260
|
+
}
|
|
51261
|
+
) }),
|
|
51262
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { ellipsis: true, children: item.content }) }),
|
|
51224
51263
|
/* @__PURE__ */ jsx(Td, { children: item.threadOf ? /* @__PURE__ */ jsx(Link, { href: `discover/${item.threadOf.id}`, onClick: onClickDetails(item.threadOf.id), children: getMessage(
|
|
51225
51264
|
{
|
|
51226
51265
|
id: "page.discover.table.cell.thread",
|
|
@@ -51229,10 +51268,10 @@ const CommentRow = ({ item }) => {
|
|
|
51229
51268
|
"#" + item.threadOf.id
|
|
51230
51269
|
) }) : "-" }),
|
|
51231
51270
|
/* @__PURE__ */ jsx(Td, { children: contentTypeLink }),
|
|
51232
|
-
/* @__PURE__ */ jsx(Td, { children: formatDate(item.updatedAt || item.createdAt, {
|
|
51271
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { children: formatDate(item.updatedAt || item.createdAt, {
|
|
51233
51272
|
dateStyle: "long",
|
|
51234
51273
|
timeStyle: "short"
|
|
51235
|
-
}) }),
|
|
51274
|
+
}) }) }),
|
|
51236
51275
|
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(
|
|
51237
51276
|
CommentStatusBadge,
|
|
51238
51277
|
{
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -8381,9 +8381,9 @@ const getRelationValidator = (enabledCollections) => zod.z.string().regex(REGEX$
|
|
|
8381
8381
|
"Invalid relation or not enabled collections"
|
|
8382
8382
|
);
|
|
8383
8383
|
const externalAuthorSchema = zod.z.object({
|
|
8384
|
-
id: zod.z.number(),
|
|
8384
|
+
id: zod.z.union([zod.z.number(), zod.z.string()]),
|
|
8385
8385
|
name: zod.z.string().min(1).max(100).optional(),
|
|
8386
|
-
email: zod.z.string().email()
|
|
8386
|
+
email: zod.z.string().email(),
|
|
8387
8387
|
avatar: zod.z.string().url().optional()
|
|
8388
8388
|
});
|
|
8389
8389
|
zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean()]);
|
|
@@ -9731,10 +9731,10 @@ const adminServices = ({ strapi: strapi2 }) => {
|
|
|
9731
9731
|
}
|
|
9732
9732
|
return { ..._2, uid };
|
|
9733
9733
|
});
|
|
9734
|
-
const levelThreadId = entity.threadOf && typeof entity.threadOf === "object" ? entity.threadOf.
|
|
9734
|
+
const levelThreadId = entity.threadOf && typeof entity.threadOf === "object" ? entity.threadOf.id : null;
|
|
9735
9735
|
const entitiesOnSameLevel = await this.getCommonService().findAllInHierarchy(
|
|
9736
9736
|
{
|
|
9737
|
-
|
|
9737
|
+
filters: {
|
|
9738
9738
|
...defaultWhere,
|
|
9739
9739
|
...query,
|
|
9740
9740
|
threadOf: levelThreadId,
|
|
@@ -10421,23 +10421,22 @@ const commonService = ({ strapi: strapi2 }) => ({
|
|
|
10421
10421
|
);
|
|
10422
10422
|
return Promise.all(
|
|
10423
10423
|
Object.entries(data).map(
|
|
10424
|
-
async ([relatedUid, { documentIds, locale }]) =>
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
)
|
|
10424
|
+
async ([relatedUid, { documentIds, locale }]) => {
|
|
10425
|
+
return Promise.all(
|
|
10426
|
+
documentIds.map(
|
|
10427
|
+
(documentId, index2) => strapi2.documents(relatedUid).findOne({
|
|
10428
|
+
documentId: documentId.toString(),
|
|
10429
|
+
locale: !lodashExports.isNil(locale[index2]) ? locale[index2] : void 0,
|
|
10430
|
+
status: "published"
|
|
10431
|
+
})
|
|
10432
|
+
)
|
|
10433
|
+
).then(
|
|
10434
|
+
(relatedEntities) => relatedEntities.filter((_2) => _2).map((_2) => ({
|
|
10435
|
+
..._2,
|
|
10436
|
+
uid: relatedUid
|
|
10437
|
+
}))
|
|
10438
|
+
);
|
|
10439
|
+
}
|
|
10441
10440
|
)
|
|
10442
10441
|
).then((result) => result.flat(2));
|
|
10443
10442
|
},
|
package/dist/server/index.mjs
CHANGED
|
@@ -8380,9 +8380,9 @@ const getRelationValidator = (enabledCollections) => z.string().regex(REGEX$1.re
|
|
|
8380
8380
|
"Invalid relation or not enabled collections"
|
|
8381
8381
|
);
|
|
8382
8382
|
const externalAuthorSchema = z.object({
|
|
8383
|
-
id: z.number(),
|
|
8383
|
+
id: z.union([z.number(), z.string()]),
|
|
8384
8384
|
name: z.string().min(1).max(100).optional(),
|
|
8385
|
-
email: z.string().email()
|
|
8385
|
+
email: z.string().email(),
|
|
8386
8386
|
avatar: z.string().url().optional()
|
|
8387
8387
|
});
|
|
8388
8388
|
z.union([z.string(), z.number(), z.boolean()]);
|
|
@@ -9730,10 +9730,10 @@ const adminServices = ({ strapi: strapi2 }) => {
|
|
|
9730
9730
|
}
|
|
9731
9731
|
return { ..._2, uid };
|
|
9732
9732
|
});
|
|
9733
|
-
const levelThreadId = entity.threadOf && typeof entity.threadOf === "object" ? entity.threadOf.
|
|
9733
|
+
const levelThreadId = entity.threadOf && typeof entity.threadOf === "object" ? entity.threadOf.id : null;
|
|
9734
9734
|
const entitiesOnSameLevel = await this.getCommonService().findAllInHierarchy(
|
|
9735
9735
|
{
|
|
9736
|
-
|
|
9736
|
+
filters: {
|
|
9737
9737
|
...defaultWhere,
|
|
9738
9738
|
...query,
|
|
9739
9739
|
threadOf: levelThreadId,
|
|
@@ -10420,23 +10420,22 @@ const commonService = ({ strapi: strapi2 }) => ({
|
|
|
10420
10420
|
);
|
|
10421
10421
|
return Promise.all(
|
|
10422
10422
|
Object.entries(data).map(
|
|
10423
|
-
async ([relatedUid, { documentIds, locale }]) =>
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
)
|
|
10423
|
+
async ([relatedUid, { documentIds, locale }]) => {
|
|
10424
|
+
return Promise.all(
|
|
10425
|
+
documentIds.map(
|
|
10426
|
+
(documentId, index2) => strapi2.documents(relatedUid).findOne({
|
|
10427
|
+
documentId: documentId.toString(),
|
|
10428
|
+
locale: !lodashExports.isNil(locale[index2]) ? locale[index2] : void 0,
|
|
10429
|
+
status: "published"
|
|
10430
|
+
})
|
|
10431
|
+
)
|
|
10432
|
+
).then(
|
|
10433
|
+
(relatedEntities) => relatedEntities.filter((_2) => _2).map((_2) => ({
|
|
10434
|
+
..._2,
|
|
10435
|
+
uid: relatedUid
|
|
10436
|
+
}))
|
|
10437
|
+
);
|
|
10438
|
+
}
|
|
10440
10439
|
)
|
|
10441
10440
|
).then((result) => result.flat(2));
|
|
10442
10441
|
},
|
|
@@ -1509,7 +1509,7 @@ declare const _default: {
|
|
|
1509
1509
|
locale?: string;
|
|
1510
1510
|
author?: {
|
|
1511
1511
|
name?: string;
|
|
1512
|
-
id?: number;
|
|
1512
|
+
id?: string | number;
|
|
1513
1513
|
email?: string;
|
|
1514
1514
|
avatar?: string;
|
|
1515
1515
|
};
|
|
@@ -7740,7 +7740,7 @@ declare const _default: {
|
|
|
7740
7740
|
locale?: string;
|
|
7741
7741
|
author?: {
|
|
7742
7742
|
name?: string;
|
|
7743
|
-
id?: number;
|
|
7743
|
+
id?: string | number;
|
|
7744
7744
|
email?: string;
|
|
7745
7745
|
avatar?: string;
|
|
7746
7746
|
};
|
|
@@ -7826,7 +7826,7 @@ declare const _default: {
|
|
|
7826
7826
|
content?: string;
|
|
7827
7827
|
author?: {
|
|
7828
7828
|
name?: string;
|
|
7829
|
-
id?: number;
|
|
7829
|
+
id?: string | number;
|
|
7830
7830
|
email?: string;
|
|
7831
7831
|
avatar?: string;
|
|
7832
7832
|
};
|
|
@@ -4713,7 +4713,7 @@ declare const pluginServices: {
|
|
|
4713
4713
|
locale?: string;
|
|
4714
4714
|
author?: {
|
|
4715
4715
|
name?: string;
|
|
4716
|
-
id?: number;
|
|
4716
|
+
id?: string | number;
|
|
4717
4717
|
email?: string;
|
|
4718
4718
|
avatar?: string;
|
|
4719
4719
|
};
|
|
@@ -4799,7 +4799,7 @@ declare const pluginServices: {
|
|
|
4799
4799
|
content?: string;
|
|
4800
4800
|
author?: {
|
|
4801
4801
|
name?: string;
|
|
4802
|
-
id?: number;
|
|
4802
|
+
id?: string | number;
|
|
4803
4803
|
email?: string;
|
|
4804
4804
|
avatar?: string;
|
|
4805
4805
|
};
|
|
@@ -7,7 +7,7 @@ export declare const newCommentValidator: (enabledCollections: string[], relatio
|
|
|
7
7
|
locale?: string;
|
|
8
8
|
author?: {
|
|
9
9
|
name?: string;
|
|
10
|
-
id?: number;
|
|
10
|
+
id?: string | number;
|
|
11
11
|
email?: string;
|
|
12
12
|
avatar?: string;
|
|
13
13
|
};
|
|
@@ -19,7 +19,7 @@ export declare const updateCommentValidator: (enabledCollections: string[], payl
|
|
|
19
19
|
content?: string;
|
|
20
20
|
author?: {
|
|
21
21
|
name?: string;
|
|
22
|
-
id?: number;
|
|
22
|
+
id?: string | number;
|
|
23
23
|
email?: string;
|
|
24
24
|
avatar?: string;
|
|
25
25
|
};
|
|
@@ -757,18 +757,18 @@ export declare const queryPaginationSchema: z.ZodObject<z.objectUtil.extendShape
|
|
|
757
757
|
export declare const validate: <I, O>(result: z.SafeParseReturnType<I, O>) => import("../utils/Either").Left<PluginError> | import("../utils/Either").Right<O>;
|
|
758
758
|
export declare const getRelationValidator: (enabledCollections: string[]) => z.ZodEffects<z.ZodString, `${string}::${string}.${string}`, string>;
|
|
759
759
|
export declare const externalAuthorSchema: z.ZodObject<{
|
|
760
|
-
id: z.ZodNumber
|
|
760
|
+
id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
761
761
|
name: z.ZodOptional<z.ZodString>;
|
|
762
|
-
email: z.
|
|
762
|
+
email: z.ZodString;
|
|
763
763
|
avatar: z.ZodOptional<z.ZodString>;
|
|
764
764
|
}, "strip", z.ZodTypeAny, {
|
|
765
765
|
name?: string;
|
|
766
|
-
id?: number;
|
|
766
|
+
id?: string | number;
|
|
767
767
|
email?: string;
|
|
768
768
|
avatar?: string;
|
|
769
769
|
}, {
|
|
770
770
|
name?: string;
|
|
771
|
-
id?: number;
|
|
771
|
+
id?: string | number;
|
|
772
772
|
email?: string;
|
|
773
773
|
avatar?: string;
|
|
774
774
|
}>;
|