@apolitical/component-library 6.0.2 → 6.0.3-ac.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/form/components/rich-text-editor/components/toolbar/components/header-option/header-option.d.ts +2 -0
- package/form/components/rich-text-editor/components/toolbar/components/header-option/index.d.ts +1 -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 -4
- package/helpers/intl.d.ts +1 -0
- package/index.js +50 -50
- package/index.mjs +4957 -4924
- package/package.json +1 -1
- package/style.css +1 -1
package/form/components/rich-text-editor/components/toolbar/components/header-option/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HeaderOption } from './header-option';
|
|
@@ -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,26 @@ 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
|
-
export type BlockOptionType = Formatting.blockquote | Formatting.link | Formatting.li | Formatting.mention | Formatting.ol | Formatting.ul | Formatting.paragraph | Formatting.span;
|
|
104
|
+
export type BlockOptionType = Formatting.blockquote | Formatting.link | Formatting.li | Formatting.mention | Formatting.ol | Formatting.ul | Formatting.paragraph | Formatting.span | Formatting.h3;
|
|
94
105
|
export interface TypeElement extends BaseElement {
|
|
95
|
-
type: BlockOptionType;
|
|
106
|
+
type: BlockOptionType | MarkOptionType;
|
|
96
107
|
}
|
|
97
108
|
export interface MentionElement extends BaseElement {
|
|
98
109
|
type: Formatting.mention;
|
|
99
110
|
id: string;
|
|
100
111
|
name?: string;
|
|
101
112
|
}
|
|
102
|
-
export type MarkOptionType = Formatting.bold | Formatting.italic | Formatting.strikethrough;
|
|
113
|
+
export type MarkOptionType = Formatting.bold | Formatting.italic | Formatting.strikethrough | Formatting.h3;
|
|
103
114
|
export interface TypeText extends BaseText {
|
|
104
115
|
[Formatting.bold]?: boolean;
|
|
105
116
|
[Formatting.italic]?: boolean;
|
|
106
117
|
[Formatting.strikethrough]?: boolean;
|
|
118
|
+
[Formatting.h3]?: boolean;
|
|
107
119
|
}
|
|
108
120
|
export type OptionTypes = {
|
|
109
121
|
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_h3: string;
|
|
300
301
|
richTextEditor_italic: string;
|
|
301
302
|
richTextEditor_strikeThrough: string;
|
|
302
303
|
richTextEditor_link: string;
|