@apolitical/component-library 6.1.0 → 6.1.1-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/discussion/components/form/form.type.d.ts +2 -21
- package/discussion/components/form/index.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/mocks/index.d.ts +2 -0
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/replies.mock.d.ts +2 -0
- package/discussion/feeds/replies-feed/cache/hooks/feed/parse-replies/mocks/user.mock.d.ts +4 -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/activity-section.helpers.d.ts +2 -0
- package/discussion/sections/activity-section/mocks/activity-functions.mock.d.ts +46 -0
- package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +45 -39
- package/discussion/sections/activity-section/mocks/index.d.ts +1 -0
- package/discussion/shared/interfaces/discussion.interface.d.ts +19 -0
- package/form/components/rich-text-editor/components/toolbar/toolbar.d.ts +1 -1
- package/form/components/rich-text-editor/helpers/ast-types/ast-types.d.ts +6 -2
- package/form/components/rich-text-editor/rich-text-editor.d.ts +1 -1
- package/form/components/rich-text-editor/rich-text-editor.types.d.ts +16 -3
- package/helpers/intl.d.ts +2 -0
- package/index.js +49 -49
- package/index.mjs +6697 -6561
- package/package.json +1 -1
- package/style.css +1 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IEnrichedUrlData } from '../../../navigation';
|
|
2
|
-
import {
|
|
3
|
-
import { ICategory } from '../../shared';
|
|
2
|
+
import { IDiscussionContent, IMentions } from './../../discussion';
|
|
3
|
+
import { ICategory, IDiscussionFormFunctions } from '../../shared';
|
|
4
4
|
export interface IDiscussionFormMeta {
|
|
5
5
|
/** Whether the form data is still loading */
|
|
6
6
|
isLoading?: boolean;
|
|
@@ -36,24 +36,6 @@ 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 {
|
|
40
|
-
onChange?: (args: {
|
|
41
|
-
[key: string]: string | boolean;
|
|
42
|
-
}) => void;
|
|
43
|
-
create: DiscussionCreateContentFunction;
|
|
44
|
-
handleSaveEdit?: (({ title, body }: {
|
|
45
|
-
title: string;
|
|
46
|
-
body: string;
|
|
47
|
-
}) => Promise<void>) | (() => void);
|
|
48
|
-
handleCancel?: () => void;
|
|
49
|
-
callback?: (args: void) => void;
|
|
50
|
-
onMention?: (value?: IListMemberData) => void;
|
|
51
|
-
props?: {
|
|
52
|
-
create: {
|
|
53
|
-
projectNames: ['questions-answers'];
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
39
|
export interface IDiscussionForm {
|
|
58
40
|
/** A unique ID for the form */
|
|
59
41
|
id?: string;
|
|
@@ -107,4 +89,3 @@ export interface IDiscussionFormState {
|
|
|
107
89
|
link?: false | IEnrichedUrlData;
|
|
108
90
|
};
|
|
109
91
|
}
|
|
110
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { IDiscussionForm, IDiscussionFormMeta } from './form.type';
|
|
1
|
+
export type { IDiscussionForm, IDiscussionFormMeta, } from './form.type';
|
|
2
2
|
export { default as DiscussionForm } from './form';
|
|
@@ -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/shared';
|
|
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 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;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const mockFunctions: {
|
|
2
|
+
activities: {
|
|
3
|
+
edit: jest.Mock<any, any, any>;
|
|
4
|
+
like: jest.Mock<any, any, any>;
|
|
5
|
+
read: jest.Mock<any, any, any>;
|
|
6
|
+
remove: jest.Mock<any, any, any>;
|
|
7
|
+
unlike: jest.Mock<any, any, any>;
|
|
8
|
+
pin: jest.Mock<any, any, any>;
|
|
9
|
+
unpin: jest.Mock<any, any, any>;
|
|
10
|
+
};
|
|
11
|
+
reactions: {
|
|
12
|
+
add: jest.Mock<any, any, any>;
|
|
13
|
+
remove: jest.Mock<any, any, any>;
|
|
14
|
+
create: jest.Mock<any, any, any>;
|
|
15
|
+
edit: jest.Mock<any, any, any>;
|
|
16
|
+
like: jest.Mock<any, any, any>;
|
|
17
|
+
list: jest.Mock<any, any, any>;
|
|
18
|
+
unlike: jest.Mock<any, any, any>;
|
|
19
|
+
};
|
|
20
|
+
likes: {
|
|
21
|
+
add: jest.Mock<any, any, any>;
|
|
22
|
+
remove: jest.Mock<any, any, any>;
|
|
23
|
+
list: jest.Mock<any, any, any>;
|
|
24
|
+
};
|
|
25
|
+
form: {
|
|
26
|
+
submit: jest.Mock<any, any, any>;
|
|
27
|
+
validate: jest.Mock<any, any, any>;
|
|
28
|
+
listMembers: jest.Mock<any, any, any>;
|
|
29
|
+
clickMentionFallback: jest.Mock<any, any, any>;
|
|
30
|
+
};
|
|
31
|
+
join: jest.Mock<any, any, any>;
|
|
32
|
+
leave: jest.Mock<any, any, any>;
|
|
33
|
+
};
|
|
34
|
+
export declare const mockProfileHooks: {
|
|
35
|
+
useProfile: jest.Mock<any, any, any>;
|
|
36
|
+
useProfileUpdate: jest.Mock<any, any, any>;
|
|
37
|
+
useMaps: jest.Mock<any, any, any>;
|
|
38
|
+
};
|
|
39
|
+
export declare const mockProfileFunctions: {
|
|
40
|
+
updateProfile: jest.Mock<any, any, any>;
|
|
41
|
+
getProfile: jest.Mock<any, any, any>;
|
|
42
|
+
uploadImage: jest.Mock<any, any, any>;
|
|
43
|
+
onSuccess: jest.Mock<any, any, any>;
|
|
44
|
+
onCancel: jest.Mock<any, any, any>;
|
|
45
|
+
onFailure: jest.Mock<any, any, any>;
|
|
46
|
+
};
|
|
@@ -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
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MemberProps, MemberDetailsProps } from '../../../user';
|
|
2
2
|
import type { ListMembers, ClickMentionFallback } from '../../../form';
|
|
3
3
|
import type { IEnrichedUrlData } from '../../../navigation';
|
|
4
|
+
import { IDiscussionFormFns } from '../../discussion';
|
|
4
5
|
export type IDiscussionContentType = 'answer' | 'post' | 'response' | 'reply' | 'question';
|
|
5
6
|
export interface IDiscussionContent {
|
|
6
7
|
/** The type of content */
|
|
@@ -90,3 +91,21 @@ export interface IConversation {
|
|
|
90
91
|
prepopulateForm?: string;
|
|
91
92
|
mentionData?: IListMemberData;
|
|
92
93
|
}
|
|
94
|
+
export interface IDiscussionFormFunctions extends IDiscussionFormFns {
|
|
95
|
+
onChange?: (args: {
|
|
96
|
+
[key: string]: string | boolean;
|
|
97
|
+
}) => void;
|
|
98
|
+
create: DiscussionCreateContentFunction;
|
|
99
|
+
handleSaveEdit?: (({ title, body }: {
|
|
100
|
+
title: string;
|
|
101
|
+
body: string;
|
|
102
|
+
}) => Promise<void>) | (() => void);
|
|
103
|
+
handleCancel?: () => void;
|
|
104
|
+
callback?: (args: void) => void;
|
|
105
|
+
onMention?: (value?: IListMemberData) => void;
|
|
106
|
+
props?: {
|
|
107
|
+
create: {
|
|
108
|
+
projectNames: ['questions-answers'];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { BaseProps } from './../../rich-text-editor.types';
|
|
3
|
-
declare const Toolbar: ({ ...props }: PropsWithChildren<BaseProps>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const Toolbar: ({ styling, ...props }: PropsWithChildren<BaseProps>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default Toolbar;
|
|
@@ -8,6 +8,7 @@ export interface NodeTypes {
|
|
|
8
8
|
[Formatting.ol]: string;
|
|
9
9
|
[Formatting.li]: string;
|
|
10
10
|
[Formatting.mention]: string;
|
|
11
|
+
[Formatting.h3]: string;
|
|
11
12
|
[Formatting.heading]: {
|
|
12
13
|
1: string;
|
|
13
14
|
2: string;
|
|
@@ -39,9 +40,10 @@ export declare enum MdastNodes {
|
|
|
39
40
|
delete = "delete",
|
|
40
41
|
inlineCode = "inlineCode",
|
|
41
42
|
thematicBreak = "thematicBreak",
|
|
42
|
-
text = "text"
|
|
43
|
+
text = "text",
|
|
44
|
+
h3 = "heading_three"
|
|
43
45
|
}
|
|
44
|
-
export type MdastNodeType = MdastNodes.paragraph | MdastNodes.heading | MdastNodes.list | MdastNodes.listItem | MdastNodes.link | MdastNodes.mention | MdastNodes.image | MdastNodes.blockquote | MdastNodes.code | MdastNodes.html | MdastNodes.emphasis | MdastNodes.strong | MdastNodes.delete | MdastNodes.inlineCode | MdastNodes.thematicBreak | MdastNodes.text;
|
|
46
|
+
export type MdastNodeType = MdastNodes.paragraph | MdastNodes.heading | MdastNodes.list | MdastNodes.listItem | MdastNodes.link | MdastNodes.mention | MdastNodes.image | MdastNodes.blockquote | MdastNodes.code | MdastNodes.html | MdastNodes.emphasis | MdastNodes.strong | MdastNodes.delete | MdastNodes.inlineCode | MdastNodes.thematicBreak | MdastNodes.text | MdastNodes.h3;
|
|
45
47
|
export declare const defaultNodeTypes: NodeTypes;
|
|
46
48
|
export interface LeafType {
|
|
47
49
|
text: string;
|
|
@@ -49,6 +51,7 @@ export interface LeafType {
|
|
|
49
51
|
[Formatting.bold]?: boolean;
|
|
50
52
|
[Formatting.italic]?: boolean;
|
|
51
53
|
[Formatting.code]?: boolean;
|
|
54
|
+
[Formatting.h3]?: boolean;
|
|
52
55
|
parentType?: string;
|
|
53
56
|
}
|
|
54
57
|
export interface BlockType {
|
|
@@ -83,6 +86,7 @@ export interface InputNodeTypes {
|
|
|
83
86
|
[Marks.code]: string;
|
|
84
87
|
[Formatting.hr]: string;
|
|
85
88
|
[Formatting.image]: string;
|
|
89
|
+
[Formatting.h3]: string;
|
|
86
90
|
}
|
|
87
91
|
type RecursivePartial<T> = {
|
|
88
92
|
[P in keyof T]?: RecursivePartial<T[P]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IRTEProps } from './rich-text-editor.types';
|
|
2
|
-
declare const RichTextEditor: ({ id, value, placeholder, maxLength, meta, functions, autoFocus, data, ...props }: IRTEProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const RichTextEditor: ({ id, value, placeholder, maxLength, meta, functions, autoFocus, data, styling, ...props }: IRTEProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default RichTextEditor;
|
|
@@ -42,6 +42,13 @@ export interface IRTEProps {
|
|
|
42
42
|
'aria-errormessage'?: string;
|
|
43
43
|
/** Optional data for the editor */
|
|
44
44
|
data?: IRTEData;
|
|
45
|
+
/** Optional styling */
|
|
46
|
+
styling?: {
|
|
47
|
+
/** Optional toolbar styling */
|
|
48
|
+
toolbar?: {
|
|
49
|
+
showHeadingOption?: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
45
52
|
}
|
|
46
53
|
export interface IRTEInitialState {
|
|
47
54
|
editorKey: string | null;
|
|
@@ -78,7 +85,8 @@ export declare enum Formatting {
|
|
|
78
85
|
paragraph = "paragraph",
|
|
79
86
|
ul = "ul_list",
|
|
80
87
|
strikethrough = "strikeThrough",
|
|
81
|
-
span = "span"
|
|
88
|
+
span = "span",
|
|
89
|
+
h3 = "heading_three"
|
|
82
90
|
}
|
|
83
91
|
export declare enum Marks {
|
|
84
92
|
delete = "delete_mark",
|
|
@@ -88,22 +96,27 @@ export declare enum Marks {
|
|
|
88
96
|
}
|
|
89
97
|
export interface BaseProps {
|
|
90
98
|
className?: string;
|
|
99
|
+
styling?: {
|
|
100
|
+
showHeadingOption?: boolean;
|
|
101
|
+
};
|
|
91
102
|
[key: string]: unknown;
|
|
92
103
|
}
|
|
93
104
|
export type BlockOptionType = Formatting.blockquote | Formatting.link | Formatting.li | Formatting.mention | Formatting.ol | Formatting.ul | Formatting.paragraph | Formatting.span;
|
|
94
105
|
export interface TypeElement extends BaseElement {
|
|
95
|
-
type: BlockOptionType;
|
|
106
|
+
type: BlockOptionType | MarkOptionType;
|
|
107
|
+
[Formatting.h3]?: boolean;
|
|
96
108
|
}
|
|
97
109
|
export interface MentionElement extends BaseElement {
|
|
98
110
|
type: Formatting.mention;
|
|
99
111
|
id: string;
|
|
100
112
|
name?: string;
|
|
101
113
|
}
|
|
102
|
-
export type MarkOptionType = Formatting.bold | Formatting.italic | Formatting.strikethrough;
|
|
114
|
+
export type MarkOptionType = Formatting.bold | Formatting.italic | Formatting.strikethrough | Formatting.h3;
|
|
103
115
|
export interface TypeText extends BaseText {
|
|
104
116
|
[Formatting.bold]?: boolean;
|
|
105
117
|
[Formatting.italic]?: boolean;
|
|
106
118
|
[Formatting.strikethrough]?: boolean;
|
|
119
|
+
[Formatting.h3]?: boolean;
|
|
107
120
|
}
|
|
108
121
|
export type OptionTypes = {
|
|
109
122
|
format: BlockOptionType | MarkOptionType;
|
package/helpers/intl.d.ts
CHANGED
|
@@ -297,6 +297,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
297
297
|
richTextEditor_placeholder: string;
|
|
298
298
|
richTextEditor_toolbar: string;
|
|
299
299
|
richTextEditor_bold: string;
|
|
300
|
+
richTextEditor_heading_three: string;
|
|
300
301
|
richTextEditor_italic: string;
|
|
301
302
|
richTextEditor_strikeThrough: string;
|
|
302
303
|
richTextEditor_link: string;
|
|
@@ -349,6 +350,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
349
350
|
poll_num_votes: string;
|
|
350
351
|
poll_remove_vote_button: string;
|
|
351
352
|
poll_aria_votes: string;
|
|
353
|
+
replies_feed_missing_polls_vote_message: string;
|
|
352
354
|
tableOfContents: string;
|
|
353
355
|
timeToComplete_hours: string;
|
|
354
356
|
timeToComplete_hours_short: string;
|