@apolitical/component-library 4.1.3 → 4.1.4-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/post/components/blockquote/blockquote.d.ts +6 -0
- package/discussion/components/post/components/blockquote/index.d.ts +1 -0
- package/discussion/components/post/components/index.d.ts +1 -0
- package/form/components/rich-text-editor/components/context/context.d.ts +3 -0
- package/form/components/rich-text-editor/components/toolbar/components/block-option/block-option.helpers.d.ts +3 -1
- package/form/components/rich-text-editor/components/toolbar/components/link-editor/link-editor.helpers.d.ts +4 -3
- package/form/components/rich-text-editor/components/toolbar/components/mark-option/mark-option.helpers.d.ts +2 -2
- package/form/components/rich-text-editor/plugins/with-linlines/with-inlines.d.ts +2 -1
- package/form/components/rich-text-editor/plugins/without-empty-links/without-empty-links.d.ts +2 -1
- package/form/components/rich-text-editor/rich-text-editor.d.ts +9 -3
- package/form/components/rich-text-editor/rich-text-editor.types.d.ts +1 -0
- package/index.js +40 -40
- package/index.mjs +5611 -5528
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/base/_blockquotes.scss +21 -0
- package/styles/variables/colors/theme/_base.scss +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Blockquote } from './blockquote';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './blockquote';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
2
|
import { Point } from 'slate';
|
|
3
|
+
import { ReportError } from './../../rich-text-editor.types';
|
|
3
4
|
declare const RichTextEditorContext: import("react").Context<{
|
|
4
5
|
/** The id of the editor */
|
|
5
6
|
id: string;
|
|
@@ -15,5 +16,7 @@ declare const RichTextEditorContext: import("react").Context<{
|
|
|
15
16
|
lastAnchor: Point | null;
|
|
16
17
|
/** The function to update the state */
|
|
17
18
|
dispatch: Dispatch<any>;
|
|
19
|
+
/** The function to report an error */
|
|
20
|
+
reportError: ReportError;
|
|
18
21
|
}>;
|
|
19
22
|
export default RichTextEditorContext;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { BaseEditor } from 'slate';
|
|
2
|
+
import { ReportError } from './../../../../rich-text-editor.types';
|
|
2
3
|
export declare const isBlockActive: (editor: BaseEditor, format: string) => boolean;
|
|
3
|
-
export declare const
|
|
4
|
+
export declare const parentIsBlockquote: (editor: BaseEditor) => boolean;
|
|
5
|
+
export declare const toggleBlock: (editor: BaseEditor, format: string, reportError: ReportError) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseEditor } from 'slate';
|
|
2
|
+
import { ReportError } from './../../../../rich-text-editor.types';
|
|
2
3
|
export declare const isLinkActive: (editor: BaseEditor) => boolean;
|
|
3
|
-
export declare const insertLink: (editor: BaseEditor, url: string, id: string) => void;
|
|
4
|
-
export declare const editLink: (editor: BaseEditor, url: string, id: string) => void;
|
|
5
|
-
export declare const wrapLink: (editor: BaseEditor, url: string, id: string) => void;
|
|
4
|
+
export declare const insertLink: (editor: BaseEditor, url: string, id: string, reportError: ReportError) => void;
|
|
5
|
+
export declare const editLink: (editor: BaseEditor, url: string, id: string, reportError: ReportError) => void;
|
|
6
|
+
export declare const wrapLink: (editor: BaseEditor, url: string, id: string, reportError?: (error: string) => void) => void;
|
|
6
7
|
export declare const unwrapLink: (editor: BaseEditor) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseEditor } from 'slate';
|
|
2
|
-
import { MarkOptionType } from '
|
|
2
|
+
import { MarkOptionType, ReportError } from './../../../../rich-text-editor.types';
|
|
3
3
|
export declare const isMarkOptionType: (value: string) => value is MarkOptionType;
|
|
4
4
|
export declare const isMarkActive: (editor: BaseEditor, format: string) => boolean;
|
|
5
|
-
export declare const toggleMark: (editor: BaseEditor, format: string) => void;
|
|
5
|
+
export declare const toggleMark: (editor: BaseEditor, format: string, reportError: ReportError) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseEditor } from 'slate';
|
|
2
2
|
import { HistoryEditor } from 'slate-history';
|
|
3
3
|
import { ReactEditor } from 'slate-react';
|
|
4
|
-
|
|
4
|
+
import { ReportError } from './../../rich-text-editor.types';
|
|
5
|
+
declare const withInlines: (editor: BaseEditor & ReactEditor & HistoryEditor, id: string, reportError: ReportError) => BaseEditor & ReactEditor & HistoryEditor;
|
|
5
6
|
export default withInlines;
|
package/form/components/rich-text-editor/plugins/without-empty-links/without-empty-links.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseEditor } from 'slate';
|
|
2
2
|
import { HistoryEditor } from 'slate-history';
|
|
3
3
|
import { ReactEditor } from 'slate-react';
|
|
4
|
-
|
|
4
|
+
import { ReportError } from './../../rich-text-editor.types';
|
|
5
|
+
declare const withoutEmptyLinks: (editor: BaseEditor & ReactEditor & HistoryEditor, reportError: ReportError) => BaseEditor & ReactEditor & HistoryEditor;
|
|
5
6
|
export default withoutEmptyLinks;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReportError } from './rich-text-editor.types';
|
|
1
2
|
interface Props {
|
|
2
3
|
/** The id of the rich text editor */
|
|
3
4
|
id?: string;
|
|
@@ -5,8 +6,13 @@ interface Props {
|
|
|
5
6
|
value?: string;
|
|
6
7
|
/** The placeholder text of the rich text editor */
|
|
7
8
|
placeholder?: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
/** Optional functions */
|
|
10
|
+
functions?: {
|
|
11
|
+
/** An optional event handler, called when the rich text editor is changed */
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
/** An optional event handler, called when the rich text editor reports an error */
|
|
14
|
+
reportError?: ReportError;
|
|
15
|
+
};
|
|
10
16
|
/** Optional autoFocus */
|
|
11
17
|
autoFocus?: boolean;
|
|
12
18
|
/** Optional aria invalid */
|
|
@@ -14,5 +20,5 @@ interface Props {
|
|
|
14
20
|
/** Optional aria error message */
|
|
15
21
|
'aria-errormessage'?: string;
|
|
16
22
|
}
|
|
17
|
-
declare const RichTextEditor: ({ id, value, placeholder,
|
|
23
|
+
declare const RichTextEditor: ({ id, value, placeholder, functions, autoFocus, ...props }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
24
|
export default RichTextEditor;
|