@btst/stack 2.7.0 → 2.8.1
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 -0
- package/dist/packages/stack/src/plugins/blog/client/components/loading/post-navigation-skeleton.cjs +13 -0
- package/dist/packages/stack/src/plugins/blog/client/components/loading/post-navigation-skeleton.mjs +11 -0
- package/dist/packages/stack/src/plugins/blog/client/components/loading/recent-posts-carousel-skeleton.cjs +17 -0
- package/dist/packages/stack/src/plugins/blog/client/components/loading/recent-posts-carousel-skeleton.mjs +15 -0
- package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.internal.cjs +18 -7
- package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.internal.mjs +18 -7
- package/dist/packages/stack/src/plugins/blog/client/components/shared/post-navigation.cjs +48 -52
- package/dist/packages/stack/src/plugins/blog/client/components/shared/post-navigation.mjs +49 -53
- package/dist/packages/stack/src/plugins/blog/client/components/shared/recent-posts-carousel.cjs +34 -37
- package/dist/packages/stack/src/plugins/blog/client/components/shared/recent-posts-carousel.mjs +35 -38
- package/dist/packages/stack/src/plugins/blog/client/hooks/blog-hooks.cjs +4 -21
- package/dist/packages/stack/src/plugins/blog/client/hooks/blog-hooks.mjs +4 -21
- package/dist/packages/stack/src/plugins/comments/api/getters.cjs +284 -0
- package/dist/packages/stack/src/plugins/comments/api/getters.mjs +280 -0
- package/dist/packages/stack/src/plugins/comments/api/mutations.cjs +118 -0
- package/dist/packages/stack/src/plugins/comments/api/mutations.mjs +112 -0
- package/dist/packages/stack/src/plugins/comments/api/plugin.cjs +335 -0
- package/dist/packages/stack/src/plugins/comments/api/plugin.mjs +333 -0
- package/dist/packages/stack/src/plugins/comments/api/query-key-defs.cjs +60 -0
- package/dist/packages/stack/src/plugins/comments/api/query-key-defs.mjs +55 -0
- package/dist/packages/stack/src/plugins/comments/api/serializers.cjs +23 -0
- package/dist/packages/stack/src/plugins/comments/api/serializers.mjs +21 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-count.cjs +46 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-count.mjs +44 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-form.cjs +86 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-form.mjs +84 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-thread.cjs +540 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-thread.mjs +538 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.cjs +64 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.internal.cjs +426 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.internal.mjs +424 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.mjs +62 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.cjs +66 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.internal.cjs +256 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.internal.mjs +254 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.mjs +64 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.cjs +86 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.internal.cjs +191 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.internal.mjs +189 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.mjs +84 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/page-wrapper.cjs +27 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/page-wrapper.mjs +25 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/pagination.cjs +37 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/pagination.mjs +35 -0
- package/dist/packages/stack/src/plugins/comments/client/hooks/use-comments.cjs +476 -0
- package/dist/packages/stack/src/plugins/comments/client/hooks/use-comments.mjs +464 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-moderation.cjs +67 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-moderation.mjs +65 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-my.cjs +27 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-my.mjs +25 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-thread.cjs +30 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-thread.mjs +28 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/index.cjs +13 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/index.mjs +11 -0
- package/dist/packages/stack/src/plugins/comments/client/plugin.cjs +116 -0
- package/dist/packages/stack/src/plugins/comments/client/plugin.mjs +114 -0
- package/dist/packages/stack/src/plugins/comments/client/utils.cjs +41 -0
- package/dist/packages/stack/src/plugins/comments/client/utils.mjs +37 -0
- package/dist/packages/stack/src/plugins/comments/db.cjs +75 -0
- package/dist/packages/stack/src/plugins/comments/db.mjs +73 -0
- package/dist/packages/stack/src/plugins/comments/schemas.cjs +45 -0
- package/dist/packages/stack/src/plugins/comments/schemas.mjs +38 -0
- package/dist/packages/stack/src/plugins/kanban/client/components/forms/task-form.cjs +0 -1
- package/dist/packages/stack/src/plugins/kanban/client/components/forms/task-form.mjs +0 -1
- package/dist/packages/stack/src/plugins/kanban/client/components/pages/board-page.internal.cjs +39 -22
- package/dist/packages/stack/src/plugins/kanban/client/components/pages/board-page.internal.mjs +40 -23
- package/dist/packages/ui/src/components/avatar.mjs +1 -1
- package/dist/packages/ui/src/components/pagination-controls.cjs +64 -0
- package/dist/packages/ui/src/components/pagination-controls.mjs +62 -0
- package/dist/packages/ui/src/components/when-visible.cjs +39 -0
- package/dist/packages/ui/src/components/when-visible.mjs +37 -0
- package/dist/plugins/blog/client/hooks/index.d.cts +1 -1
- package/dist/plugins/blog/client/hooks/index.d.mts +1 -1
- package/dist/plugins/blog/client/hooks/index.d.ts +1 -1
- package/dist/plugins/blog/client/index.d.cts +24 -2
- package/dist/plugins/blog/client/index.d.mts +24 -2
- package/dist/plugins/blog/client/index.d.ts +24 -2
- package/dist/plugins/comments/api/index.cjs +21 -0
- package/dist/plugins/comments/api/index.d.cts +126 -0
- package/dist/plugins/comments/api/index.d.mts +126 -0
- package/dist/plugins/comments/api/index.d.ts +126 -0
- package/dist/plugins/comments/api/index.mjs +5 -0
- package/dist/plugins/comments/client/components/index.cjs +15 -0
- package/dist/plugins/comments/client/components/index.d.cts +125 -0
- package/dist/plugins/comments/client/components/index.d.mts +125 -0
- package/dist/plugins/comments/client/components/index.d.ts +125 -0
- package/dist/plugins/comments/client/components/index.mjs +5 -0
- package/dist/plugins/comments/client/hooks/index.cjs +17 -0
- package/dist/plugins/comments/client/hooks/index.d.cts +200 -0
- package/dist/plugins/comments/client/hooks/index.d.mts +200 -0
- package/dist/plugins/comments/client/hooks/index.d.ts +200 -0
- package/dist/plugins/comments/client/hooks/index.mjs +1 -0
- package/dist/plugins/comments/client/index.cjs +9 -0
- package/dist/plugins/comments/client/index.d.cts +262 -0
- package/dist/plugins/comments/client/index.d.mts +262 -0
- package/dist/plugins/comments/client/index.d.ts +262 -0
- package/dist/plugins/comments/client/index.mjs +2 -0
- package/dist/plugins/comments/client.css +2 -0
- package/dist/plugins/comments/query-keys.cjs +113 -0
- package/dist/plugins/comments/query-keys.d.cts +71 -0
- package/dist/plugins/comments/query-keys.d.mts +71 -0
- package/dist/plugins/comments/query-keys.d.ts +71 -0
- package/dist/plugins/comments/query-keys.mjs +111 -0
- package/dist/plugins/comments/style.css +15 -0
- package/dist/plugins/kanban/api/index.d.cts +1 -1
- package/dist/plugins/kanban/api/index.d.mts +1 -1
- package/dist/plugins/kanban/api/index.d.ts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.cts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.mts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.ts +1 -1
- package/dist/plugins/kanban/client/index.d.cts +1 -1
- package/dist/plugins/kanban/client/index.d.mts +1 -1
- package/dist/plugins/kanban/client/index.d.ts +1 -1
- package/dist/plugins/kanban/query-keys.d.cts +1 -1
- package/dist/plugins/kanban/query-keys.d.mts +1 -1
- package/dist/plugins/kanban/query-keys.d.ts +1 -1
- package/dist/shared/{stack.FeaWkglm.d.ts → stack.BxFl46lB.d.cts} +24 -1
- package/dist/shared/stack.C-b3Sn8j.d.cts +142 -0
- package/dist/shared/stack.C-b3Sn8j.d.mts +142 -0
- package/dist/shared/stack.C-b3Sn8j.d.ts +142 -0
- package/dist/shared/stack.CJE9sAjV.d.ts +335 -0
- package/dist/shared/stack.CmHRdhl8.d.cts +335 -0
- package/dist/shared/{stack.CNLHlv7r.d.mts → stack.DOZ1EXjM.d.mts} +6 -12
- package/dist/shared/{stack.FeaWkglm.d.mts → stack.DRpeDS6X.d.ts} +24 -1
- package/dist/shared/{stack.CQAZwXhV.d.cts → stack.DX-tQ93o.d.cts} +6 -12
- package/dist/shared/stack.Dcz6636A.d.mts +335 -0
- package/dist/shared/{stack.FeaWkglm.d.cts → stack.Jb0kQDJC.d.mts} +24 -1
- package/dist/shared/stack.Ldfkr5b2.d.cts +112 -0
- package/dist/shared/stack.Ldfkr5b2.d.mts +112 -0
- package/dist/shared/stack.Ldfkr5b2.d.ts +112 -0
- package/dist/shared/{stack.D3BsrpAz.d.ts → stack.VF6FhyZw.d.ts} +6 -12
- package/package.json +69 -4
- package/src/plugins/blog/client/components/loading/post-navigation-skeleton.tsx +10 -0
- package/src/plugins/blog/client/components/loading/recent-posts-carousel-skeleton.tsx +18 -0
- package/src/plugins/blog/client/components/pages/post-page.internal.tsx +23 -8
- package/src/plugins/blog/client/components/shared/post-navigation.tsx +0 -5
- package/src/plugins/blog/client/components/shared/recent-posts-carousel.tsx +1 -5
- package/src/plugins/blog/client/hooks/blog-hooks.tsx +8 -33
- package/src/plugins/blog/client/overrides.ts +26 -1
- package/src/plugins/cms/client/components/shared/pagination.tsx +14 -42
- package/src/plugins/comments/api/getters.ts +444 -0
- package/src/plugins/comments/api/index.ts +21 -0
- package/src/plugins/comments/api/mutations.ts +206 -0
- package/src/plugins/comments/api/plugin.ts +628 -0
- package/src/plugins/comments/api/query-key-defs.ts +143 -0
- package/src/plugins/comments/api/serializers.ts +37 -0
- package/src/plugins/comments/client/components/comment-count.tsx +66 -0
- package/src/plugins/comments/client/components/comment-form.tsx +112 -0
- package/src/plugins/comments/client/components/comment-thread.tsx +799 -0
- package/src/plugins/comments/client/components/index.tsx +11 -0
- package/src/plugins/comments/client/components/pages/moderation-page.internal.tsx +550 -0
- package/src/plugins/comments/client/components/pages/moderation-page.tsx +70 -0
- package/src/plugins/comments/client/components/pages/my-comments-page.internal.tsx +367 -0
- package/src/plugins/comments/client/components/pages/my-comments-page.tsx +72 -0
- package/src/plugins/comments/client/components/pages/resource-comments-page.internal.tsx +225 -0
- package/src/plugins/comments/client/components/pages/resource-comments-page.tsx +97 -0
- package/src/plugins/comments/client/components/shared/page-wrapper.tsx +32 -0
- package/src/plugins/comments/client/components/shared/pagination.tsx +44 -0
- package/src/plugins/comments/client/hooks/index.tsx +13 -0
- package/src/plugins/comments/client/hooks/use-comments.tsx +717 -0
- package/src/plugins/comments/client/index.ts +14 -0
- package/src/plugins/comments/client/localization/comments-moderation.ts +75 -0
- package/src/plugins/comments/client/localization/comments-my.ts +32 -0
- package/src/plugins/comments/client/localization/comments-thread.ts +32 -0
- package/src/plugins/comments/client/localization/index.ts +11 -0
- package/src/plugins/comments/client/overrides.ts +164 -0
- package/src/plugins/comments/client/plugin.tsx +195 -0
- package/src/plugins/comments/client/utils.ts +67 -0
- package/src/plugins/comments/client.css +2 -0
- package/src/plugins/comments/db.ts +77 -0
- package/src/plugins/comments/query-keys.ts +189 -0
- package/src/plugins/comments/schemas.ts +72 -0
- package/src/plugins/comments/style.css +15 -0
- package/src/plugins/comments/types.ts +73 -0
- package/src/plugins/kanban/client/components/forms/task-form.tsx +0 -1
- package/src/plugins/kanban/client/components/pages/board-page.internal.tsx +46 -27
- package/src/plugins/kanban/client/overrides.ts +27 -1
- package/dist/shared/{stack.Rtcvl8sS.d.cts → stack.BOokfhZD.d.cts} +3 -3
- package/dist/shared/{stack.D4Cea8II.d.ts → stack.BvCR4-9H.d.ts} +3 -3
- package/dist/shared/{stack.HE_IvqV5.d.mts → stack.CWxAl9K3.d.mts} +3 -3
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery, useSuspenseQuery, useInfiniteQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { createApiClient } from '@btst/stack/plugins/client';
|
|
4
|
+
import { createCommentsQueryKeys } from '../../../../../../../plugins/comments/query-keys.mjs';
|
|
5
|
+
import { toError } from '../utils.mjs';
|
|
6
|
+
|
|
7
|
+
function getClient(config) {
|
|
8
|
+
return createApiClient({
|
|
9
|
+
baseURL: config.apiBaseURL,
|
|
10
|
+
basePath: config.apiBasePath
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function useComments(config, params, options) {
|
|
14
|
+
const client = getClient(config);
|
|
15
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
16
|
+
const query = useQuery({
|
|
17
|
+
...queries.comments.list(params),
|
|
18
|
+
staleTime: 3e4,
|
|
19
|
+
retry: false,
|
|
20
|
+
enabled: options?.enabled ?? true
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
data: query.data,
|
|
24
|
+
comments: query.data?.items ?? [],
|
|
25
|
+
total: query.data?.total ?? 0,
|
|
26
|
+
isLoading: query.isLoading,
|
|
27
|
+
isFetching: query.isFetching,
|
|
28
|
+
error: query.error,
|
|
29
|
+
refetch: query.refetch
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function useSuspenseComments(config, params) {
|
|
33
|
+
const client = getClient(config);
|
|
34
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
35
|
+
const { data, refetch, error, isFetching } = useSuspenseQuery({
|
|
36
|
+
...queries.comments.list(params),
|
|
37
|
+
staleTime: 3e4,
|
|
38
|
+
retry: false
|
|
39
|
+
});
|
|
40
|
+
if (error && !isFetching) {
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
comments: data?.items ?? [],
|
|
45
|
+
total: data?.total ?? 0,
|
|
46
|
+
refetch
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function useSuspenseModerationComments(config, params) {
|
|
50
|
+
const limit = params.limit ?? 20;
|
|
51
|
+
const page = params.page ?? 1;
|
|
52
|
+
const offset = (page - 1) * limit;
|
|
53
|
+
const client = getClient(config);
|
|
54
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
55
|
+
const { data, refetch, error, isFetching } = useSuspenseQuery({
|
|
56
|
+
...queries.comments.list({ status: params.status, limit, offset }),
|
|
57
|
+
staleTime: 3e4,
|
|
58
|
+
retry: false
|
|
59
|
+
});
|
|
60
|
+
if (error && !isFetching) {
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
const comments = data?.items ?? [];
|
|
64
|
+
const total = data?.total ?? 0;
|
|
65
|
+
const totalPages = Math.max(1, Math.ceil(total / limit));
|
|
66
|
+
return {
|
|
67
|
+
comments,
|
|
68
|
+
total,
|
|
69
|
+
limit,
|
|
70
|
+
offset,
|
|
71
|
+
totalPages,
|
|
72
|
+
refetch
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function useInfiniteComments(config, params, options) {
|
|
76
|
+
const pageSize = params.pageSize ?? 10;
|
|
77
|
+
const client = getClient(config);
|
|
78
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
79
|
+
const baseQuery = queries.commentsThread.list({
|
|
80
|
+
resourceId: params.resourceId,
|
|
81
|
+
resourceType: params.resourceType,
|
|
82
|
+
parentId: params.parentId ?? null,
|
|
83
|
+
status: params.status,
|
|
84
|
+
currentUserId: params.currentUserId,
|
|
85
|
+
limit: pageSize
|
|
86
|
+
});
|
|
87
|
+
const query = useInfiniteQuery({
|
|
88
|
+
...baseQuery,
|
|
89
|
+
initialPageParam: 0,
|
|
90
|
+
getNextPageParam: (lastPage) => {
|
|
91
|
+
const nextOffset = lastPage.offset + lastPage.limit;
|
|
92
|
+
return nextOffset < lastPage.total ? nextOffset : void 0;
|
|
93
|
+
},
|
|
94
|
+
staleTime: 3e4,
|
|
95
|
+
retry: false,
|
|
96
|
+
enabled: options?.enabled ?? true
|
|
97
|
+
});
|
|
98
|
+
const comments = query.data?.pages.flatMap((p) => p.items) ?? [];
|
|
99
|
+
const total = query.data?.pages[0]?.total ?? 0;
|
|
100
|
+
return {
|
|
101
|
+
comments,
|
|
102
|
+
total,
|
|
103
|
+
queryKey: baseQuery.queryKey,
|
|
104
|
+
isLoading: query.isLoading,
|
|
105
|
+
isFetching: query.isFetching,
|
|
106
|
+
loadMore: query.fetchNextPage,
|
|
107
|
+
hasMore: !!query.hasNextPage,
|
|
108
|
+
isLoadingMore: query.isFetchingNextPage,
|
|
109
|
+
error: query.error
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function useCommentCount(config, params) {
|
|
113
|
+
const client = getClient(config);
|
|
114
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
115
|
+
const query = useQuery({
|
|
116
|
+
...queries.commentCount.byResource(params),
|
|
117
|
+
staleTime: 6e4,
|
|
118
|
+
retry: false
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
count: query.data ?? 0,
|
|
122
|
+
isLoading: query.isLoading,
|
|
123
|
+
error: query.error
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function usePostComment(config, params) {
|
|
127
|
+
const queryClient = useQueryClient();
|
|
128
|
+
const client = getClient(config);
|
|
129
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
130
|
+
const getListKey = (parentId, offset, limit) => {
|
|
131
|
+
if (params.infiniteKey && (parentId ?? null) === null) {
|
|
132
|
+
return params.infiniteKey;
|
|
133
|
+
}
|
|
134
|
+
return queries.comments.list({
|
|
135
|
+
resourceId: params.resourceId,
|
|
136
|
+
resourceType: params.resourceType,
|
|
137
|
+
parentId: parentId ?? null,
|
|
138
|
+
status: "approved",
|
|
139
|
+
currentUserId: params.currentUserId,
|
|
140
|
+
limit,
|
|
141
|
+
offset
|
|
142
|
+
}).queryKey;
|
|
143
|
+
};
|
|
144
|
+
const isInfinitePost = (parentId) => !!params.infiniteKey && (parentId ?? null) === null;
|
|
145
|
+
return useMutation({
|
|
146
|
+
mutationFn: async (input) => {
|
|
147
|
+
const response = await client("@post/comments", {
|
|
148
|
+
method: "POST",
|
|
149
|
+
body: {
|
|
150
|
+
resourceId: params.resourceId,
|
|
151
|
+
resourceType: params.resourceType,
|
|
152
|
+
parentId: input.parentId ?? null,
|
|
153
|
+
body: input.body
|
|
154
|
+
},
|
|
155
|
+
headers: config.headers
|
|
156
|
+
});
|
|
157
|
+
const data = response.data;
|
|
158
|
+
if (!data) throw toError(response.error);
|
|
159
|
+
return data;
|
|
160
|
+
},
|
|
161
|
+
onMutate: async (input) => {
|
|
162
|
+
const listKey = getListKey(input.parentId, input.offset, input.limit);
|
|
163
|
+
await queryClient.cancelQueries({ queryKey: listKey });
|
|
164
|
+
const optimisticId = `optimistic-${Date.now()}`;
|
|
165
|
+
const optimistic = {
|
|
166
|
+
id: optimisticId,
|
|
167
|
+
resourceId: params.resourceId,
|
|
168
|
+
resourceType: params.resourceType,
|
|
169
|
+
parentId: input.parentId ?? null,
|
|
170
|
+
authorId: params.currentUserId ?? "",
|
|
171
|
+
resolvedAuthorName: "You",
|
|
172
|
+
resolvedAvatarUrl: null,
|
|
173
|
+
body: input.body,
|
|
174
|
+
status: "pending",
|
|
175
|
+
likes: 0,
|
|
176
|
+
isLikedByCurrentUser: false,
|
|
177
|
+
editedAt: null,
|
|
178
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
179
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
180
|
+
replyCount: 0
|
|
181
|
+
};
|
|
182
|
+
if (isInfinitePost(input.parentId)) {
|
|
183
|
+
const previous2 = queryClient.getQueryData(listKey);
|
|
184
|
+
queryClient.setQueryData(
|
|
185
|
+
listKey,
|
|
186
|
+
(old) => {
|
|
187
|
+
if (!old) {
|
|
188
|
+
return {
|
|
189
|
+
pages: [
|
|
190
|
+
{
|
|
191
|
+
items: [optimistic],
|
|
192
|
+
total: 1,
|
|
193
|
+
limit: params.pageSize ?? 10,
|
|
194
|
+
offset: 0
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
pageParams: [0]
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
const lastIdx = old.pages.length - 1;
|
|
201
|
+
return {
|
|
202
|
+
...old,
|
|
203
|
+
// Increment `total` on every page so the header count (which reads
|
|
204
|
+
// pages[0].total) stays in sync even after multiple pages are loaded.
|
|
205
|
+
pages: old.pages.map(
|
|
206
|
+
(page, idx) => idx === lastIdx ? {
|
|
207
|
+
...page,
|
|
208
|
+
items: [...page.items, optimistic],
|
|
209
|
+
total: page.total + 1
|
|
210
|
+
} : { ...page, total: page.total + 1 }
|
|
211
|
+
)
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
return { previous: previous2, isInfinite: true, listKey, optimisticId };
|
|
216
|
+
}
|
|
217
|
+
const previous = queryClient.getQueryData(listKey);
|
|
218
|
+
queryClient.setQueryData(listKey, (old) => {
|
|
219
|
+
if (!old) {
|
|
220
|
+
return { items: [optimistic], total: 1, limit: 20, offset: 0 };
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
...old,
|
|
224
|
+
items: [...old.items, optimistic],
|
|
225
|
+
total: old.total + 1
|
|
226
|
+
};
|
|
227
|
+
});
|
|
228
|
+
return { previous, isInfinite: false, listKey, optimisticId };
|
|
229
|
+
},
|
|
230
|
+
onSuccess: (data, _input, context) => {
|
|
231
|
+
if (!context) return;
|
|
232
|
+
if (context.isInfinite) {
|
|
233
|
+
queryClient.setQueryData(
|
|
234
|
+
context.listKey,
|
|
235
|
+
(old) => {
|
|
236
|
+
if (!old) {
|
|
237
|
+
return {
|
|
238
|
+
pages: [
|
|
239
|
+
{
|
|
240
|
+
items: [data],
|
|
241
|
+
total: 1,
|
|
242
|
+
limit: _input.limit ?? params.pageSize ?? 10,
|
|
243
|
+
offset: _input.offset ?? 0
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
pageParams: [_input.offset ?? 0]
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
...old,
|
|
251
|
+
pages: old.pages.map((page) => ({
|
|
252
|
+
...page,
|
|
253
|
+
items: page.items.map(
|
|
254
|
+
(item) => item.id === context.optimisticId ? data : item
|
|
255
|
+
)
|
|
256
|
+
}))
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
} else {
|
|
261
|
+
queryClient.setQueryData(context.listKey, (old) => {
|
|
262
|
+
if (!old) {
|
|
263
|
+
return {
|
|
264
|
+
items: [data],
|
|
265
|
+
total: 1,
|
|
266
|
+
limit: _input.limit ?? params.pageSize ?? 20,
|
|
267
|
+
offset: _input.offset ?? 0
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
...old,
|
|
272
|
+
items: old.items.map(
|
|
273
|
+
(item) => item.id === context.optimisticId ? data : item
|
|
274
|
+
)
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
onError: (_err, _input, context) => {
|
|
280
|
+
if (!context) return;
|
|
281
|
+
queryClient.setQueryData(context.listKey, context.previous);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
function useUpdateComment(config) {
|
|
286
|
+
const queryClient = useQueryClient();
|
|
287
|
+
const client = getClient(config);
|
|
288
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
289
|
+
return useMutation({
|
|
290
|
+
mutationFn: async (input) => {
|
|
291
|
+
const response = await client("@patch/comments/:id", {
|
|
292
|
+
method: "PATCH",
|
|
293
|
+
params: { id: input.id },
|
|
294
|
+
body: { body: input.body },
|
|
295
|
+
headers: config.headers
|
|
296
|
+
});
|
|
297
|
+
const data = response.data;
|
|
298
|
+
if (!data) throw toError(response.error);
|
|
299
|
+
return data;
|
|
300
|
+
},
|
|
301
|
+
onSettled: () => {
|
|
302
|
+
queryClient.invalidateQueries({
|
|
303
|
+
queryKey: queries.comments.list._def
|
|
304
|
+
});
|
|
305
|
+
queryClient.invalidateQueries({ queryKey: ["commentsThread"] });
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function useApproveComment(config) {
|
|
310
|
+
const queryClient = useQueryClient();
|
|
311
|
+
const client = getClient(config);
|
|
312
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
313
|
+
return useMutation({
|
|
314
|
+
mutationFn: async (id) => {
|
|
315
|
+
const response = await client("@patch/comments/:id/status", {
|
|
316
|
+
method: "PATCH",
|
|
317
|
+
params: { id },
|
|
318
|
+
body: { status: "approved" },
|
|
319
|
+
headers: config.headers
|
|
320
|
+
});
|
|
321
|
+
const data = response.data;
|
|
322
|
+
if (!data) throw toError(response.error);
|
|
323
|
+
return data;
|
|
324
|
+
},
|
|
325
|
+
onSettled: () => {
|
|
326
|
+
queryClient.invalidateQueries({
|
|
327
|
+
queryKey: queries.comments.list._def
|
|
328
|
+
});
|
|
329
|
+
queryClient.invalidateQueries({
|
|
330
|
+
queryKey: queries.commentCount.byResource._def
|
|
331
|
+
});
|
|
332
|
+
queryClient.invalidateQueries({ queryKey: ["commentsThread"] });
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function useUpdateCommentStatus(config) {
|
|
337
|
+
const queryClient = useQueryClient();
|
|
338
|
+
const client = getClient(config);
|
|
339
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
340
|
+
return useMutation({
|
|
341
|
+
mutationFn: async (input) => {
|
|
342
|
+
const response = await client("@patch/comments/:id/status", {
|
|
343
|
+
method: "PATCH",
|
|
344
|
+
params: { id: input.id },
|
|
345
|
+
body: { status: input.status },
|
|
346
|
+
headers: config.headers
|
|
347
|
+
});
|
|
348
|
+
const data = response.data;
|
|
349
|
+
if (!data) throw toError(response.error);
|
|
350
|
+
return data;
|
|
351
|
+
},
|
|
352
|
+
onSettled: () => {
|
|
353
|
+
queryClient.invalidateQueries({
|
|
354
|
+
queryKey: queries.comments.list._def
|
|
355
|
+
});
|
|
356
|
+
queryClient.invalidateQueries({
|
|
357
|
+
queryKey: queries.commentCount.byResource._def
|
|
358
|
+
});
|
|
359
|
+
queryClient.invalidateQueries({ queryKey: ["commentsThread"] });
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function useDeleteComment(config) {
|
|
364
|
+
const queryClient = useQueryClient();
|
|
365
|
+
const client = getClient(config);
|
|
366
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
367
|
+
return useMutation({
|
|
368
|
+
mutationFn: async (id) => {
|
|
369
|
+
const response = await client("@delete/comments/:id", {
|
|
370
|
+
method: "DELETE",
|
|
371
|
+
params: { id },
|
|
372
|
+
headers: config.headers
|
|
373
|
+
});
|
|
374
|
+
const data = response.data;
|
|
375
|
+
if (!data) throw toError(response.error);
|
|
376
|
+
return data;
|
|
377
|
+
},
|
|
378
|
+
onSettled: () => {
|
|
379
|
+
queryClient.invalidateQueries({
|
|
380
|
+
queryKey: queries.comments.list._def
|
|
381
|
+
});
|
|
382
|
+
queryClient.invalidateQueries({
|
|
383
|
+
queryKey: queries.commentCount.byResource._def
|
|
384
|
+
});
|
|
385
|
+
queryClient.invalidateQueries({ queryKey: ["commentsThread"] });
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
function useToggleLike(config, params) {
|
|
390
|
+
const queryClient = useQueryClient();
|
|
391
|
+
const client = getClient(config);
|
|
392
|
+
const queries = createCommentsQueryKeys(client, config.headers);
|
|
393
|
+
const isInfinite = !!params.infiniteKey && (params.parentId ?? null) === null;
|
|
394
|
+
const listKey = isInfinite ? params.infiniteKey : queries.comments.list({
|
|
395
|
+
resourceId: params.resourceId,
|
|
396
|
+
resourceType: params.resourceType,
|
|
397
|
+
parentId: params.parentId ?? null,
|
|
398
|
+
status: "approved",
|
|
399
|
+
currentUserId: params.currentUserId
|
|
400
|
+
}).queryKey;
|
|
401
|
+
function applyLikeUpdate(commentId, updater) {
|
|
402
|
+
if (isInfinite) {
|
|
403
|
+
queryClient.setQueryData(
|
|
404
|
+
listKey,
|
|
405
|
+
(old) => {
|
|
406
|
+
if (!old) return old;
|
|
407
|
+
return {
|
|
408
|
+
...old,
|
|
409
|
+
pages: old.pages.map((page) => ({
|
|
410
|
+
...page,
|
|
411
|
+
items: page.items.map(
|
|
412
|
+
(c) => c.id === commentId ? updater(c) : c
|
|
413
|
+
)
|
|
414
|
+
}))
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
} else {
|
|
419
|
+
queryClient.setQueryData(listKey, (old) => {
|
|
420
|
+
if (!old) return old;
|
|
421
|
+
return {
|
|
422
|
+
...old,
|
|
423
|
+
items: old.items.map((c) => c.id === commentId ? updater(c) : c)
|
|
424
|
+
};
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return useMutation({
|
|
429
|
+
mutationFn: async (input) => {
|
|
430
|
+
const response = await client("@post/comments/:id/like", {
|
|
431
|
+
method: "POST",
|
|
432
|
+
params: { id: input.commentId },
|
|
433
|
+
body: { authorId: input.authorId },
|
|
434
|
+
headers: config.headers
|
|
435
|
+
});
|
|
436
|
+
const data = response.data;
|
|
437
|
+
if (!data) throw toError(response.error);
|
|
438
|
+
return data;
|
|
439
|
+
},
|
|
440
|
+
onMutate: async (input) => {
|
|
441
|
+
await queryClient.cancelQueries({ queryKey: listKey });
|
|
442
|
+
const previous = isInfinite ? queryClient.getQueryData(listKey) : queryClient.getQueryData(listKey);
|
|
443
|
+
applyLikeUpdate(input.commentId, (c) => {
|
|
444
|
+
const wasLiked = c.isLikedByCurrentUser;
|
|
445
|
+
return {
|
|
446
|
+
...c,
|
|
447
|
+
isLikedByCurrentUser: !wasLiked,
|
|
448
|
+
likes: wasLiked ? Math.max(0, c.likes - 1) : c.likes + 1
|
|
449
|
+
};
|
|
450
|
+
});
|
|
451
|
+
return { previous };
|
|
452
|
+
},
|
|
453
|
+
onError: (_err, _input, context) => {
|
|
454
|
+
if (context?.previous !== void 0) {
|
|
455
|
+
queryClient.setQueryData(listKey, context.previous);
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
onSettled: () => {
|
|
459
|
+
queryClient.invalidateQueries({ queryKey: listKey });
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export { useApproveComment, useCommentCount, useComments, useDeleteComment, useInfiniteComments, usePostComment, useSuspenseComments, useSuspenseModerationComments, useToggleLike, useUpdateComment, useUpdateCommentStatus };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const COMMENTS_MODERATION = {
|
|
4
|
+
COMMENTS_MODERATION_TITLE: "Comment Moderation",
|
|
5
|
+
COMMENTS_MODERATION_DESCRIPTION: "Review and manage comments across all resources.",
|
|
6
|
+
COMMENTS_MODERATION_TAB_PENDING: "Pending",
|
|
7
|
+
COMMENTS_MODERATION_TAB_APPROVED: "Approved",
|
|
8
|
+
COMMENTS_MODERATION_TAB_SPAM: "Spam",
|
|
9
|
+
COMMENTS_MODERATION_SELECTED: "{n} selected",
|
|
10
|
+
COMMENTS_MODERATION_APPROVE_SELECTED: "Approve selected",
|
|
11
|
+
COMMENTS_MODERATION_DELETE_SELECTED: "Delete selected",
|
|
12
|
+
COMMENTS_MODERATION_EMPTY: "No {status} comments.",
|
|
13
|
+
COMMENTS_MODERATION_COL_AUTHOR: "Author",
|
|
14
|
+
COMMENTS_MODERATION_COL_COMMENT: "Comment",
|
|
15
|
+
COMMENTS_MODERATION_COL_RESOURCE: "Resource",
|
|
16
|
+
COMMENTS_MODERATION_COL_DATE: "Date",
|
|
17
|
+
COMMENTS_MODERATION_COL_ACTIONS: "Actions",
|
|
18
|
+
COMMENTS_MODERATION_SELECT_ALL: "Select all",
|
|
19
|
+
COMMENTS_MODERATION_SELECT_ONE: "Select comment",
|
|
20
|
+
COMMENTS_MODERATION_ACTION_VIEW: "View",
|
|
21
|
+
COMMENTS_MODERATION_ACTION_APPROVE: "Approve",
|
|
22
|
+
COMMENTS_MODERATION_ACTION_SPAM: "Mark as spam",
|
|
23
|
+
COMMENTS_MODERATION_ACTION_DELETE: "Delete",
|
|
24
|
+
COMMENTS_MODERATION_TOAST_APPROVED: "Comment approved",
|
|
25
|
+
COMMENTS_MODERATION_TOAST_APPROVE_ERROR: "Failed to approve comment",
|
|
26
|
+
COMMENTS_MODERATION_TOAST_SPAM: "Marked as spam",
|
|
27
|
+
COMMENTS_MODERATION_TOAST_SPAM_ERROR: "Failed to update status",
|
|
28
|
+
COMMENTS_MODERATION_TOAST_DELETED: "Comment deleted",
|
|
29
|
+
COMMENTS_MODERATION_TOAST_DELETED_PLURAL: "{n} comments deleted",
|
|
30
|
+
COMMENTS_MODERATION_TOAST_DELETE_ERROR: "Failed to delete comment(s)",
|
|
31
|
+
COMMENTS_MODERATION_TOAST_BULK_APPROVED: "{n} comment(s) approved",
|
|
32
|
+
COMMENTS_MODERATION_TOAST_BULK_APPROVE_ERROR: "Failed to approve comments",
|
|
33
|
+
COMMENTS_MODERATION_DIALOG_TITLE: "Comment Details",
|
|
34
|
+
COMMENTS_MODERATION_DIALOG_RESOURCE: "Resource",
|
|
35
|
+
COMMENTS_MODERATION_DIALOG_LIKES: "Likes",
|
|
36
|
+
COMMENTS_MODERATION_DIALOG_REPLY_TO: "Reply to",
|
|
37
|
+
COMMENTS_MODERATION_DIALOG_EDITED: "Edited",
|
|
38
|
+
COMMENTS_MODERATION_DIALOG_BODY: "Body",
|
|
39
|
+
COMMENTS_MODERATION_DIALOG_APPROVE: "Approve",
|
|
40
|
+
COMMENTS_MODERATION_DIALOG_MARK_SPAM: "Mark spam",
|
|
41
|
+
COMMENTS_MODERATION_DIALOG_DELETE: "Delete",
|
|
42
|
+
COMMENTS_MODERATION_DELETE_TITLE_SINGULAR: "Delete comment?",
|
|
43
|
+
COMMENTS_MODERATION_DELETE_TITLE_PLURAL: "Delete {n} comments?",
|
|
44
|
+
COMMENTS_MODERATION_DELETE_DESCRIPTION_SINGULAR: "This action cannot be undone. The comment will be permanently deleted.",
|
|
45
|
+
COMMENTS_MODERATION_DELETE_DESCRIPTION_PLURAL: "This action cannot be undone. The comments will be permanently deleted.",
|
|
46
|
+
COMMENTS_MODERATION_DELETE_CANCEL: "Cancel",
|
|
47
|
+
COMMENTS_MODERATION_DELETE_CONFIRM: "Delete",
|
|
48
|
+
COMMENTS_MODERATION_DELETE_DELETING: "Deleting\u2026",
|
|
49
|
+
COMMENTS_MODERATION_PAGINATION_PREVIOUS: "Previous",
|
|
50
|
+
COMMENTS_MODERATION_PAGINATION_NEXT: "Next",
|
|
51
|
+
COMMENTS_MODERATION_PAGINATION_SHOWING: "Showing {from}\u2013{to} of {total}",
|
|
52
|
+
COMMENTS_RESOURCE_TITLE: "Comments",
|
|
53
|
+
COMMENTS_RESOURCE_PENDING_SECTION: "Pending Review",
|
|
54
|
+
COMMENTS_RESOURCE_THREAD_SECTION: "Thread",
|
|
55
|
+
COMMENTS_RESOURCE_ACTION_APPROVE: "Approve",
|
|
56
|
+
COMMENTS_RESOURCE_ACTION_SPAM: "Spam",
|
|
57
|
+
COMMENTS_RESOURCE_ACTION_DELETE: "Delete",
|
|
58
|
+
COMMENTS_RESOURCE_DELETE_CONFIRM: "Delete this comment?",
|
|
59
|
+
COMMENTS_RESOURCE_TOAST_APPROVED: "Comment approved",
|
|
60
|
+
COMMENTS_RESOURCE_TOAST_APPROVE_ERROR: "Failed to approve",
|
|
61
|
+
COMMENTS_RESOURCE_TOAST_SPAM: "Marked as spam",
|
|
62
|
+
COMMENTS_RESOURCE_TOAST_SPAM_ERROR: "Failed to update",
|
|
63
|
+
COMMENTS_RESOURCE_TOAST_DELETED: "Comment deleted",
|
|
64
|
+
COMMENTS_RESOURCE_TOAST_DELETE_ERROR: "Failed to delete"
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.COMMENTS_MODERATION = COMMENTS_MODERATION;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const COMMENTS_MODERATION = {
|
|
2
|
+
COMMENTS_MODERATION_TITLE: "Comment Moderation",
|
|
3
|
+
COMMENTS_MODERATION_DESCRIPTION: "Review and manage comments across all resources.",
|
|
4
|
+
COMMENTS_MODERATION_TAB_PENDING: "Pending",
|
|
5
|
+
COMMENTS_MODERATION_TAB_APPROVED: "Approved",
|
|
6
|
+
COMMENTS_MODERATION_TAB_SPAM: "Spam",
|
|
7
|
+
COMMENTS_MODERATION_SELECTED: "{n} selected",
|
|
8
|
+
COMMENTS_MODERATION_APPROVE_SELECTED: "Approve selected",
|
|
9
|
+
COMMENTS_MODERATION_DELETE_SELECTED: "Delete selected",
|
|
10
|
+
COMMENTS_MODERATION_EMPTY: "No {status} comments.",
|
|
11
|
+
COMMENTS_MODERATION_COL_AUTHOR: "Author",
|
|
12
|
+
COMMENTS_MODERATION_COL_COMMENT: "Comment",
|
|
13
|
+
COMMENTS_MODERATION_COL_RESOURCE: "Resource",
|
|
14
|
+
COMMENTS_MODERATION_COL_DATE: "Date",
|
|
15
|
+
COMMENTS_MODERATION_COL_ACTIONS: "Actions",
|
|
16
|
+
COMMENTS_MODERATION_SELECT_ALL: "Select all",
|
|
17
|
+
COMMENTS_MODERATION_SELECT_ONE: "Select comment",
|
|
18
|
+
COMMENTS_MODERATION_ACTION_VIEW: "View",
|
|
19
|
+
COMMENTS_MODERATION_ACTION_APPROVE: "Approve",
|
|
20
|
+
COMMENTS_MODERATION_ACTION_SPAM: "Mark as spam",
|
|
21
|
+
COMMENTS_MODERATION_ACTION_DELETE: "Delete",
|
|
22
|
+
COMMENTS_MODERATION_TOAST_APPROVED: "Comment approved",
|
|
23
|
+
COMMENTS_MODERATION_TOAST_APPROVE_ERROR: "Failed to approve comment",
|
|
24
|
+
COMMENTS_MODERATION_TOAST_SPAM: "Marked as spam",
|
|
25
|
+
COMMENTS_MODERATION_TOAST_SPAM_ERROR: "Failed to update status",
|
|
26
|
+
COMMENTS_MODERATION_TOAST_DELETED: "Comment deleted",
|
|
27
|
+
COMMENTS_MODERATION_TOAST_DELETED_PLURAL: "{n} comments deleted",
|
|
28
|
+
COMMENTS_MODERATION_TOAST_DELETE_ERROR: "Failed to delete comment(s)",
|
|
29
|
+
COMMENTS_MODERATION_TOAST_BULK_APPROVED: "{n} comment(s) approved",
|
|
30
|
+
COMMENTS_MODERATION_TOAST_BULK_APPROVE_ERROR: "Failed to approve comments",
|
|
31
|
+
COMMENTS_MODERATION_DIALOG_TITLE: "Comment Details",
|
|
32
|
+
COMMENTS_MODERATION_DIALOG_RESOURCE: "Resource",
|
|
33
|
+
COMMENTS_MODERATION_DIALOG_LIKES: "Likes",
|
|
34
|
+
COMMENTS_MODERATION_DIALOG_REPLY_TO: "Reply to",
|
|
35
|
+
COMMENTS_MODERATION_DIALOG_EDITED: "Edited",
|
|
36
|
+
COMMENTS_MODERATION_DIALOG_BODY: "Body",
|
|
37
|
+
COMMENTS_MODERATION_DIALOG_APPROVE: "Approve",
|
|
38
|
+
COMMENTS_MODERATION_DIALOG_MARK_SPAM: "Mark spam",
|
|
39
|
+
COMMENTS_MODERATION_DIALOG_DELETE: "Delete",
|
|
40
|
+
COMMENTS_MODERATION_DELETE_TITLE_SINGULAR: "Delete comment?",
|
|
41
|
+
COMMENTS_MODERATION_DELETE_TITLE_PLURAL: "Delete {n} comments?",
|
|
42
|
+
COMMENTS_MODERATION_DELETE_DESCRIPTION_SINGULAR: "This action cannot be undone. The comment will be permanently deleted.",
|
|
43
|
+
COMMENTS_MODERATION_DELETE_DESCRIPTION_PLURAL: "This action cannot be undone. The comments will be permanently deleted.",
|
|
44
|
+
COMMENTS_MODERATION_DELETE_CANCEL: "Cancel",
|
|
45
|
+
COMMENTS_MODERATION_DELETE_CONFIRM: "Delete",
|
|
46
|
+
COMMENTS_MODERATION_DELETE_DELETING: "Deleting\u2026",
|
|
47
|
+
COMMENTS_MODERATION_PAGINATION_PREVIOUS: "Previous",
|
|
48
|
+
COMMENTS_MODERATION_PAGINATION_NEXT: "Next",
|
|
49
|
+
COMMENTS_MODERATION_PAGINATION_SHOWING: "Showing {from}\u2013{to} of {total}",
|
|
50
|
+
COMMENTS_RESOURCE_TITLE: "Comments",
|
|
51
|
+
COMMENTS_RESOURCE_PENDING_SECTION: "Pending Review",
|
|
52
|
+
COMMENTS_RESOURCE_THREAD_SECTION: "Thread",
|
|
53
|
+
COMMENTS_RESOURCE_ACTION_APPROVE: "Approve",
|
|
54
|
+
COMMENTS_RESOURCE_ACTION_SPAM: "Spam",
|
|
55
|
+
COMMENTS_RESOURCE_ACTION_DELETE: "Delete",
|
|
56
|
+
COMMENTS_RESOURCE_DELETE_CONFIRM: "Delete this comment?",
|
|
57
|
+
COMMENTS_RESOURCE_TOAST_APPROVED: "Comment approved",
|
|
58
|
+
COMMENTS_RESOURCE_TOAST_APPROVE_ERROR: "Failed to approve",
|
|
59
|
+
COMMENTS_RESOURCE_TOAST_SPAM: "Marked as spam",
|
|
60
|
+
COMMENTS_RESOURCE_TOAST_SPAM_ERROR: "Failed to update",
|
|
61
|
+
COMMENTS_RESOURCE_TOAST_DELETED: "Comment deleted",
|
|
62
|
+
COMMENTS_RESOURCE_TOAST_DELETE_ERROR: "Failed to delete"
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { COMMENTS_MODERATION };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const COMMENTS_MY = {
|
|
4
|
+
COMMENTS_MY_LOGIN_TITLE: "Please log in to view your comments",
|
|
5
|
+
COMMENTS_MY_LOGIN_DESCRIPTION: "You need to be logged in to see your comment history.",
|
|
6
|
+
COMMENTS_MY_EMPTY_TITLE: "No comments yet",
|
|
7
|
+
COMMENTS_MY_EMPTY_DESCRIPTION: "Comments you post will appear here.",
|
|
8
|
+
COMMENTS_MY_PAGE_TITLE: "My Comments",
|
|
9
|
+
COMMENTS_MY_COL_COMMENT: "Comment",
|
|
10
|
+
COMMENTS_MY_COL_RESOURCE: "Resource",
|
|
11
|
+
COMMENTS_MY_COL_STATUS: "Status",
|
|
12
|
+
COMMENTS_MY_COL_DATE: "Date",
|
|
13
|
+
COMMENTS_MY_REPLY_INDICATOR: "\u21A9 Reply",
|
|
14
|
+
COMMENTS_MY_VIEW_LINK: "View",
|
|
15
|
+
COMMENTS_MY_STATUS_APPROVED: "Approved",
|
|
16
|
+
COMMENTS_MY_STATUS_PENDING: "Pending",
|
|
17
|
+
COMMENTS_MY_STATUS_SPAM: "Spam",
|
|
18
|
+
COMMENTS_MY_TOAST_DELETED: "Comment deleted",
|
|
19
|
+
COMMENTS_MY_TOAST_DELETE_ERROR: "Failed to delete comment",
|
|
20
|
+
COMMENTS_MY_DELETE_TITLE: "Delete comment?",
|
|
21
|
+
COMMENTS_MY_DELETE_DESCRIPTION: "This action cannot be undone. The comment will be permanently removed.",
|
|
22
|
+
COMMENTS_MY_DELETE_CANCEL: "Cancel",
|
|
23
|
+
COMMENTS_MY_DELETE_CONFIRM: "Delete",
|
|
24
|
+
COMMENTS_MY_DELETE_BUTTON_SR: "Delete comment"
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.COMMENTS_MY = COMMENTS_MY;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const COMMENTS_MY = {
|
|
2
|
+
COMMENTS_MY_LOGIN_TITLE: "Please log in to view your comments",
|
|
3
|
+
COMMENTS_MY_LOGIN_DESCRIPTION: "You need to be logged in to see your comment history.",
|
|
4
|
+
COMMENTS_MY_EMPTY_TITLE: "No comments yet",
|
|
5
|
+
COMMENTS_MY_EMPTY_DESCRIPTION: "Comments you post will appear here.",
|
|
6
|
+
COMMENTS_MY_PAGE_TITLE: "My Comments",
|
|
7
|
+
COMMENTS_MY_COL_COMMENT: "Comment",
|
|
8
|
+
COMMENTS_MY_COL_RESOURCE: "Resource",
|
|
9
|
+
COMMENTS_MY_COL_STATUS: "Status",
|
|
10
|
+
COMMENTS_MY_COL_DATE: "Date",
|
|
11
|
+
COMMENTS_MY_REPLY_INDICATOR: "\u21A9 Reply",
|
|
12
|
+
COMMENTS_MY_VIEW_LINK: "View",
|
|
13
|
+
COMMENTS_MY_STATUS_APPROVED: "Approved",
|
|
14
|
+
COMMENTS_MY_STATUS_PENDING: "Pending",
|
|
15
|
+
COMMENTS_MY_STATUS_SPAM: "Spam",
|
|
16
|
+
COMMENTS_MY_TOAST_DELETED: "Comment deleted",
|
|
17
|
+
COMMENTS_MY_TOAST_DELETE_ERROR: "Failed to delete comment",
|
|
18
|
+
COMMENTS_MY_DELETE_TITLE: "Delete comment?",
|
|
19
|
+
COMMENTS_MY_DELETE_DESCRIPTION: "This action cannot be undone. The comment will be permanently removed.",
|
|
20
|
+
COMMENTS_MY_DELETE_CANCEL: "Cancel",
|
|
21
|
+
COMMENTS_MY_DELETE_CONFIRM: "Delete",
|
|
22
|
+
COMMENTS_MY_DELETE_BUTTON_SR: "Delete comment"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { COMMENTS_MY };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const COMMENTS_THREAD = {
|
|
4
|
+
COMMENTS_TITLE: "Comments",
|
|
5
|
+
COMMENTS_EMPTY: "Be the first to comment.",
|
|
6
|
+
COMMENTS_EDITED_BADGE: "(edited)",
|
|
7
|
+
COMMENTS_PENDING_BADGE: "Pending approval",
|
|
8
|
+
COMMENTS_LIKE_ARIA: "Like",
|
|
9
|
+
COMMENTS_UNLIKE_ARIA: "Unlike",
|
|
10
|
+
COMMENTS_REPLY_BUTTON: "Reply",
|
|
11
|
+
COMMENTS_EDIT_BUTTON: "Edit",
|
|
12
|
+
COMMENTS_DELETE_BUTTON: "Delete",
|
|
13
|
+
COMMENTS_SAVE_EDIT: "Save",
|
|
14
|
+
COMMENTS_REPLIES_SINGULAR: "reply",
|
|
15
|
+
COMMENTS_REPLIES_PLURAL: "replies",
|
|
16
|
+
COMMENTS_HIDE_REPLIES: "Hide replies",
|
|
17
|
+
COMMENTS_DELETE_CONFIRM: "Delete this comment?",
|
|
18
|
+
COMMENTS_LOGIN_PROMPT: "Please sign in to leave a comment.",
|
|
19
|
+
COMMENTS_LOGIN_LINK: "Sign in",
|
|
20
|
+
COMMENTS_FORM_PLACEHOLDER: "Write a comment\u2026",
|
|
21
|
+
COMMENTS_FORM_CANCEL: "Cancel",
|
|
22
|
+
COMMENTS_FORM_POST_COMMENT: "Post comment",
|
|
23
|
+
COMMENTS_FORM_POST_REPLY: "Post reply",
|
|
24
|
+
COMMENTS_FORM_POSTING: "Posting\u2026",
|
|
25
|
+
COMMENTS_FORM_SUBMIT_ERROR: "Failed to submit comment",
|
|
26
|
+
COMMENTS_LOAD_MORE: "Load more comments",
|
|
27
|
+
COMMENTS_LOADING_MORE: "Loading\u2026"
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.COMMENTS_THREAD = COMMENTS_THREAD;
|