@apolitical/component-library 1.13.3-beta.4 → 1.13.4-beta.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.
- package/banners/banner-section/banner-section.d.ts +3 -5
- package/discussion/components/post/post.d.ts +1 -1
- package/discussion/components/thread/thread.d.ts +3 -3
- package/discussion/feeds/replies-feed/replies-feed.d.ts +7 -2
- package/discussion/feeds/replies-feed/replies-feed.handlers.d.ts +6 -2
- package/discussion/feeds/replies-to-replies-feed/index.d.ts +1 -0
- package/discussion/feeds/replies-to-replies-feed/replies-to-replies-feed.d.ts +35 -0
- package/discussion/feeds/replies-to-replies-feed/replies-to-replies-feed.handlers.d.ts +134 -0
- package/general/divider/divider.d.ts +1 -3
- package/index.js +14 -14
- package/index.mjs +2271 -2068
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/base/_index.scss +1 -1
- package/styles/variables/sizes/_common.scss +0 -3
- package/styles/base/_layout.scss +0 -10
|
@@ -5,7 +5,7 @@ interface ContentPropObject {
|
|
|
5
5
|
/** The text to display */
|
|
6
6
|
text: string;
|
|
7
7
|
/** The element to wrap the text in */
|
|
8
|
-
element?:
|
|
8
|
+
element?: typeof allowedElements[number];
|
|
9
9
|
}
|
|
10
10
|
type ContentPropType = false | string | ContentPropObject;
|
|
11
11
|
interface ContentType {
|
|
@@ -17,8 +17,6 @@ interface ContentType {
|
|
|
17
17
|
text?: ContentPropType;
|
|
18
18
|
}
|
|
19
19
|
export interface BannerSectionType {
|
|
20
|
-
/** Additional className */
|
|
21
|
-
className?: string;
|
|
22
20
|
/** The content to display */
|
|
23
21
|
content: ContentType;
|
|
24
22
|
/** The image to display */
|
|
@@ -26,7 +24,7 @@ export interface BannerSectionType {
|
|
|
26
24
|
/** The colour variant (when there's no image) */
|
|
27
25
|
variant?: 'default' | 'light';
|
|
28
26
|
/** How to handle spacing on the banner */
|
|
29
|
-
spacing?: 'normal' | '
|
|
27
|
+
spacing?: 'normal' | 'compact';
|
|
30
28
|
/** The CTA to display */
|
|
31
29
|
cta?: {
|
|
32
30
|
text: string;
|
|
@@ -38,5 +36,5 @@ export interface BannerSectionType {
|
|
|
38
36
|
/** Any additional children */
|
|
39
37
|
children?: React.ReactNode;
|
|
40
38
|
}
|
|
41
|
-
declare const _default: React.MemoExoticComponent<({
|
|
39
|
+
declare const _default: React.MemoExoticComponent<({ content: contentProp, image, variant, spacing, cta, children }: BannerSectionType) => import("react/jsx-runtime").JSX.Element>;
|
|
42
40
|
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface Props {
|
|
3
|
-
/** If the thread is open or not */
|
|
4
|
-
isOpen?: boolean;
|
|
5
3
|
/** The number of posts in the thread */
|
|
6
4
|
count?: number;
|
|
5
|
+
/** Whether to show the show replies button or not */
|
|
6
|
+
showRepliesButton?: boolean;
|
|
7
7
|
/** The posts to render */
|
|
8
8
|
children: React.ReactNode | JSX.Element | JSX.Element[];
|
|
9
9
|
}
|
|
10
|
-
declare const Thread: ({
|
|
10
|
+
declare const Thread: ({ count, showRepliesButton, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default Thread;
|
|
@@ -7,7 +7,11 @@ interface Props {
|
|
|
7
7
|
repliesList: IReply[] | undefined;
|
|
8
8
|
isMember: boolean;
|
|
9
9
|
functions: {
|
|
10
|
-
createReply: (
|
|
10
|
+
createReply: ({ activityId, replyId, content, }: {
|
|
11
|
+
activityId?: string;
|
|
12
|
+
replyId?: string;
|
|
13
|
+
content: string;
|
|
14
|
+
}) => Promise<void>;
|
|
11
15
|
editReply: ({ parentId, replyId, content, }: {
|
|
12
16
|
parentId: string;
|
|
13
17
|
replyId: string;
|
|
@@ -15,8 +19,9 @@ interface Props {
|
|
|
15
19
|
body: string;
|
|
16
20
|
};
|
|
17
21
|
}) => Promise<void>;
|
|
18
|
-
like: ({ replyId }: {
|
|
22
|
+
like: ({ replyId, replyParentId, }: {
|
|
19
23
|
replyId: string;
|
|
24
|
+
replyParentId?: string;
|
|
20
25
|
}) => Promise<void>;
|
|
21
26
|
unlike: ({ replyId }: {
|
|
22
27
|
replyId: string;
|
|
@@ -4,10 +4,14 @@ import { IUserContext } from '../../..';
|
|
|
4
4
|
interface buildAddReplyHandlersProps {
|
|
5
5
|
queryClient: QueryClient;
|
|
6
6
|
queryKey: QueryKey;
|
|
7
|
-
mutationFn: (
|
|
7
|
+
mutationFn: (content: {
|
|
8
|
+
body: string;
|
|
9
|
+
}) => Promise<void>;
|
|
8
10
|
}
|
|
9
11
|
export declare const buildAddReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildAddReplyHandlersProps) => {
|
|
10
|
-
mutationFn: (
|
|
12
|
+
mutationFn: (content: {
|
|
13
|
+
body: string;
|
|
14
|
+
}) => Promise<void>;
|
|
11
15
|
onMutate: () => Promise<void>;
|
|
12
16
|
onError: (_err: {
|
|
13
17
|
[key: string]: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RepliesFeed } from './replies-to-replies-feed';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IReply } from '../../getstream';
|
|
3
|
+
interface Props {
|
|
4
|
+
basePath: string;
|
|
5
|
+
parentId: string;
|
|
6
|
+
replyParentId: string;
|
|
7
|
+
activityId: string;
|
|
8
|
+
replyCount: number;
|
|
9
|
+
replies: IReply[] | undefined;
|
|
10
|
+
isMember: boolean;
|
|
11
|
+
functions: {
|
|
12
|
+
create: ({ activityId, replyId, content, }: {
|
|
13
|
+
activityId?: string;
|
|
14
|
+
replyId?: string;
|
|
15
|
+
content: string;
|
|
16
|
+
}) => Promise<void>;
|
|
17
|
+
edit: ({ parentId, replyId, content, }: {
|
|
18
|
+
parentId: string;
|
|
19
|
+
replyId: string;
|
|
20
|
+
content: {
|
|
21
|
+
body: string;
|
|
22
|
+
};
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
like: ({ replyId }: {
|
|
25
|
+
replyId: string;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
unlike: ({ replyId }: {
|
|
28
|
+
replyId: string;
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
join: () => Promise<void>;
|
|
31
|
+
leave: () => Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
declare const RepliesToRepliesFeed: React.FC<Props>;
|
|
35
|
+
export default RepliesToRepliesFeed;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { QueryClient, QueryKey } from '@tanstack/query-core';
|
|
2
|
+
import { IActivity, ILike, IReply } from '../../getstream';
|
|
3
|
+
import { IUserContext } from '../../../context';
|
|
4
|
+
interface buildAddReplyToReplyHandlersProps {
|
|
5
|
+
queryClient: QueryClient;
|
|
6
|
+
queryKey: QueryKey;
|
|
7
|
+
mutationFn: (content: {
|
|
8
|
+
body: string;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const buildAddReplyToReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildAddReplyToReplyHandlersProps) => {
|
|
12
|
+
mutationFn: (content: {
|
|
13
|
+
body: string;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
onMutate: () => Promise<void>;
|
|
16
|
+
onSuccess: (data: IReply) => {
|
|
17
|
+
previousActivity: IActivity | undefined;
|
|
18
|
+
};
|
|
19
|
+
onError: (_err: {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
}, _changedActivity: {
|
|
22
|
+
activityId: string;
|
|
23
|
+
}, context: {
|
|
24
|
+
previousActivity: IActivity;
|
|
25
|
+
}) => void;
|
|
26
|
+
onSettled: () => void;
|
|
27
|
+
};
|
|
28
|
+
interface buildEditReplyToReplyHandlersProps {
|
|
29
|
+
queryClient: QueryClient;
|
|
30
|
+
queryKey: QueryKey;
|
|
31
|
+
mutationFn: ({ parentId, replyId, content, }: {
|
|
32
|
+
parentId: string;
|
|
33
|
+
replyId: string;
|
|
34
|
+
content: {
|
|
35
|
+
body: string;
|
|
36
|
+
};
|
|
37
|
+
}) => Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export declare const buildEditReplyToReplyHanders: ({ queryClient, queryKey, mutationFn, }: buildEditReplyToReplyHandlersProps) => {
|
|
40
|
+
mutationFn: ({ parentId, replyId, content, }: {
|
|
41
|
+
parentId: string;
|
|
42
|
+
replyId: string;
|
|
43
|
+
content: {
|
|
44
|
+
body: string;
|
|
45
|
+
};
|
|
46
|
+
}) => Promise<void>;
|
|
47
|
+
onError: (_err: {
|
|
48
|
+
[key: string]: string;
|
|
49
|
+
}, _changedActivity: {
|
|
50
|
+
activityId: string;
|
|
51
|
+
}, context: {
|
|
52
|
+
previousActivity: IActivity;
|
|
53
|
+
}) => void;
|
|
54
|
+
onMutate: ({ replyInfo, content: { body }, }: {
|
|
55
|
+
replyInfo: {
|
|
56
|
+
parentId: string;
|
|
57
|
+
replySlug: string;
|
|
58
|
+
replyParentId: string;
|
|
59
|
+
};
|
|
60
|
+
content: {
|
|
61
|
+
body: string;
|
|
62
|
+
};
|
|
63
|
+
}) => Promise<{
|
|
64
|
+
previousActivity: IActivity;
|
|
65
|
+
} | undefined>;
|
|
66
|
+
};
|
|
67
|
+
interface buildLikeReplyHandlersProps {
|
|
68
|
+
queryClient: QueryClient;
|
|
69
|
+
queryKey: QueryKey;
|
|
70
|
+
mutationFn: ({ replyId, replyParentId, }: {
|
|
71
|
+
replyId: string;
|
|
72
|
+
replyParentId?: string;
|
|
73
|
+
}) => Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
export declare const buildLikeReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildLikeReplyHandlersProps) => {
|
|
76
|
+
mutationFn: ({ replyId, replyParentId, }: {
|
|
77
|
+
replyId: string;
|
|
78
|
+
replyParentId?: string | undefined;
|
|
79
|
+
}) => Promise<void>;
|
|
80
|
+
onMutate: ({ replyId, replyParentId, }: {
|
|
81
|
+
replyId: string;
|
|
82
|
+
replyParentId?: string | undefined;
|
|
83
|
+
}) => Promise<{
|
|
84
|
+
previousActivity: IActivity | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
onError: (_err: {
|
|
87
|
+
[key: string]: string;
|
|
88
|
+
}, _newActivity: {
|
|
89
|
+
activityId: string;
|
|
90
|
+
}, context: {
|
|
91
|
+
previousActivity: IActivity;
|
|
92
|
+
}) => void;
|
|
93
|
+
onSuccess: (data: ILike, variables: {
|
|
94
|
+
replyId: string;
|
|
95
|
+
replyParentId?: string;
|
|
96
|
+
}) => {
|
|
97
|
+
previousActivity: IActivity | undefined;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
interface buildUnlikeReplyHandlersProps {
|
|
101
|
+
queryClient: QueryClient;
|
|
102
|
+
queryKey: QueryKey;
|
|
103
|
+
user: IUserContext | null;
|
|
104
|
+
mutationFn: ({ replyId, replyParentId, }: {
|
|
105
|
+
replyId: string;
|
|
106
|
+
replyParentId?: string;
|
|
107
|
+
}) => Promise<void>;
|
|
108
|
+
}
|
|
109
|
+
export declare const buildUnlikeReplyHandlers: ({ queryClient, queryKey, mutationFn, user, }: buildUnlikeReplyHandlersProps) => {
|
|
110
|
+
mutationFn: ({ replyId, replyParentId, }: {
|
|
111
|
+
replyId: string;
|
|
112
|
+
replyParentId?: string | undefined;
|
|
113
|
+
}) => Promise<void>;
|
|
114
|
+
onMutate: ({ replyId, replyParentId, }: {
|
|
115
|
+
replyId: string;
|
|
116
|
+
replyParentId?: string | undefined;
|
|
117
|
+
}) => Promise<{
|
|
118
|
+
previousActivity: IActivity | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
onError: (_err: {
|
|
121
|
+
[key: string]: string;
|
|
122
|
+
}, _newActivity: {
|
|
123
|
+
activityId: string;
|
|
124
|
+
}, context: {
|
|
125
|
+
previousActivity: IActivity;
|
|
126
|
+
}) => void;
|
|
127
|
+
onSuccess: (_data: ILike, variables: {
|
|
128
|
+
replyId: string;
|
|
129
|
+
replyParentId?: string;
|
|
130
|
+
}) => {
|
|
131
|
+
previousActivity: IActivity | undefined;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
interface Props {
|
|
2
|
-
/** Additional className */
|
|
3
|
-
className?: string;
|
|
4
2
|
/** The maximum width of the divider */
|
|
5
3
|
maxWidth?: number | false;
|
|
6
4
|
}
|
|
7
|
-
declare const _default: ({
|
|
5
|
+
declare const _default: ({ maxWidth }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
6
|
export default _default;
|