@select-org/select-post-builder 1.1.44 → 1.1.45
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/dist/index.d.ts +24 -0
- package/dist/post-builder.cjs.js +52 -50
- package/dist/post-builder.css +1 -1
- package/dist/post-builder.js +5725 -5562
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { JSONContent } from '@tiptap/react';
|
|
3
|
+
import { JSONContent as JSONContent_2 } from '@tiptap/core';
|
|
3
4
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
4
5
|
import { ReactNode } from 'react';
|
|
5
6
|
|
|
@@ -52,6 +53,12 @@ declare type BaseProps = {
|
|
|
52
53
|
onDirtyStateChange?: (isDirty: boolean) => void;
|
|
53
54
|
onReady?: (controls: PostBuilderControls) => void;
|
|
54
55
|
disableNavigationWarning?: boolean;
|
|
56
|
+
/** Tiptap JSONContent to pre-populate the editor with (takes precedence over localStorage draft) */
|
|
57
|
+
initialContent?: JSONContent;
|
|
58
|
+
/** When true, the submit/post button in the toolbar is hidden */
|
|
59
|
+
hideSubmitButton?: boolean;
|
|
60
|
+
/** Fires when the user switches between editor tabs (Media, Blog, Poll) */
|
|
61
|
+
onEditorTabChange?: (tab: EditorTypes) => void;
|
|
55
62
|
};
|
|
56
63
|
|
|
57
64
|
export declare enum EditorPlacement {
|
|
@@ -62,6 +69,12 @@ export declare enum EditorPlacement {
|
|
|
62
69
|
Global = "Global"
|
|
63
70
|
}
|
|
64
71
|
|
|
72
|
+
export declare enum EditorTypes {
|
|
73
|
+
Media = "Post",
|
|
74
|
+
Blog = "Blog",
|
|
75
|
+
Poll = "Poll"
|
|
76
|
+
}
|
|
77
|
+
|
|
65
78
|
declare interface ImageInfo {
|
|
66
79
|
width: number;
|
|
67
80
|
height: number;
|
|
@@ -137,6 +150,17 @@ export declare interface PostBuilderControls {
|
|
|
137
150
|
saveDraft: () => void;
|
|
138
151
|
discardDraft: () => void;
|
|
139
152
|
keepEditing: () => void;
|
|
153
|
+
/** Set editor content programmatically (e.g. pre-populate AI-generated text) */
|
|
154
|
+
setContent: (content: JSONContent_2) => void;
|
|
155
|
+
/** Extract current editor content without triggering submit */
|
|
156
|
+
getContent: () => {
|
|
157
|
+
html: string;
|
|
158
|
+
json: JSONContent_2;
|
|
159
|
+
text: string;
|
|
160
|
+
payload: Partial<PostCreationData>;
|
|
161
|
+
} | null;
|
|
162
|
+
/** Clear editor content and localStorage draft */
|
|
163
|
+
clearEditor: () => void;
|
|
140
164
|
}
|
|
141
165
|
|
|
142
166
|
export declare const PostBuilderEditor: FC<PostBuilderEditorProps>;
|