@apolitical/component-library 8.3.2-bht.0 → 8.3.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/discussion/components/post/post.d.ts +2 -1
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/parse-replies.d.ts +3 -2
- package/discussion/feeds/replies-feed/components/nested-replies-feed/nested-replies-feed.d.ts +2 -1
- package/discussion/feeds/replies-feed/components/reply-item/reply-item.d.ts +3 -2
- package/discussion/feeds/replies-feed/index.d.ts +1 -1
- package/discussion/feeds/replies-feed/mocks/course-discussion-replies-feed.mock.d.ts +144 -0
- package/discussion/feeds/replies-feed/mocks/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/replies-feed.d.ts +2 -1
- package/discussion/sections/activity-section/activity-section.d.ts +2 -1
- package/discussion/sections/activity-section/activity-section.mock.d.ts +52 -1
- package/discussion/sections/activity-section/mocks/course-discussion-activity-section.mock.d.ts +57 -0
- package/discussion/shared/helpers/get-localised-content.helper.d.ts +11 -0
- package/discussion/shared/helpers/index.d.ts +1 -0
- package/discussion/shared/interfaces/activity.interface.d.ts +3 -1
- package/discussion/shared/interfaces/discussion.interface.d.ts +4 -0
- package/index.js +67 -67
- package/index.mjs +8730 -8148
- package/package.json +1 -1
|
@@ -96,6 +96,7 @@ export interface IDiscussionPostProps {
|
|
|
96
96
|
basePath: string;
|
|
97
97
|
/** The ID of the parent, used for slugs */
|
|
98
98
|
parentId: string;
|
|
99
|
+
disableMentions?: boolean;
|
|
99
100
|
}
|
|
100
|
-
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges, basePath, parentId, locale, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges, basePath, parentId, locale, disableMentions, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
101
102
|
export default Post;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IUserContext } from '../../../../../../../context';
|
|
2
|
-
import { IMentions, IReaction } from '../../../../../../../discussion/shared';
|
|
2
|
+
import { DiscussionType, IMentions, IReaction } from '../../../../../../../discussion/shared';
|
|
3
3
|
import { DefaultGenerics, EnrichedUser } from 'getstream';
|
|
4
4
|
interface ExtractedReplyData {
|
|
5
5
|
mentions?: IMentions;
|
|
@@ -21,8 +21,9 @@ export interface IParsedReplies {
|
|
|
21
21
|
parent: string;
|
|
22
22
|
user: EnrichedUser<DefaultGenerics> | undefined;
|
|
23
23
|
}
|
|
24
|
-
export declare function parseReplies({ replies, user, }: {
|
|
24
|
+
export declare function parseReplies({ replies, user, replyType, }: {
|
|
25
25
|
replies: IReaction[];
|
|
26
26
|
user: IUserContext;
|
|
27
|
+
replyType?: DiscussionType;
|
|
27
28
|
}): IParsedReplies[];
|
|
28
29
|
export {};
|
package/discussion/feeds/replies-feed/components/nested-replies-feed/nested-replies-feed.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type IDiscussionFormFns } from '../../../../../discussion/shared';
|
|
2
|
+
import { DiscussionType, type IDiscussionFormFns } from '../../../../../discussion/shared';
|
|
3
3
|
import { ILikesFeedQueryFns } from '../../../../../discussion/feeds/likes-feed';
|
|
4
4
|
import { type IQueryFns } from '../../cache';
|
|
5
5
|
interface NestedRepliesFunctions {
|
|
@@ -22,6 +22,7 @@ interface Props {
|
|
|
22
22
|
isMember: boolean;
|
|
23
23
|
/** Functions for the replies query */
|
|
24
24
|
functions: NestedRepliesFunctions;
|
|
25
|
+
type?: DiscussionType;
|
|
25
26
|
}
|
|
26
27
|
declare const NestedRepliesFeed: React.FC<Props>;
|
|
27
28
|
export default NestedRepliesFeed;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ILikesFeedQueryFns } from '../../../../../discussion/feeds/likes-feed';
|
|
3
|
-
import { type IDiscussionFormFns } from '../../../../../discussion/shared';
|
|
3
|
+
import { DiscussionType, type IDiscussionFormFns } from '../../../../../discussion/shared';
|
|
4
4
|
import type { IParsedReplies, IQueryFns } from '../../cache';
|
|
5
5
|
interface IMutations {
|
|
6
6
|
edit: (params: {
|
|
@@ -38,6 +38,7 @@ interface Props {
|
|
|
38
38
|
mutations: IMutations;
|
|
39
39
|
likes: ILikesFeedQueryFns;
|
|
40
40
|
};
|
|
41
|
+
type?: DiscussionType;
|
|
41
42
|
}
|
|
42
|
-
export default function ReplyItem({ formFns, activityId, basePath, focus, isMember, parentId, reply, }: Props): JSX.Element;
|
|
43
|
+
export default function ReplyItem({ formFns, activityId, basePath, focus, isMember, parentId, reply, type, }: Props): JSX.Element;
|
|
43
44
|
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export declare const courseDiscussionRepliesFeedMock: {
|
|
2
|
+
next: string;
|
|
3
|
+
results: ({
|
|
4
|
+
created_at: string;
|
|
5
|
+
updated_at: string;
|
|
6
|
+
id: string;
|
|
7
|
+
user_id: string;
|
|
8
|
+
user: {
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
id: string;
|
|
12
|
+
data: {
|
|
13
|
+
name: string;
|
|
14
|
+
badges: {
|
|
15
|
+
communities: {
|
|
16
|
+
'community-slug': string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
kind: string;
|
|
22
|
+
activity_id: string;
|
|
23
|
+
data: {
|
|
24
|
+
content: {
|
|
25
|
+
original: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
parent: string;
|
|
29
|
+
latest_children: {
|
|
30
|
+
reply?: undefined;
|
|
31
|
+
};
|
|
32
|
+
children_counts: {
|
|
33
|
+
reply?: undefined;
|
|
34
|
+
};
|
|
35
|
+
own_children?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
created_at: string;
|
|
38
|
+
updated_at: string;
|
|
39
|
+
id: string;
|
|
40
|
+
user_id: string;
|
|
41
|
+
user: {
|
|
42
|
+
created_at: string;
|
|
43
|
+
updated_at: string;
|
|
44
|
+
id: string;
|
|
45
|
+
data: {
|
|
46
|
+
name: string;
|
|
47
|
+
badges?: undefined;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
kind: string;
|
|
51
|
+
activity_id: string;
|
|
52
|
+
data: {
|
|
53
|
+
content: {
|
|
54
|
+
original: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
parent: string;
|
|
58
|
+
latest_children: {
|
|
59
|
+
reply: {
|
|
60
|
+
created_at: string;
|
|
61
|
+
updated_at: string;
|
|
62
|
+
id: string;
|
|
63
|
+
user_id: string;
|
|
64
|
+
user: {
|
|
65
|
+
created_at: string;
|
|
66
|
+
updated_at: string;
|
|
67
|
+
id: string;
|
|
68
|
+
data: {
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
kind: string;
|
|
73
|
+
activity_id: string;
|
|
74
|
+
data: {
|
|
75
|
+
content: {
|
|
76
|
+
original: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
parent: string;
|
|
80
|
+
latest_children: {};
|
|
81
|
+
children_counts: {};
|
|
82
|
+
}[];
|
|
83
|
+
};
|
|
84
|
+
own_children: {
|
|
85
|
+
reply: {
|
|
86
|
+
created_at: string;
|
|
87
|
+
updated_at: string;
|
|
88
|
+
id: string;
|
|
89
|
+
user_id: string;
|
|
90
|
+
user: {
|
|
91
|
+
created_at: string;
|
|
92
|
+
updated_at: string;
|
|
93
|
+
id: string;
|
|
94
|
+
data: {
|
|
95
|
+
name: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
kind: string;
|
|
99
|
+
activity_id: string;
|
|
100
|
+
data: {
|
|
101
|
+
content: {
|
|
102
|
+
original: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
parent: string;
|
|
106
|
+
latest_children: {};
|
|
107
|
+
children_counts: {};
|
|
108
|
+
}[];
|
|
109
|
+
};
|
|
110
|
+
children_counts: {
|
|
111
|
+
reply: number;
|
|
112
|
+
};
|
|
113
|
+
} | {
|
|
114
|
+
created_at: string;
|
|
115
|
+
updated_at: string;
|
|
116
|
+
id: string;
|
|
117
|
+
user_id: string;
|
|
118
|
+
user: {
|
|
119
|
+
created_at: string;
|
|
120
|
+
updated_at: string;
|
|
121
|
+
id: string;
|
|
122
|
+
data: {
|
|
123
|
+
name: string;
|
|
124
|
+
badges?: undefined;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
kind: string;
|
|
128
|
+
activity_id: string;
|
|
129
|
+
data: {
|
|
130
|
+
content: {
|
|
131
|
+
original: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
parent: string;
|
|
135
|
+
latest_children: {
|
|
136
|
+
reply?: undefined;
|
|
137
|
+
};
|
|
138
|
+
children_counts: {
|
|
139
|
+
reply?: undefined;
|
|
140
|
+
};
|
|
141
|
+
own_children?: undefined;
|
|
142
|
+
})[];
|
|
143
|
+
duration: string;
|
|
144
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type IProfileFormProps } from '../../../form';
|
|
3
|
-
import { type IDiscussionFormFns } from '../../../discussion/shared';
|
|
3
|
+
import { DiscussionType, type IDiscussionFormFns } from '../../../discussion/shared';
|
|
4
4
|
import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
5
5
|
import { type IQueryFns } from './cache';
|
|
6
6
|
interface RepliesFunctions {
|
|
@@ -32,6 +32,7 @@ interface Props {
|
|
|
32
32
|
profile: IProfileFormProps;
|
|
33
33
|
/** Whether to show the replies */
|
|
34
34
|
showReplies: boolean;
|
|
35
|
+
type?: DiscussionType;
|
|
35
36
|
}
|
|
36
37
|
declare const RepliesFeed: React.FC<Props>;
|
|
37
38
|
export default RepliesFeed;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type IProfileFormProps } from '../../../form';
|
|
3
3
|
import { type ILikesFeedQueryFns, type IRepliesFeedQueryFns } from '../../../discussion/feeds';
|
|
4
|
-
import { type IDiscussionFormFns } from '../../../discussion/shared';
|
|
4
|
+
import { type IDiscussionFormFns, DiscussionType } from '../../../discussion/shared';
|
|
5
5
|
import { type IQueryFns } from './cache';
|
|
6
6
|
import { ICategory } from '../../shared';
|
|
7
7
|
interface IActivitySectionQueryFns extends IQueryFns {
|
|
@@ -26,6 +26,7 @@ export interface IActivitySectionProps {
|
|
|
26
26
|
categories?: ICategory[];
|
|
27
27
|
/** The locale of the page */
|
|
28
28
|
locale?: string;
|
|
29
|
+
type?: DiscussionType;
|
|
29
30
|
}
|
|
30
31
|
declare const ActivitySection: React.FC<IActivitySectionProps>;
|
|
31
32
|
export default ActivitySection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { DiscussionType, type IActivity, type IReaction } from '../../shared';
|
|
2
2
|
import { type IMention } from '../../../form';
|
|
3
3
|
export declare const functions: {
|
|
4
4
|
activities: {
|
|
@@ -101,3 +101,54 @@ export declare const args: {
|
|
|
101
101
|
slug: string;
|
|
102
102
|
}[];
|
|
103
103
|
};
|
|
104
|
+
export declare const argsForCourseDiscussion: {
|
|
105
|
+
basePath: string;
|
|
106
|
+
parentId: string;
|
|
107
|
+
activityId: string;
|
|
108
|
+
isMember: boolean;
|
|
109
|
+
isOwner: boolean;
|
|
110
|
+
profile: {
|
|
111
|
+
hooks: {
|
|
112
|
+
useMaps: () => {
|
|
113
|
+
buildLocation: (input: string) => Promise<{
|
|
114
|
+
id: string;
|
|
115
|
+
en: string;
|
|
116
|
+
code: string;
|
|
117
|
+
}>;
|
|
118
|
+
isValidPlace: (input: string) => boolean;
|
|
119
|
+
predictPlaces: (input: string) => Promise<never[]>;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
functions: {
|
|
123
|
+
uploadImage: () => Promise<void>;
|
|
124
|
+
onSuccess: () => Promise<void>;
|
|
125
|
+
onFailure: () => void;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
type: DiscussionType;
|
|
129
|
+
functions: {
|
|
130
|
+
activities: {
|
|
131
|
+
read: () => Promise<IActivity>;
|
|
132
|
+
};
|
|
133
|
+
reactions: {
|
|
134
|
+
list: () => Promise<{
|
|
135
|
+
results: IReaction[];
|
|
136
|
+
next: string;
|
|
137
|
+
duration: string;
|
|
138
|
+
}>;
|
|
139
|
+
};
|
|
140
|
+
form: {
|
|
141
|
+
listMembers: () => Promise<IMention[]>;
|
|
142
|
+
clickMentionFallback: () => Promise<unknown>;
|
|
143
|
+
};
|
|
144
|
+
likes: {
|
|
145
|
+
list: () => Promise<{
|
|
146
|
+
results: never[];
|
|
147
|
+
next: string;
|
|
148
|
+
duration: string;
|
|
149
|
+
}>;
|
|
150
|
+
};
|
|
151
|
+
join: () => Promise<void>;
|
|
152
|
+
leave: () => Promise<void>;
|
|
153
|
+
};
|
|
154
|
+
};
|
package/discussion/sections/activity-section/mocks/course-discussion-activity-section.mock.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const courseDiscussionActivitySectionMock: {
|
|
2
|
+
POST: {
|
|
3
|
+
actor: {
|
|
4
|
+
created_at: string;
|
|
5
|
+
updated_at: string;
|
|
6
|
+
id: string;
|
|
7
|
+
data: {
|
|
8
|
+
jobTitle: string;
|
|
9
|
+
name: string;
|
|
10
|
+
organization: string;
|
|
11
|
+
location: {
|
|
12
|
+
en: string;
|
|
13
|
+
};
|
|
14
|
+
badges: {
|
|
15
|
+
communities: {
|
|
16
|
+
'community-slug': string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
categories: never[];
|
|
22
|
+
content: {
|
|
23
|
+
en: string;
|
|
24
|
+
es: string;
|
|
25
|
+
fr: string;
|
|
26
|
+
pt: string;
|
|
27
|
+
};
|
|
28
|
+
feed_id: string;
|
|
29
|
+
foreign_id: string;
|
|
30
|
+
id: string;
|
|
31
|
+
latest_reactions: {
|
|
32
|
+
like: never[];
|
|
33
|
+
reply: never[];
|
|
34
|
+
};
|
|
35
|
+
latest_reactions_extra: {
|
|
36
|
+
like: never[];
|
|
37
|
+
reply: never[];
|
|
38
|
+
};
|
|
39
|
+
object: string;
|
|
40
|
+
origin: null;
|
|
41
|
+
own_reactions: {
|
|
42
|
+
like: never[];
|
|
43
|
+
reply: never[];
|
|
44
|
+
};
|
|
45
|
+
reaction_counts: {
|
|
46
|
+
like: number;
|
|
47
|
+
reply: number;
|
|
48
|
+
};
|
|
49
|
+
target: string;
|
|
50
|
+
time: string;
|
|
51
|
+
verb: string;
|
|
52
|
+
};
|
|
53
|
+
POLL: {
|
|
54
|
+
total_replies: number;
|
|
55
|
+
verb: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const getLocalisedActivityContent: ({ content, locale, }: {
|
|
2
|
+
content: {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
locale: string;
|
|
6
|
+
}) => string;
|
|
7
|
+
export declare const getLocalisedReactionContent: ({ content, }: {
|
|
8
|
+
content: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
}) => string;
|
|
@@ -4,6 +4,10 @@ import type { ListMembers, ClickMentionFallback } from '../../../form';
|
|
|
4
4
|
import type { IEnrichedUrlData } from '../../../navigation';
|
|
5
5
|
import type { ICategory } from './community.category.interface';
|
|
6
6
|
import type { ILikesFeedQueryFns, ICreatePollVars } from '../../../discussion/feeds';
|
|
7
|
+
export declare enum DiscussionType {
|
|
8
|
+
Communities = "communities",
|
|
9
|
+
Courses = "courses"
|
|
10
|
+
}
|
|
7
11
|
export declare enum DiscussionContentType {
|
|
8
12
|
Answer = "answer",
|
|
9
13
|
Poll = "poll",
|