@apolitical/component-library 5.2.1-jc.4 → 5.2.1
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/communities/members-list/index.d.ts +2 -0
- package/communities/members-list/members-list.constants.d.ts +1 -0
- package/communities/members-list/members-list.d.ts +6 -2
- package/discussion/components/likes/components/index.d.ts +1 -0
- package/discussion/components/likes/components/likes-modal/index.d.ts +1 -0
- package/discussion/components/likes/components/likes-modal/likes-modal.d.ts +17 -0
- package/discussion/components/likes/index.d.ts +1 -0
- package/discussion/components/likes/likes.d.ts +14 -3
- package/discussion/components/likes/likes.mock.d.ts +2 -0
- package/discussion/components/likes/mocks/index.d.ts +1 -0
- package/discussion/components/likes/mocks/likes-response.mock.d.ts +64 -0
- package/discussion/components/likes/tooltip.hook.d.ts +5 -0
- package/discussion/components/post/index.d.ts +1 -0
- package/discussion/components/post/post.d.ts +17 -6
- package/discussion/components/post/post.mock.d.ts +64 -0
- package/discussion/discussion.helpers.d.ts +1 -1
- package/discussion/feeds/activities-feed/activities-feed.d.ts +2 -0
- package/discussion/feeds/activities-feed/cache/cache.helper.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/edit/edit.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/like/like.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/list/list.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/remove/remove.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/hooks/unlike/unlike.hook.d.ts +1 -1
- package/discussion/feeds/activities-feed/cache/index.d.ts +0 -1
- package/discussion/feeds/activities-feed/mocks/activities-feed.mock.d.ts +75 -1
- package/discussion/feeds/index.d.ts +1 -0
- package/discussion/feeds/likes-feed/cache/cache.interface.d.ts +11 -0
- package/discussion/feeds/likes-feed/cache/hooks/feed/feed.hook.d.ts +20 -0
- package/discussion/feeds/likes-feed/cache/hooks/feed/index.d.ts +1 -0
- package/discussion/feeds/likes-feed/cache/hooks/index.d.ts +2 -0
- package/discussion/feeds/likes-feed/cache/hooks/list/index.d.ts +1 -0
- package/discussion/feeds/likes-feed/cache/hooks/list/list.hook.d.ts +16 -0
- package/discussion/feeds/likes-feed/cache/index.d.ts +2 -0
- package/discussion/feeds/likes-feed/index.d.ts +3 -0
- package/discussion/feeds/likes-feed/likes-feed.d.ts +16 -0
- package/discussion/feeds/replies-feed/cache/cache.helper.d.ts +2 -2
- package/discussion/feeds/replies-feed/cache/hooks/edit/edit.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/like/like.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/list/list.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/remove/remove.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/hooks/unlike/unlike.hook.d.ts +1 -1
- package/discussion/feeds/replies-feed/cache/index.d.ts +0 -1
- package/discussion/feeds/replies-feed/nested-replies-feed/nested-replies-feed.d.ts +7 -1
- package/discussion/feeds/replies-feed/replies-feed.d.ts +14 -10
- package/discussion/index.d.ts +2 -1
- package/discussion/sections/activity-section/activity-section.d.ts +2 -0
- package/discussion/sections/activity-section/cache/hooks/read/read.hook.d.ts +1 -1
- package/discussion/shared/helpers/cache.helper.d.ts +25 -0
- package/discussion/shared/helpers/index.d.ts +1 -0
- 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/general/link/link.d.ts +2 -2
- package/general/responsive-image/responsive-image.helpers.d.ts +10 -1
- package/helpers/intl.d.ts +1 -1
- package/index.js +61 -61
- package/index.mjs +8783 -8619
- package/package.json +4 -1
- package/sections/full-width-section/full-width-section.d.ts +0 -2
- package/style.css +1 -1
- package/styles/variables/colors/_colors.scss +0 -2
- package/styles/variables/colors/theme/_base.scss +1 -1
- package/styles/variables/colors/theme/_general.scss +1 -0
- package/styles/variables/colors/theme/_layout.scss +1 -1
- package/text/helper-text-box/helper-text-box.d.ts +2 -2
- package/text/helper-text-box/index.d.ts +1 -0
- package/user/index.d.ts +2 -0
- package/user/member/member.d.ts +3 -0
- package/user/member/member.helpers.d.ts +1 -1
|
@@ -3,5 +3,5 @@ import type { ICache } from '../..';
|
|
|
3
3
|
interface IRemoveVars {
|
|
4
4
|
replyId: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function useRemoveReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
6
|
+
export declare function useRemoveReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, }: IMutationContext<void, Error, IRemoveVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<void, Error, IRemoveVars, ICache>;
|
|
7
7
|
export {};
|
|
@@ -4,5 +4,5 @@ interface IUnlikeVars {
|
|
|
4
4
|
replyId: string;
|
|
5
5
|
reactionId?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function useUnlikeReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError
|
|
7
|
+
export declare function useUnlikeReply({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, user, }: IMutationContext<unknown, Error, IUnlikeVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<unknown, Error, IUnlikeVars, ICache>;
|
|
8
8
|
export {};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { IMentionsFns } from '../../../../discussion/discussion.d';
|
|
3
3
|
import type { IQueryFns } from './../cache';
|
|
4
|
-
|
|
4
|
+
import { ILikesFeedQueryFns } from '../../../../discussion/feeds/likes-feed';
|
|
5
|
+
interface NestedRepliesFunctions {
|
|
6
|
+
/** Functions for the replies query */
|
|
7
|
+
reactions: IQueryFns;
|
|
8
|
+
mentions: IMentionsFns;
|
|
9
|
+
/** Functions for the likes query */
|
|
10
|
+
likes: ILikesFeedQueryFns;
|
|
5
11
|
}
|
|
6
12
|
interface Props {
|
|
7
13
|
/** The base path, used for slugs */
|
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
import { type IProfileFormProps } from '../../../form';
|
|
3
3
|
import type { IMentionsFns } from './../../discussion';
|
|
4
4
|
import { type IQueryFns } from './cache';
|
|
5
|
+
import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
6
|
+
interface RepliesFunctions {
|
|
7
|
+
/** Functions for the replies query */
|
|
8
|
+
reactions: IQueryFns;
|
|
9
|
+
/** Functions for the likes query */
|
|
10
|
+
likes: ILikesFeedQueryFns;
|
|
11
|
+
/** Query functions for the mentions */
|
|
12
|
+
mentions: IMentionsFns;
|
|
13
|
+
/** Function to join the community */
|
|
14
|
+
join: () => Promise<void>;
|
|
15
|
+
/** Function to leave the community */
|
|
16
|
+
leave: () => Promise<void>;
|
|
17
|
+
}
|
|
5
18
|
interface Props {
|
|
6
19
|
/** The base path, used for slugs */
|
|
7
20
|
basePath: string;
|
|
@@ -14,16 +27,7 @@ interface Props {
|
|
|
14
27
|
/** Whether the user is a member of the community */
|
|
15
28
|
isMember: boolean;
|
|
16
29
|
/** Functions for the replies query */
|
|
17
|
-
functions:
|
|
18
|
-
/** Query functions for the replies */
|
|
19
|
-
reactions: IQueryFns;
|
|
20
|
-
/** Query functions for the mentions */
|
|
21
|
-
mentions: IMentionsFns;
|
|
22
|
-
/** Function to join the community */
|
|
23
|
-
join: () => Promise<void>;
|
|
24
|
-
/** Function to leave the community */
|
|
25
|
-
leave: () => Promise<void>;
|
|
26
|
-
};
|
|
30
|
+
functions: RepliesFunctions;
|
|
27
31
|
/** Props to pass into the profile form */
|
|
28
32
|
profile: IProfileFormProps;
|
|
29
33
|
}
|
package/discussion/index.d.ts
CHANGED
|
@@ -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,
|
|
5
|
+
export type { IActivity, IFullDiscussionContent, IListMemberData, IMentionData, IMentions, IReaction, IUser, } from './shared/interfaces';
|
|
@@ -3,6 +3,7 @@ import { type IProfileFormProps } from '../../../form';
|
|
|
3
3
|
import { type IRepliesFeedQueryFns } from '../../../discussion/feeds';
|
|
4
4
|
import type { IMentionsFns } from './../../discussion.d';
|
|
5
5
|
import { type IQueryFns } from './cache';
|
|
6
|
+
import type { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
6
7
|
interface IActivitySectionQueryFns extends IQueryFns {
|
|
7
8
|
remove: () => Promise<void>;
|
|
8
9
|
}
|
|
@@ -15,6 +16,7 @@ export interface IActivitySectionProps {
|
|
|
15
16
|
functions: {
|
|
16
17
|
activities: IActivitySectionQueryFns;
|
|
17
18
|
reactions: IRepliesFeedQueryFns;
|
|
19
|
+
likes: ILikesFeedQueryFns;
|
|
18
20
|
mentions: IMentionsFns;
|
|
19
21
|
join: () => Promise<void>;
|
|
20
22
|
leave: () => Promise<void>;
|
|
@@ -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("
|
|
8
|
+
activity: import("../../../../..").IActivity | undefined;
|
|
9
9
|
error: Error | null;
|
|
10
10
|
isLoading: boolean;
|
|
11
11
|
isFetching: boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { InfiniteData } from '@tanstack/query-core';
|
|
2
|
+
type ICacheItemBase = {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
export interface ICachePage<ICacheItem extends ICacheItemBase> {
|
|
6
|
+
results: ICacheItem[];
|
|
7
|
+
next: string;
|
|
8
|
+
}
|
|
9
|
+
export type ICache<ICacheItem extends ICacheItemBase> = InfiniteData<ICachePage<ICacheItem>, string>;
|
|
10
|
+
interface IAdditionOptions {
|
|
11
|
+
append?: boolean;
|
|
12
|
+
replace?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildEmptyCacheWithItem<ICacheItem>(item: ICacheItem): {
|
|
15
|
+
pages: {
|
|
16
|
+
next: string;
|
|
17
|
+
results: ICacheItem[];
|
|
18
|
+
}[];
|
|
19
|
+
pageParams: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare function addItem<ICacheItem extends ICacheItemBase>(item: ICacheItem, cache?: ICache<ICacheItem>, opts?: IAdditionOptions): ICache<ICacheItem>;
|
|
22
|
+
export declare function findItem<ICacheItem extends ICacheItemBase>(itemId: string, cache?: ICache<ICacheItem>): ICacheItem | undefined;
|
|
23
|
+
export declare function removeItem<ICacheItem extends ICacheItemBase>(itemId: string, cache: ICache<ICacheItem>): ICache<ICacheItem>;
|
|
24
|
+
export declare function flattenCache<ICacheItem extends ICacheItemBase>(cache?: ICache<ICacheItem>): ICacheItem[];
|
|
25
|
+
export {};
|
|
@@ -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
|
+
}
|
package/general/link/link.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
export interface ILinkProps {
|
|
3
3
|
/** URL for link */
|
|
4
4
|
href?: string | undefined;
|
|
5
5
|
/** Content to rendered */
|
|
@@ -33,5 +33,5 @@ interface Props {
|
|
|
33
33
|
/** Data attributes for the link */
|
|
34
34
|
'data-before'?: string;
|
|
35
35
|
}
|
|
36
|
-
declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }:
|
|
36
|
+
declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: ILinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
export default Link;
|
|
@@ -33,7 +33,7 @@ export namespace IMAGE_ASPECTS {
|
|
|
33
33
|
let sizes_3: string;
|
|
34
34
|
export { sizes_3 as sizes };
|
|
35
35
|
}
|
|
36
|
-
namespace
|
|
36
|
+
namespace highlightSection {
|
|
37
37
|
let range_4: {
|
|
38
38
|
height: number;
|
|
39
39
|
width: number;
|
|
@@ -51,6 +51,15 @@ export namespace IMAGE_ASPECTS {
|
|
|
51
51
|
let sizes_5: string;
|
|
52
52
|
export { sizes_5 as sizes };
|
|
53
53
|
}
|
|
54
|
+
namespace fallback {
|
|
55
|
+
let range_6: {
|
|
56
|
+
height: number;
|
|
57
|
+
width: number;
|
|
58
|
+
}[];
|
|
59
|
+
export { range_6 as range };
|
|
60
|
+
let sizes_6: string;
|
|
61
|
+
export { sizes_6 as sizes };
|
|
62
|
+
}
|
|
54
63
|
}
|
|
55
64
|
export function buildSourceParameters({ aspect: customAspect, range: customRange, sizes: customSizes, }: {
|
|
56
65
|
aspect: any;
|
package/helpers/intl.d.ts
CHANGED
|
@@ -154,7 +154,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
154
154
|
discussion_form_explainer_question: string;
|
|
155
155
|
discussion_likes: string;
|
|
156
156
|
discussion_likes_short: string;
|
|
157
|
-
|
|
157
|
+
discussion_likes_showAll: string;
|
|
158
158
|
discussion_likes_like: string;
|
|
159
159
|
discussion_likes_unlike: string;
|
|
160
160
|
discussion_likes_show: string;
|