@apolitical/component-library 6.0.1 → 6.0.2-601.11
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/cards/card/card.d.ts +1 -1
- package/cards/cards.types.d.ts +7 -2
- package/cards/carousel/components/carousel/carousel.helpers.d.ts +4 -1
- package/discussion/components/form/form.type.d.ts +1 -2
- package/discussion/components/form/index.d.ts +1 -1
- package/discussion/components/index.d.ts +0 -1
- package/discussion/components/post/post.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/feed/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/parse-replies.d.ts +28 -0
- package/discussion/feeds/replies-feed/components/add-reply-form/add-reply-form.d.ts +16 -0
- package/discussion/feeds/replies-feed/components/add-reply-form/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/components/index.d.ts +3 -0
- package/discussion/feeds/replies-feed/components/load-more-replies-button/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/components/load-more-replies-button/load-more-replies-button.d.ts +15 -0
- package/discussion/feeds/replies-feed/{nested-replies-feed → components/nested-replies-feed}/nested-replies-feed.d.ts +3 -3
- package/discussion/feeds/replies-feed/components/reply-item/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/components/reply-item/reply-item.d.ts +26 -0
- package/discussion/feeds/replies-feed/mocks/index.d.ts +1 -0
- package/discussion/feeds/replies-feed/mocks/parsed-replies-feed.mock.d.ts +13 -0
- package/discussion/feeds/replies-feed/replies-feed.d.ts +4 -2
- package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +45 -39
- package/helpers/intl.d.ts +5 -0
- package/hooks/use-tooltips.d.ts +0 -2
- package/index.d.ts +1 -0
- package/index.js +61 -61
- package/index.mjs +23045 -22632
- package/navigation/action-bar/action-bar.d.ts +80 -0
- package/navigation/action-bar/components/button/button.d.ts +6 -0
- package/navigation/action-bar/components/button/index.d.ts +1 -0
- package/navigation/action-bar/components/index.d.ts +3 -0
- package/{discussion → navigation/action-bar}/components/likes/components/likes-modal/likes-modal.d.ts +1 -1
- package/{discussion → navigation/action-bar}/components/likes/index.d.ts +2 -1
- package/{discussion → navigation/action-bar}/components/likes/likes.d.ts +3 -3
- package/{discussion → navigation/action-bar}/components/likes/likes.helpers.d.ts +1 -1
- package/{discussion → navigation/action-bar}/components/likes/likes.mock.d.ts +1 -1
- package/navigation/action-bar/index.d.ts +2 -0
- package/navigation/index.d.ts +1 -0
- package/package.json +1 -1
- package/polls/index.d.ts +1 -0
- package/polls/poll/components/index.d.ts +1 -0
- package/polls/poll/components/poll-option/index.d.ts +1 -0
- package/polls/poll/components/poll-option/poll-option.d.ts +18 -0
- package/polls/poll/index.d.ts +3 -0
- package/polls/poll/poll.d.ts +18 -0
- package/polls/poll/poll.enums.d.ts +4 -0
- package/polls/poll/poll.helpers.d.ts +9 -0
- package/polls/poll/poll.mocks.d.ts +58 -0
- package/polls/poll/poll.types.d.ts +10 -0
- package/style.css +1 -1
- package/styles/variables/colors/theme/_index.scss +3 -3
- package/styles/variables/colors/theme/_polls.scss +10 -0
- package/text/pill/pill.d.ts +4 -1
- package/discussion/components/button/button.d.ts +0 -6
- package/discussion/components/button/index.d.ts +0 -1
- /package/discussion/feeds/replies-feed/{nested-replies-feed → components/nested-replies-feed}/index.d.ts +0 -0
- /package/discussion/feeds/replies-feed/{nested-replies-feed → components/nested-replies-feed}/mocks/index.d.ts +0 -0
- /package/discussion/feeds/replies-feed/{nested-replies-feed → components/nested-replies-feed}/mocks/nested-replies-feed.mock.d.ts +0 -0
- /package/{discussion → navigation/action-bar}/components/likes/components/index.d.ts +0 -0
- /package/{discussion → navigation/action-bar}/components/likes/components/likes-modal/index.d.ts +0 -0
- /package/{discussion → navigation/action-bar}/components/likes/mocks/index.d.ts +0 -0
- /package/{discussion → navigation/action-bar}/components/likes/mocks/likes-response.mock.d.ts +0 -0
- /package/{discussion → navigation/action-bar}/components/likes/tooltip.hook.d.ts +0 -0
- /package/{discussion/components/post → navigation/action-bar}/components/share-link/index.d.ts +0 -0
- /package/{discussion/components/post → navigation/action-bar}/components/share-link/share-link.d.ts +0 -0
package/cards/card/card.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CardProps } from './../cards.types';
|
|
2
|
-
declare const Card: ({ id, className, buildCardData, buildMemberData, card, cta, gtmContext, handleCardClick,
|
|
2
|
+
declare const Card: ({ id, className, buildCardData, buildMemberData, card, cta, gtmContext, handleCardClick, meta, }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Card;
|
package/cards/cards.types.d.ts
CHANGED
|
@@ -93,8 +93,13 @@ export interface CardProps {
|
|
|
93
93
|
className?: string;
|
|
94
94
|
/** A callback to run when the user clicks on the card CTA */
|
|
95
95
|
handleCardClick?: (card: CardType) => Promise<string>;
|
|
96
|
-
/**
|
|
97
|
-
|
|
96
|
+
/** Metadata about the card */
|
|
97
|
+
meta?: {
|
|
98
|
+
/** If the browser should be able to reach the card, e.g. for out of view cards in carousels */
|
|
99
|
+
isTabbable?: boolean;
|
|
100
|
+
/** If the browser should focus on this card */
|
|
101
|
+
setFocus?: boolean;
|
|
102
|
+
};
|
|
98
103
|
}
|
|
99
104
|
export interface CarouselTitleProps {
|
|
100
105
|
/** The title text */
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const shouldDisplayCard: (index: number, cardsPerPage: number, page: number, loadedPages: number[]) =>
|
|
1
|
+
export declare const shouldDisplayCard: (index: number, cardsPerPage: number, page: number, loadedPages: number[]) => {
|
|
2
|
+
inView: boolean;
|
|
3
|
+
isLoaded: boolean;
|
|
4
|
+
};
|
|
@@ -36,7 +36,7 @@ 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 {
|
|
39
|
+
export interface IDiscussionFormFunctions extends IDiscussionFormFns {
|
|
40
40
|
onChange?: (args: {
|
|
41
41
|
[key: string]: string | boolean;
|
|
42
42
|
}) => void;
|
|
@@ -107,4 +107,3 @@ export interface IDiscussionFormState {
|
|
|
107
107
|
link?: false | IEnrichedUrlData;
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { IDiscussionForm, IDiscussionFormMeta } from './form.type';
|
|
1
|
+
export type { IDiscussionForm, IDiscussionFormFunctions, IDiscussionFormMeta, } from './form.type';
|
|
2
2
|
export { default as DiscussionForm } from './form';
|
|
@@ -94,5 +94,5 @@ export interface IDiscussionPostProps {
|
|
|
94
94
|
/** The ID of the parent, used for slugs */
|
|
95
95
|
parentId: string;
|
|
96
96
|
}
|
|
97
|
-
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated,
|
|
97
|
+
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges, categories, basePath, parentId, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
98
98
|
export default Post;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './parse-replies';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IUserContext } from '../../../../../../../context';
|
|
2
|
+
import { IMentions, IReaction } from '../../../../../../../discussion/shared';
|
|
3
|
+
import { DefaultGenerics, EnrichedUser } from 'getstream';
|
|
4
|
+
interface ExtractedReplyData {
|
|
5
|
+
mentions?: IMentions;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface IParsedReplies {
|
|
9
|
+
body: string;
|
|
10
|
+
data: ExtractedReplyData;
|
|
11
|
+
likeId: string;
|
|
12
|
+
liked: boolean;
|
|
13
|
+
likes: number;
|
|
14
|
+
peopleWhoLiked: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}[] | false;
|
|
18
|
+
replyId: string;
|
|
19
|
+
userLiked: boolean;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
parent: string;
|
|
22
|
+
user: EnrichedUser<DefaultGenerics> | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare function parseReplies({ replies, user, }: {
|
|
25
|
+
replies: IReaction[];
|
|
26
|
+
user: IUserContext;
|
|
27
|
+
}): IParsedReplies[];
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IDiscussionFormFunctions } from '../../../../../discussion/components';
|
|
3
|
+
interface Props {
|
|
4
|
+
/** Whether the user is a member of the community */
|
|
5
|
+
isMember: boolean;
|
|
6
|
+
/** The ID of the parent, used for slugs */
|
|
7
|
+
parentId: string;
|
|
8
|
+
/** Query functions for the mentions */
|
|
9
|
+
formFunctions: IDiscussionFormFunctions;
|
|
10
|
+
/** Function to join the community */
|
|
11
|
+
join: () => Promise<void>;
|
|
12
|
+
/** Function to leave the community */
|
|
13
|
+
leave: () => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export default function AddReplyForm({ parentId, isMember, formFunctions, leave, join, }: Props): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AddReplyForm } from './add-reply-form';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LoadMoreRepliesButton } from './load-more-replies-button';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Whether the button is loading */
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
/** Whether there is a next page */
|
|
6
|
+
hasNextPage: boolean;
|
|
7
|
+
/** Function to fetch the next page */
|
|
8
|
+
fetchNextPage: () => void;
|
|
9
|
+
/** The index to focus on */
|
|
10
|
+
setFocusReplyIndex: (index: number) => void;
|
|
11
|
+
/** The total number of replies */
|
|
12
|
+
totalReplies: number;
|
|
13
|
+
}
|
|
14
|
+
export default function LoadMoreRepliesButton({ isLoading, hasNextPage, fetchNextPage, setFocusReplyIndex, totalReplies, }: Props): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ReplyItem } from './reply-item';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ILikesFeedQueryFns } from '../../../../../discussion/feeds/likes-feed';
|
|
3
|
+
import type { IDiscussionFormFns } from '../../../../discussion';
|
|
4
|
+
import type { IQueryFns, IParsedReplies } from '../../cache';
|
|
5
|
+
interface Props {
|
|
6
|
+
/** The ID of the activity the replies are for */
|
|
7
|
+
activityId: string;
|
|
8
|
+
/** The base path, used for slugs */
|
|
9
|
+
basePath: string;
|
|
10
|
+
/** The ID of the parent, used for slugs */
|
|
11
|
+
parentId: string;
|
|
12
|
+
/** Whether the user is a member of the community */
|
|
13
|
+
isMember: boolean;
|
|
14
|
+
/** The reply data */
|
|
15
|
+
reply: IParsedReplies;
|
|
16
|
+
/** Whether to show the replies */
|
|
17
|
+
focus: boolean;
|
|
18
|
+
/** Functions for the replies query */
|
|
19
|
+
formFns: {
|
|
20
|
+
form: IDiscussionFormFns;
|
|
21
|
+
reactions: IQueryFns;
|
|
22
|
+
likes: ILikesFeedQueryFns;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export default function ReplyItem({ formFns, activityId, basePath, focus, isMember, parentId, reply, }: Props): JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const parsedRepliesMock: {
|
|
2
|
+
user: string;
|
|
3
|
+
body: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
data: {};
|
|
6
|
+
likeId: string;
|
|
7
|
+
liked: boolean;
|
|
8
|
+
likes: number;
|
|
9
|
+
peopleWhoLiked: never[];
|
|
10
|
+
replyId: string;
|
|
11
|
+
parent: string;
|
|
12
|
+
userLiked: boolean;
|
|
13
|
+
}[];
|
|
@@ -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
|
|
9
|
+
/** Functions for http://localhost:3026/communities/playground/61b7fae0-0eed-11ef-8080-800013820cbdthe likes query */
|
|
10
10
|
likes: ILikesFeedQueryFns;
|
|
11
11
|
/** Query functions for the mentions */
|
|
12
12
|
form: IDiscussionFormFns;
|
|
@@ -30,6 +30,8 @@ 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;
|
|
33
35
|
}
|
|
34
36
|
declare const RepliesFeed: React.FC<Props>;
|
|
35
37
|
export default RepliesFeed;
|
|
@@ -1,46 +1,52 @@
|
|
|
1
1
|
export declare const activitySectionMock: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
+
};
|
|
16
18
|
};
|
|
17
19
|
};
|
|
18
20
|
};
|
|
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;
|
|
19
47
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
48
|
+
POLL: {
|
|
49
|
+
total_replies: number;
|
|
50
|
+
verb: string;
|
|
42
51
|
};
|
|
43
|
-
target: string;
|
|
44
|
-
time: string;
|
|
45
|
-
verb: string;
|
|
46
52
|
};
|
package/helpers/intl.d.ts
CHANGED
|
@@ -345,6 +345,11 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
345
345
|
signup_submitting: string;
|
|
346
346
|
signup_success_title: string;
|
|
347
347
|
signup_success_text: string;
|
|
348
|
+
poll_instructions: string;
|
|
349
|
+
poll_num_votes: string;
|
|
350
|
+
poll_remove_vote_button: string;
|
|
351
|
+
poll_aria_votes: string;
|
|
352
|
+
replies_feed_missing_polls_vote_message: string;
|
|
348
353
|
tableOfContents: string;
|
|
349
354
|
timeToComplete_hours: string;
|
|
350
355
|
timeToComplete_hours_short: string;
|
package/hooks/use-tooltips.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ declare const _default: (hasTooltip?: boolean) => {
|
|
|
7
7
|
onMouseOut?: undefined;
|
|
8
8
|
onFocus?: undefined;
|
|
9
9
|
onBlur?: undefined;
|
|
10
|
-
tabIndex?: undefined;
|
|
11
10
|
};
|
|
12
11
|
} | {
|
|
13
12
|
showTooltip: boolean;
|
|
@@ -18,7 +17,6 @@ declare const _default: (hasTooltip?: boolean) => {
|
|
|
18
17
|
onMouseOut: () => void;
|
|
19
18
|
onFocus: () => void;
|
|
20
19
|
onBlur: () => void;
|
|
21
|
-
tabIndex: number;
|
|
22
20
|
};
|
|
23
21
|
};
|
|
24
22
|
export default _default;
|