@apolitical/component-library 5.1.2-SW.3 → 5.1.2-SW.4
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/index.d.ts +1 -0
- package/discussion/components/post/post.d.ts +8 -4
- package/discussion/index.d.ts +2 -2
- package/discussion/shared/interfaces/activity.interface.d.ts +2 -1
- package/discussion/shared/interfaces/discussion.interface.d.ts +84 -0
- package/discussion/shared/interfaces/index.d.ts +1 -0
- package/index.js +49 -49
- package/index.mjs +3548 -3517
- package/package.json +4 -1
- package/style.css +1 -1
- package/user/member/member.d.ts +3 -0
|
@@ -2,15 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import { type ListMembers, ClickMentionFallback } from '../../../form';
|
|
3
3
|
import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, IForceHide, IFullDiscussionContent } from '../../discussion';
|
|
4
4
|
import { IBadgesOption } from '../../../user/badges';
|
|
5
|
-
interface
|
|
5
|
+
export interface IPostContent extends IFullDiscussionContent {
|
|
6
6
|
/** The post body */
|
|
7
7
|
postBody?: string;
|
|
8
|
+
/** Custom message to pass through to the Member component */
|
|
9
|
+
memberCustomMessage?: string;
|
|
8
10
|
}
|
|
9
|
-
interface
|
|
11
|
+
export interface IDiscussionPostProps {
|
|
10
12
|
/** The element that will render around the content */
|
|
11
13
|
element?: 'li' | 'div' | 'section' | 'article';
|
|
12
14
|
/** Information about the content being posted */
|
|
13
|
-
content:
|
|
15
|
+
content: IPostContent;
|
|
14
16
|
/** If the user has permission to interact with the post box and content, e.g. if they're a member of the community */
|
|
15
17
|
userHasPermissions?: boolean;
|
|
16
18
|
/** If the user has owner permissions, e.g. if they're a community owner */
|
|
@@ -73,6 +75,8 @@ interface Props {
|
|
|
73
75
|
styling?: {
|
|
74
76
|
/** Option of whether or not to show the copy link button */
|
|
75
77
|
showShareLinkButton?: boolean;
|
|
78
|
+
/** Option of whether or not to show the more menu button */
|
|
79
|
+
showMoreMenuButton?: boolean;
|
|
76
80
|
};
|
|
77
81
|
/** If the browser should focus on this post */
|
|
78
82
|
setFocus?: boolean;
|
|
@@ -81,5 +85,5 @@ interface Props {
|
|
|
81
85
|
/** Whether to show badges and the scope of the badge */
|
|
82
86
|
badges?: IBadgesOption;
|
|
83
87
|
}
|
|
84
|
-
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton }, setFocus, isCommunity, badges, }:
|
|
88
|
+
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton, showMoreMenuButton }, setFocus, isCommunity, badges, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
85
89
|
export default Post;
|
package/discussion/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './components';
|
|
2
2
|
export * from './feeds';
|
|
3
|
+
export * from './discussion.helpers';
|
|
3
4
|
export * from './sections';
|
|
4
|
-
export type { IListMemberData, IMentionData, IMentions } from './
|
|
5
|
-
export type { IActivity, IReaction, IUser } from './shared/interfaces';
|
|
5
|
+
export type { IActivity, IFullDiscussionContent, IListMemberData, IMentionData, IMentions, IReaction, IUser, } from './shared/interfaces';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { MemberProps, MemberDetailsProps } from '../../../user';
|
|
2
|
+
import type { ListMembers, ClickMentionFallback } from '../../../form';
|
|
3
|
+
export type IDiscussionContentType = 'answer' | 'post' | 'response' | 'reply' | 'question';
|
|
4
|
+
export interface IDiscussionContent {
|
|
5
|
+
/** The type of content */
|
|
6
|
+
type: IDiscussionContentType;
|
|
7
|
+
/** The slugs we're dealing with - used in functions */
|
|
8
|
+
slugs: {
|
|
9
|
+
question?: string;
|
|
10
|
+
answer?: string;
|
|
11
|
+
reply?: string;
|
|
12
|
+
};
|
|
13
|
+
/** The ID for the content */
|
|
14
|
+
slug?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IFullDiscussionContent extends IDiscussionContent {
|
|
17
|
+
/** The ID for the content */
|
|
18
|
+
id?: string;
|
|
19
|
+
/** The content slug */
|
|
20
|
+
slug: string;
|
|
21
|
+
/** The title of the content post */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** The body of the content post */
|
|
24
|
+
body?: string;
|
|
25
|
+
/** The author of the post */
|
|
26
|
+
author: MemberProps;
|
|
27
|
+
createdAt: Date | string;
|
|
28
|
+
/** The number of likes to display */
|
|
29
|
+
likes?: number;
|
|
30
|
+
/** If the current user liked the content */
|
|
31
|
+
userLiked?: boolean;
|
|
32
|
+
peopleWhoLiked?: MemberProps[] | false;
|
|
33
|
+
/** If the content is pinned */
|
|
34
|
+
pinned?: boolean;
|
|
35
|
+
/** If the user is able to like the content (e.g. they can't like if they're not a member) */
|
|
36
|
+
canLike?: boolean;
|
|
37
|
+
/** The number of comments the post has */
|
|
38
|
+
comments?: number;
|
|
39
|
+
/** Details of users mentioned in the content */
|
|
40
|
+
mentions?: IMentions;
|
|
41
|
+
/** If the content has been edited */
|
|
42
|
+
isEdited?: boolean;
|
|
43
|
+
/** The URL to use for reporting context, etc. */
|
|
44
|
+
linkBase?: string;
|
|
45
|
+
}
|
|
46
|
+
export type IForceHide = {
|
|
47
|
+
/** Whether to hide the whole action bar */
|
|
48
|
+
actionBar?: boolean;
|
|
49
|
+
/** Whether to hide the comments */
|
|
50
|
+
comments?: boolean;
|
|
51
|
+
/** Whether to hide the likes */
|
|
52
|
+
likes?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type DiscussionCreateContentFunction = (args1: void | object, args2?: object) => void;
|
|
55
|
+
export type DiscussionCreateLikeFunction = (args1: object) => void;
|
|
56
|
+
export type DiscussionDeleteLikeFunction = (args: object) => void;
|
|
57
|
+
export interface IMentions {
|
|
58
|
+
[key: string]: IMentionData;
|
|
59
|
+
}
|
|
60
|
+
export interface IMentionData {
|
|
61
|
+
/** The time the mention was created */
|
|
62
|
+
created_at: string;
|
|
63
|
+
/** The time the mention was updated */
|
|
64
|
+
updated_at: string;
|
|
65
|
+
/** The ID, matching the key */
|
|
66
|
+
id: string;
|
|
67
|
+
/** The data of the user being mentioned */
|
|
68
|
+
data: MemberDetailsProps;
|
|
69
|
+
/** An error message, shown if the user was deleted */
|
|
70
|
+
error?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface IMentionsFns {
|
|
73
|
+
listMembers: ListMembers;
|
|
74
|
+
clickMentionFallback: ClickMentionFallback;
|
|
75
|
+
}
|
|
76
|
+
export interface IListMemberData {
|
|
77
|
+
id?: string;
|
|
78
|
+
name?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface IConversation {
|
|
81
|
+
showForm: boolean;
|
|
82
|
+
prepopulateForm?: string;
|
|
83
|
+
mentionData?: IListMemberData;
|
|
84
|
+
}
|