@select-org/select-post-builder 1.4.0 → 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-DJc4w8wg.js +247 -0
- package/dist/index-EgqA5cJ8.mjs +53551 -0
- package/dist/index.d.ts +21 -7
- package/dist/post-builder.cjs.js +1 -254
- package/dist/post-builder.css +1 -1
- package/dist/post-builder.js +13 -61541
- package/dist/voice-recording-overlay-C2b6z1lN.js +3 -0
- package/dist/voice-recording-overlay-DoMCBBHV.mjs +8059 -0
- package/package.json +17 -18
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
|
-
*
|
|
139
|
-
*
|
|
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
|
|
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
|
|
450
|
-
* `[data-media-group]`
|
|
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
|
|
@@ -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` (
|
|
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).
|