@select-org/select-post-builder 1.2.6 → 1.2.8

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
@@ -54,7 +54,17 @@ declare type BaseProps = {
54
54
  hideGroupSelector?: boolean;
55
55
  isSubmitting?: boolean;
56
56
  clearOnSuccess?: boolean;
57
- onCreatePost: (params: CreatePostCallbackPayload) => void;
57
+ onCreatePost: (params: CreatePostCallbackPayload,
58
+ /**
59
+ * Present only when the submit fails and the host wants to refill the
60
+ * editor with what was just submitted. `restoreContent()` re-injects the
61
+ * exact submitted content into the current live editor instance (resolved
62
+ * at call time, so it still works if this editor instance was destroyed
63
+ * and recreated in the meantime).
64
+ */
65
+ meta?: {
66
+ restoreContent: () => void;
67
+ }) => void;
58
68
  onVoiceComment?: (params: {
59
69
  voiceUrl: string;
60
70
  voiceTime: number;
@@ -263,6 +273,14 @@ export declare interface PostBuilderConfig {
263
273
  unauthenticatedMode?: boolean;
264
274
  }
265
275
 
276
+ /**
277
+ * Imperative controls handed to the host once via `onReady`. Safe to hold for
278
+ * the component's entire lifetime: every method resolves the live editor (and
279
+ * the tab it belongs to) at call time, so the controls keep working across the
280
+ * internal editor re-creates caused by mount and Post/Blog/Poll tab switches.
281
+ * When no live editor exists, `getContent` returns null and the mutating
282
+ * methods no-op — none of them throw.
283
+ */
266
284
  export declare interface PostBuilderControls {
267
285
  saveDraft: () => void;
268
286
  discardDraft: () => void;
@@ -465,6 +483,17 @@ declare module 'axios' {
465
483
  }
466
484
 
467
485
 
486
+ declare module '@tiptap/core' {
487
+ interface Commands<ReturnType> {
488
+ poll: {
489
+ insertPoll: (attrs: {
490
+ choices: PollChoiceItem[];
491
+ }) => ReturnType;
492
+ };
493
+ }
494
+ }
495
+
496
+
468
497
  declare module '@tiptap/core' {
469
498
  interface Commands<ReturnType> {
470
499
  media: {
@@ -493,17 +522,6 @@ declare module '@tiptap/core' {
493
522
  }
494
523
 
495
524
 
496
- declare module '@tiptap/core' {
497
- interface Commands<ReturnType> {
498
- poll: {
499
- insertPoll: (attrs: {
500
- choices: PollChoiceItem[];
501
- }) => ReturnType;
502
- };
503
- }
504
- }
505
-
506
-
507
525
  declare module '@tiptap/core' {
508
526
  interface Commands<ReturnType> {
509
527
  customLink: {
@@ -532,6 +550,22 @@ declare module '@tiptap/core' {
532
550
  }
533
551
 
534
552
 
553
+ declare module '@tiptap/core' {
554
+ interface Commands<ReturnType> {
555
+ iframe: {
556
+ /**
557
+ * Insert an iframe node into the document
558
+ */
559
+ setIframe: (options: {
560
+ src: string;
561
+ width?: string;
562
+ height?: string;
563
+ }) => ReturnType;
564
+ };
565
+ }
566
+ }
567
+
568
+
535
569
  declare module '@tiptap/core' {
536
570
  interface Commands<ReturnType> {
537
571
  smartMediaUpload: {
@@ -591,19 +625,3 @@ declare module '@tiptap/core' {
591
625
  };
592
626
  }
593
627
  }
594
-
595
-
596
- declare module '@tiptap/core' {
597
- interface Commands<ReturnType> {
598
- iframe: {
599
- /**
600
- * Insert an iframe node into the document
601
- */
602
- setIframe: (options: {
603
- src: string;
604
- width?: string;
605
- height?: string;
606
- }) => ReturnType;
607
- };
608
- }
609
- }