@apolitical/component-library 6.1.2 → 6.1.3-ac.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/discussion/components/form/form.type.d.ts +21 -2
- package/discussion/components/form/index.d.ts +1 -1
- package/discussion/components/post/index.d.ts +1 -1
- package/discussion/components/post/post.d.ts +1 -6
- package/discussion/components/post/post.helpers.d.ts +2 -0
- package/discussion/feeds/activities-feed/activities-feed.d.ts +2 -4
- package/discussion/feeds/replies-feed/cache/hooks/feed/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/mocks/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/nested-replies-feed.d.ts +3 -3
- package/discussion/feeds/replies-feed/replies-feed.d.ts +2 -4
- package/discussion/sections/activity-section/activity-section.d.ts +2 -4
- package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +39 -45
- package/discussion/sections/activity-section/mocks/index.d.ts +0 -1
- package/discussion/shared/interfaces/discussion.interface.d.ts +2 -20
- package/helpers/intl.d.ts +0 -1
- package/index.js +41 -41
- package/index.mjs +6559 -6671
- package/package.json +1 -1
- package/user/badge/interface/badge.interfaces.d.ts +3 -3
- package/user/badges/badges.interface.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/index.d.ts +0 -2
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/replies.mock.d.ts +0 -2
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/user.mock.d.ts +0 -4
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/parse-replies.d.ts +0 -28
- package/discussion/feeds/replies-feed/components/add-reply-form/add-reply-form.d.ts +0 -16
- package/discussion/feeds/replies-feed/components/add-reply-form/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/components/index.d.ts +0 -3
- package/discussion/feeds/replies-feed/components/load-more-replies-button/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/components/load-more-replies-button/load-more-replies-button.d.ts +0 -13
- package/discussion/feeds/replies-feed/components/reply-item/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/components/reply-item/reply-item.d.ts +0 -26
- package/discussion/feeds/replies-feed/mocks/parsed-replies-feed.mock.d.ts +0 -13
- package/discussion/sections/activity-section/activity-section.helpers.d.ts +0 -2
- package/discussion/sections/activity-section/activity-section.mock.d.ts +0 -103
- package/discussion/sections/activity-section/mocks/activity-functions.mock.d.ts +0 -46
- /package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/index.d.ts +0 -0
- /package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/mocks/index.d.ts +0 -0
- /package/discussion/feeds/replies-feed/{components/nested-replies-feed → nested-replies-feed}/mocks/nested-replies-feed.mock.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IEnrichedUrlData } from '../../../navigation';
|
|
2
|
-
import { IDiscussionContent, IMentions } from './../../discussion';
|
|
3
|
-
import { ICategory
|
|
2
|
+
import { DiscussionCreateContentFunction, IDiscussionContent, IListMemberData, IMentions, IDiscussionFormFns } from './../../discussion';
|
|
3
|
+
import { ICategory } from '../../shared';
|
|
4
4
|
export interface IDiscussionFormMeta {
|
|
5
5
|
/** Whether the form data is still loading */
|
|
6
6
|
isLoading?: boolean;
|
|
@@ -36,6 +36,24 @@ export interface IDiscussionFormMeta {
|
|
|
36
36
|
/** Whether the success message should show on a successful submit */
|
|
37
37
|
showSuccessMessage?: boolean;
|
|
38
38
|
}
|
|
39
|
+
interface IDiscussionFormFunctions extends IDiscussionFormFns {
|
|
40
|
+
onChange?: (args: {
|
|
41
|
+
[key: string]: string | boolean;
|
|
42
|
+
}) => void;
|
|
43
|
+
create: DiscussionCreateContentFunction;
|
|
44
|
+
handleSaveEdit?: (({ title, body }: {
|
|
45
|
+
title: string;
|
|
46
|
+
body: string;
|
|
47
|
+
}) => Promise<void>) | (() => void);
|
|
48
|
+
handleCancel?: () => void;
|
|
49
|
+
callback?: (args: void) => void;
|
|
50
|
+
onMention?: (value?: IListMemberData) => void;
|
|
51
|
+
props?: {
|
|
52
|
+
create: {
|
|
53
|
+
projectNames: ['questions-answers'];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}
|
|
39
57
|
export interface IDiscussionForm {
|
|
40
58
|
/** A unique ID for the form */
|
|
41
59
|
id?: string;
|
|
@@ -89,3 +107,4 @@ export interface IDiscussionFormState {
|
|
|
89
107
|
link?: false | IEnrichedUrlData;
|
|
90
108
|
};
|
|
91
109
|
}
|
|
110
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { IDiscussionForm, IDiscussionFormMeta
|
|
1
|
+
export type { IDiscussionForm, IDiscussionFormMeta } from './form.type';
|
|
2
2
|
export { default as DiscussionForm } from './form';
|
|
@@ -84,15 +84,10 @@ export interface IDiscussionPostProps {
|
|
|
84
84
|
isCommunity?: boolean;
|
|
85
85
|
/** Whether to show badges and the scope of the badge */
|
|
86
86
|
badges?: IBadgesOption;
|
|
87
|
-
/** Categories for the community */
|
|
88
|
-
categories?: {
|
|
89
|
-
name: string;
|
|
90
|
-
slug: string;
|
|
91
|
-
}[];
|
|
92
87
|
/** The base path, used for slugs */
|
|
93
88
|
basePath: string;
|
|
94
89
|
/** The ID of the parent, used for slugs */
|
|
95
90
|
parentId: string;
|
|
96
91
|
}
|
|
97
|
-
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges,
|
|
92
|
+
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges, basePath, parentId, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
98
93
|
export default Post;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { IMentions } from './../../discussion';
|
|
2
2
|
import { ListMembers } from '../../../form';
|
|
3
|
+
import { ICategory } from '../../shared';
|
|
3
4
|
export declare const getPostBody: (body: string, isTruncated: boolean | number, mentions?: IMentions, listMembers?: ListMembers) => Promise<string>;
|
|
5
|
+
export declare const enrichPostCategories: (postCategories: string[], allCategories: ICategory[]) => (ICategory | undefined)[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type IProfileFormProps } from '../../../form';
|
|
3
|
+
import { ICategory } from '../../../discussion/shared';
|
|
3
4
|
import type { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
4
5
|
import type { IDiscussionFormFns } from '../../../discussion/discussion.d';
|
|
5
6
|
import { type IQueryFns } from './cache';
|
|
@@ -13,10 +14,7 @@ interface Props {
|
|
|
13
14
|
/** Whether the user is an owner of the community */
|
|
14
15
|
isOwner: boolean;
|
|
15
16
|
/** The categories for the community */
|
|
16
|
-
categories:
|
|
17
|
-
name: string;
|
|
18
|
-
slug: string;
|
|
19
|
-
}[];
|
|
17
|
+
categories: ICategory[];
|
|
20
18
|
/** Functions for the activities query */
|
|
21
19
|
functions: {
|
|
22
20
|
/** Query functions for the activities */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { IDiscussionFormFns } from '
|
|
3
|
-
import { ILikesFeedQueryFns } from '
|
|
4
|
-
import { type IQueryFns } from '
|
|
2
|
+
import type { IDiscussionFormFns } from '../../../../discussion/discussion.d';
|
|
3
|
+
import { ILikesFeedQueryFns } from '../../../../discussion/feeds/likes-feed';
|
|
4
|
+
import { type IQueryFns } from './../cache';
|
|
5
5
|
interface NestedRepliesFunctions {
|
|
6
6
|
/** Functions for the replies query */
|
|
7
7
|
reactions: IQueryFns;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type IProfileFormProps } from '../../../form';
|
|
3
3
|
import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
4
|
-
import type { IDiscussionFormFns } from '
|
|
4
|
+
import type { IDiscussionFormFns } from './../../discussion';
|
|
5
5
|
import { type IQueryFns } from './cache';
|
|
6
6
|
interface RepliesFunctions {
|
|
7
7
|
/** Functions for the replies query */
|
|
8
8
|
reactions: IQueryFns;
|
|
9
|
-
/** Functions for likes query */
|
|
9
|
+
/** Functions for the likes query */
|
|
10
10
|
likes: ILikesFeedQueryFns;
|
|
11
11
|
/** Query functions for the mentions */
|
|
12
12
|
form: IDiscussionFormFns;
|
|
@@ -30,8 +30,6 @@ interface Props {
|
|
|
30
30
|
functions: RepliesFunctions;
|
|
31
31
|
/** Props to pass into the profile form */
|
|
32
32
|
profile: IProfileFormProps;
|
|
33
|
-
/** Whether to show the replies */
|
|
34
|
-
showReplies: boolean;
|
|
35
33
|
}
|
|
36
34
|
declare const RepliesFeed: React.FC<Props>;
|
|
37
35
|
export default RepliesFeed;
|
|
@@ -3,6 +3,7 @@ import { type IProfileFormProps } from '../../../form';
|
|
|
3
3
|
import { type IRepliesFeedQueryFns, type ILikesFeedQueryFns } from '../../../discussion/feeds';
|
|
4
4
|
import type { IDiscussionFormFns } from './../../discussion.d';
|
|
5
5
|
import { type IQueryFns } from './cache';
|
|
6
|
+
import { ICategory } from '../../shared';
|
|
6
7
|
interface IActivitySectionQueryFns extends IQueryFns {
|
|
7
8
|
remove: () => Promise<void>;
|
|
8
9
|
}
|
|
@@ -21,10 +22,7 @@ export interface IActivitySectionProps {
|
|
|
21
22
|
leave: () => Promise<void>;
|
|
22
23
|
};
|
|
23
24
|
profile: IProfileFormProps;
|
|
24
|
-
categories?:
|
|
25
|
-
name: string;
|
|
26
|
-
slug: string;
|
|
27
|
-
}[];
|
|
25
|
+
categories?: ICategory[];
|
|
28
26
|
}
|
|
29
27
|
declare const ActivitySection: React.FC<IActivitySectionProps>;
|
|
30
28
|
export default ActivitySection;
|
|
@@ -1,52 +1,46 @@
|
|
|
1
1
|
export declare const activitySectionMock: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'community-slug': string[];
|
|
17
|
-
};
|
|
2
|
+
actor: {
|
|
3
|
+
created_at: string;
|
|
4
|
+
updated_at: string;
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
jobTitle: string;
|
|
8
|
+
name: string;
|
|
9
|
+
organization: string;
|
|
10
|
+
location: {
|
|
11
|
+
en: string;
|
|
12
|
+
};
|
|
13
|
+
badges: {
|
|
14
|
+
communities: {
|
|
15
|
+
'community-slug': string[];
|
|
18
16
|
};
|
|
19
17
|
};
|
|
20
18
|
};
|
|
21
|
-
categories: never[];
|
|
22
|
-
content: string;
|
|
23
|
-
feed_id: string;
|
|
24
|
-
foreign_id: string;
|
|
25
|
-
id: string;
|
|
26
|
-
latest_reactions: {
|
|
27
|
-
like: never[];
|
|
28
|
-
reply: never[];
|
|
29
|
-
};
|
|
30
|
-
latest_reactions_extra: {
|
|
31
|
-
like: never[];
|
|
32
|
-
reply: never[];
|
|
33
|
-
};
|
|
34
|
-
object: string;
|
|
35
|
-
origin: null;
|
|
36
|
-
own_reactions: {
|
|
37
|
-
like: never[];
|
|
38
|
-
reply: never[];
|
|
39
|
-
};
|
|
40
|
-
reaction_counts: {
|
|
41
|
-
like: number;
|
|
42
|
-
reply: number;
|
|
43
|
-
};
|
|
44
|
-
target: string;
|
|
45
|
-
time: string;
|
|
46
|
-
verb: string;
|
|
47
19
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
categories: string[];
|
|
21
|
+
content: string;
|
|
22
|
+
feed_id: string;
|
|
23
|
+
foreign_id: string;
|
|
24
|
+
id: string;
|
|
25
|
+
latest_reactions: {
|
|
26
|
+
like: never[];
|
|
27
|
+
reply: never[];
|
|
28
|
+
};
|
|
29
|
+
latest_reactions_extra: {
|
|
30
|
+
like: never[];
|
|
31
|
+
reply: never[];
|
|
32
|
+
};
|
|
33
|
+
object: string;
|
|
34
|
+
origin: null;
|
|
35
|
+
own_reactions: {
|
|
36
|
+
like: never[];
|
|
37
|
+
reply: never[];
|
|
38
|
+
};
|
|
39
|
+
reaction_counts: {
|
|
40
|
+
like: number;
|
|
41
|
+
reply: number;
|
|
51
42
|
};
|
|
43
|
+
target: string;
|
|
44
|
+
time: string;
|
|
45
|
+
verb: string;
|
|
52
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MemberProps, MemberDetailsProps } from '../../../user';
|
|
2
2
|
import type { ListMembers, ClickMentionFallback } from '../../../form';
|
|
3
3
|
import type { IEnrichedUrlData } from '../../../navigation';
|
|
4
|
-
import {
|
|
4
|
+
import { ICategory } from './community.category.interface';
|
|
5
5
|
export type IDiscussionContentType = 'answer' | 'post' | 'response' | 'reply' | 'question';
|
|
6
6
|
export interface IDiscussionContent {
|
|
7
7
|
/** The type of content */
|
|
@@ -27,7 +27,7 @@ export interface IFullDiscussionContent extends IDiscussionContent {
|
|
|
27
27
|
/** The author of the post */
|
|
28
28
|
author: MemberProps;
|
|
29
29
|
/** The post categories */
|
|
30
|
-
categories?:
|
|
30
|
+
categories?: ICategory[];
|
|
31
31
|
createdAt: Date | string;
|
|
32
32
|
/** The number of likes to display */
|
|
33
33
|
likes?: number;
|
|
@@ -91,21 +91,3 @@ export interface IConversation {
|
|
|
91
91
|
prepopulateForm?: string;
|
|
92
92
|
mentionData?: IListMemberData;
|
|
93
93
|
}
|
|
94
|
-
export interface IDiscussionFormFunctions extends IDiscussionFormFns {
|
|
95
|
-
onChange?: (args: {
|
|
96
|
-
[key: string]: string | boolean;
|
|
97
|
-
}) => void;
|
|
98
|
-
create: DiscussionCreateContentFunction;
|
|
99
|
-
handleSaveEdit?: (({ title, body }: {
|
|
100
|
-
title: string;
|
|
101
|
-
body: string;
|
|
102
|
-
}) => Promise<void>) | (() => void);
|
|
103
|
-
handleCancel?: () => void;
|
|
104
|
-
callback?: (args: void) => void;
|
|
105
|
-
onMention?: (value?: IListMemberData) => void;
|
|
106
|
-
props?: {
|
|
107
|
-
create: {
|
|
108
|
-
projectNames: ['questions-answers'];
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
}
|
package/helpers/intl.d.ts
CHANGED
|
@@ -350,7 +350,6 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
350
350
|
poll_num_votes: string;
|
|
351
351
|
poll_remove_vote_button: string;
|
|
352
352
|
poll_aria_votes: string;
|
|
353
|
-
replies_feed_missing_polls_vote_message: string;
|
|
354
353
|
tableOfContents: string;
|
|
355
354
|
timeToComplete_hours: string;
|
|
356
355
|
timeToComplete_hours_short: string;
|