@select-org/select-post-builder 1.1.46 → 1.1.47
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 +72 -38
- package/dist/post-builder.cjs.js +32 -32
- package/dist/post-builder.js +3793 -3629
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -39,16 +39,21 @@ declare type BaseProps = {
|
|
|
39
39
|
hideGroupSelector?: boolean;
|
|
40
40
|
isSubmitting?: boolean;
|
|
41
41
|
clearOnSuccess?: boolean;
|
|
42
|
-
onCreatePost: (params:
|
|
43
|
-
payload: Partial<PostCreationData>;
|
|
44
|
-
html: string;
|
|
45
|
-
json: JSONContent;
|
|
46
|
-
text: string;
|
|
47
|
-
}) => void;
|
|
42
|
+
onCreatePost: (params: CreatePostCallbackPayload) => void;
|
|
48
43
|
onVoiceComment?: (params: {
|
|
49
44
|
voiceUrl: string;
|
|
50
45
|
voiceTime: number;
|
|
51
46
|
}) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Optional voice handoff for hosts that want to upload voice in their
|
|
49
|
+
* own pipeline. When provided AND `allowSendWhileUploading` is on, the
|
|
50
|
+
* comments-toolbar emits the recorded Blob via this callback instead of
|
|
51
|
+
* uploading sync via Filestore.uploadVoiceV2.
|
|
52
|
+
*/
|
|
53
|
+
onVoiceRecord?: (params: {
|
|
54
|
+
blob: Blob;
|
|
55
|
+
voiceTime: number;
|
|
56
|
+
}) => void;
|
|
52
57
|
onGroupSelect?: (groupId: string) => void;
|
|
53
58
|
onDirtyStateChange?: (isDirty: boolean) => void;
|
|
54
59
|
onReady?: (controls: PostBuilderControls) => void;
|
|
@@ -61,6 +66,27 @@ declare type BaseProps = {
|
|
|
61
66
|
onEditorTabChange?: (tab: EditorTypes) => void;
|
|
62
67
|
};
|
|
63
68
|
|
|
69
|
+
declare type CreatePostCallbackPayload = {
|
|
70
|
+
payload: Partial<PostCreationData> & {
|
|
71
|
+
error?: string;
|
|
72
|
+
};
|
|
73
|
+
html: string;
|
|
74
|
+
json: JSONContent;
|
|
75
|
+
text: string;
|
|
76
|
+
/**
|
|
77
|
+
* Per-item upload state for in-flight media. Only populated when
|
|
78
|
+
* `allowSendWhileUploading` is on AND there are items with blob: URLs at
|
|
79
|
+
* submit time. Each entry: blob (the source File for host persistence),
|
|
80
|
+
* promise (resolves to the final hosted item), abort (cancel the underlying
|
|
81
|
+
* axios request).
|
|
82
|
+
*/
|
|
83
|
+
pendingUploads?: Map<string, {
|
|
84
|
+
blob: File | Blob;
|
|
85
|
+
promise: Promise<PostCreationMediaItem | PollPostMediaOptionItem>;
|
|
86
|
+
abort: () => void;
|
|
87
|
+
}>;
|
|
88
|
+
};
|
|
89
|
+
|
|
64
90
|
export declare enum EditorPlacement {
|
|
65
91
|
Feed = "Feed",
|
|
66
92
|
Modal = "Modal",
|
|
@@ -144,6 +170,14 @@ export declare interface PostBuilderConfig {
|
|
|
144
170
|
toI18N: (key: string) => string;
|
|
145
171
|
i18nKeys?: Partial<PostBuilderI18nKeys>;
|
|
146
172
|
logEvent: (name: string, properties: Record<string, unknown>) => void;
|
|
173
|
+
/**
|
|
174
|
+
* When true, allows Send to fire while media uploads are still in flight.
|
|
175
|
+
* The host must provide an `onCreatePost` handler that consumes the new
|
|
176
|
+
* `pendingUploads` field on the payload, and an `onVoiceRecord` prop on
|
|
177
|
+
* the editor for the voice handoff. Defaults to false; existing consumers
|
|
178
|
+
* are unaffected.
|
|
179
|
+
*/
|
|
180
|
+
allowSendWhileUploading?: boolean;
|
|
147
181
|
}
|
|
148
182
|
|
|
149
183
|
export declare interface PostBuilderControls {
|
|
@@ -236,7 +270,7 @@ declare interface PostBuilderI18nKeys {
|
|
|
236
270
|
uploadsInProgressKey: string;
|
|
237
271
|
}
|
|
238
272
|
|
|
239
|
-
export declare const PostBuilderProvider: ({ children, apiBaseURL, authToken, toI18N, i18nKeys, logEvent, }: PostBuilderConfig) => JSX_2.Element;
|
|
273
|
+
export declare const PostBuilderProvider: ({ children, apiBaseURL, authToken, toI18N, i18nKeys, logEvent, allowSendWhileUploading, }: PostBuilderConfig) => JSX_2.Element;
|
|
240
274
|
|
|
241
275
|
declare type PostCreationData = {
|
|
242
276
|
body: string;
|
|
@@ -344,37 +378,6 @@ declare module '@tiptap/core' {
|
|
|
344
378
|
}
|
|
345
379
|
|
|
346
380
|
|
|
347
|
-
declare module '@tiptap/core' {
|
|
348
|
-
interface Commands<ReturnType> {
|
|
349
|
-
iframe: {
|
|
350
|
-
/**
|
|
351
|
-
* Insert an iframe node into the document
|
|
352
|
-
*/
|
|
353
|
-
setIframe: (options: {
|
|
354
|
-
src: string;
|
|
355
|
-
width?: string;
|
|
356
|
-
height?: string;
|
|
357
|
-
}) => ReturnType;
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
declare module '@tiptap/core' {
|
|
364
|
-
interface Commands<ReturnType> {
|
|
365
|
-
smartMediaUpload: {
|
|
366
|
-
insertMediaWithUpload: (params: {
|
|
367
|
-
source: File | Blob | string;
|
|
368
|
-
type: MediaNodeTypes;
|
|
369
|
-
mediaType?: MediaItemType;
|
|
370
|
-
caption?: string;
|
|
371
|
-
searchFrom?: ImageSearchFrom;
|
|
372
|
-
}) => ReturnType;
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
381
|
declare module '@tiptap/core' {
|
|
379
382
|
interface Commands<ReturnType> {
|
|
380
383
|
customLink: {
|
|
@@ -403,6 +406,22 @@ declare module '@tiptap/core' {
|
|
|
403
406
|
}
|
|
404
407
|
|
|
405
408
|
|
|
409
|
+
declare module '@tiptap/core' {
|
|
410
|
+
interface Commands<ReturnType> {
|
|
411
|
+
iframe: {
|
|
412
|
+
/**
|
|
413
|
+
* Insert an iframe node into the document
|
|
414
|
+
*/
|
|
415
|
+
setIframe: (options: {
|
|
416
|
+
src: string;
|
|
417
|
+
width?: string;
|
|
418
|
+
height?: string;
|
|
419
|
+
}) => ReturnType;
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
|
|
406
425
|
declare module '@tiptap/core' {
|
|
407
426
|
interface Commands<ReturnType> {
|
|
408
427
|
linkPreview: {
|
|
@@ -430,3 +449,18 @@ declare module '@tiptap/core' {
|
|
|
430
449
|
};
|
|
431
450
|
}
|
|
432
451
|
}
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
declare module '@tiptap/core' {
|
|
455
|
+
interface Commands<ReturnType> {
|
|
456
|
+
smartMediaUpload: {
|
|
457
|
+
insertMediaWithUpload: (params: {
|
|
458
|
+
source: File | Blob | string;
|
|
459
|
+
type: MediaNodeTypes;
|
|
460
|
+
mediaType?: MediaItemType;
|
|
461
|
+
caption?: string;
|
|
462
|
+
searchFrom?: ImageSearchFrom;
|
|
463
|
+
}) => ReturnType;
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
}
|