@apolitical/component-library 6.1.1-ac.1 → 6.1.2-ac.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/post/index.d.ts +1 -1
- package/discussion/components/post/post.d.ts +6 -1
- package/discussion/components/post/post.helpers.d.ts +0 -2
- package/discussion/feeds/activities-feed/activities-feed.d.ts +4 -2
- package/discussion/sections/activity-section/activity-section.d.ts +4 -2
- package/discussion/shared/interfaces/discussion.interface.d.ts +1 -2
- 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 +53 -53
- package/index.mjs +8918 -8891
- package/navigation/action-bar/action-bar.d.ts +2 -0
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -84,10 +84,15 @@ export interface IDiscussionPostProps {
|
|
|
84
84
|
isCommunity?: boolean;
|
|
85
85
|
/** Whether to show badges and the scope of the badge */
|
|
86
86
|
badges?: IBadgesOption;
|
|
87
|
+
/** Categories for the community */
|
|
88
|
+
categories?: {
|
|
89
|
+
name: string;
|
|
90
|
+
slug: string;
|
|
91
|
+
}[];
|
|
87
92
|
/** The base path, used for slugs */
|
|
88
93
|
basePath: string;
|
|
89
94
|
/** The ID of the parent, used for slugs */
|
|
90
95
|
parentId: string;
|
|
91
96
|
}
|
|
92
|
-
declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges, basePath, parentId, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
93
98
|
export default Post;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { IMentions } from './../../discussion';
|
|
2
2
|
import { ListMembers } from '../../../form';
|
|
3
|
-
import { ICategory } from '../../shared';
|
|
4
3
|
export declare const getPostBody: (body: string, isTruncated: boolean | number, mentions?: IMentions, listMembers?: ListMembers) => Promise<string>;
|
|
5
|
-
export declare const enrichPostCategories: (postCategories: string[], allCategories: ICategory[]) => (ICategory | undefined)[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type IProfileFormProps } from '../../../form';
|
|
3
|
-
import { ICategory } from '../../../discussion/shared';
|
|
4
3
|
import type { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
|
|
5
4
|
import type { IDiscussionFormFns } from '../../../discussion/discussion.d';
|
|
6
5
|
import { type IQueryFns } from './cache';
|
|
@@ -14,7 +13,10 @@ interface Props {
|
|
|
14
13
|
/** Whether the user is an owner of the community */
|
|
15
14
|
isOwner: boolean;
|
|
16
15
|
/** The categories for the community */
|
|
17
|
-
categories:
|
|
16
|
+
categories: {
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
}[];
|
|
18
20
|
/** Functions for the activities query */
|
|
19
21
|
functions: {
|
|
20
22
|
/** Query functions for the activities */
|
|
@@ -3,7 +3,6 @@ import { type IProfileFormProps } from '../../../form';
|
|
|
3
3
|
import { type IRepliesFeedQueryFns, type ILikesFeedQueryFns } from '../../../discussion/feeds';
|
|
4
4
|
import type { IDiscussionFormFns } from './../../discussion.d';
|
|
5
5
|
import { type IQueryFns } from './cache';
|
|
6
|
-
import { ICategory } from '../../shared';
|
|
7
6
|
interface IActivitySectionQueryFns extends IQueryFns {
|
|
8
7
|
remove: () => Promise<void>;
|
|
9
8
|
}
|
|
@@ -22,7 +21,10 @@ export interface IActivitySectionProps {
|
|
|
22
21
|
leave: () => Promise<void>;
|
|
23
22
|
};
|
|
24
23
|
profile: IProfileFormProps;
|
|
25
|
-
categories?:
|
|
24
|
+
categories?: {
|
|
25
|
+
name: string;
|
|
26
|
+
slug: string;
|
|
27
|
+
}[];
|
|
26
28
|
}
|
|
27
29
|
declare const ActivitySection: React.FC<IActivitySectionProps>;
|
|
28
30
|
export default ActivitySection;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MemberProps, MemberDetailsProps } from '../../../user';
|
|
2
2
|
import type { ListMembers, ClickMentionFallback } from '../../../form';
|
|
3
3
|
import type { IEnrichedUrlData } from '../../../navigation';
|
|
4
|
-
import { ICategory } from './community.category.interface';
|
|
5
4
|
export type IDiscussionContentType = 'answer' | 'post' | 'response' | 'reply' | 'question';
|
|
6
5
|
export interface IDiscussionContent {
|
|
7
6
|
/** The type of content */
|
|
@@ -27,7 +26,7 @@ export interface IFullDiscussionContent extends IDiscussionContent {
|
|
|
27
26
|
/** The author of the post */
|
|
28
27
|
author: MemberProps;
|
|
29
28
|
/** The post categories */
|
|
30
|
-
categories?:
|
|
29
|
+
categories?: string[];
|
|
31
30
|
createdAt: Date | string;
|
|
32
31
|
/** The number of likes to display */
|
|
33
32
|
likes?: number;
|
|
@@ -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
|
@@ -171,6 +171,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
171
171
|
discussion_moreMenu_report: string;
|
|
172
172
|
discussion_comments_screenReader: string;
|
|
173
173
|
discussion_comments: string;
|
|
174
|
+
discussion_comments_loading: string;
|
|
174
175
|
discussion_responses_answer: string;
|
|
175
176
|
discussion_responses_comment: string;
|
|
176
177
|
discussion_responses_title: string;
|
|
@@ -297,6 +298,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
297
298
|
richTextEditor_placeholder: string;
|
|
298
299
|
richTextEditor_toolbar: string;
|
|
299
300
|
richTextEditor_bold: string;
|
|
301
|
+
richTextEditor_heading_three: string;
|
|
300
302
|
richTextEditor_italic: string;
|
|
301
303
|
richTextEditor_strikeThrough: string;
|
|
302
304
|
richTextEditor_link: string;
|