@apolitical/component-library 5.1.0-jc.2 → 5.1.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/likes/index.d.ts +0 -1
- package/discussion/components/likes/likes.d.ts +2 -11
- package/discussion/components/post/post.d.ts +3 -9
- package/discussion/components/post/post.mock.d.ts +0 -52
- package/discussion/discussion.helpers.d.ts +1 -1
- package/discussion/feeds/activities-feed/activities-feed.d.ts +0 -2
- package/discussion/feeds/activities-feed/cache/cache.helper.d.ts +5 -0
- 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 +1 -0
- package/discussion/feeds/activities-feed/mocks/activities-feed.mock.d.ts +1 -75
- package/discussion/feeds/replies-feed/cache/cache.helper.d.ts +16 -0
- 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 -2
- 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 +1 -0
- package/discussion/feeds/replies-feed/nested-replies-feed/nested-replies-feed.d.ts +1 -7
- package/discussion/feeds/replies-feed/replies-feed.d.ts +12 -14
- package/discussion/sections/activity-section/activity-section.d.ts +0 -2
- package/discussion/shared/helpers/index.d.ts +0 -1
- package/discussion/shared/interfaces/activity.interface.d.ts +2 -0
- package/form/components/rich-text-editor/helpers/transform/transform.d.ts +1 -1
- package/general/link/link.d.ts +2 -2
- package/helpers/intl.d.ts +1 -1
- package/index.js +48 -48
- package/index.mjs +8330 -8434
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/variables/colors/theme/_general.scss +0 -1
- package/user/index.d.ts +0 -2
- package/user/member/member.helpers.d.ts +1 -1
- package/discussion/components/likes/likes-modal.d.ts +0 -28
- package/discussion/components/likes/likes.mock.d.ts +0 -2
- package/discussion/components/likes/mocks/likes-response.mock.d.ts +0 -52
- package/discussion/feeds/likes-feed/cache/cache.interface.d.ts +0 -11
- package/discussion/feeds/likes-feed/cache/hooks/feed/feed.hook.d.ts +0 -20
- package/discussion/feeds/likes-feed/cache/hooks/feed/index.d.ts +0 -1
- package/discussion/feeds/likes-feed/cache/hooks/index.d.ts +0 -2
- package/discussion/feeds/likes-feed/cache/hooks/list/index.d.ts +0 -1
- package/discussion/feeds/likes-feed/cache/hooks/list/list.hook.d.ts +0 -16
- package/discussion/feeds/likes-feed/cache/index.d.ts +0 -2
- package/discussion/feeds/likes-feed/index.d.ts +0 -2
- package/discussion/feeds/likes-feed/likes-feed.d.ts +0 -20
- package/discussion/shared/helpers/cache.helper.d.ts +0 -25
|
@@ -16,7 +16,6 @@ $general: (
|
|
|
16
16
|
time-to-complete: get-map($c, 'p500'),
|
|
17
17
|
tooltip: get-map($c, 'white'),
|
|
18
18
|
tooltip_bg: color.adjust(get-map($c, 'n900'), $alpha: -0.1),
|
|
19
|
-
tooltip_button: get-map($c, 'white'),
|
|
20
19
|
progress_tracker_line_bg: get-map($c, 'n100'),
|
|
21
20
|
progress_tracker_line_bg_active: get-map($c, 'b700'),
|
|
22
21
|
progress_tracker_dot_bg: get-map($c, 'n100'),
|
package/user/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const getMember: (member: MemberProps) => {
|
|
|
14
14
|
country: string;
|
|
15
15
|
url: string;
|
|
16
16
|
image: string | undefined;
|
|
17
|
-
badges: import("
|
|
17
|
+
badges: import("../badge").IBadgesObject | undefined;
|
|
18
18
|
};
|
|
19
19
|
export declare const getUserDetails: ({ role, organisation, country, maximumCharacters, }: {
|
|
20
20
|
role?: string | undefined;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IBadgesOption } from '../../../user/badges';
|
|
2
|
-
import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
3
|
-
export interface ILikesModalProps {
|
|
4
|
-
/** Whether the modal is open on page load */
|
|
5
|
-
showModal?: boolean;
|
|
6
|
-
/** The number of likes */
|
|
7
|
-
likes?: 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
|
-
/** Functions used inside the modal */
|
|
17
|
-
functions: {
|
|
18
|
-
likes: {
|
|
19
|
-
list: ILikesFeedQueryFns['list'];
|
|
20
|
-
};
|
|
21
|
-
/** Function to call when the modal is closed */
|
|
22
|
-
onClose?: () => void;
|
|
23
|
-
};
|
|
24
|
-
/** Additional classes */
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
|
-
declare const LikesModal: ({ showModal, activityId, functions: { onClose, likes: likesFns }, badges, likes, className, basePath, parentId, }: ILikesModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export default LikesModal;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export declare const likesResponseMock: {
|
|
2
|
-
results: ({
|
|
3
|
-
created_at: string;
|
|
4
|
-
updated_at: string;
|
|
5
|
-
id: string;
|
|
6
|
-
user_id: string;
|
|
7
|
-
user: {
|
|
8
|
-
id: string;
|
|
9
|
-
data: {
|
|
10
|
-
name: string;
|
|
11
|
-
thumbnail: string;
|
|
12
|
-
jobTitle: string;
|
|
13
|
-
organization: string;
|
|
14
|
-
};
|
|
15
|
-
created_at?: undefined;
|
|
16
|
-
updated_at?: undefined;
|
|
17
|
-
};
|
|
18
|
-
kind: string;
|
|
19
|
-
activity_id: string;
|
|
20
|
-
data: {
|
|
21
|
-
mentioned_users: null;
|
|
22
|
-
};
|
|
23
|
-
parent: string;
|
|
24
|
-
latest_children: {};
|
|
25
|
-
children_counts: {};
|
|
26
|
-
} | {
|
|
27
|
-
created_at: string;
|
|
28
|
-
updated_at: string;
|
|
29
|
-
id: string;
|
|
30
|
-
user_id: string;
|
|
31
|
-
user: {
|
|
32
|
-
created_at: string;
|
|
33
|
-
updated_at: string;
|
|
34
|
-
id: string;
|
|
35
|
-
data: {
|
|
36
|
-
jobTitle: string;
|
|
37
|
-
name: string;
|
|
38
|
-
organization: string;
|
|
39
|
-
thumbnail: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
kind: string;
|
|
43
|
-
activity_id: string;
|
|
44
|
-
data: {
|
|
45
|
-
mentioned_users: null;
|
|
46
|
-
};
|
|
47
|
-
parent: string;
|
|
48
|
-
latest_children: {};
|
|
49
|
-
children_counts: {};
|
|
50
|
-
})[];
|
|
51
|
-
next: string;
|
|
52
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InfiniteData } from '@tanstack/query-core';
|
|
2
|
-
import type { ReactionFilterAPIResponse } from 'getstream';
|
|
3
|
-
import type { IReaction } from '../../../../discussion/shared';
|
|
4
|
-
export type ICache = InfiniteData<ICachePage, string>;
|
|
5
|
-
export type ICachePage = ExtendedReactionFilterAPIResponse;
|
|
6
|
-
export type ICacheItems = ICacheItem[];
|
|
7
|
-
type ICacheItem = IReaction;
|
|
8
|
-
interface ExtendedReactionFilterAPIResponse extends ReactionFilterAPIResponse {
|
|
9
|
-
results: IReaction[];
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { QueryKey } from '@tanstack/react-query';
|
|
2
|
-
import { UR } from 'getstream';
|
|
3
|
-
import type { ICachePage } from '../..';
|
|
4
|
-
export interface IQueryFns {
|
|
5
|
-
list: (_: UR) => Promise<ICachePage>;
|
|
6
|
-
}
|
|
7
|
-
interface ILikesFeedArgs {
|
|
8
|
-
queryFns: IQueryFns;
|
|
9
|
-
queryKey: QueryKey;
|
|
10
|
-
}
|
|
11
|
-
export declare function useLikesFeed({ queryFns: { list }, queryKey }: ILikesFeedArgs): {
|
|
12
|
-
likesCount: string;
|
|
13
|
-
error: Error | null;
|
|
14
|
-
isLoading: boolean;
|
|
15
|
-
hasNextPage: boolean;
|
|
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
|
-
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[];
|
|
19
|
-
};
|
|
20
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './feed.hook';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './list.hook';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { QueryKey } from '@tanstack/react-query';
|
|
2
|
-
import { UR } from 'getstream';
|
|
3
|
-
import type { ICache, ICachePage } from '../..';
|
|
4
|
-
export interface IListLikesArgs {
|
|
5
|
-
queryFn: (_: UR) => Promise<ICachePage>;
|
|
6
|
-
queryKey: QueryKey;
|
|
7
|
-
}
|
|
8
|
-
export declare function useListLikes({ queryFn, queryKey }: IListLikesArgs): {
|
|
9
|
-
likes: import('../../../../../../discussion/shared').IReaction[];
|
|
10
|
-
likesCount: string;
|
|
11
|
-
error: Error | null;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
hasNextPage: boolean;
|
|
14
|
-
fetchNextPage: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").a2 | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").aj<ICache, Error>>;
|
|
15
|
-
refetch: (options?: import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").Z | undefined) => Promise<import("@tanstack/query-core/build/legacy/queryClient-13f81fcb").ac<ICache, Error>>;
|
|
16
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IQueryFns } from '../../../discussion/feeds/likes-feed/cache';
|
|
2
|
-
import { type IBadgesOption } from '../../../user';
|
|
3
|
-
interface Props {
|
|
4
|
-
/** Whether to show badges and the scope of the badge */
|
|
5
|
-
badges?: IBadgesOption;
|
|
6
|
-
/** The base path, used for slugs */
|
|
7
|
-
basePath: string;
|
|
8
|
-
/** The ID of the parent, used for slugs */
|
|
9
|
-
parentId: string;
|
|
10
|
-
/** The ID of the activity the replies are for */
|
|
11
|
-
activityId: string;
|
|
12
|
-
/** The initial number of likes */
|
|
13
|
-
initialLikeCount: number;
|
|
14
|
-
/** Functions for the replies query */
|
|
15
|
-
functions: {
|
|
16
|
-
likes: IQueryFns;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export default function LikesFeed({ badges, basePath, parentId, activityId, initialLikeCount, functions, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
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 {};
|