@select-org/select-post-builder 1.4.1 → 1.4.2

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
@@ -135,8 +135,10 @@ declare type CreatePostCallbackPayload = {
135
135
  /**
136
136
  * Per-item upload state for media the host may need to persist. Populated
137
137
  * when `allowSendWhileUploading` is on OR `unauthenticatedMode` is on, for
138
- * items with blob: URLs at submit time. Each entry always carries `blob`
139
- * (the source File for host persistence). For in-flight uploads
138
+ * media still uploading (or deferred) at submit time, keyed by the payload
139
+ * item's `key`. `blob` is the source File for host persistence; it is absent
140
+ * for a remote-URL upload (GIF or image search, pasted image URL), whose
141
+ * placeholder item uses the remote URL. For in-flight uploads
140
142
  * (allowSendWhileUploading), `promise` resolves to the final hosted item and
141
143
  * `abort` cancels the underlying axios request. For deferred blobs
142
144
  * (unauthenticatedMode) both `promise` and `abort` are undefined — the bytes
@@ -144,10 +146,18 @@ declare type CreatePostCallbackPayload = {
144
146
  * via `resumeDeferredUploads`.
145
147
  */
146
148
  pendingUploads?: Map<string, {
147
- blob: File | Blob;
149
+ blob?: File | Blob;
148
150
  promise?: Promise<PostCreationMediaItem | PollPostMediaOptionItem>;
149
151
  abort?: () => void;
150
152
  }>;
153
+ /**
154
+ * Present only for a Blog post sent while a link preview card is still loading.
155
+ * `payload.htmlBody` has those cards removed; this resolves, within about 5 s, to
156
+ * the HTML with each card filled from its resolved metadata, and cards that failed
157
+ * or timed out removed. It never rejects. A host that ignores it saves the link
158
+ * without a card instead of an empty box.
159
+ */
160
+ pendingHtmlBody?: Promise<string>;
151
161
  };
152
162
 
153
163
  export declare interface DraftRehydrateRequestDetail {
@@ -224,6 +234,9 @@ declare enum NewPostType {
224
234
  NEW_COMMENT_MEDIA = "new:comment:media"
225
235
  }
226
236
 
237
+ /** Uids of the media nodes `stripPendingMediaFromJsonBody` removes. */
238
+ export declare function pendingMediaUids(jsonBody: JSONContent_2 | undefined): Set<string>;
239
+
227
240
  declare type PollChoiceItem = PollPostTextOptionItem | PollPostMediaOptionItem;
228
241
 
229
242
  declare type PollPostMediaOptionItem = BasePollOptionItem & PostCreationMediaItem;
@@ -446,11 +459,12 @@ declare enum SpecialType {
446
459
 
447
460
  /**
448
461
  * Walks a serialized htmlBody string and removes media wrappers whose upload
449
- * did not complete (data-src missing or blob:-prefixed). Empty
450
- * `[data-media-group]` wrappers left behind are also removed. Mirrors
462
+ * did not complete (data-src missing or blob:-prefixed, or data-uid in
463
+ * `pendingUids` from `pendingMediaUids`). Empty `[data-media-group]`
464
+ * wrappers left behind are also removed. Mirrors
451
465
  * `stripPendingMediaFromJsonBody` for the JSON form.
452
466
  */
453
- export declare function stripPendingMediaFromHtml(html: string | undefined): string | undefined;
467
+ export declare function stripPendingMediaFromHtml(html: string | undefined, pendingUids?: ReadonlySet<string>): string | undefined;
454
468
 
455
469
  /**
456
470
  * Walks the editor JSON and removes media nodes whose upload did not complete
@@ -524,6 +538,22 @@ declare module '@tiptap/core' {
524
538
  }
525
539
 
526
540
 
541
+ declare module '@tiptap/core' {
542
+ interface Commands<ReturnType> {
543
+ iframe: {
544
+ /**
545
+ * Insert an iframe node into the document
546
+ */
547
+ setIframe: (options: {
548
+ src: string;
549
+ width?: string;
550
+ height?: string;
551
+ }) => ReturnType;
552
+ };
553
+ }
554
+ }
555
+
556
+
527
557
  declare module '@tiptap/core' {
528
558
  interface Commands<ReturnType> {
529
559
  customLink: {
@@ -552,22 +582,6 @@ declare module '@tiptap/core' {
552
582
  }
553
583
 
554
584
 
555
- declare module '@tiptap/core' {
556
- interface Commands<ReturnType> {
557
- iframe: {
558
- /**
559
- * Insert an iframe node into the document
560
- */
561
- setIframe: (options: {
562
- src: string;
563
- width?: string;
564
- height?: string;
565
- }) => ReturnType;
566
- };
567
- }
568
- }
569
-
570
-
571
585
  declare module '@tiptap/core' {
572
586
  interface Commands<ReturnType> {
573
587
  smartMediaUpload: {
@@ -583,7 +597,7 @@ declare module '@tiptap/core' {
583
597
  * (`attrs.deferred === true`). Map key = node uid; value = the raw
584
598
  * File/Blob for file-kind nodes, which the host persists from
585
599
  * `pendingUploads` across the auth redirect. URL-kind deferred nodes are
586
- * NOT surfaced via `pendingUploads` (getPendingUpload requires a blob) —
600
+ * NOT surfaced via `pendingUploads` (no blob and no upload in flight) —
587
601
  * their remote URL rides in the doc JSON on `attrs.src`, so the host
588
602
  * supplies that string here from the persisted node. Nodes with no entry
589
603
  * in the map are deleted (bytes unrecoverable — the host toasts separately).
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BQv-TaVA.js");require("react");exports.EditorPlacement=e.EditorPlacement;exports.EditorTypes=e.EditorTypes;exports.PostBuilderEditor=e.PostBuilderEditor;exports.PostBuilderEvents=e.PostBuilderEvents;exports.PostBuilderProvider=e.PostBuilderProvider;exports.applyResolvedMediaItem=e.applyResolvedMediaItem;exports.applyResolvedMediaItemToHtml=e.applyResolvedMediaItemToHtml;exports.ensurePollMinimum=e.ensurePollMinimum;exports.stripPendingMediaFromHtml=e.stripPendingMediaFromHtml;exports.stripPendingMediaFromJsonBody=e.stripPendingMediaFromJsonBody;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DJc4w8wg.js");require("react");exports.EditorPlacement=e.EditorPlacement;exports.EditorTypes=e.EditorTypes;exports.PostBuilderEditor=e.PostBuilderEditor;exports.PostBuilderEvents=e.PostBuilderEvents;exports.PostBuilderProvider=e.PostBuilderProvider;exports.applyResolvedMediaItem=e.applyResolvedMediaItem;exports.applyResolvedMediaItemToHtml=e.applyResolvedMediaItemToHtml;exports.ensurePollMinimum=e.ensurePollMinimum;exports.pendingMediaUids=e.pendingMediaUids;exports.stripPendingMediaFromHtml=e.stripPendingMediaFromHtml;exports.stripPendingMediaFromJsonBody=e.stripPendingMediaFromJsonBody;
@@ -1,14 +1,15 @@
1
- import { E as i, a as o, P as d, b as r, c as t, d as l, e as m, f as n, s as p, h as P } from "./index-C2R4ewDG.mjs";
1
+ import { E as a, a as d, P as o, b as r, c as t, d as l, e as m, f as n, p, s as P, h as M } from "./index-EgqA5cJ8.mjs";
2
2
  import "react";
3
3
  export {
4
- i as EditorPlacement,
5
- o as EditorTypes,
6
- d as PostBuilderEditor,
4
+ a as EditorPlacement,
5
+ d as EditorTypes,
6
+ o as PostBuilderEditor,
7
7
  r as PostBuilderEvents,
8
8
  t as PostBuilderProvider,
9
9
  l as applyResolvedMediaItem,
10
10
  m as applyResolvedMediaItemToHtml,
11
11
  n as ensurePollMinimum,
12
- p as stripPendingMediaFromHtml,
13
- P as stripPendingMediaFromJsonBody
12
+ p as pendingMediaUids,
13
+ P as stripPendingMediaFromHtml,
14
+ M as stripPendingMediaFromJsonBody
14
15
  };