@apolitical/component-library 1.18.3 → 1.18.5-beta.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/add-post/add-post.d.ts +9 -4
- package/discussion/components/form/form.d.ts +4 -2
- package/discussion/components/form/index.d.ts +1 -0
- package/discussion/components/thread/thread.d.ts +13 -5
- package/discussion/feeds/replies-feed/nested-replies-feed/nested-replies-feed.d.ts +1 -1
- package/index.js +13 -13
- package/index.mjs +1515 -1574
- package/navigation/load-more/load-more.d.ts +5 -7
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { IDiscussionContentType } from '../../discussion';
|
|
2
|
+
import { IDiscussionForm } from '../../../discussion/components/form';
|
|
4
3
|
interface Props {
|
|
4
|
+
/** Props for the form - this uses everything the `DiscussionForm` component does */
|
|
5
|
+
form: IDiscussionForm;
|
|
6
|
+
/** Details about what a user needs to have to be able to access the form */
|
|
5
7
|
membershipRequiredToPost: {
|
|
8
|
+
/** Whether the user needs to be a member of the community to post */
|
|
6
9
|
required: boolean;
|
|
10
|
+
/** Whether the user is a member of the community */
|
|
7
11
|
isMember?: boolean;
|
|
12
|
+
/** The function to join the community */
|
|
8
13
|
join?: () => Promise<void>;
|
|
14
|
+
/** The function to leave the community */
|
|
9
15
|
leave?: () => Promise<void>;
|
|
16
|
+
/** The text to show when the user is not a member of the community */
|
|
10
17
|
notMemberStateText?: string;
|
|
11
18
|
};
|
|
12
|
-
contentType: IDiscussionContentType;
|
|
13
|
-
createPost: UseMutateFunction<any, any, any, any>;
|
|
14
19
|
}
|
|
15
20
|
declare const AddPost: React.FC<Props>;
|
|
16
21
|
export default AddPost;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DiscussionCreateContentFunction, IDiscussionContent } from './../../discussion';
|
|
3
|
-
interface
|
|
3
|
+
export interface IDiscussionForm {
|
|
4
4
|
/** Information about the content being created/edited */
|
|
5
5
|
content: IDiscussionContent;
|
|
6
6
|
/** If the user has permission to interact with the form, e.g. if they're a member of the community */
|
|
@@ -20,6 +20,8 @@ interface Props {
|
|
|
20
20
|
};
|
|
21
21
|
/** The `ref` for the input, if we need to have control over it in the parent */
|
|
22
22
|
inputRef?: React.Ref<HTMLTextAreaElement> | undefined;
|
|
23
|
+
/** The placeholder text - this defaults to the intl text */
|
|
24
|
+
placeholder?: string;
|
|
23
25
|
/** The maximum number of characters */
|
|
24
26
|
maxLength?: number;
|
|
25
27
|
/** The minimum number of rows */
|
|
@@ -48,5 +50,5 @@ interface Props {
|
|
|
48
50
|
/** The language to use for the text */
|
|
49
51
|
locale?: string;
|
|
50
52
|
}
|
|
51
|
-
declare const Form: ({ content, userHasPermissions, meta, inputRef, maxLength, minRows, forceShow, functions, gtmContext, }:
|
|
53
|
+
declare const Form: ({ content, userHasPermissions, meta, inputRef, placeholder, maxLength, minRows, forceShow, functions, gtmContext, }: IDiscussionForm) => import("react/jsx-runtime").JSX.Element;
|
|
52
54
|
export default Form;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IDiscussionForm } from './../form';
|
|
2
3
|
interface Props {
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** Props for the load more button */
|
|
5
|
+
loadMore?: {
|
|
6
|
+
/** Whether the page is loading */
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
/** If there is a next page */
|
|
9
|
+
hasNextPage: boolean;
|
|
10
|
+
/** The function to load the next page for the thread */
|
|
11
|
+
loadNextPage: () => void;
|
|
12
|
+
};
|
|
13
|
+
/** Props for the discussion form */
|
|
14
|
+
form?: IDiscussionForm;
|
|
7
15
|
/** The posts to render */
|
|
8
16
|
children: React.ReactNode | JSX.Element | JSX.Element[];
|
|
9
17
|
}
|
|
10
|
-
declare const Thread: ({
|
|
18
|
+
declare const Thread: ({ loadMore: { isLoading, hasNextPage, loadNextPage }, form, children, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
19
|
export default Thread;
|