@select-org/select-post-builder 1.1.43 → 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 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>;
@@ -309,6 +333,17 @@ declare module '@tiptap/core' {
309
333
  }
310
334
 
311
335
 
336
+ declare module '@tiptap/core' {
337
+ interface Commands<ReturnType> {
338
+ poll: {
339
+ insertPoll: (attrs: {
340
+ choices: PollChoiceItem[];
341
+ }) => ReturnType;
342
+ };
343
+ }
344
+ }
345
+
346
+
312
347
  declare module '@tiptap/core' {
313
348
  interface Commands<ReturnType> {
314
349
  customLink: {
@@ -353,17 +388,6 @@ declare module '@tiptap/core' {
353
388
  }
354
389
 
355
390
 
356
- declare module '@tiptap/core' {
357
- interface Commands<ReturnType> {
358
- poll: {
359
- insertPoll: (attrs: {
360
- choices: PollChoiceItem[];
361
- }) => ReturnType;
362
- };
363
- }
364
- }
365
-
366
-
367
391
  declare module '@tiptap/core' {
368
392
  interface Commands<ReturnType> {
369
393
  smartMediaUpload: {