@apolitical/component-library 5.2.0-jc.4 → 5.2.0-jc.7

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.
@@ -1 +1,2 @@
1
1
  export { default as MembersList } from './members-list';
2
+ export type { CommunityMemberProps } from './members-list';
@@ -1,6 +1,6 @@
1
1
  import { type IProfileFormProps } from '../../form';
2
2
  import { MemberDetailsProps } from '../../user';
3
- interface CommunityMemberProps extends MemberDetailsProps {
3
+ export interface CommunityMemberProps extends MemberDetailsProps {
4
4
  /** Whether the user is an admin of the community or not */
5
5
  isAdmin?: boolean;
6
6
  }
@@ -23,8 +23,12 @@ interface Props {
23
23
  gtmContext?: string;
24
24
  /** The GTM event to use */
25
25
  gtmType?: string;
26
+ /** Whether to show the header */
27
+ showHeader?: boolean;
28
+ /** Whether to show placeholders */
29
+ showPlaceholders?: boolean;
26
30
  /** Additional classes */
27
31
  className?: string;
28
32
  }
29
- declare const MembersList: ({ members: { data, total }, communitySlug, isMember, hasNextPage, loadNextPage, profile, gtmContext, gtmType, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
33
+ declare const MembersList: ({ members: { data, total }, communitySlug, isMember, hasNextPage, loadNextPage, profile, gtmContext, gtmType, showHeader, showPlaceholders, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
30
34
  export default MembersList;
@@ -1,18 +1,7 @@
1
- import { ILikesFeedQueryFns } from '../../../../../discussion/feeds';
2
- import { IBadgesOption } from '../../../../../user';
3
- export interface ILikesModalProps {
1
+ import { ILikesFeedProps, ILikesFeedQueryFns } from '../../../../../discussion/feeds';
2
+ export interface ILikesModalProps extends ILikesFeedProps {
4
3
  /** Whether the modal is open on page load */
5
4
  showModal?: boolean;
6
- /** The number of likes */
7
- likeCount?: number;
8
- /** The ID of the activity to show likes for */
9
- activityId: string;
10
- /** The base path, used for slugs */
11
- basePath: string;
12
- /** The ID of the parent */
13
- parentId: string;
14
- /** Whether to show badges and the scope of the badge */
15
- badges?: IBadgesOption;
16
5
  /** Functions used inside the modal */
17
6
  functions: {
18
7
  likes: {
@@ -24,5 +13,5 @@ export interface ILikesModalProps {
24
13
  /** Additional classes */
25
14
  className?: string;
26
15
  }
27
- declare const LikesModal: ({ showModal, activityId, functions: { onClose, likes: likesFns }, badges, likeCount, className, basePath, parentId, }: ILikesModalProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const LikesModal: ({ showModal, activityId, functions: { onClose, likes: likesFns }, likeCount, className, basePath, parentId, }: ILikesModalProps) => import("react/jsx-runtime").JSX.Element;
28
17
  export default LikesModal;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { MemberProps } from '../../../user';
2
+ import { IBadgesOption, MemberProps } from '../../../user';
3
3
  import { IDiscussionContent } from './../../discussion';
4
4
  import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
5
5
  interface Props {
@@ -23,6 +23,8 @@ interface Props {
23
23
  basePath: string;
24
24
  /** The ID of the parent, used for slugs */
25
25
  parentId: string;
26
+ /** Whether to show badges and the scope of the badge */
27
+ badges: IBadgesOption | undefined;
26
28
  /** Functions to handle liking and unliking */
27
29
  functions: {
28
30
  /** Function to create a like */
@@ -35,7 +37,7 @@ interface Props {
35
37
  /** The language to use for the text */
36
38
  locale?: string;
37
39
  }
38
- declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, activityId, basePath, parentId, functions: { createLike, deleteLike, listLikes, }, }: Props) => React.DetailedReactHTMLElement<{
40
+ declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, activityId, basePath, parentId, badges, functions: { createLike, deleteLike, listLikes, }, }: Props) => React.DetailedReactHTMLElement<{
39
41
  className: string;
40
42
  onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
41
43
  onMouseEnter: () => void;
@@ -11,6 +11,12 @@ export declare const likesResponseMock: {
11
11
  thumbnail: string;
12
12
  jobTitle: string;
13
13
  organization: string;
14
+ badges: {
15
+ communities: {
16
+ 'endor-alumni': string[];
17
+ };
18
+ platform?: undefined;
19
+ };
14
20
  };
15
21
  created_at?: undefined;
16
22
  updated_at?: undefined;
@@ -37,6 +43,12 @@ export declare const likesResponseMock: {
37
43
  name: string;
38
44
  organization: string;
39
45
  thumbnail: string;
46
+ badges: {
47
+ platform: {
48
+ all: string[];
49
+ };
50
+ communities?: undefined;
51
+ };
40
52
  };
41
53
  };
42
54
  kind: string;
@@ -1,2 +1,3 @@
1
+ export type { IDiscussionPostProps, IPostContent } from './post';
1
2
  export { default as DiscussionPost } from './post';
2
3
  export { getPostBody } from './post.helpers';
@@ -1,16 +1,19 @@
1
1
  import React from 'react';
2
2
  import { ClickMentionFallback, type ListMembers } from '../../../form';
3
- import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, DiscussionListLikesFunction, IForceHide, IFullDiscussionContent } from '../../discussion';
3
+ import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, DiscussionListLikesFunction } from '../../discussion';
4
+ import type { IForceHide, IFullDiscussionContent } from '../../shared/interfaces';
4
5
  import { IBadgesOption } from '../../../user/badges';
5
- interface PostContent extends IFullDiscussionContent {
6
+ export interface IPostContent extends IFullDiscussionContent {
6
7
  /** The post body */
7
8
  postBody?: string;
9
+ /** Custom message to pass through to the Member component */
10
+ memberCustomMessage?: string;
8
11
  }
9
- interface Props {
12
+ export interface IDiscussionPostProps {
10
13
  /** The element that will render around the content */
11
14
  element?: 'li' | 'div' | 'section' | 'article';
12
15
  /** Information about the content being posted */
13
- content: PostContent;
16
+ content: IPostContent;
14
17
  /** If the user has permission to interact with the post box and content, e.g. if they're a member of the community */
15
18
  userHasPermissions?: boolean;
16
19
  /** If the user has owner permissions, e.g. if they're a community owner */
@@ -75,6 +78,8 @@ interface Props {
75
78
  styling?: {
76
79
  /** Option of whether or not to show the copy link button */
77
80
  showShareLinkButton?: boolean;
81
+ /** Option of whether or not to show the more menu button */
82
+ showMoreMenuButton?: boolean;
78
83
  };
79
84
  /** If the browser should focus on this post */
80
85
  setFocus?: boolean;
@@ -87,5 +92,5 @@ interface Props {
87
92
  /** The ID of the parent, used for slugs */
88
93
  parentId: string;
89
94
  }
90
- declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton }, setFocus, isCommunity, badges, basePath, parentId, }: Props) => import("react/jsx-runtime").JSX.Element;
95
+ declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, styling: { showShareLinkButton, showMoreMenuButton }, setFocus, isCommunity, badges, basePath, parentId, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
91
96
  export default Post;
@@ -22,6 +22,12 @@ declare namespace _default {
22
22
  thumbnail: string;
23
23
  jobTitle: string;
24
24
  organization: string;
25
+ badges: {
26
+ communities: {
27
+ 'endor-alumni': string[];
28
+ };
29
+ platform?: undefined;
30
+ };
25
31
  };
26
32
  created_at?: undefined;
27
33
  updated_at?: undefined;
@@ -48,6 +54,12 @@ declare namespace _default {
48
54
  name: string;
49
55
  organization: string;
50
56
  thumbnail: string;
57
+ badges: {
58
+ platform: {
59
+ all: string[];
60
+ };
61
+ communities?: undefined;
62
+ };
51
63
  };
52
64
  };
53
65
  kind: string;
@@ -15,6 +15,6 @@ export declare function useLikesFeed({ queryFns: { list }, queryKey }: ILikesFee
15
15
  hasNextPage: boolean;
16
16
  fetchNextPage: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").a2 | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").aj<import("../..").ICache, Error>>;
17
17
  refetch: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").Z | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").ac<import("../..").ICache, Error>>;
18
- likes: import("../../../../../shared").IReaction[];
18
+ likes: import("../../../../..").IReaction[];
19
19
  };
20
20
  export {};
@@ -1,2 +1,3 @@
1
1
  export type { IQueryFns as ILikesFeedQueryFns } from './cache';
2
2
  export { default as LikesFeed } from './likes-feed';
3
+ export type { ILikesFeedProps } from './likes-feed';
@@ -1,16 +1,11 @@
1
- import { type IBadgesOption } from '../../../user';
2
1
  import { IQueryFns } from './cache';
3
- interface Props {
4
- /** Whether to show badges and the scope of the badge */
5
- badges?: IBadgesOption;
2
+ export interface ILikesFeedProps {
6
3
  /** The base path, used for slugs */
7
4
  basePath: string;
8
5
  /** The ID of the parent, used for slugs */
9
6
  parentId: string;
10
7
  /** The ID of the activity the replies are for */
11
8
  activityId: string;
12
- /** The initial number of likes */
13
- initialLikeCount: number;
14
9
  /** The total number of likes */
15
10
  likeCount: number;
16
11
  /** Functions for the replies query */
@@ -18,5 +13,4 @@ interface Props {
18
13
  likes: IQueryFns;
19
14
  };
20
15
  }
21
- export default function LikesFeed({ badges, basePath, parentId, activityId, initialLikeCount, likeCount, functions, }: Props): import("react/jsx-runtime").JSX.Element;
22
- export {};
16
+ export default function LikesFeed({ basePath, parentId, activityId, likeCount, functions, }: ILikesFeedProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +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 { IMentionData, IMentions, IListMemberData } from './discussion.d';
5
+ export type { IActivity, IFullDiscussionContent, IListMemberData, IMentionData, IMentions, IReaction, IUser, } from './shared/interfaces';
@@ -5,7 +5,7 @@ export interface IReadActivityArgs {
5
5
  queryKey: QueryKey;
6
6
  }
7
7
  export declare function useReadActivity({ queryFn, queryKey }: IReadActivityArgs): {
8
- activity: import("../../../../../shared").IActivity | undefined;
8
+ activity: import("../../../../..").IActivity | undefined;
9
9
  error: Error | null;
10
10
  isLoading: boolean;
11
11
  isFetching: boolean;
@@ -1,7 +1,8 @@
1
1
  import type { FlatActivityEnriched } from 'getstream';
2
2
  export interface IActivity extends FlatActivityEnriched {
3
- title: string;
4
3
  content: string;
4
+ feed_id?: string;
5
+ title: string;
5
6
  total_replies?: number;
6
7
  total_likes?: number;
7
8
  }
@@ -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
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './activity.interface';
2
2
  export * from './context.interface';
3
+ export * from './discussion.interface';
3
4
  export * from './reaction.interface';
4
5
  export * from './user.interface';
@@ -12,8 +12,8 @@ export default function transform<T extends InputNodeTypes>(node: MdastNode, opt
12
12
  position?: any;
13
13
  ordered?: boolean | undefined;
14
14
  checked?: any;
15
- lang?: string | undefined;
16
15
  depth?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
16
+ lang?: string | undefined;
17
17
  spread?: any;
18
18
  indent?: any;
19
19
  text: string | undefined;